Version18.72.2

This commit is contained in:
Antonio Cañas Vargas 2019-03-11 14:51:18 +01:00
parent 4185208bd5
commit 4d12f8ee3a
3 changed files with 47 additions and 4 deletions

View File

@ -453,11 +453,12 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf ps2pdf source.ps destination.pdf
*/ */
#define Log_PLATFORM_VERSION "SWAD 18.72.1 (2019-03-11)" #define Log_PLATFORM_VERSION "SWAD 18.72.2 (2019-03-11)"
#define CSS_FILE "swad18.68.3.css" #define CSS_FILE "swad18.68.3.css"
#define JS_FILE "swad18.64.js" #define JS_FILE "swad18.64.js"
/* /*
Version 18.72.1: Mar 11, 2019 Show attendance list from list of students. (239075 lines) Version 18.72.2: Mar 11, 2019 Create new message from list of users. (239114 lines)
Version 18.72.1: Mar 11, 2019 Show attendance list from list of users. (239075 lines)
Version 18.72: Mar 11, 2019 Show homework from list of students and teachers. (239043 lines) Version 18.72: Mar 11, 2019 Show homework from list of students and teachers. (239043 lines)
Version 18.71: Mar 11, 2019 Listing of users now allow to do several actions. Not finished. (238920 lines) Version 18.71: Mar 11, 2019 Listing of users now allow to do several actions. Not finished. (238920 lines)
3 changes necessary in database: 3 changes necessary in database:

View File

@ -240,6 +240,7 @@ static bool Usr_PutActionsSeveralUsrs (Rol_Role_t UsrsRole);
static void Usr_PutActionShowRecords (void); static void Usr_PutActionShowRecords (void);
static void Usr_PutActionShowHomework (void); static void Usr_PutActionShowHomework (void);
static void Usr_PutActionShowAttendance (void); static void Usr_PutActionShowAttendance (void);
static void Usr_PutActionNewMessage (void);
static void Usr_PutActionFollowUsers (void); static void Usr_PutActionFollowUsers (void);
static void Usr_StartListUsrsAction (Usr_ListUsrsAction_t ListUsrsAction); static void Usr_StartListUsrsAction (Usr_ListUsrsAction_t ListUsrsAction);
static void Usr_EndListUsrsAction (void); static void Usr_EndListUsrsAction (void);
@ -7952,6 +7953,7 @@ void Usr_SeeTeachers (void)
/* Start form */ /* Start form */
Frm_StartForm (ActDoActOnSevTch); Frm_StartForm (ActDoActOnSevTch);
Grp_PutParamsCodGrps ();
/* Start table */ /* Start table */
Tbl_StartTableWide (0); Tbl_StartTableWide (0);
@ -8023,6 +8025,7 @@ static bool Usr_PutActionsSeveralUsrs (Rol_Role_t UsrsRole)
bool ICanViewRecords; bool ICanViewRecords;
bool ICanViewHomework; bool ICanViewHomework;
bool ICanViewAttendance; bool ICanViewAttendance;
bool ICanSendMessage;
bool ICanFollow; bool ICanFollow;
bool OptionsShown = false; bool OptionsShown = false;
@ -8036,10 +8039,12 @@ static bool Usr_PutActionsSeveralUsrs (Rol_Role_t UsrsRole)
ICanViewHomework = ICanViewHomework =
ICanViewAttendance = ICanViewAttendance =
ICanSendMessage =
ICanFollow = false; ICanFollow = false;
break; break;
case Rol_STD: case Rol_STD:
ICanViewRecords = ICanViewRecords =
ICanSendMessage =
ICanFollow = (Gbl.Scope.Current == Sco_SCOPE_CRS && ICanFollow = (Gbl.Scope.Current == Sco_SCOPE_CRS &&
(Gbl.Usrs.Me.IBelongToCurrentCrs || (Gbl.Usrs.Me.IBelongToCurrentCrs ||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)); Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM));
@ -8051,6 +8056,7 @@ static bool Usr_PutActionsSeveralUsrs (Rol_Role_t UsrsRole)
break; break;
case Rol_TCH: case Rol_TCH:
ICanViewRecords = ICanViewRecords =
ICanSendMessage =
ICanFollow = (Gbl.Scope.Current == Sco_SCOPE_CRS); ICanFollow = (Gbl.Scope.Current == Sco_SCOPE_CRS);
ICanViewHomework = (Gbl.Usrs.Me.Role.Logged == Rol_NET || ICanViewHomework = (Gbl.Usrs.Me.Role.Logged == Rol_NET ||
@ -8063,6 +8069,7 @@ static bool Usr_PutActionsSeveralUsrs (Rol_Role_t UsrsRole)
ICanViewRecords = ICanViewRecords =
ICanViewHomework = ICanViewHomework =
ICanViewAttendance = ICanViewAttendance =
ICanSendMessage =
ICanFollow = false; ICanFollow = false;
break; break;
} }
@ -8092,6 +8099,13 @@ static bool Usr_PutActionsSeveralUsrs (Rol_Role_t UsrsRole)
OptionsShown = true; OptionsShown = true;
} }
/***** New message *****/
if (ICanSendMessage)
{ // I can write and send a new message to users
Usr_PutActionNewMessage ();
OptionsShown = true;
}
/***** Follow *****/ /***** Follow *****/
if (ICanFollow) if (ICanFollow)
{ // I can follow users { // I can follow users
@ -8144,6 +8158,19 @@ static void Usr_PutActionShowAttendance (void)
Usr_EndListUsrsAction (); Usr_EndListUsrsAction ();
} }
/*****************************************************************************/
/*************** Put action to write a new message to users ******************/
/*****************************************************************************/
static void Usr_PutActionNewMessage (void)
{
extern const char *Txt_Send_message;
Usr_StartListUsrsAction (Usr_NEW_MESSAGE);
fprintf (Gbl.F.Out,"%s",Txt_Send_message);
Usr_EndListUsrsAction ();
}
/*****************************************************************************/ /*****************************************************************************/
/*********************** Put action to follow users **************************/ /*********************** Put action to follow users **************************/
/*****************************************************************************/ /*****************************************************************************/
@ -8255,6 +8282,20 @@ void Usr_DoActionOnSeveralUsrs1 (void)
break; break;
} }
break; break;
case Usr_NEW_MESSAGE:
switch (Gbl.Action.Act)
{
case ActDoActOnSevStd:
case ActDoActOnSevTch:
Gbl.Action.Act = ActReqMsgUsr;
Tab_SetCurrentTab ();
break;
default:
Ale_CreateAlert (Ale_ERROR,NULL,
"Wrong action.");
break;
}
break;
case Usr_FOLLOW_USERS: case Usr_FOLLOW_USERS:
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
"Not implemented."); "Not implemented.");

