mirror of https://github.com/acanas/swad-core.git
Version 22.100.2: Apr 19, 2023 Institution admins can edit departments.
This commit is contained in:
parent
5e3c7a33e6
commit
15fe3d4b04
|
@ -284,9 +284,9 @@ const struct Act_Actions ActLst_Actions[ActLst_NUM_ACTIONS] =
|
|||
// Actions in menu:
|
||||
[ActSeeInsInf ] = {1153, 0,TabIns,ActSeeInsInf , 0, 0, 0, 0,0x3C7, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,InsCfg_ShowConfiguration ,"info" },
|
||||
[ActSeeCtr ] = { 676, 1,TabIns,ActSeeCtr , 0, 0, 0, 0,0x3C7, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Ctr_ShowCtrsOfCurrentIns ,"building" },
|
||||
[ActSeePlc ] = { 703, 2,TabIns,ActSeePlc , 0, 0, 0, 0,0x3C7, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Plc_SeePlaces ,"map-marker-alt" },
|
||||
[ActSeeDpt ] = { 675, 3,TabIns,ActSeeDpt , 0, 0, 0, 0,0x3C7, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Dpt_SeeDepts ,"users" },
|
||||
[ActSeeHld ] = { 707, 4,TabIns,ActSeeHld , 0, 0, 0, 0,0x3C7, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Hld_SeeHolidays ,"calendar-day" },
|
||||
[ActSeePlc ] = { 703, 2,TabIns,ActSeePlc , 0, 0, 0, 0,0x3C7, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Plc_SeeAllPlaces ,"map-marker-alt" },
|
||||
[ActSeeDpt ] = { 675, 3,TabIns,ActSeeDpt , 0, 0, 0, 0,0x3C7, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Dpt_SeeAllDepts ,"users" },
|
||||
[ActSeeHld ] = { 707, 4,TabIns,ActSeeHld , 0, 0, 0, 0,0x3C7, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Hld_SeeAllHolidays ,"calendar-day" },
|
||||
|
||||
// Actions not in menu:
|
||||
[ActPrnInsInf ] = {1154,-1,TabUnk,ActSeeInsInf , 0, 0, 0, 0,0x3C7, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,NULL ,InsCfg_PrintConfiguration ,NULL},
|
||||
|
@ -314,13 +314,13 @@ const struct Act_Actions ActLst_Actions[ActLst_NUM_ACTIONS] =
|
|||
[ActRenPlcSho ] = { 894,-1,TabUnk,ActSeePlc , 0, 0, 0, 0,0x200, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Plc_RenamePlaceShort ,Plc_ContEditAfterChgPlc ,NULL},
|
||||
[ActRenPlcFul ] = { 895,-1,TabUnk,ActSeePlc , 0, 0, 0, 0,0x200, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Plc_RenamePlaceFull ,Plc_ContEditAfterChgPlc ,NULL},
|
||||
|
||||
[ActEdiDpt ] = { 677,-1,TabUnk,ActSeeDpt , 0, 0, 0, 0,0x200, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Dpt_EditDepartments ,NULL},
|
||||
[ActNewDpt ] = { 687,-1,TabUnk,ActSeeDpt , 0, 0, 0, 0,0x200, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dpt_ReceiveFormNewDpt ,Dpt_ContEditAfterChgDpt ,NULL},
|
||||
[ActRemDpt ] = { 690,-1,TabUnk,ActSeeDpt , 0, 0, 0, 0,0x200, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dpt_RemoveDepartment ,Dpt_ContEditAfterChgDpt ,NULL},
|
||||
[ActChgDptIns ] = { 721,-1,TabUnk,ActSeeDpt , 0, 0, 0, 0,0x200, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dpt_ChangeDepartIns ,Dpt_ContEditAfterChgDpt ,NULL},
|
||||
[ActRenDptSho ] = { 688,-1,TabUnk,ActSeeDpt , 0, 0, 0, 0,0x200, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dpt_RenameDepartShort ,Dpt_ContEditAfterChgDpt ,NULL},
|
||||
[ActRenDptFul ] = { 689,-1,TabUnk,ActSeeDpt , 0, 0, 0, 0,0x200, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dpt_RenameDepartFull ,Dpt_ContEditAfterChgDpt ,NULL},
|
||||
[ActChgDptWWW ] = { 691,-1,TabUnk,ActSeeDpt , 0, 0, 0, 0,0x200, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dpt_ChangeDptWWW ,Dpt_ContEditAfterChgDpt ,NULL},
|
||||
[ActEdiDpt ] = { 677,-1,TabUnk,ActSeeDpt , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Dpt_EditDepartments ,NULL},
|
||||
[ActNewDpt ] = { 687,-1,TabUnk,ActSeeDpt , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dpt_ReceiveFormNewDpt ,Dpt_ContEditAfterChgDpt ,NULL},
|
||||
[ActRemDpt ] = { 690,-1,TabUnk,ActSeeDpt , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dpt_RemoveDepartment ,Dpt_ContEditAfterChgDpt ,NULL},
|
||||
[ActChgDptIns ] = { 721,-1,TabUnk,ActSeeDpt , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dpt_ChangeDepartIns ,Dpt_ContEditAfterChgDpt ,NULL},
|
||||
[ActRenDptSho ] = { 688,-1,TabUnk,ActSeeDpt , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dpt_RenameDepartShort ,Dpt_ContEditAfterChgDpt ,NULL},
|
||||
[ActRenDptFul ] = { 689,-1,TabUnk,ActSeeDpt , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dpt_RenameDepartFull ,Dpt_ContEditAfterChgDpt ,NULL},
|
||||
[ActChgDptWWW ] = { 691,-1,TabUnk,ActSeeDpt , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dpt_ChangeDptWWW ,Dpt_ContEditAfterChgDpt ,NULL},
|
||||
|
||||
[ActEdiHld ] = { 713,-1,TabUnk,ActSeeHld , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Hld_EditHolidays ,NULL},
|
||||
[ActNewHld ] = { 714,-1,TabUnk,ActSeeHld , 0, 0, 0, 0,0x300, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Hld_ReceiveFormNewHoliday ,Hld_ContEditAfterChgHld ,NULL},
|
||||
|
|
|
@ -40,12 +40,6 @@
|
|||
|
||||
const bool Adm_ICanAdminOtherUsrs[Rol_NUM_ROLES] =
|
||||
{
|
||||
/* Users who can not admin */
|
||||
[Rol_UNK ] = false,
|
||||
[Rol_GST ] = false,
|
||||
[Rol_USR ] = false,
|
||||
[Rol_STD ] = false,
|
||||
[Rol_NET ] = false,
|
||||
/* Users who can admin */
|
||||
[Rol_TCH ] = true,
|
||||
[Rol_DEG_ADM] = true,
|
||||
|
|
|
@ -629,11 +629,12 @@ TODO: Emilce Barrera Mesa: Podr
|
|||
TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen.
|
||||
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 22.100.1 (2023-04-19)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 22.100.2 (2023-04-19)"
|
||||
#define CSS_FILE "swad22.95.css"
|
||||
#define JS_FILE "swad22.49.js"
|
||||
/*
|
||||
Version 22.100.1: Apr 19, 2023 Changes in projects. (? lines)
|
||||
Version 22.100.2: Apr 19, 2023 Institution admins can edit departments. (338889 lines)
|
||||
Version 22.100.1: Apr 19, 2023 Changes in projects. (338897 lines)
|
||||
Version 22.100: Apr 18, 2023 Changes in resources, assignments, exams, games, attendance events and surveys. (338875 lines)
|
||||
Version 22.99: Apr 18, 2023 Code refactoring in rubrics. (339025 lines)
|
||||
Version 22.98: Apr 17, 2023 Code refactoring in rubrics. (339062 lines)
|
||||
|
|
|
@ -49,6 +49,17 @@
|
|||
#include "swad_parameter_code.h"
|
||||
#include "swad_string.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************************** Private constants ****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static const bool Dpt_ICanEditDpts[Rol_NUM_ROLES] =
|
||||
{
|
||||
/* Users who can edit */
|
||||
[Rol_INS_ADM] = true,
|
||||
[Rol_SYS_ADM] = true,
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** External global variables from others modules ****************/
|
||||
/*****************************************************************************/
|
||||
|
@ -102,7 +113,7 @@ static void Dpt_ResetDepartments (struct Dpt_Departments *Departments)
|
|||
/*************************** List all departments ****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Dpt_SeeDepts (void)
|
||||
void Dpt_SeeAllDepts (void)
|
||||
{
|
||||
extern const char *Hlp_INSTITUTION_Departments;
|
||||
extern const char *Txt_Departments_of_INSTITUTION_X;
|
||||
|
@ -139,9 +150,7 @@ void Dpt_SeeDepts (void)
|
|||
if (asprintf (&Title,Txt_Departments_of_INSTITUTION_X,Gbl.Hierarchy.Ins.FullName) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
Box_BoxTableBegin (NULL,Title,
|
||||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM ? Dpt_PutIconToEditDpts :
|
||||
NULL,
|
||||
NULL,
|
||||
Dpt_PutIconToEditDpts,NULL,
|
||||
Hlp_INSTITUTION_Departments,Box_NOT_CLOSABLE,2);
|
||||
free (Title);
|
||||
|
||||
|
@ -255,8 +264,9 @@ static Dpt_Order_t Dpt_GetParDptOrder (void)
|
|||
|
||||
static void Dpt_PutIconToEditDpts (__attribute__((unused)) void *Args)
|
||||
{
|
||||
Ico_PutContextualIconToEdit (ActEdiDpt,NULL,
|
||||
NULL,NULL);
|
||||
if (Dpt_ICanEditDpts[Gbl.Usrs.Me.Role.Logged])
|
||||
Ico_PutContextualIconToEdit (ActEdiDpt,NULL,
|
||||
NULL,NULL);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -62,7 +62,7 @@ struct Dpt_Departments
|
|||
/***************************** Public prototypes *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Dpt_SeeDepts (void);
|
||||
void Dpt_SeeAllDepts (void);
|
||||
void Dpt_EditDepartments (void);
|
||||
void Dpt_FreeListDepartments (struct Dpt_Departments *Departments);
|
||||
void Dpt_GetDepartmentDataByCod (struct Dpt_Department *Dpt);
|
||||
|
|
|
@ -97,7 +97,7 @@ void Hld_ResetHolidays (struct Hld_Holidays *Holidays)
|
|||
/****************************** List all holidays ****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Hld_SeeHolidays (void)
|
||||
void Hld_SeeAllHolidays (void)
|
||||
{
|
||||
extern const char *Hlp_INSTITUTION_Holidays;
|
||||
extern const char *Txt_Holidays;
|
||||
|
|
|
@ -84,7 +84,7 @@ struct Hld_Holidays
|
|||
|
||||
void Hld_ResetHolidays (struct Hld_Holidays *Holidays);
|
||||
|
||||
void Hld_SeeHolidays (void);
|
||||
void Hld_SeeAllHolidays (void);
|
||||
void Hld_PutIconToSeeHlds (void);
|
||||
void Hld_EditHolidays (void);
|
||||
void Hld_GetListHolidays (struct Hld_Holidays *Holidays);
|
||||
|
|
|
@ -96,7 +96,7 @@ void Plc_ResetPlaces (struct Plc_Places *Places)
|
|||
/***************************** List all places *******************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Plc_SeePlaces (void)
|
||||
void Plc_SeeAllPlaces (void)
|
||||
{
|
||||
extern const char *Hlp_INSTITUTION_Places;
|
||||
extern const char *Txt_Places;
|
||||
|
|
|
@ -69,7 +69,7 @@ struct Plc_Places
|
|||
|
||||
void Plc_ResetPlaces (struct Plc_Places *Places);
|
||||
|
||||
void Plc_SeePlaces (void);
|
||||
void Plc_SeeAllPlaces (void);
|
||||
void Plc_EditPlaces (void);
|
||||
void Plc_PutIconToViewPlaces (void);
|
||||
void Plc_GetListPlaces (struct Plc_Places *Places);
|
||||
|
|
|
@ -2015,30 +2015,16 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView,
|
|||
extern const char *Txt_Confirm;
|
||||
const char *Rec_RecordHelp[Rec_SHARED_NUM_VIEW_TYPES] =
|
||||
{
|
||||
[Rec_SHA_SIGN_UP_IN_CRS_FORM ] = Hlp_USERS_SignUp,
|
||||
|
||||
[Rec_SHA_MY_RECORD_FORM ] = Hlp_PROFILE_Record,
|
||||
|
||||
[Rec_SHA_OTHER_EXISTING_USR_FORM] = NULL,
|
||||
[Rec_SHA_OTHER_NEW_USR_FORM ] = NULL,
|
||||
[Rec_SHA_OTHER_USR_CHECK ] = NULL,
|
||||
|
||||
[Rec_SHA_RECORD_LIST ] = NULL,
|
||||
[Rec_SHA_RECORD_PRINT ] = NULL,
|
||||
[Rec_SHA_RECORD_PUBLIC ] = Hlp_START_Profiles_view_public_profile,
|
||||
[Rec_SHA_SIGN_UP_IN_CRS_FORM] = Hlp_USERS_SignUp,
|
||||
[Rec_SHA_MY_RECORD_FORM ] = Hlp_PROFILE_Record,
|
||||
[Rec_SHA_RECORD_PUBLIC ] = Hlp_START_Profiles_view_public_profile,
|
||||
};
|
||||
const char *Rec_RecordListHelp[Rol_NUM_ROLES] =
|
||||
{
|
||||
[Rol_UNK ] = NULL,
|
||||
[Rol_GST ] = Hlp_USERS_Guests,
|
||||
[Rol_USR ] = NULL,
|
||||
[Rol_STD ] = Hlp_USERS_Students_shared_record_card,
|
||||
[Rol_NET ] = Hlp_USERS_Teachers_shared_record_card,
|
||||
[Rol_TCH ] = Hlp_USERS_Teachers_shared_record_card,
|
||||
[Rol_DEG_ADM] = NULL,
|
||||
[Rol_CTR_ADM] = NULL,
|
||||
[Rol_INS_ADM] = NULL,
|
||||
[Rol_SYS_ADM] = NULL,
|
||||
};
|
||||
char StrRecordWidth[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
|
||||
Usr_MeOrOther_t MeOrOther;
|
||||
|
|
Loading…
Reference in New Issue