diff --git a/soap/swad_web_service.h b/soap/swad_web_service.h index b089bd95..1eaf6ae3 100644 --- a/soap/swad_web_service.h +++ b/soap/swad_web_service.h @@ -494,7 +494,7 @@ int swad__loginByUserPasswordKey (char *userID,char *userPassword,char *appKey, struct swad__loginByUserPasswordKeyOutput *loginByUserPasswordKeyOut); int swad__loginBySessionKey (char *sessionID,char *appKey, struct swad__loginBySessionKeyOutput *loginBySessionKeyOut); -int swad__getAvailableRoles (char *wsKey, +int swad__getAvailableRoles (char *wsKey,int courseCode, struct swad__getAvailableRolesOutput *getAvailableRolesOut); int swad__getNewPassword (char *userID,char *appKey, struct swad__getNewPasswordOutput *getNewPasswordOut); diff --git a/swad_API.c b/swad_API.c index d4b65a6b..00232bae 100644 --- a/swad_API.c +++ b/swad_API.c @@ -1187,7 +1187,7 @@ With this function, SWADroid is able to check if user can see the button to show */ int swad__getAvailableRoles (struct soap *soap, - char *wsKey, // input + char *wsKey,int courseCode, // input struct swad__getAvailableRolesOutput *getAvailableRolesOut) // output { int ReturnCode; @@ -1195,6 +1195,7 @@ int swad__getAvailableRoles (struct soap *soap, /***** Initializations *****/ API_Set_gSOAP_RuntimeEnv (soap); Gbl.WebService.Function = API_getAvailableRoles; + Gbl.Hierarchy.Crs.CrsCod = (long) courseCode; /***** Default value returned on error *****/ getAvailableRolesOut->roles = 0; // error @@ -1216,8 +1217,28 @@ int swad__getAvailableRoles (struct soap *soap, Gbl.Usrs.Me.Role.Logged = Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role; /***** Return available roles *****/ + DB_QueryINSERT ("can not debug", + "INSERT INTO debug" + " (DebugTime,Txt)" + " VALUES" + " (NOW(),'Gbl.Usrs.Me.Role.Available before Rol_SetMyRoles: %u')", + Gbl.Usrs.Me.Role.Available); + Rol_SetMyRoles (); getAvailableRolesOut->roles = Gbl.Usrs.Me.Role.Available; + DB_QueryINSERT ("can not debug", + "INSERT INTO debug" + " (DebugTime,Txt)" + " VALUES" + " (NOW(),'Gbl.Usrs.Me.Role.Available after Rol_SetMyRoles: %u')", + Gbl.Usrs.Me.Role.Available); + + DB_QueryINSERT ("can not debug", + "INSERT INTO debug" + " (DebugTime,Txt)" + " VALUES" + " (NOW(),'getAvailableRolesOut->roles: %d')", + getAvailableRolesOut->roles); return SOAP_OK; } @@ -5294,19 +5315,6 @@ int swad__getMatchStatus (struct soap *soap, break; } - DB_QueryINSERT ("can not debug", - "INSERT INTO debug" - " (DebugTime,Txt)" - " VALUES" - " (NOW(),'getMatchStatusOut->matchCode: %d;" - " getMatchStatusOut->questionIndex: %d;" - " getMatchStatusOut->numAnswers: %d;" - " getMatchStatusOut->answerIndex: %d')", - getMatchStatusOut->matchCode, - getMatchStatusOut->questionIndex, - getMatchStatusOut->numAnswers, - getMatchStatusOut->answerIndex); - return SOAP_OK; } @@ -6076,7 +6084,9 @@ int swad__getLocation (struct soap *soap, " AND rooms.BldCod=buildings.BldCod" " AND buildings.CtrCod=centres.CtrCod" " AND centres.InsCod=institutions.InsCod" - " ORDER BY rooms.Capacity DESC LIMIT 1", // Get the biggest room + " ORDER BY rooms.Capacity," // Get the biggest room + "rooms.ShortName" + " DESC LIMIT 1", MACnum); API_GetDataOfLocation (soap, diff --git a/swad_action.c b/swad_action.c index 07853905..92909c68 100644 --- a/swad_action.c +++ b/swad_action.c @@ -1834,7 +1834,7 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un -1, // #19 (obsolete action) ActSeeSylPra, // #20 -1, // #21 (obsolete action) - ActDoActOnSevTch, // #22 + ActSeeRecSevTch, // #22 ActAdmBrf, // #23 -1, // #24 (obsolete action) ActSeeCrsTT, // #25 diff --git a/swad_changelog.h b/swad_changelog.h index 492b402a..03d37567 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -555,7 +555,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.263.1 (2020-09-02)" +#define Log_PLATFORM_VERSION "SWAD 20.0 (2020-09-22)" #define CSS_FILE "swad19.253.css" #define JS_FILE "swad19.254.js" /* @@ -573,6 +573,8 @@ TODO: Que al generar un examen s TODO: Create module swad_test_result "sudo apt install webp" en Ubuntu, y "yum install libwebp libwebp-tools" en CentOS, para decodificar imágenes Web/ug reportado por Javier Fernández Baldomero. + Version 20.0: Sep 22, 2020 Changes in API function getAvailableRoles. + Fixed bug when listing teachers' records. (304400 lines) Version 19.263.1: Sep 02, 2020 MAC address in form to create a new room. (304389 lines) Version 19.263: Sep 02, 2020 New module swad_MAC for MAC addresses. (304364 lines) Version 19.262: Sep 01, 2020 Edition of MAC addresses in listing of rooms. (304239 lines)