View File

@ -115,14 +115,15 @@ typedef enum
} Usr_ShowUsrsType_t; } Usr_ShowUsrsType_t;
#define Usr_SHOW_USRS_TYPE_DEFAULT Usr_LIST_AS_CLASS_PHOTO #define Usr_SHOW_USRS_TYPE_DEFAULT Usr_LIST_AS_CLASS_PHOTO
#define Usr_LIST_USRS_NUM_ACTIONS 5 #define Usr_LIST_USRS_NUM_ACTIONS 6
typedef enum typedef enum
{ {
Usr_LIST_USRS_UNKNOWN_ACTION = 0, Usr_LIST_USRS_UNKNOWN_ACTION = 0,
Usr_SHOW_RECORDS = 1, Usr_SHOW_RECORDS = 1,
Usr_VIEW_HOMEWORK = 2, Usr_VIEW_HOMEWORK = 2,
Usr_SHOW_ATTENDANCE = 3, Usr_SHOW_ATTENDANCE = 3,
Usr_FOLLOW_USERS = 4, Usr_NEW_MESSAGE = 4,
Usr_FOLLOW_USERS = 5,
} Usr_ListUsrsAction_t; } Usr_ListUsrsAction_t;
#define Usr_LIST_USRS_DEFAULT_ACTION Usr_SHOW_RECORDS #define Usr_LIST_USRS_DEFAULT_ACTION Usr_SHOW_RECORDS