Version 16.226

This commit is contained in:
Antonio Cañas Vargas 2017-05-29 21:34:43 +02:00
parent 3a07717622
commit 3ac8d2b49e
22 changed files with 141 additions and 114 deletions

View File

@ -1309,27 +1309,30 @@ a:hover /* Default ==> underlined */
}
.BT_SUBMIT
{
color:white;
font-size:20px;
font-weight:bold;
line-height:normal;
margin:8px auto;
padding:10px 20px;
border-radius:4px;
box-shadow:0 1px 0 rgba(255,255,255,0.15) inset;
color:white;
font-size:20px;
font-weight:bold;
line-height:normal;
white-space:nowrap;
}
.BT_SUBMIT_INLINE
{
box-sizing:border-box;
min-width:170px;
margin:0 10px;
padding:2px 4px;
border-radius:4px;
box-shadow:0 1px 0 rgba(255,255,255,0.15) inset;
color:white;
font-size:15px;
font-weight:bold;
line-height:normal;
margin:0 10px;
padding:4px;
border-radius:4px;
box-shadow:0 1px 0 rgba(255,255,255,0.15) inset;
white-space:nowrap;
vertical-align:middle;
}
.BT_SUBMIT:hover
{
@ -1490,7 +1493,6 @@ a:hover /* Default ==> underlined */
{
display:inline-block;
box-sizing:border-box;
max-width:90%;
margin:8px auto;
padding:12px;
background-color:#FFF9EA;

View File

@ -165,6 +165,9 @@ static void Asg_ShowAllAssignments (void)
if (Asg_CheckIfICanCreateAssignments ())
Asg_PutButtonToCreateNewAsg ();
/***** Put link to register students *****/
Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs ();
/***** End frame *****/
Lay_EndRoundFrame ();

View File

@ -1994,7 +1994,8 @@ static void Att_ListAttStudents (struct AttendanceEvent *Att)
/***** Free memory used for user's data *****/
Usr_UsrDataDestructor (&UsrDat);
}
else
else // Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs == 0
/***** Show warning indicating no students found *****/
Usr_ShowWarningNoUsersFound (Rol_STD);
/***** End section with user list *****/
@ -2699,7 +2700,8 @@ void Usr_ReqListStdsAttendanceCrs (void)
Usr_FreeListsSelectedUsrsCods ();
}
}
else
else // Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs == 0
/***** Show warning indicating no students found *****/
Usr_ShowWarningNoUsersFound (Rol_STD);
/***** End section with user list *****/

View File

@ -235,13 +235,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.225.12 (2017-05-29)"
#define CSS_FILE "swad16.222.css"
#define Log_PLATFORM_VERSION "SWAD 16.226 (2017-05-29)"
#define CSS_FILE "swad16.226.css"
#define JS_FILE "swad16.206.3.js"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
/*
Version 16.226: May 29, 2017 Code refactoring in buttons. (220607 lines)
Version 16.225.12:May 29, 2017 Button to register students in connected and requests. (220587 lines)
Version 16.225.11:May 29, 2017 Button to register students everytime an alert with no students in course is displayed. (220581 lines)
Version 16.225.10:May 29, 2017 Buttons to register students in listing of teacher's courses. (220561 lines)

View File

@ -492,9 +492,7 @@ static void Con_ShowConnectedUsrsBelongingToLocation (void)
fprintf (Gbl.F.Out,"</table>");
/***** Put link to register students *****/
if (Gbl.Usrs.Me.LoggedRole == Rol_TCH) // Course selected and I am logged as teacher
if (!Gbl.CurrentCrs.Crs.NumUsrs[Rol_STD]) // No students in course
Usr_ShowWarningNoUsersFound (Rol_STD);
Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs ();
/***** End container *****/
fprintf (Gbl.F.Out,"</div>");

View File

@ -514,7 +514,6 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
extern const char *Txt_My_courses;
extern const char *Txt_System;
extern const char *Txt_Go_to_X;
extern const char *Txt_Register_students;
struct Country Cty;
struct Instit Ins;
struct Centre Ctr;
@ -541,7 +540,6 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1];
const char *ClassNormal;
char ClassHighlight[64];
Rol_Role_t MyRoleInCrsDB;
ClassNormal = The_ClassForm[Gbl.Prefs.Theme];
sprintf (ClassHighlight,"%s LIGHT_BLUE",The_ClassFormDark[Gbl.Prefs.Theme]);
@ -749,22 +747,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Act_FormEnd ();
/***** Put link to register students *****/
MyRoleInCrsDB = Rol_GetRoleInCrs (Crs.CrsCod,
Gbl.Usrs.Me.UsrDat.UsrCod);
if (MyRoleInCrsDB == Rol_TCH) // I am a teacher in this course
{
Crs.NumUsrs[Rol_STD] = Usr_GetNumUsrsInCrs (Rol_STD,Crs.CrsCod);
if (!Crs.NumUsrs[Rol_STD]) // No students in this course
{
Act_FormStart (ActReqEnrSevStd);
Crs_PutParamCrsCod (Crs.CrsCod);
fprintf (Gbl.F.Out,"<button type=\"submit\" class=\"BT_SUBMIT_INLINE BT_CREATE\">"
"%s"
"</button>",
Txt_Register_students);
Act_FormEnd ();
}
}
Enr_PutButtonInlineToRegisterStds (Crs.CrsCod);
fprintf (Gbl.F.Out,"</li>");
}

View File

@ -223,7 +223,7 @@ void Dup_ListDuplicateUsrs (void)
/***** Free memory used for user's data *****/
Usr_UsrDataDestructor (&UsrDat);
}
else // There are no users
else // There are no duplicated users
/***** Show warning indicating no users found *****/
Usr_ShowWarningNoUsersFound (Rol_UNK);
@ -281,7 +281,7 @@ static void Dup_ListSimilarUsrs (void)
Gbl.Usrs.Other.UsrDat.UsrCod);
NumUsrs = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get similar users");
/***** List possible duplicated users *****/
/***** List possible similar users *****/
if (NumUsrs)
{
/***** Initialize field names *****/
@ -364,7 +364,7 @@ static void Dup_ListSimilarUsrs (void)
/***** Free memory used for user's data *****/
Usr_UsrDataDestructor (&UsrDat);
}
else // There are no users
else // There are no similar users
/***** Show warning indicating no users found *****/
Usr_ShowWarningNoUsersFound (Rol_UNK);

View File

@ -152,39 +152,33 @@ static void Enr_EffectivelyRemAdm (struct UsrData *UsrDat,Sco_Scope_t Scope,
long Cod,const char *InsCtrDegName);
/*****************************************************************************/
/***************** Show form with button to enrol students *******************/
/************ Put button to register students *************/
/*****************************************************************************/
void Enr_PutButtonToEnrolStudents (void)
void Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs (void)
{
extern const char *Txt_Register_students;
/***** Form to enrol several students *****/
if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected
Gbl.Usrs.Me.LoggedRole == Rol_TCH) // I am logged as teacher
{
Act_FormStart (ActReqEnrSevStd);
Lay_PutCreateButton (Txt_Register_students);
Act_FormEnd ();
}
/***** Put link to register students *****/
if (Gbl.Usrs.Me.LoggedRole == Rol_TCH) // Course selected and I am logged as teacher
if (!Gbl.CurrentCrs.Crs.NumUsrs[Rol_STD]) // No students in course
Usr_ShowWarningNoUsersFound (Rol_STD);
}
/*****************************************************************************/
/**************** Show form with button to enrol teachers ********************/
/************ Put button to register students *************/
/*****************************************************************************/
void Enr_PutButtonToEnrolOneTeacher (void)
void Enr_PutButtonInlineToRegisterStds (long CrsCod)
{
extern const char *Txt_Register_teacher;
extern const char *Txt_Register_students;
/***** Form to enrol several students *****/
if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected
Gbl.Usrs.Me.LoggedRole >= Rol_DEG_ADM) // I am an administrator
{
Act_FormStart (ActReqMdfOneTch);
Lay_PutConfirmButton (Txt_Register_teacher);
Act_FormEnd ();
}
if (Rol_GetRoleInCrs (CrsCod,Gbl.Usrs.Me.UsrDat.UsrCod) == Rol_TCH) // I am a teacher in course
if (!Usr_GetNumUsrsInCrs (Rol_STD,CrsCod)) // No students in course
{
Act_FormStart (ActReqEnrSevStd);
Crs_PutParamCrsCod (CrsCod);
Lay_PutCreateButtonInline (Txt_Register_students);
Act_FormEnd ();
}
}
/*****************************************************************************/
@ -1838,7 +1832,7 @@ void Enr_AskRemAllStdsThisCrs (void)
Lay_StartRoundFrame (NULL,Txt_Remove_all_students,NULL,
Hlp_USERS_Administration_remove_all_students);
if ((NumStds = Usr_GetNumUsrsInCrs (Rol_STD,Gbl.CurrentCrs.Crs.CrsCod)))
if (Gbl.CurrentCrs.Crs.NumUsrs[Rol_STD])
{
/***** Show question and button to remove students *****/
/* Start alert */
@ -1856,7 +1850,7 @@ void Enr_AskRemAllStdsThisCrs (void)
/* End alert */
Ale_ShowAlertAndButton2 (ActUnk,NULL,NULL,NULL,Lay_NO_BUTTON,NULL);
}
else
else // Gbl.CurrentCrs.Crs.NumUsrs[Rol_STD] == 0
/***** Show warning indicating no students found *****/
Usr_ShowWarningNoUsersFound (Rol_STD);
@ -1881,7 +1875,7 @@ void Enr_RemAllStdsThisCrs (void)
NumStdsInCrs,Gbl.CurrentCrs.Crs.FullName);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
}
else
else // NumStdsInCrs == 0
/***** Show warning indicating no students found *****/
Usr_ShowWarningNoUsersFound (Rol_STD);
}
@ -2933,9 +2927,7 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected)
Ale_ShowAlert (Ale_INFO,Txt_No_enrolment_requests);
/***** Put link to register students *****/
if (Gbl.Usrs.Me.LoggedRole == Rol_TCH) // Course selected and I am logged as teacher
if (!Gbl.CurrentCrs.Crs.NumUsrs[Rol_STD]) // No students in course
Usr_ShowWarningNoUsersFound (Rol_STD);
Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs ();
/***** End frame *****/
Lay_EndRoundFrame ();

View File

@ -70,8 +70,8 @@ typedef enum
/****************************** Public prototypes ****************************/
/*****************************************************************************/
void Enr_PutButtonToEnrolStudents (void);
void Enr_PutButtonToEnrolOneTeacher (void);
void Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs (void);
void Enr_PutButtonInlineToRegisterStds (long CrsCod);
void Enr_PutLinkToRequestSignUp (void);

View File

@ -689,10 +689,13 @@ static void Exa_ListExamAnnouncements (Exa_TypeViewExamAnnouncement_t TypeViewEx
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
/***** Button to create a new assignment *****/
/***** Button to create a new exam announcement *****/
if (ICanEdit)
Exa_PutButtonToCreateNewExamAnnouncement ();
/***** Put link to register students *****/
Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs ();
/***** End frame *****/
Lay_EndRoundFrame ();
}

View File

@ -3132,6 +3132,9 @@ void Brw_AskEditWorksCrs (void)
/* Form to select type of list used for select several users */
Usr_ShowFormsToSelectUsrListType (ActReqAsgWrkCrs);
/***** Put link to register students *****/
Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs ();
/* Start form */
Act_FormStart (ActAdmAsgWrkCrs);
Grp_PutParamsCodGrps ();
@ -3152,7 +3155,8 @@ void Brw_AskEditWorksCrs (void)
Act_FormEnd ();
}
}
else
else // NumTotalUsrs == 0
/***** Show warning indicating no users found *****/
Usr_ShowWarningNoUsersFound (Rol_UNK);
/***** End section with user list *****/

View File

@ -2181,6 +2181,11 @@ static void For_WriteLinkToForum (struct Forum *Forum,
/***** End row *****/
fprintf (Gbl.F.Out,"</a>");
Act_FormEnd ();
/***** Put link to register students *****/
if (Forum->Type == For_FORUM_COURSE_USRS)
Enr_PutButtonInlineToRegisterStds (Forum->Location);
fprintf (Gbl.F.Out,"</li>");
}

View File

@ -61,7 +61,7 @@ extern struct Globals Gbl;
static void Hlp_ShowRowHelpWhatWouldYouLikeToDo (const char *Description,
Act_Action_t Action,
const char *ClassButton,
Lay_Button_t Button,
const char *TxtButton);
/*****************************************************************************/
@ -147,7 +147,7 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
Gbl.CurrentCrs.Crs.ShrtName);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActionsRemoveMe[Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB],
"BT_REMOVE",Txt_Remove_me);
Lay_REMOVE_BUTTON,Txt_Remove_me);
}
}
else // I do not belong to this course
@ -157,7 +157,7 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
Gbl.CurrentCrs.Crs.ShrtName);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActReqSignUp,
"BT_CREATE",Txt_Sign_up);
Lay_CREATE_BUTTON,Txt_Sign_up);
}
}
@ -172,14 +172,14 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
Gbl.CurrentCrs.Crs.ShrtName);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActReqEnrSevStd,
"BT_CREATE",Txt_Register_students);
Lay_CREATE_BUTTON,Txt_Register_students);
}
if (Gbl.Action.Act != ActMyCrs) // I am not seeing the action to list my courses
/* Request list my courses */
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Txt_Go_to_one_of_my_courses,
ActMyCrs,
"BT_CONFIRM",Txt_My_courses);
Lay_CONFIRM_BUTTON,Txt_My_courses);
}
if (Gbl.CurrentDeg.Deg.DegCod > 0) // Degree selected
@ -190,7 +190,7 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
Gbl.CurrentDeg.Deg.ShrtName);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActSeeCrs,
"BT_CONFIRM",Txt_Courses);
Lay_CONFIRM_BUTTON,Txt_Courses);
}
else if (Gbl.CurrentCtr.Ctr.CtrCod > 0) // Centre selected
{
@ -200,7 +200,7 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
Gbl.CurrentCtr.Ctr.ShrtName);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActSeeDeg,
"BT_CONFIRM",Txt_Degrees);
Lay_CONFIRM_BUTTON,Txt_Degrees);
}
else if (Gbl.CurrentIns.Ins.InsCod > 0) // Institution selected
{
@ -210,7 +210,7 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
Gbl.CurrentIns.Ins.ShrtName);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActSeeCtr,
"BT_CONFIRM",Txt_Centres);
Lay_CONFIRM_BUTTON,Txt_Centres);
}
else if (Gbl.CurrentCty.Cty.CtyCod > 0) // Country selected
{
@ -220,33 +220,33 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
Gbl.CurrentCty.Cty.Name[Gbl.Prefs.Language]);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActSeeIns,
"BT_CONFIRM",Txt_Institutions);
Lay_CONFIRM_BUTTON,Txt_Institutions);
}
else
/* Select a country */
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.CurrentCty.Cty.CtyCod > 0 ? Txt_Select_another_country :
Txt_Select_one_country,
ActSeeCty,
"BT_CONFIRM",Txt_Countries);
Lay_CONFIRM_BUTTON,Txt_Countries);
if (!Gbl.Usrs.Me.MyPhotoExists) // I have no photo
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Txt_Upload_my_picture,
ActReqMyPho,
"BT_CREATE",Txt_Upload_photo);
Lay_CREATE_BUTTON,Txt_Upload_photo);
}
else // I am not logged
{
/* Log in */
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Txt_Log_in,
ActFrmLogIn,
"BT_CONFIRM",Txt_Log_in);
Lay_CONFIRM_BUTTON,Txt_Log_in);
/* Sign up */
sprintf (Gbl.Title,Txt_New_on_PLATFORM_Sign_up,
Cfg_PLATFORM_SHORT_NAME);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActFrmMyAcc,
"BT_CREATE",Txt_Create_account);
Lay_CREATE_BUTTON,Txt_Create_account);
}
/* End table */
@ -259,7 +259,7 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
static void Hlp_ShowRowHelpWhatWouldYouLikeToDo (const char *Description,
Act_Action_t Action,
const char *ClassButton,
Lay_Button_t Button,
const char *TxtButton)
{
/***** Description *****/
@ -272,10 +272,7 @@ static void Hlp_ShowRowHelpWhatWouldYouLikeToDo (const char *Description,
/***** Button *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">");
Act_FormStart (Action);
fprintf (Gbl.F.Out,"<button type=\"submit\" class=\"BT_SUBMIT_INLINE %s\">"
"%s"
"</button>",
ClassButton,TxtButton);
Lay_PutButtonInline (Button,TxtButton);
Act_FormEnd ();
fprintf (Gbl.F.Out,"</td>"
"</tr>");

View File

@ -1363,6 +1363,26 @@ void Lay_PutButton (Lay_Button_t Button,const char *TxtButton)
}
}
void Lay_PutButtonInline (Lay_Button_t Button,const char *TxtButton)
{
if (TxtButton)
if (TxtButton[0])
switch (Button)
{
case Lay_NO_BUTTON:
break;
case Lay_CREATE_BUTTON:
Lay_PutCreateButtonInline (TxtButton);
break;
case Lay_CONFIRM_BUTTON:
Lay_PutConfirmButtonInline (TxtButton);
break;
case Lay_REMOVE_BUTTON:
Lay_PutRemoveButtonInline (TxtButton);
break;
}
}
void Lay_PutCreateButton (const char *TxtButton)
{
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\">"

View File

@ -85,6 +85,7 @@ void Lay_PutIconBRemovalNotAllowed (void);
void Lay_PutIconRemove (void);
void Lay_PutButton (Lay_Button_t Button,const char *TxtButton);
void Lay_PutButtonInline (Lay_Button_t Button,const char *TxtButton);
void Lay_PutCreateButton (const char *TxtButton);
void Lay_PutCreateButtonInline (const char *TxtButton);
void Lay_PutConfirmButton (const char *TxtButton);

View File

@ -978,7 +978,8 @@ void Mai_ListEmails (void)
"</div>");
}
}
else
else // Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs == 0
/***** Show warning indicating no students found *****/
Usr_ShowWarningNoUsersFound (Rol_STD);
/***** End section with user list *****/

View File

@ -635,10 +635,7 @@ void Mrk_ShowMyMarks (void)
UsrDat = &Gbl.Usrs.Other.UsrDat;
}
else
{
UsrIsOK = false;
Usr_ShowWarningNoUsersFound (Rol_STD);
}
}
else // Course zone
{
@ -648,10 +645,7 @@ void Mrk_ShowMyMarks (void)
UsrDat = &Gbl.Usrs.Other.UsrDat;
}
else
{
UsrIsOK = false;
Usr_ShowWarningNoUsersFound (Rol_STD);
}
}
}
@ -706,6 +700,9 @@ void Mrk_ShowMyMarks (void)
unlink (FileNameUsrMarks); // File with marks is no longer necessary
}
else
/***** Show warning indicating no students found *****/
Usr_ShowWarningNoUsersFound (Rol_STD);
}
/*****************************************************************************/

View File

@ -247,6 +247,9 @@ static void Msg_PutFormMsgUsrs (char Content[Cns_MAX_BYTES_LONG_TEXT + 1])
/***** Form to select type of list used for select several users *****/
Usr_ShowFormsToSelectUsrListType (ActReqMsgUsr);
/***** Put link to register students *****/
Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs ();
/***** Check if it's a big list *****/
ShowUsrsInCrs = Usr_GetIfShowBigList (NumUsrsInCrs,"CopyMessageToHiddenFields()");

View File

@ -460,6 +460,9 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing)
if (Not_CheckIfICanEditNotices ())
Not_PutButtonToAddNewNotice ();
/***** Put link to register students *****/
Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs ();
/***** End frame *****/
Lay_EndRoundFrame ();
break;

View File

@ -489,6 +489,9 @@ void Sta_AskShowCrsHits (void)
/***** Form to select type of list used for select several users *****/
Usr_ShowFormsToSelectUsrListType (ActReqAccCrs);
/***** Put link to register students *****/
Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs ();
/***** Start form *****/
Act_FormStartAnchor (ActSeeAccCrs,Sta_STAT_RESULTS_SECTION_ID);

View File

@ -7025,7 +7025,8 @@ void Tst_SelUsrsToSeeUsrsTestResults (void)
Act_FormEnd ();
}
}
else
else // NumTotalUsrs == 0
/***** Show warning indicating no students found *****/
Usr_ShowWarningNoUsersFound (Rol_UNK);
/***** End section with user list *****/

View File

@ -5941,6 +5941,7 @@ static void Usr_ListMainDataGsts (bool PutCheckBoxToSelectUsr)
Usr_UsrDataDestructor (&UsrDat);
}
else // Gbl.Usrs.LstUsrs[Rol_GST].NumUsrs == 0
/***** Show warning indicating no guests found *****/
Usr_ShowWarningNoUsersFound (Rol_GST);
/***** Free memory for guests list *****/
@ -6193,6 +6194,7 @@ void Usr_ListAllDataGsts (void)
Lay_EndTable ();
}
else // Gbl.Usrs.LstUsrs[Rol_GST].NumUsrs == 0
/***** Show warning indicating no guests found *****/
Usr_ShowWarningNoUsersFound (Rol_GST);
/***** Free memory for guests list *****/
@ -6396,6 +6398,7 @@ void Usr_ListAllDataStds (void)
free ((void *) GroupNames);
}
else // Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs == 0
/***** Show warning indicating no students found *****/
Usr_ShowWarningNoUsersFound (Rol_STD);
/***** Free memory for list of selected groups *****/
@ -6522,7 +6525,7 @@ void Usr_ListAllDataTchs (void)
/***** End of table *****/
Lay_EndTable ();
}
else // Gbl.Usrs.LstUsrs[Rol_TCH].NumUsrs == 0
else // NumUsrs == 0
/***** Show warning indicating no teachers found *****/
Usr_ShowWarningNoUsersFound (Rol_TCH);
@ -7308,7 +7311,8 @@ void Usr_SeeGuests (void)
Act_FormEnd ();
}
}
else
else // Gbl.Usrs.LstUsrs[Rol_GST].NumUsrs == 0
/***** Show warning indicating no guests found *****/
Usr_ShowWarningNoUsersFound (Rol_GST);
/***** End section with user list *****/
@ -7482,7 +7486,7 @@ void Usr_SeeStudents (void)
}
}
}
else
else // Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs == 0
/***** Show warning indicating no students found *****/
Usr_ShowWarningNoUsersFound (Rol_STD);
@ -7644,15 +7648,10 @@ void Usr_SeeTeachers (void)
}
}
}
else
{
else // NumUsrs == 0
/***** Show warning indicating no teachers found *****/
Usr_ShowWarningNoUsersFound (Rol_TCH);
/***** Button to enrol a teacher *****/
Enr_PutButtonToEnrolOneTeacher ();
}
/***** End section with user list *****/
Lay_EndSection ();
@ -7846,7 +7845,8 @@ void Usr_SeeGstClassPhotoPrn (void)
Rol_GST,false);
Lay_EndTable ();
}
else
else // Gbl.Usrs.LstUsrs[Rol_GST].NumUsrs
/***** Show warning indicating no guests found *****/
Usr_ShowWarningNoUsersFound (Rol_GST);
/***** Free memory for guests list *****/
@ -7893,7 +7893,8 @@ void Usr_SeeStdClassPhotoPrn (void)
Rol_STD,false);
Lay_EndTable ();
}
else
else // Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs == 0
/***** Show warning indicating no students found *****/
Usr_ShowWarningNoUsersFound (Rol_STD);
/***** Free memory for students list *****/
@ -7957,7 +7958,7 @@ void Usr_SeeTchClassPhotoPrn (void)
Lay_EndTable ();
}
else
else // NumUsrs == 0
/***** Show warning indicating no teachers found *****/
Usr_ShowWarningNoUsersFound (Rol_TCH);
@ -8160,16 +8161,23 @@ bool Usr_ChkIfUsrCodExists (long UsrCod)
void Usr_ShowWarningNoUsersFound (Rol_Role_t Role)
{
extern const char *Txt_No_users_found[Rol_NUM_ROLES];
extern const char *Txt_Register_students;
extern const char *Txt_Register_teacher;
if (Role == Rol_STD && // No students found
Gbl.Usrs.Me.LoggedRole == Rol_TCH) // Course selected and I am logged as teacher
{
/***** Show alert *****/
Ale_ShowAlert (Ale_WARNING,Txt_No_users_found[Role]);
/***** Show alert and button to enrol students *****/
Ale_ShowAlertAndButton (Ale_WARNING,Txt_No_users_found[Rol_STD],
ActReqEnrSevStd,NULL,NULL,NULL,
Lay_CREATE_BUTTON,Txt_Register_students);
/***** Button to enrol students *****/
Enr_PutButtonToEnrolStudents ();
}
else if (Role == Rol_TCH && // No teachers found
Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected
Gbl.Usrs.Me.LoggedRole >= Rol_DEG_ADM) // I am an administrator
/***** Show alert and button to enrol students *****/
Ale_ShowAlertAndButton (Ale_WARNING,Txt_No_users_found[Rol_TCH],
ActReqMdfOneTch,NULL,NULL,NULL,
Lay_CREATE_BUTTON,Txt_Register_teacher);
else
/***** Show alert *****/
Ale_ShowAlert (Ale_INFO,Txt_No_users_found[Role]);