mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-08 01:35:32 +02:00
Version 20.67.4: Apr 25, 2021 New file extensions for LogicWorks, reported by Eva Martínez Ortigosa.
This commit is contained in:
parent
59fbfea9ef
commit
06f12acde8
|
@ -186,7 +186,7 @@ static void RSS_WriteNotices (FILE *FileRSS,struct Crs_Course *Crs)
|
||||||
|
|
||||||
/* Get notice code */
|
/* Get notice code */
|
||||||
if (sscanf (row[0],"%ld",&NotCod) != 1)
|
if (sscanf (row[0],"%ld",&NotCod) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of notice.");
|
Lay_WrongNoticeExit ();
|
||||||
|
|
||||||
/* Get UTC date-time of publication */
|
/* Get UTC date-time of publication */
|
||||||
CreatTimeUTC = 0L;
|
CreatTimeUTC = 0L;
|
||||||
|
@ -285,12 +285,12 @@ static void RSS_WriteCallsForExams (FILE *FileRSS,struct Crs_Course *Crs)
|
||||||
NumExa < NumExams;
|
NumExa < NumExams;
|
||||||
NumExa++)
|
NumExa++)
|
||||||
{
|
{
|
||||||
/***** Get data of the exam announcement *****/
|
/***** Get data of the call for exam *****/
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get exam announcement code */
|
/* Get call for exam code */
|
||||||
if (sscanf (row[0],"%ld",&ExaCod) != 1)
|
if (sscanf (row[0],"%ld",&ExaCod) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of exam announcement.");
|
Lay_WrongCallForExamExit ();
|
||||||
|
|
||||||
/* Get UTC date-time of publication */
|
/* Get UTC date-time of publication */
|
||||||
CallTimeUTC = 0L;
|
CallTimeUTC = 0L;
|
||||||
|
|
|
@ -1571,7 +1571,7 @@ void Agd_RequestCreatOrEditEvent (void)
|
||||||
Agd_GetParams (&Agenda,Agd_MY_AGENDA);
|
Agd_GetParams (&Agenda,Agd_MY_AGENDA);
|
||||||
|
|
||||||
/***** Get the code of the event *****/
|
/***** Get the code of the event *****/
|
||||||
ItsANewEvent = ((AgdEvent.AgdCod = Agd_GetParamAgdCod ()) == -1L);
|
ItsANewEvent = ((AgdEvent.AgdCod = Agd_GetParamAgdCod ()) <= 0);
|
||||||
|
|
||||||
/***** Get from the database the data of the event *****/
|
/***** Get from the database the data of the event *****/
|
||||||
AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
|
AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
|
||||||
|
@ -1709,7 +1709,7 @@ void Agd_ReceiveFormEvent (void)
|
||||||
AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
|
AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
|
||||||
|
|
||||||
/***** Get the code of the event *****/
|
/***** Get the code of the event *****/
|
||||||
ItsANewEvent = ((AgdEvent.AgdCod = Agd_GetParamAgdCod ()) == -1L);
|
ItsANewEvent = ((AgdEvent.AgdCod = Agd_GetParamAgdCod ()) <= 0);
|
||||||
|
|
||||||
/***** Get start/end date-times *****/
|
/***** Get start/end date-times *****/
|
||||||
AgdEvent.TimeUTC[Dat_START_TIME] = Dat_GetTimeUTCFromForm ("StartTimeUTC");
|
AgdEvent.TimeUTC[Dat_START_TIME] = Dat_GetTimeUTCFromForm ("StartTimeUTC");
|
||||||
|
|
|
@ -155,7 +155,7 @@ void Ann_ShowAllAnnouncements (void)
|
||||||
|
|
||||||
/* Get announcement code (row[0]) */
|
/* Get announcement code (row[0]) */
|
||||||
if (sscanf (row[0],"%ld",&AnnCod) != 1)
|
if (sscanf (row[0],"%ld",&AnnCod) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of announcement.");
|
Lay_WrongAnnouncementExit ();
|
||||||
|
|
||||||
/* Get status of the announcement (row[1]) */
|
/* Get status of the announcement (row[1]) */
|
||||||
Status = Ann_OBSOLETE_ANNOUNCEMENT;
|
Status = Ann_OBSOLETE_ANNOUNCEMENT;
|
||||||
|
@ -260,7 +260,7 @@ void Ann_ShowMyAnnouncementsNotMarkedAsSeen (void)
|
||||||
|
|
||||||
/* Get announcement code (row[0]) */
|
/* Get announcement code (row[0]) */
|
||||||
if (sscanf (row[0],"%ld",&AnnCod) != 1)
|
if (sscanf (row[0],"%ld",&AnnCod) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of announcement.");
|
Lay_WrongAnnouncementExit ();
|
||||||
|
|
||||||
/* Get the subject (row[1]), the content (row[2]), and insert links */
|
/* Get the subject (row[1]), the content (row[2]), and insert links */
|
||||||
Str_Copy (Subject,row[1],sizeof (Subject) - 1);
|
Str_Copy (Subject,row[1],sizeof (Subject) - 1);
|
||||||
|
@ -395,7 +395,7 @@ static long Ann_GetParamAnnCod (void)
|
||||||
|
|
||||||
/***** Get announcement code *****/
|
/***** Get announcement code *****/
|
||||||
if ((AnnCod = Par_GetParToLong ("AnnCod")) <= 0)
|
if ((AnnCod = Par_GetParToLong ("AnnCod")) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of announcement.");
|
Lay_WrongAnnouncementExit ();
|
||||||
|
|
||||||
return AnnCod;
|
return AnnCod;
|
||||||
}
|
}
|
||||||
|
|
|
@ -549,7 +549,7 @@ static void Asg_WriteAssignmentFolder (struct Asg_Assignment *Asg,bool PrintView
|
||||||
Frm_BeginForm (ActFrmCreAsgCrs);
|
Frm_BeginForm (ActFrmCreAsgCrs);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Str_Copy (Gbl.FileBrowser.FilFolLnk.Path,Brw_INTERNAL_NAME_ROOT_FOLDER_ASSIGNMENTS,
|
Str_Copy (Gbl.FileBrowser.FilFolLnk.Path,Brw_INTERNAL_NAME_ROOT_FOLDER_ASSIGNMENTS,
|
||||||
|
@ -1233,7 +1233,7 @@ void Asg_RequestCreatOrEditAsg (void)
|
||||||
Assignments.CurrentPage = Pag_GetParamPagNum (Pag_ASSIGNMENTS);
|
Assignments.CurrentPage = Pag_GetParamPagNum (Pag_ASSIGNMENTS);
|
||||||
|
|
||||||
/***** Get the code of the assignment *****/
|
/***** Get the code of the assignment *****/
|
||||||
ItsANewAssignment = ((Asg.AsgCod = Asg_GetParamAsgCod ()) == -1L);
|
ItsANewAssignment = ((Asg.AsgCod = Asg_GetParamAsgCod ()) <= 0);
|
||||||
|
|
||||||
/***** Get from the database the data of the assignment *****/
|
/***** Get from the database the data of the assignment *****/
|
||||||
if (ItsANewAssignment)
|
if (ItsANewAssignment)
|
||||||
|
|
|
@ -1303,7 +1303,7 @@ void Att_ReceiveFormAttEvent (void)
|
||||||
char Description[Cns_MAX_BYTES_TEXT + 1];
|
char Description[Cns_MAX_BYTES_TEXT + 1];
|
||||||
|
|
||||||
/***** Get the code of the attendance event *****/
|
/***** Get the code of the attendance event *****/
|
||||||
ItsANewAttEvent = ((ReceivedAtt.AttCod = Att_GetParamAttCod ()) == -1L);
|
ItsANewAttEvent = ((ReceivedAtt.AttCod = Att_GetParamAttCod ()) <= 0);
|
||||||
|
|
||||||
if (!ItsANewAttEvent)
|
if (!ItsANewAttEvent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -760,7 +760,7 @@ static void Ctr_GetDataOfCenterFromRow (struct Ctr_Center *Ctr,MYSQL_ROW row)
|
||||||
|
|
||||||
/***** Get center status (row[3]) *****/
|
/***** Get center status (row[3]) *****/
|
||||||
if (sscanf (row[3],"%u",&(Ctr->Status)) != 1)
|
if (sscanf (row[3],"%u",&(Ctr->Status)) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong center status.");
|
Lay_WrongStatusExit ();
|
||||||
|
|
||||||
/***** Get requester user's code (row[4]) *****/
|
/***** Get requester user's code (row[4]) *****/
|
||||||
Ctr->RequesterUsrCod = Str_ConvertStrCodToLongCod (row[4]);
|
Ctr->RequesterUsrCod = Str_ConvertStrCodToLongCod (row[4]);
|
||||||
|
@ -1518,7 +1518,7 @@ void Ctr_ChangeCtrStatus (void)
|
||||||
(unsigned long) Ctr_MAX_STATUS,
|
(unsigned long) Ctr_MAX_STATUS,
|
||||||
(unsigned long) Ctr_WRONG_STATUS);
|
(unsigned long) Ctr_WRONG_STATUS);
|
||||||
if (Status == Ctr_WRONG_STATUS)
|
if (Status == Ctr_WRONG_STATUS)
|
||||||
Lay_ShowErrorAndExit ("Wrong status.");
|
Lay_WrongStatusExit ();
|
||||||
StatusTxt = Ctr_GetStatusTxtFromStatusBits (Status);
|
StatusTxt = Ctr_GetStatusTxtFromStatusBits (Status);
|
||||||
Status = Ctr_GetStatusBitsFromStatusTxt (StatusTxt); // New status
|
Status = Ctr_GetStatusBitsFromStatusTxt (StatusTxt); // New status
|
||||||
|
|
||||||
|
|
|
@ -600,13 +600,20 @@ TODO: Salvador Romero Cort
|
||||||
|
|
||||||
TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria.
|
TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria.
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 20.67.2 (2021-04-25)"
|
#define Log_PLATFORM_VERSION "SWAD 20.67.4 (2021-04-25)"
|
||||||
#define CSS_FILE "swad20.45.css"
|
#define CSS_FILE "swad20.45.css"
|
||||||
#define JS_FILE "swad20.6.2.js"
|
#define JS_FILE "swad20.6.2.js"
|
||||||
/*
|
/*
|
||||||
TODO: Rename CENTRE to CENTER in help wiki.
|
TODO: Rename CENTRE to CENTER in help wiki.
|
||||||
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
||||||
|
|
||||||
|
Version 20.67.4: Apr 25, 2021 New file extensions for LogicWorks, reported by Eva Martínez Ortigosa. (309670 lines)
|
||||||
|
Copy the following icons to icon public directory:
|
||||||
|
sudo cp icon/filext32x32/cct32x32.gif /var/www/html/swad/icon/filext32x32/
|
||||||
|
sudo cp icon/filext32x32/clf32x32.gif /var/www/html/swad/icon/filext32x32/
|
||||||
|
sudo cp icon/filext32x32/tim32x32.gif /var/www/html/swad/icon/filext32x32/
|
||||||
|
|
||||||
|
Version 20.67.3: Apr 25, 2021 Code refactoring in error messages. (309662 lines)
|
||||||
Version 20.67.2: Apr 25, 2021 Code refactoring in error messages. (309482 lines)
|
Version 20.67.2: Apr 25, 2021 Code refactoring in error messages. (309482 lines)
|
||||||
Version 20.67.1: Apr 24, 2021 Code refactoring in error messages. (309415 lines)
|
Version 20.67.1: Apr 24, 2021 Code refactoring in error messages. (309415 lines)
|
||||||
Version 20.67: Apr 24, 2021 Bug fixing and code optimizations related to user's roles. (309356 lines)
|
Version 20.67: Apr 24, 2021 Bug fixing and code optimizations related to user's roles. (309356 lines)
|
||||||
|
|
|
@ -746,7 +746,7 @@ static void Con_GetNumConnectedUsrsWithARoleBelongingCurrentLocation (Rol_Role_t
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -910,7 +910,7 @@ static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role)
|
||||||
Frm_BeginFormUnique (ActSeeRecOneTch);
|
Frm_BeginFormUnique (ActSeeRecOneTch);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||||
|
@ -1116,7 +1116,7 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (NumUsrs)
|
if (NumUsrs)
|
||||||
|
@ -1176,7 +1176,7 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
|
||||||
Frm_BeginForm (ActSeeRecOneTch);
|
Frm_BeginForm (ActSeeRecOneTch);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
}
|
}
|
||||||
Usr_PutParamUsrCodEncrypted (UsrDat.EnUsrCod);
|
Usr_PutParamUsrCodEncrypted (UsrDat.EnUsrCod);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1846,7 +1846,7 @@ static void Crs_GetDataOfCourseFromRow (struct Crs_Course *Crs,MYSQL_ROW row)
|
||||||
|
|
||||||
/***** Get course status (row[4]) *****/
|
/***** Get course status (row[4]) *****/
|
||||||
if (sscanf (row[4],"%u",&(Crs->Status)) != 1)
|
if (sscanf (row[4],"%u",&(Crs->Status)) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong course status.");
|
Lay_WrongStatusExit ();
|
||||||
|
|
||||||
/***** Get requester user'code (row[5]) *****/
|
/***** Get requester user'code (row[5]) *****/
|
||||||
Crs->RequesterUsrCod = Str_ConvertStrCodToLongCod (row[5]);
|
Crs->RequesterUsrCod = Str_ConvertStrCodToLongCod (row[5]);
|
||||||
|
@ -2397,7 +2397,7 @@ void Crs_ChangeCrsStatus (void)
|
||||||
(unsigned long) Crs_MAX_STATUS,
|
(unsigned long) Crs_MAX_STATUS,
|
||||||
(unsigned long) Crs_WRONG_STATUS);
|
(unsigned long) Crs_WRONG_STATUS);
|
||||||
if (Status == Crs_WRONG_STATUS)
|
if (Status == Crs_WRONG_STATUS)
|
||||||
Lay_ShowErrorAndExit ("Wrong status.");
|
Lay_WrongStatusExit ();
|
||||||
StatusTxt = Crs_GetStatusTxtFromStatusBits (Status);
|
StatusTxt = Crs_GetStatusTxtFromStatusBits (Status);
|
||||||
Status = Crs_GetStatusBitsFromStatusTxt (StatusTxt); // New status
|
Status = Crs_GetStatusBitsFromStatusTxt (StatusTxt); // New status
|
||||||
|
|
||||||
|
|
|
@ -1414,7 +1414,7 @@ static void Deg_GetDataOfDegreeFromRow (struct Deg_Degree *Deg,MYSQL_ROW row)
|
||||||
|
|
||||||
/* Get course status (row[3]) */
|
/* Get course status (row[3]) */
|
||||||
if (sscanf (row[3],"%u",&(Deg->Status)) != 1)
|
if (sscanf (row[3],"%u",&(Deg->Status)) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong degree status.");
|
Lay_WrongStatusExit ();
|
||||||
|
|
||||||
/* Get requester user's code (row[4]) */
|
/* Get requester user's code (row[4]) */
|
||||||
Deg->RequesterUsrCod = Str_ConvertStrCodToLongCod (row[4]);
|
Deg->RequesterUsrCod = Str_ConvertStrCodToLongCod (row[4]);
|
||||||
|
@ -1807,7 +1807,7 @@ void Deg_ChangeDegStatus (void)
|
||||||
(unsigned long) Deg_MAX_STATUS,
|
(unsigned long) Deg_MAX_STATUS,
|
||||||
(unsigned long) Deg_WRONG_STATUS);
|
(unsigned long) Deg_WRONG_STATUS);
|
||||||
if (Status == Deg_WRONG_STATUS)
|
if (Status == Deg_WRONG_STATUS)
|
||||||
Lay_ShowErrorAndExit ("Wrong status.");
|
Lay_WrongStatusExit ();
|
||||||
StatusTxt = Deg_GetStatusTxtFromStatusBits (Status);
|
StatusTxt = Deg_GetStatusTxtFromStatusBits (Status);
|
||||||
Status = Deg_GetStatusBitsFromStatusTxt (StatusTxt); // New status
|
Status = Deg_GetStatusBitsFromStatusTxt (StatusTxt); // New status
|
||||||
|
|
||||||
|
|
|
@ -390,11 +390,11 @@ static void Dpt_GetListDepartments (struct Dpt_Departments *Departments,long Ins
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get department code (row[0]) */
|
/* Get department code (row[0]) */
|
||||||
if ((Dpt->DptCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((Dpt->DptCod = Str_ConvertStrCodToLongCod (row[0])) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of department.");
|
Lay_WrongDepartmentExit ();
|
||||||
|
|
||||||
/* Get institution code (row[1]) */
|
/* Get institution code (row[1]) */
|
||||||
if ((Dpt->InsCod = Str_ConvertStrCodToLongCod (row[1])) < 0)
|
if ((Dpt->InsCod = Str_ConvertStrCodToLongCod (row[1])) <= 0)
|
||||||
Lay_WrongInstitExit ();
|
Lay_WrongInstitExit ();
|
||||||
|
|
||||||
/* Get short name (row[2]), full name (row[3])
|
/* Get short name (row[2]), full name (row[3])
|
||||||
|
@ -644,7 +644,7 @@ long Dpt_GetAndCheckParamDptCod (long MinCodAllowed)
|
||||||
|
|
||||||
/***** Get and check parameter with code of department *****/
|
/***** Get and check parameter with code of department *****/
|
||||||
if ((DptCod = Par_GetParToLong (Dpt_PARAM_DPT_COD_NAME)) < MinCodAllowed)
|
if ((DptCod = Par_GetParToLong (Dpt_PARAM_DPT_COD_NAME)) < MinCodAllowed)
|
||||||
Lay_ShowErrorAndExit ("Code of department is missing or invalid.");
|
Lay_WrongDepartmentExit ();
|
||||||
|
|
||||||
return DptCod;
|
return DptCod;
|
||||||
}
|
}
|
||||||
|
@ -1206,7 +1206,7 @@ static void Dpt_EditingDepartmentConstructor (void)
|
||||||
{
|
{
|
||||||
/***** Pointer must be NULL *****/
|
/***** Pointer must be NULL *****/
|
||||||
if (Dpt_EditingDpt != NULL)
|
if (Dpt_EditingDpt != NULL)
|
||||||
Lay_ShowErrorAndExit ("Error initializing department.");
|
Lay_WrongDepartmentExit ();
|
||||||
|
|
||||||
/***** Allocate memory for department *****/
|
/***** Allocate memory for department *****/
|
||||||
if ((Dpt_EditingDpt = malloc (sizeof (*Dpt_EditingDpt))) == NULL)
|
if ((Dpt_EditingDpt = malloc (sizeof (*Dpt_EditingDpt))) == NULL)
|
||||||
|
|
|
@ -243,7 +243,7 @@ void Enr_ModifyRoleInCurrentCrs (struct UsrData *UsrDat,Rol_Role_t NewRole)
|
||||||
case Rol_TCH:
|
case Rol_TCH:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Update the role of a user in a course *****/
|
/***** Update the role of a user in a course *****/
|
||||||
|
@ -289,7 +289,7 @@ void Enr_RegisterUsrInCurrentCrs (struct UsrData *UsrDat,Rol_Role_t NewRole,
|
||||||
case Rol_TCH:
|
case Rol_TCH:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Register user in current course in database *****/
|
/***** Register user in current course in database *****/
|
||||||
|
@ -363,7 +363,7 @@ static void Enr_NotifyAfterEnrolment (struct UsrData *UsrDat,Rol_Role_t NewRole)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
NotifyEvent = Ntf_EVENT_UNKNOWN;
|
NotifyEvent = Ntf_EVENT_UNKNOWN;
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Remove possible enrolment request ******/
|
/***** Remove possible enrolment request ******/
|
||||||
|
@ -453,7 +453,7 @@ void Enr_ReqAcceptRegisterInCrs (void)
|
||||||
Frm_BeginForm (ActAccEnrTch);
|
Frm_BeginForm (ActAccEnrTch);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
}
|
}
|
||||||
Btn_PutCreateButtonInline (Txt_Confirm_my_enrolment);
|
Btn_PutCreateButtonInline (Txt_Confirm_my_enrolment);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
@ -471,7 +471,7 @@ void Enr_ReqAcceptRegisterInCrs (void)
|
||||||
Frm_BeginForm (ActRemMe_Tch);
|
Frm_BeginForm (ActRemMe_Tch);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
}
|
}
|
||||||
Btn_PutRemoveButtonInline (Txt_Remove_me_from_this_course);
|
Btn_PutRemoveButtonInline (Txt_Remove_me_from_this_course);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
@ -493,7 +493,7 @@ void Enr_ReqAcceptRegisterInCrs (void)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
NotifyEvent = Ntf_EVENT_UNKNOWN;
|
NotifyEvent = Ntf_EVENT_UNKNOWN;
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Ntf_MarkNotifAsSeen (NotifyEvent,-1L,Gbl.Hierarchy.Crs.CrsCod,
|
Ntf_MarkNotifAsSeen (NotifyEvent,-1L,Gbl.Hierarchy.Crs.CrsCod,
|
||||||
|
@ -726,7 +726,7 @@ static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role)
|
||||||
default:
|
default:
|
||||||
NextAction = ActUnk;
|
NextAction = ActUnk;
|
||||||
Title = NULL;
|
Title = NULL;
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -751,7 +751,7 @@ static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role)
|
||||||
default:
|
default:
|
||||||
NextAction = ActUnk;
|
NextAction = ActUnk;
|
||||||
Title = NULL;
|
Title = NULL;
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Frm_BeginForm (NextAction);
|
Frm_BeginForm (NextAction);
|
||||||
|
@ -1115,7 +1115,7 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
|
||||||
Lay_NoPermissionExit ();
|
Lay_NoPermissionExit ();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2016,7 +2016,7 @@ void Enr_SignUpInCrs (void)
|
||||||
if (!(RoleFromForm == Rol_STD ||
|
if (!(RoleFromForm == Rol_STD ||
|
||||||
RoleFromForm == Rol_NET ||
|
RoleFromForm == Rol_NET ||
|
||||||
RoleFromForm == Rol_TCH))
|
RoleFromForm == Rol_TCH))
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
|
|
||||||
/***** Try to get and old request of the same user in the same course from database *****/
|
/***** Try to get and old request of the same user in the same course from database *****/
|
||||||
ReqCod = DB_QuerySELECTCode ("can not get enrolment request",
|
ReqCod = DB_QuerySELECTCode ("can not get enrolment request",
|
||||||
|
@ -2179,7 +2179,7 @@ void Enr_AskIfRejectSignUp (void)
|
||||||
Btn_REMOVE_BUTTON,Txt_Reject);
|
Btn_REMOVE_BUTTON,Txt_Reject);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3026,7 +3026,7 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
NextAction = ActUnk;
|
NextAction = ActUnk;
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Frm_BeginForm (NextAction);
|
Frm_BeginForm (NextAction);
|
||||||
|
@ -3172,7 +3172,7 @@ void Enr_PutLinkToAdminSeveralUsrs (Rol_Role_t Role)
|
||||||
default:
|
default:
|
||||||
NextAction = ActUnk;
|
NextAction = ActUnk;
|
||||||
TitleText = NULL;
|
TitleText = NULL;
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
}
|
}
|
||||||
Lay_PutContextualLinkIconText (NextAction,NULL,
|
Lay_PutContextualLinkIconText (NextAction,NULL,
|
||||||
NULL,NULL,
|
NULL,NULL,
|
||||||
|
@ -3252,7 +3252,7 @@ static void Enr_ReqAnotherUsrIDToRegisterRemove (Rol_Role_t Role)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
NextAction = ActUnk;
|
NextAction = ActUnk;
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Enr_WriteFormToReqAnotherUsrID (NextAction,NULL);
|
Enr_WriteFormToReqAnotherUsrID (NextAction,NULL);
|
||||||
|
@ -3890,7 +3890,7 @@ void Enr_CreateNewUsr1 (void)
|
||||||
Gbl.Action.Act = ActCreTch;
|
Gbl.Action.Act = ActCreTch;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Tab_SetCurrentTab ();
|
Tab_SetCurrentTab ();
|
||||||
|
@ -4021,7 +4021,7 @@ void Enr_ModifyUsr1 (void)
|
||||||
Gbl.Action.Act = ActUpdTch;
|
Gbl.Action.Act = ActUpdTch;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Tab_SetCurrentTab ();
|
Tab_SetCurrentTab ();
|
||||||
|
@ -4186,7 +4186,7 @@ static void Enr_AskIfRemoveUsrFromCrs (struct UsrData *UsrDat)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
NextAction = ActUnk;
|
NextAction = ActUnk;
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Frm_BeginForm (NextAction);
|
Frm_BeginForm (NextAction);
|
||||||
|
|
|
@ -824,7 +824,7 @@ void Exa_GetListExams (struct Exa_Exams *Exams,Exa_Order_t SelectedOrder)
|
||||||
Lay_NotEnoughMemoryExit ();
|
Lay_NotEnoughMemoryExit ();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1289,7 +1289,7 @@ static void ExaPrn_GetCorrectIntAnswerFromDB (struct Tst_Question *Question)
|
||||||
/***** Get correct answer *****/
|
/***** Get correct answer *****/
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
if (sscanf (row[0],"%ld",&Question->Answer.Integer) != 1)
|
if (sscanf (row[0],"%ld",&Question->Answer.Integer) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong integer answer.");
|
Lay_WrongAnswerExit ();
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
@ -1312,7 +1312,7 @@ static void ExaPrn_GetCorrectFltAnswerFromDB (struct Tst_Question *Question)
|
||||||
|
|
||||||
/***** Check if number of rows is correct *****/
|
/***** Check if number of rows is correct *****/
|
||||||
if (Question->Answer.NumOptions != 2)
|
if (Question->Answer.NumOptions != 2)
|
||||||
Lay_ShowErrorAndExit ("Wrong float range.");
|
Lay_WrongAnswerExit ();
|
||||||
|
|
||||||
/***** Get float range *****/
|
/***** Get float range *****/
|
||||||
for (NumOpt = 0;
|
for (NumOpt = 0;
|
||||||
|
|
|
@ -950,8 +950,8 @@ static void ExaRes_ShowResults (struct Exa_Exams *Exams,
|
||||||
NumResult++)
|
NumResult++)
|
||||||
{
|
{
|
||||||
/* Get print code (row[0]) */
|
/* Get print code (row[0]) */
|
||||||
if ((Print.PrnCod = DB_GetNextCode (mysql_res)) < 0)
|
if ((Print.PrnCod = DB_GetNextCode (mysql_res)) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of exam print.");
|
Lay_WrongExamExit ();
|
||||||
|
|
||||||
/* Get print data */
|
/* Get print data */
|
||||||
ExaPrn_GetDataOfPrintByPrnCod (&Print);
|
ExaPrn_GetDataOfPrintByPrnCod (&Print);
|
||||||
|
|
|
@ -175,7 +175,7 @@ void ExaSes_ListSessions (struct Exa_Exams *Exams,
|
||||||
Lay_NotEnoughMemoryExit ();
|
Lay_NotEnoughMemoryExit ();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -737,7 +737,7 @@ static void ExaSes_ListOneOrMoreSessionsResult (struct Exa_Exams *Exams,
|
||||||
ExaSes_ListOneOrMoreSessionsResultTch (Exams,Session);
|
ExaSes_ListOneOrMoreSessionsResultTch (Exams,Session);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1866,7 +1866,7 @@ void ExaSet_MoveUpSet (void)
|
||||||
/* Indexes of sets to be exchanged */
|
/* Indexes of sets to be exchanged */
|
||||||
SetIndTop = ExaSet_GetPrevSetIndexInExam (Exam.ExaCod,SetIndBottom);
|
SetIndTop = ExaSet_GetPrevSetIndexInExam (Exam.ExaCod,SetIndBottom);
|
||||||
if (!SetIndTop)
|
if (!SetIndTop)
|
||||||
Lay_ShowErrorAndExit ("Wrong index of set.");
|
Lay_ShowErrorAndExit ("Wrong set index.");
|
||||||
|
|
||||||
/* Exchange sets */
|
/* Exchange sets */
|
||||||
ExaSet_ExchangeSets (Exam.ExaCod,SetIndTop,SetIndBottom);
|
ExaSet_ExchangeSets (Exam.ExaCod,SetIndTop,SetIndBottom);
|
||||||
|
@ -1917,7 +1917,7 @@ void ExaSet_MoveDownSet (void)
|
||||||
/* Indexes of sets to be exchanged */
|
/* Indexes of sets to be exchanged */
|
||||||
SetIndBottom = ExaSet_GetNextSetIndexInExam (Exam.ExaCod,SetIndTop);
|
SetIndBottom = ExaSet_GetNextSetIndexInExam (Exam.ExaCod,SetIndTop);
|
||||||
if (!SetIndBottom)
|
if (!SetIndBottom)
|
||||||
Lay_ShowErrorAndExit ("Wrong index of set.");
|
Lay_ShowErrorAndExit ("Wrong set index.");
|
||||||
|
|
||||||
/* Exchange sets */
|
/* Exchange sets */
|
||||||
ExaSet_ExchangeSets (Exam.ExaCod,SetIndTop,SetIndBottom);
|
ExaSet_ExchangeSets (Exam.ExaCod,SetIndTop,SetIndBottom);
|
||||||
|
|
|
@ -1800,7 +1800,7 @@ static void Fig_GetSizeOfFileZoneFromDB (Hie_Lvl_Level_t Scope,
|
||||||
(unsigned) FileBrowser);
|
(unsigned) FileBrowser);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Lay_ShowErrorAndExit ("Wrong file browser.");
|
Lay_WrongFileBrowserExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1978,7 +1978,7 @@ static void Fig_GetSizeOfFileZoneFromDB (Hie_Lvl_Level_t Scope,
|
||||||
(unsigned) FileBrowser);
|
(unsigned) FileBrowser);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Lay_ShowErrorAndExit ("Wrong file browser.");
|
Lay_WrongFileBrowserExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2144,7 +2144,7 @@ static void Fig_GetSizeOfFileZoneFromDB (Hie_Lvl_Level_t Scope,
|
||||||
(unsigned) FileBrowser);
|
(unsigned) FileBrowser);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Lay_ShowErrorAndExit ("Wrong file browser.");
|
Lay_WrongFileBrowserExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2298,7 +2298,7 @@ static void Fig_GetSizeOfFileZoneFromDB (Hie_Lvl_Level_t Scope,
|
||||||
(unsigned) FileBrowser);
|
(unsigned) FileBrowser);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Lay_ShowErrorAndExit ("Wrong file browser.");
|
Lay_WrongFileBrowserExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2440,7 +2440,7 @@ static void Fig_GetSizeOfFileZoneFromDB (Hie_Lvl_Level_t Scope,
|
||||||
(unsigned) FileBrowser);
|
(unsigned) FileBrowser);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Lay_ShowErrorAndExit ("Wrong file browser.");
|
Lay_WrongFileBrowserExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2570,7 +2570,7 @@ static void Fig_GetSizeOfFileZoneFromDB (Hie_Lvl_Level_t Scope,
|
||||||
(unsigned) FileBrowser);
|
(unsigned) FileBrowser);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Lay_ShowErrorAndExit ("Wrong file browser.");
|
Lay_WrongFileBrowserExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1977,7 +1977,7 @@ void Brw_GetParAndInitFileBrowser (void)
|
||||||
Brw_ADMI_MRK_CRS;
|
Brw_ADMI_MRK_CRS;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3403,7 +3403,7 @@ static void Brw_ShowDataOwnerAsgWrk (struct UsrData *UsrDat)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
NextAction = ActUnk;
|
NextAction = ActUnk;
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Frm_BeginForm (NextAction);
|
Frm_BeginForm (NextAction);
|
||||||
|
@ -4035,7 +4035,7 @@ static void Brw_WriteSubtitleOfFileBrowser (void)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Subtitle[0] = '\0';
|
Subtitle[0] = '\0';
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -7160,7 +7160,7 @@ static bool Brw_GetMyClipboard (void)
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
|
||||||
if (NumRows > 1)
|
if (NumRows > 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting source of copy.");
|
Lay_WrongCopySrcExit ();
|
||||||
|
|
||||||
return (bool) (NumRows == 1);
|
return (bool) (NumRows == 1);
|
||||||
}
|
}
|
||||||
|
@ -7953,7 +7953,7 @@ static void Brw_PasteClipboard (void)
|
||||||
(unsigned) Hie.Ins.InsCod,
|
(unsigned) Hie.Ins.InsCod,
|
||||||
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("The copy source does not exist.");
|
Lay_WrongCopySrcExit ();
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_DOC_CTR:
|
case Brw_ADMI_DOC_CTR:
|
||||||
case Brw_ADMI_SHR_CTR:
|
case Brw_ADMI_SHR_CTR:
|
||||||
|
@ -7965,7 +7965,7 @@ static void Brw_PasteClipboard (void)
|
||||||
(unsigned) Hie.Ctr.CtrCod,
|
(unsigned) Hie.Ctr.CtrCod,
|
||||||
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("The copy source does not exist.");
|
Lay_WrongCopySrcExit ();
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_DOC_DEG:
|
case Brw_ADMI_DOC_DEG:
|
||||||
case Brw_ADMI_SHR_DEG:
|
case Brw_ADMI_SHR_DEG:
|
||||||
|
@ -7977,7 +7977,7 @@ static void Brw_PasteClipboard (void)
|
||||||
(unsigned) Hie.Deg.DegCod,
|
(unsigned) Hie.Deg.DegCod,
|
||||||
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("The copy source does not exist.");
|
Lay_WrongCopySrcExit ();
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_DOC_CRS:
|
case Brw_ADMI_DOC_CRS:
|
||||||
case Brw_ADMI_TCH_CRS:
|
case Brw_ADMI_TCH_CRS:
|
||||||
|
@ -7989,7 +7989,7 @@ static void Brw_PasteClipboard (void)
|
||||||
Cfg_PATH_CRS_PRIVATE,Hie.Crs.CrsCod,
|
Cfg_PATH_CRS_PRIVATE,Hie.Crs.CrsCod,
|
||||||
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("The copy source does not exist.");
|
Lay_WrongCopySrcExit ();
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_DOC_GRP:
|
case Brw_ADMI_DOC_GRP:
|
||||||
case Brw_ADMI_TCH_GRP:
|
case Brw_ADMI_TCH_GRP:
|
||||||
|
@ -8004,7 +8004,7 @@ static void Brw_PasteClipboard (void)
|
||||||
GrpDat.GrpCod,
|
GrpDat.GrpCod,
|
||||||
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("The copy source does not exist.");
|
Lay_WrongCopySrcExit ();
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_ASG_CRS:
|
case Brw_ADMI_ASG_CRS:
|
||||||
case Brw_ADMI_WRK_CRS:
|
case Brw_ADMI_WRK_CRS:
|
||||||
|
@ -8026,7 +8026,7 @@ static void Brw_PasteClipboard (void)
|
||||||
Usr_UsrDataDestructor (&UsrDat);
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("The copy source does not exist.");
|
Lay_WrongCopySrcExit ();
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_ASG_USR:
|
case Brw_ADMI_ASG_USR:
|
||||||
case Brw_ADMI_WRK_USR:
|
case Brw_ADMI_WRK_USR:
|
||||||
|
@ -8038,7 +8038,7 @@ static void Brw_PasteClipboard (void)
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("The copy source does not exist.");
|
Lay_WrongCopySrcExit ();
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_DOC_PRJ:
|
case Brw_ADMI_DOC_PRJ:
|
||||||
case Brw_ADMI_ASS_PRJ:
|
case Brw_ADMI_ASS_PRJ:
|
||||||
|
@ -8051,7 +8051,7 @@ static void Brw_PasteClipboard (void)
|
||||||
PrjCod,
|
PrjCod,
|
||||||
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("The copy source does not exist.");
|
Lay_WrongCopySrcExit ();
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_BRF_USR:
|
case Brw_ADMI_BRF_USR:
|
||||||
snprintf (PathOrg,sizeof (PathOrg),"%s/%s",
|
snprintf (PathOrg,sizeof (PathOrg),"%s/%s",
|
||||||
|
@ -8059,7 +8059,7 @@ static void Brw_PasteClipboard (void)
|
||||||
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
Gbl.FileBrowser.Clipboard.FilFolLnk.Full);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Lay_ShowErrorAndExit ("Wrong file browser.");
|
Lay_WrongFileBrowserExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10749,7 +10749,7 @@ void Brw_GetAndUpdateFileViews (struct FileMetadata *FileMetadata)
|
||||||
else
|
else
|
||||||
FileMetadata->NumMyViews = FileMetadata->NumPublicViews;
|
FileMetadata->NumMyViews = FileMetadata->NumPublicViews;
|
||||||
|
|
||||||
/***** Update number of my views (if I am not logged, UsrCod == -1L) *****/
|
/***** Update number of my views *****/
|
||||||
Brw_UpdateFileViews (FileMetadata->NumMyViews,FileMetadata->FilCod);
|
Brw_UpdateFileViews (FileMetadata->NumMyViews,FileMetadata->FilCod);
|
||||||
|
|
||||||
/***** Increment number of file views in my user's figures *****/
|
/***** Increment number of file views in my user's figures *****/
|
||||||
|
|
|
@ -48,7 +48,9 @@ const char *Ext_FileExtensionsAllowed[] =
|
||||||
"bz2" ,
|
"bz2" ,
|
||||||
"c" ,
|
"c" ,
|
||||||
"cc" ,
|
"cc" ,
|
||||||
|
"cct" , // LogicWorks
|
||||||
"cdr" ,
|
"cdr" ,
|
||||||
|
"clf" , // LogicWorks
|
||||||
"cpp" ,
|
"cpp" ,
|
||||||
"css" ,
|
"css" ,
|
||||||
"csv" ,
|
"csv" ,
|
||||||
|
@ -135,6 +137,7 @@ const char *Ext_FileExtensionsAllowed[] =
|
||||||
"tex" ,
|
"tex" ,
|
||||||
"tgz" ,
|
"tgz" ,
|
||||||
"tif" ,
|
"tif" ,
|
||||||
|
"tim" , // LogicWorks
|
||||||
"txt" ,
|
"txt" ,
|
||||||
"voc" ,
|
"voc" ,
|
||||||
"vp" , // Justinmind, http://www.justinmind.com/
|
"vp" , // Justinmind, http://www.justinmind.com/
|
||||||
|
|
19
swad_forum.c
19
swad_forum.c
|
@ -490,7 +490,7 @@ void For_DisablePost (void)
|
||||||
For_ShowPostsOfAThread (&Forums,Ale_SUCCESS,Txt_FORUM_Post_banned);
|
For_ShowPostsOfAThread (&Forums,Ale_SUCCESS,Txt_FORUM_Post_banned);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("The post to be banned no longer exists.");
|
Lay_WrongPostExit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1123,7 +1123,7 @@ static void For_ShowPostsOfAThread (struct For_Forums *Forums,
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
if (sscanf (row[0],"%ld",&Forums->PstCod) != 1)
|
if (sscanf (row[0],"%ld",&Forums->PstCod) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of post.");
|
Lay_WrongPostExit ();
|
||||||
|
|
||||||
CreatTimeUTC = Dat_GetUNIXTimeFromStr (row[1]);
|
CreatTimeUTC = Dat_GetUNIXTimeFromStr (row[1]);
|
||||||
|
|
||||||
|
@ -1385,7 +1385,7 @@ static void For_GetPstData (long PstCod,long *UsrCod,time_t *CreatTimeUTC,
|
||||||
" FROM for_posts"
|
" FROM for_posts"
|
||||||
" WHERE PstCod=%ld",
|
" WHERE PstCod=%ld",
|
||||||
PstCod) != 1)
|
PstCod) != 1)
|
||||||
Lay_ShowErrorAndExit ("Internal error in database when getting data of a post.");
|
Lay_WrongPostExit ();
|
||||||
|
|
||||||
/***** Get number of rows *****/
|
/***** Get number of rows *****/
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
@ -3686,13 +3686,12 @@ static void For_GetThreadData (struct For_Thread *Thr)
|
||||||
/***** Get the code of the last post in this thread (row[1]) *****/
|
/***** Get the code of the last post in this thread (row[1]) *****/
|
||||||
Thr->PstCod[Dat_END_TIME ] = Str_ConvertStrCodToLongCod (row[1]);
|
Thr->PstCod[Dat_END_TIME ] = Str_ConvertStrCodToLongCod (row[1]);
|
||||||
|
|
||||||
/***** Get the code of the first message in this thread (row[0]) *****/
|
/***** Get the code of the first message (row[0])
|
||||||
|
and the last message (row[1]) in this thread *****/
|
||||||
if (sscanf (row[0],"%ld",&(Thr->PstCod[Dat_START_TIME])) != 1)
|
if (sscanf (row[0],"%ld",&(Thr->PstCod[Dat_START_TIME])) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of post.");
|
Lay_WrongPostExit ();
|
||||||
|
|
||||||
/***** Get the code of the last message in this thread (row[1]) *****/
|
|
||||||
if (sscanf (row[1],"%ld",&(Thr->PstCod[Dat_END_TIME])) != 1)
|
if (sscanf (row[1],"%ld",&(Thr->PstCod[Dat_END_TIME])) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of post.");
|
Lay_WrongPostExit ();
|
||||||
|
|
||||||
/***** Get the author of the first post in this thread (row[2]) *****/
|
/***** Get the author of the first post in this thread (row[2]) *****/
|
||||||
Thr->UsrCod[Dat_START_TIME] = Str_ConvertStrCodToLongCod (row[2]);
|
Thr->UsrCod[Dat_START_TIME] = Str_ConvertStrCodToLongCod (row[2]);
|
||||||
|
@ -4267,7 +4266,7 @@ void For_RemovePost (void)
|
||||||
/***** Check if I can remove the post *****/
|
/***** Check if I can remove the post *****/
|
||||||
/* Check if the message really exists, if it has not been removed */
|
/* Check if the message really exists, if it has not been removed */
|
||||||
if (!For_GetIfForumPstExists (Forums.PstCod))
|
if (!For_GetIfForumPstExists (Forums.PstCod))
|
||||||
Lay_ShowErrorAndExit ("The post to remove no longer exists.");
|
Lay_WrongPostExit ();
|
||||||
|
|
||||||
/* Check if I am the author of the message */
|
/* Check if I am the author of the message */
|
||||||
ItsMe = Usr_ItsMe (UsrDat.UsrCod);
|
ItsMe = Usr_ItsMe (UsrDat.UsrCod);
|
||||||
|
@ -4627,7 +4626,7 @@ static void For_MoveThrToCurrentForum (const struct For_Forums *Forums)
|
||||||
Forums->Thread.Current);
|
Forums->Thread.Current);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Lay_ShowErrorAndExit ("Wrong forum.");
|
Lay_WrongForumExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -890,7 +890,7 @@ void Gam_GetListGames (struct Gam_Games *Games,Gam_Order_t SelectedOrder)
|
||||||
Lay_NotEnoughMemoryExit ();
|
Lay_NotEnoughMemoryExit ();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2885,7 +2885,7 @@ void Gam_GetScoreRange (long GamCod,double *MinScore,double *MaxScore)
|
||||||
{
|
{
|
||||||
unsigned NumAnswers;
|
unsigned NumAnswers;
|
||||||
|
|
||||||
/***** Get maximum score of a game from database *****/
|
/***** Get number of answers of a game from database *****/
|
||||||
NumAnswers = (unsigned)
|
NumAnswers = (unsigned)
|
||||||
DB_QueryCOUNT ("can not number of answers of a question",
|
DB_QueryCOUNT ("can not number of answers of a question",
|
||||||
"SELECT COUNT(tst_answers.AnsInd)"
|
"SELECT COUNT(tst_answers.AnsInd)"
|
||||||
|
@ -2896,7 +2896,7 @@ void Gam_GetScoreRange (long GamCod,double *MinScore,double *MaxScore)
|
||||||
" GROUP BY tst_answers.QstCod",
|
" GROUP BY tst_answers.QstCod",
|
||||||
GamCod);
|
GamCod);
|
||||||
if (NumAnswers < 2)
|
if (NumAnswers < 2)
|
||||||
Lay_ShowErrorAndExit ("Wrong number of answers.");
|
Lay_WrongAnswerExit ();
|
||||||
|
|
||||||
/***** Set minimum and maximum scores *****/
|
/***** Set minimum and maximum scores *****/
|
||||||
*MinScore = *MaxScore = 0.0;
|
*MinScore = *MaxScore = 0.0;
|
||||||
|
|
|
@ -383,8 +383,8 @@ void Hld_GetListHolidays (struct Hld_Holidays *Holidays)
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get holiday code (row[0]) */
|
/* Get holiday code (row[0]) */
|
||||||
if ((Hld->HldCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((Hld->HldCod = Str_ConvertStrCodToLongCod (row[0])) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong holiday code.");
|
Lay_WrongHolidayExit ();
|
||||||
|
|
||||||
/* Get place code (row[1]) */
|
/* Get place code (row[1]) */
|
||||||
Hld->PlcCod = Str_ConvertStrCodToLongCod (row[1]);
|
Hld->PlcCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||||
|
@ -398,7 +398,7 @@ void Hld_GetListHolidays (struct Hld_Holidays *Holidays)
|
||||||
|
|
||||||
/* Get start date (row[4] holds the start date in YYYYMMDD format) */
|
/* Get start date (row[4] holds the start date in YYYYMMDD format) */
|
||||||
if (!(Dat_GetDateFromYYYYMMDD (&(Hld->StartDate),row[4])))
|
if (!(Dat_GetDateFromYYYYMMDD (&(Hld->StartDate),row[4])))
|
||||||
Lay_ShowErrorAndExit ("Wrong start date.");
|
Lay_WrongDateExit ();
|
||||||
|
|
||||||
/* Set / get end date */
|
/* Set / get end date */
|
||||||
switch (Hld->HldTyp)
|
switch (Hld->HldTyp)
|
||||||
|
@ -410,7 +410,7 @@ void Hld_GetListHolidays (struct Hld_Holidays *Holidays)
|
||||||
case Hld_NON_SCHOOL_PERIOD: // One or more days
|
case Hld_NON_SCHOOL_PERIOD: // One or more days
|
||||||
/* Get end date (row[5] holds the end date in YYYYMMDD format) */
|
/* Get end date (row[5] holds the end date in YYYYMMDD format) */
|
||||||
if (!(Dat_GetDateFromYYYYMMDD (&(Hld->EndDate),row[5])))
|
if (!(Dat_GetDateFromYYYYMMDD (&(Hld->EndDate),row[5])))
|
||||||
Lay_ShowErrorAndExit ("Wrong end date.");
|
Lay_WrongDateExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -445,7 +445,7 @@ static void Hld_GetDataOfHolidayByCod (struct Hld_Holiday *Hld)
|
||||||
|
|
||||||
/***** Check if holiday code is correct *****/
|
/***** Check if holiday code is correct *****/
|
||||||
if (Hld->HldCod <= 0)
|
if (Hld->HldCod <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of holiday.");
|
Lay_WrongHolidayExit ();
|
||||||
|
|
||||||
/***** Get data of holiday from database *****/
|
/***** Get data of holiday from database *****/
|
||||||
if (DB_QuerySELECT (&mysql_res,"can not get data of a holiday",
|
if (DB_QuerySELECT (&mysql_res,"can not get data of a holiday",
|
||||||
|
@ -496,7 +496,7 @@ static void Hld_GetDataOfHolidayByCod (struct Hld_Holiday *Hld)
|
||||||
|
|
||||||
/* Get start date (row[3] holds the start date in YYYYMMDD format) */
|
/* Get start date (row[3] holds the start date in YYYYMMDD format) */
|
||||||
if (!(Dat_GetDateFromYYYYMMDD (&(Hld->StartDate),row[3])))
|
if (!(Dat_GetDateFromYYYYMMDD (&(Hld->StartDate),row[3])))
|
||||||
Lay_ShowErrorAndExit ("Wrong start date.");
|
Lay_WrongDateExit ();
|
||||||
|
|
||||||
/* Set / get end date */
|
/* Set / get end date */
|
||||||
switch (Hld->HldTyp)
|
switch (Hld->HldTyp)
|
||||||
|
@ -508,7 +508,7 @@ static void Hld_GetDataOfHolidayByCod (struct Hld_Holiday *Hld)
|
||||||
case Hld_NON_SCHOOL_PERIOD: // One or more days
|
case Hld_NON_SCHOOL_PERIOD: // One or more days
|
||||||
/* Get end date (row[4] holds the end date in YYYYMMDD format) */
|
/* Get end date (row[4] holds the end date in YYYYMMDD format) */
|
||||||
if (!(Dat_GetDateFromYYYYMMDD (&(Hld->EndDate),row[4])))
|
if (!(Dat_GetDateFromYYYYMMDD (&(Hld->EndDate),row[4])))
|
||||||
Lay_ShowErrorAndExit ("Wrong end date.");
|
Lay_WrongDateExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -542,10 +542,10 @@ static Hld_HolidayType_t Hld_GetTypeOfHoliday (const char *UnsignedStr)
|
||||||
unsigned UnsignedNum;
|
unsigned UnsignedNum;
|
||||||
|
|
||||||
if (sscanf (UnsignedStr,"%u",&UnsignedNum) != 1)
|
if (sscanf (UnsignedStr,"%u",&UnsignedNum) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong type of holiday.");
|
Lay_WrongHolidayExit ();
|
||||||
|
|
||||||
if (UnsignedNum >= Hld_NUM_TYPES_HOLIDAY)
|
if (UnsignedNum >= Hld_NUM_TYPES_HOLIDAY)
|
||||||
Lay_ShowErrorAndExit ("Wrong type of holiday.");
|
Lay_WrongHolidayExit ();
|
||||||
|
|
||||||
return (Hld_HolidayType_t) UnsignedNum;
|
return (Hld_HolidayType_t) UnsignedNum;
|
||||||
}
|
}
|
||||||
|
@ -720,8 +720,8 @@ void Hld_RemoveHoliday (void)
|
||||||
Hld_EditingHolidayConstructor ();
|
Hld_EditingHolidayConstructor ();
|
||||||
|
|
||||||
/***** Get holiday code *****/
|
/***** Get holiday code *****/
|
||||||
if ((Hld_EditingHld->HldCod = Hld_GetParamHldCod ()) == -1L)
|
if ((Hld_EditingHld->HldCod = Hld_GetParamHldCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of holiday is missing.");
|
Lay_WrongHolidayExit ();
|
||||||
|
|
||||||
/***** Get data of the holiday from database *****/
|
/***** Get data of the holiday from database *****/
|
||||||
Hld_GetDataOfHolidayByCod (Hld_EditingHld);
|
Hld_GetDataOfHolidayByCod (Hld_EditingHld);
|
||||||
|
@ -752,8 +752,8 @@ void Hld_ChangeHolidayPlace (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the holiday */
|
/* Get the code of the holiday */
|
||||||
if ((Hld_EditingHld->HldCod = Hld_GetParamHldCod ()) == -1L)
|
if ((Hld_EditingHld->HldCod = Hld_GetParamHldCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of holiday is missing.");
|
Lay_WrongHolidayExit ();
|
||||||
|
|
||||||
/* Get the new place for the holiday */
|
/* Get the new place for the holiday */
|
||||||
NewPlace.PlcCod = Plc_GetParamPlcCod ();
|
NewPlace.PlcCod = Plc_GetParamPlcCod ();
|
||||||
|
@ -793,8 +793,8 @@ void Hld_ChangeHolidayType (void)
|
||||||
Hld_EditingHolidayConstructor ();
|
Hld_EditingHolidayConstructor ();
|
||||||
|
|
||||||
/***** Get the code of the holiday *****/
|
/***** Get the code of the holiday *****/
|
||||||
if ((Hld_EditingHld->HldCod = Hld_GetParamHldCod ()) == -1L)
|
if ((Hld_EditingHld->HldCod = Hld_GetParamHldCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of holiday is missing.");
|
Lay_WrongHolidayExit ();
|
||||||
|
|
||||||
/***** Get from the database the data of the holiday *****/
|
/***** Get from the database the data of the holiday *****/
|
||||||
Hld_GetDataOfHolidayByCod (Hld_EditingHld);
|
Hld_GetDataOfHolidayByCod (Hld_EditingHld);
|
||||||
|
@ -852,8 +852,8 @@ static void Hld_ChangeDate (Hld_StartOrEndDate_t StartOrEndDate)
|
||||||
Hld_EditingHolidayConstructor ();
|
Hld_EditingHolidayConstructor ();
|
||||||
|
|
||||||
/***** Get the code of the holiday *****/
|
/***** Get the code of the holiday *****/
|
||||||
if ((Hld_EditingHld->HldCod = Hld_GetParamHldCod ()) == -1L)
|
if ((Hld_EditingHld->HldCod = Hld_GetParamHldCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of holiday is missing.");
|
Lay_WrongHolidayExit ();
|
||||||
|
|
||||||
/***** Get from the database the data of the holiday *****/
|
/***** Get from the database the data of the holiday *****/
|
||||||
Hld_GetDataOfHolidayByCod (Hld_EditingHld);
|
Hld_GetDataOfHolidayByCod (Hld_EditingHld);
|
||||||
|
@ -925,8 +925,8 @@ void Hld_RenameHoliday (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the holiday */
|
/* Get the code of the holiday */
|
||||||
if ((Hld_EditingHld->HldCod = Hld_GetParamHldCod ()) == -1L)
|
if ((Hld_EditingHld->HldCod = Hld_GetParamHldCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of holiday is missing.");
|
Lay_WrongHolidayExit ();
|
||||||
|
|
||||||
/* Get the new name for the holiday */
|
/* Get the new name for the holiday */
|
||||||
Par_GetParToText ("Name",NewHldName,Hld_MAX_BYTES_HOLIDAY_NAME);
|
Par_GetParToText ("Name",NewHldName,Hld_MAX_BYTES_HOLIDAY_NAME);
|
||||||
|
@ -1214,7 +1214,7 @@ static void Hld_EditingHolidayConstructor (void)
|
||||||
{
|
{
|
||||||
/***** Pointer must be NULL *****/
|
/***** Pointer must be NULL *****/
|
||||||
if (Hld_EditingHld != NULL)
|
if (Hld_EditingHld != NULL)
|
||||||
Lay_ShowErrorAndExit ("Error initializing holiday.");
|
Lay_WrongHolidayExit ();
|
||||||
|
|
||||||
/***** Allocate memory for holiday *****/
|
/***** Allocate memory for holiday *****/
|
||||||
if ((Hld_EditingHld = malloc (sizeof (*Hld_EditingHld))) == NULL)
|
if ((Hld_EditingHld = malloc (sizeof (*Hld_EditingHld))) == NULL)
|
||||||
|
|
|
@ -842,7 +842,7 @@ static void Ins_GetDataOfInstitFromRow (struct Ins_Instit *Ins,MYSQL_ROW row)
|
||||||
|
|
||||||
/***** Get institution status (row[2]) *****/
|
/***** Get institution status (row[2]) *****/
|
||||||
if (sscanf (row[2],"%u",&(Ins->Status)) != 1)
|
if (sscanf (row[2],"%u",&(Ins->Status)) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong institution status.");
|
Lay_WrongStatusExit ();
|
||||||
|
|
||||||
/***** Get requester user's code (row[3]) *****/
|
/***** Get requester user's code (row[3]) *****/
|
||||||
Ins->RequesterUsrCod = Str_ConvertStrCodToLongCod (row[3]);
|
Ins->RequesterUsrCod = Str_ConvertStrCodToLongCod (row[3]);
|
||||||
|
@ -1618,7 +1618,7 @@ void Ins_ChangeInsStatus (void)
|
||||||
(unsigned long) Ins_MAX_STATUS,
|
(unsigned long) Ins_MAX_STATUS,
|
||||||
(unsigned long) Ins_WRONG_STATUS);
|
(unsigned long) Ins_WRONG_STATUS);
|
||||||
if (Status == Ins_WRONG_STATUS)
|
if (Status == Ins_WRONG_STATUS)
|
||||||
Lay_ShowErrorAndExit ("Wrong status.");
|
Lay_WrongStatusExit ();
|
||||||
StatusTxt = Ins_GetStatusTxtFromStatusBits (Status);
|
StatusTxt = Ins_GetStatusTxtFromStatusBits (Status);
|
||||||
Status = Ins_GetStatusBitsFromStatusTxt (StatusTxt); // New status
|
Status = Ins_GetStatusBitsFromStatusTxt (StatusTxt); // New status
|
||||||
|
|
||||||
|
|
213
swad_layout.c
213
swad_layout.c
|
@ -1378,6 +1378,15 @@ void Lay_NotEnoughMemoryExit (void)
|
||||||
Lay_ShowErrorAndExit ("Not enough memory.");
|
Lay_ShowErrorAndExit ("Not enough memory.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************* Write error message and exit when wrong action ****************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongActionExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong action.");
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************* Write error message and exit when wrong scope *****************/
|
/************* Write error message and exit when wrong scope *****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1422,6 +1431,24 @@ void Lay_WrongCourseExit (void)
|
||||||
Lay_ShowErrorAndExit ("Wrong course.");
|
Lay_ShowErrorAndExit ("Wrong course.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*********** Write error message and exit when wrong department **************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongDepartmentExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong department.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************** Write error message and exit when wrong place ****************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongPlaceExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong department.");
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************* Write error message and exit when wrong order *****************/
|
/************* Write error message and exit when wrong order *****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1431,6 +1458,83 @@ void Lay_WrongOrderExit (void)
|
||||||
Lay_ShowErrorAndExit ("Wrong order.");
|
Lay_ShowErrorAndExit ("Wrong order.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************* Write error message and exit when wrong status ****************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongStatusExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong status.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************* Write error message and exit when wrong date ****************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongDateExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong date.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************** Write error message and exit when wrong plugin ***************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongPluginExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong plugin.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/********** Write error message and exit when wrong items list/item **********/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongItemsListExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong items list.");
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lay_WrongItemExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong item.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/********** Write error message and exit when wrong syllabus format **********/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongSyllabusFormatExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong syllabus format.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*********** Write error message and exit when wrong file browser ************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongFileBrowserExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong file browser.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*********** Write error message and exit when wrong copy source *************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongCopySrcExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("The copy source does not exist.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/********** Write error message and exit when wrong number of rows ***********/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongNumberOfRowsExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong number of rows.");
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********* Write error message and exit when wrong group type/group **********/
|
/********* Write error message and exit when wrong group type/group **********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1455,7 +1559,7 @@ void Lay_WrongTypeOfViewExit (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************* Write error message and exit when wrong banner ****************/
|
/*********** Write error message and exit when wrong banner/link *************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Lay_WrongBannerExit (void)
|
void Lay_WrongBannerExit (void)
|
||||||
|
@ -1463,8 +1567,22 @@ void Lay_WrongBannerExit (void)
|
||||||
Lay_ShowErrorAndExit ("Wrong banner.");
|
Lay_ShowErrorAndExit ("Wrong banner.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Lay_WrongLinkExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong link.");
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************ Write error message and exit when wrong building ***************/
|
/************* Write error message and exit when wrong holiday ***************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongHolidayExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong holiday.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/********** Write error message and exit when wrong building/room ************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Lay_WrongBuildingExit (void)
|
void Lay_WrongBuildingExit (void)
|
||||||
|
@ -1472,6 +1590,20 @@ void Lay_WrongBuildingExit (void)
|
||||||
Lay_ShowErrorAndExit ("Wrong building.");
|
Lay_ShowErrorAndExit ("Wrong building.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Lay_WrongRoomExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong room.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*********** Write error message and exit when wrong record field ************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongRecordFieldExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong record field.");
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********** Write error message and exit when wrong assignment **************/
|
/*********** Write error message and exit when wrong assignment **************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1499,6 +1631,24 @@ void Lay_WrongCallForExamExit (void)
|
||||||
Lay_ShowErrorAndExit ("Wrong call for exam.");
|
Lay_ShowErrorAndExit ("Wrong call for exam.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************** Write error message and exit when wrong tag *****************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongTagExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong tag.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************** Write error message and exit when wrong test *****************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongTestExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong test.");
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************** Write error message and exit when wrong exam *****************/
|
/************** Write error message and exit when wrong exam *****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1595,6 +1745,65 @@ void Lay_WrongEventExit (void)
|
||||||
Lay_ShowErrorAndExit ("Wrong event.");
|
Lay_ShowErrorAndExit ("Wrong event.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*********** Write error message and exit when wrong announcement ************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongAnnouncementExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong announcement.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************** Write error message and exit when wrong notice ***************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongNoticeExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong notice.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************ Write error message and exit when wrong forum/post *************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongForumExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong forum.");
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lay_WrongPostExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong post.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************** Write error message and exit when wrong message **************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongMessageExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong message.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************ Write error message and exit when wrong mail domain ************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongMailDomainExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong mail domain.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************* Show error message about wrong role and exit ******************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Lay_WrongRoleExit (void)
|
||||||
|
{
|
||||||
|
Lay_ShowErrorAndExit ("Wrong role.");
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************ Write error message and exit when user does not exists *********/
|
/************ Write error message and exit when user does not exists *********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -70,6 +70,7 @@ void Lay_PutContextualCheckbox (Act_Action_t NextAction,
|
||||||
const char *Title,const char *Text);
|
const char *Title,const char *Text);
|
||||||
|
|
||||||
void Lay_NotEnoughMemoryExit (void);
|
void Lay_NotEnoughMemoryExit (void);
|
||||||
|
void Lay_WrongActionExit (void);
|
||||||
void Lay_WrongScopeExit (void);
|
void Lay_WrongScopeExit (void);
|
||||||
void Lay_WrongCountrExit (void);
|
void Lay_WrongCountrExit (void);
|
||||||
void Lay_WrongInstitExit (void);
|
void Lay_WrongInstitExit (void);
|
||||||
|
@ -77,15 +78,32 @@ void Lay_WrongCenterExit (void);
|
||||||
void Lay_WrongDegTypExit (void);
|
void Lay_WrongDegTypExit (void);
|
||||||
void Lay_WrongDegreeExit (void);
|
void Lay_WrongDegreeExit (void);
|
||||||
void Lay_WrongCourseExit (void);
|
void Lay_WrongCourseExit (void);
|
||||||
|
void Lay_WrongDepartmentExit (void);
|
||||||
|
void Lay_WrongPlaceExit (void);
|
||||||
void Lay_WrongOrderExit (void);
|
void Lay_WrongOrderExit (void);
|
||||||
|
void Lay_WrongStatusExit (void);
|
||||||
|
void Lay_WrongDateExit (void);
|
||||||
|
void Lay_WrongPluginExit (void);
|
||||||
|
void Lay_WrongItemsListExit (void);
|
||||||
|
void Lay_WrongItemExit (void);
|
||||||
|
void Lay_WrongSyllabusFormatExit (void);
|
||||||
|
void Lay_WrongFileBrowserExit (void);
|
||||||
|
void Lay_WrongCopySrcExit (void);
|
||||||
|
void Lay_WrongNumberOfRowsExit (void);
|
||||||
void Lay_WrongGrpTypExit (void);
|
void Lay_WrongGrpTypExit (void);
|
||||||
void Lay_WrongGroupExit (void);
|
void Lay_WrongGroupExit (void);
|
||||||
void Lay_WrongTypeOfViewExit (void);
|
void Lay_WrongTypeOfViewExit (void);
|
||||||
void Lay_WrongBannerExit (void);
|
void Lay_WrongBannerExit (void);
|
||||||
|
void Lay_WrongLinkExit (void);
|
||||||
|
void Lay_WrongHolidayExit (void);
|
||||||
void Lay_WrongBuildingExit (void);
|
void Lay_WrongBuildingExit (void);
|
||||||
|
void Lay_WrongRoomExit (void);
|
||||||
|
void Lay_WrongRecordFieldExit (void);
|
||||||
void Lay_WrongAssignmentExit (void);
|
void Lay_WrongAssignmentExit (void);
|
||||||
void Lay_WrongProjectExit (void);
|
void Lay_WrongProjectExit (void);
|
||||||
void Lay_WrongCallForExamExit (void);
|
void Lay_WrongCallForExamExit (void);
|
||||||
|
void Lay_WrongTagExit (void);
|
||||||
|
void Lay_WrongTestExit (void);
|
||||||
void Lay_WrongExamExit (void);
|
void Lay_WrongExamExit (void);
|
||||||
void Lay_WrongSetExit (void);
|
void Lay_WrongSetExit (void);
|
||||||
void Lay_WrongQuestionExit (void);
|
void Lay_WrongQuestionExit (void);
|
||||||
|
@ -98,6 +116,13 @@ void Lay_WrongMatchExit (void);
|
||||||
void Lay_WrongSurveyExit (void);
|
void Lay_WrongSurveyExit (void);
|
||||||
void Lay_WrongWhoExit (void);
|
void Lay_WrongWhoExit (void);
|
||||||
void Lay_WrongEventExit (void);
|
void Lay_WrongEventExit (void);
|
||||||
|
void Lay_WrongAnnouncementExit (void);
|
||||||
|
void Lay_WrongNoticeExit (void);
|
||||||
|
void Lay_WrongForumExit (void);
|
||||||
|
void Lay_WrongPostExit (void);
|
||||||
|
void Lay_WrongMessageExit (void);
|
||||||
|
void Lay_WrongMailDomainExit (void);
|
||||||
|
void Lay_WrongRoleExit (void);
|
||||||
void Lay_WrongUserExit (void);
|
void Lay_WrongUserExit (void);
|
||||||
void Lay_NoPermissionExit (void);
|
void Lay_NoPermissionExit (void);
|
||||||
void Lay_ShowErrorAndExit (const char *Txt);
|
void Lay_ShowErrorAndExit (const char *Txt);
|
||||||
|
|
18
swad_link.c
18
swad_link.c
|
@ -320,8 +320,8 @@ void Lnk_GetListLinks (void)
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get link code (row[0]) */
|
/* Get link code (row[0]) */
|
||||||
if ((Lnk->LnkCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((Lnk->LnkCod = Str_ConvertStrCodToLongCod (row[0])) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of institutional link.");
|
Lay_WrongLinkExit ();
|
||||||
|
|
||||||
/* Get the short name (row[0]), the full name (row[1])
|
/* Get the short name (row[0]), the full name (row[1])
|
||||||
and de URL (row[2]) of the link */
|
and de URL (row[2]) of the link */
|
||||||
|
@ -493,8 +493,8 @@ void Lnk_RemoveLink (void)
|
||||||
Lnk_EditingLinkConstructor ();
|
Lnk_EditingLinkConstructor ();
|
||||||
|
|
||||||
/***** Get link code *****/
|
/***** Get link code *****/
|
||||||
if ((Lnk_EditingLnk->LnkCod = Lnk_GetParamLnkCod ()) == -1L)
|
if ((Lnk_EditingLnk->LnkCod = Lnk_GetParamLnkCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of institutional link is missing.");
|
Lay_WrongLinkExit ();
|
||||||
|
|
||||||
/***** Get data of the link from database *****/
|
/***** Get data of the link from database *****/
|
||||||
Lnk_GetDataOfLinkByCod (Lnk_EditingLnk);
|
Lnk_GetDataOfLinkByCod (Lnk_EditingLnk);
|
||||||
|
@ -570,8 +570,8 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the link */
|
/* Get the code of the link */
|
||||||
if ((Lnk_EditingLnk->LnkCod = Lnk_GetParamLnkCod ()) == -1L)
|
if ((Lnk_EditingLnk->LnkCod = Lnk_GetParamLnkCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of institutional link is missing.");
|
Lay_WrongLinkExit ();
|
||||||
|
|
||||||
/* Get the new name for the link */
|
/* Get the new name for the link */
|
||||||
Par_GetParToText (ParamName,NewLnkName,MaxBytes);
|
Par_GetParToText (ParamName,NewLnkName,MaxBytes);
|
||||||
|
@ -659,8 +659,8 @@ void Lnk_ChangeLinkWWW (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the link */
|
/* Get the code of the link */
|
||||||
if ((Lnk_EditingLnk->LnkCod = Lnk_GetParamLnkCod ()) == -1L)
|
if ((Lnk_EditingLnk->LnkCod = Lnk_GetParamLnkCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of institutional link is missing.");
|
Lay_WrongLinkExit ();
|
||||||
|
|
||||||
/* Get the new WWW for the link */
|
/* Get the new WWW for the link */
|
||||||
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
||||||
|
@ -864,7 +864,7 @@ static void Lnk_EditingLinkConstructor (void)
|
||||||
{
|
{
|
||||||
/***** Pointer must be NULL *****/
|
/***** Pointer must be NULL *****/
|
||||||
if (Lnk_EditingLnk != NULL)
|
if (Lnk_EditingLnk != NULL)
|
||||||
Lay_ShowErrorAndExit ("Error initializing link.");
|
Lay_WrongLinkExit ();
|
||||||
|
|
||||||
/***** Allocate memory for link *****/
|
/***** Allocate memory for link *****/
|
||||||
if ((Lnk_EditingLnk = malloc (sizeof (*Lnk_EditingLnk))) == NULL)
|
if ((Lnk_EditingLnk = malloc (sizeof (*Lnk_EditingLnk))) == NULL)
|
||||||
|
|
14
swad_mail.c
14
swad_mail.c
|
@ -325,8 +325,8 @@ static void Mai_GetListMailDomainsAllowedForNotif (void)
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get mail code (row[0]) */
|
/* Get mail code (row[0]) */
|
||||||
if ((Mai->MaiCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((Mai->MaiCod = Str_ConvertStrCodToLongCod (row[0])) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of mail domain.");
|
Lay_WrongMailDomainExit ();
|
||||||
|
|
||||||
/* Get the mail domain (row[1]) and the mail domain info (row[2]) */
|
/* Get the mail domain (row[1]) and the mail domain info (row[2]) */
|
||||||
Str_Copy (Mai->Domain,row[1],sizeof (Mai->Domain) - 1);
|
Str_Copy (Mai->Domain,row[1],sizeof (Mai->Domain) - 1);
|
||||||
|
@ -574,8 +574,8 @@ void Mai_RemoveMailDomain (void)
|
||||||
Mai_EditingMailDomainConstructor ();
|
Mai_EditingMailDomainConstructor ();
|
||||||
|
|
||||||
/***** Get mail code *****/
|
/***** Get mail code *****/
|
||||||
if ((Mai_EditingMai->MaiCod = Mai_GetParamMaiCod ()) == -1L)
|
if ((Mai_EditingMai->MaiCod = Mai_GetParamMaiCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of mail domain is missing.");
|
Lay_WrongMailDomainExit ();
|
||||||
|
|
||||||
/***** Get data of the mail from database *****/
|
/***** Get data of the mail from database *****/
|
||||||
Mai_GetDataOfMailDomainByCod (Mai_EditingMai);
|
Mai_GetDataOfMailDomainByCod (Mai_EditingMai);
|
||||||
|
@ -651,8 +651,8 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the mail */
|
/* Get the code of the mail */
|
||||||
if ((Mai_EditingMai->MaiCod = Mai_GetParamMaiCod ()) == -1L)
|
if ((Mai_EditingMai->MaiCod = Mai_GetParamMaiCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of mail domain is missing.");
|
Lay_WrongMailDomainExit ();
|
||||||
|
|
||||||
/* Get the new name for the mail */
|
/* Get the new name for the mail */
|
||||||
Par_GetParToText (ParamName,NewMaiName,MaxBytes);
|
Par_GetParToText (ParamName,NewMaiName,MaxBytes);
|
||||||
|
@ -1941,7 +1941,7 @@ static void Mai_EditingMailDomainConstructor (void)
|
||||||
{
|
{
|
||||||
/***** Pointer must be NULL *****/
|
/***** Pointer must be NULL *****/
|
||||||
if (Mai_EditingMai != NULL)
|
if (Mai_EditingMai != NULL)
|
||||||
Lay_ShowErrorAndExit ("Error initializing mail domain.");
|
Lay_WrongMailDomainExit ();
|
||||||
|
|
||||||
/***** Allocate memory for mail domain *****/
|
/***** Allocate memory for mail domain *****/
|
||||||
if ((Mai_EditingMai = malloc (sizeof (*Mai_EditingMai))) == NULL)
|
if ((Mai_EditingMai = malloc (sizeof (*Mai_EditingMai))) == NULL)
|
||||||
|
|
10
swad_mark.c
10
swad_mark.c
|
@ -197,11 +197,11 @@ static void Mrk_GetNumRowsHeaderAndFooter (struct MarksProperties *Marks)
|
||||||
|
|
||||||
/* Header (row[0]) */
|
/* Header (row[0]) */
|
||||||
if (sscanf (row[0],"%u",&(Marks->Header)) != 1)
|
if (sscanf (row[0],"%u",&(Marks->Header)) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong number of header rows.");
|
Lay_WrongNumberOfRowsExit ();
|
||||||
|
|
||||||
/* Footer (row[1]) */
|
/* Footer (row[1]) */
|
||||||
if (sscanf (row[1],"%u",&(Marks->Footer)) != 1)
|
if (sscanf (row[1],"%u",&(Marks->Footer)) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong number of footer rows.");
|
Lay_WrongNumberOfRowsExit ();
|
||||||
}
|
}
|
||||||
else // Unknown numbers of header and footer rows
|
else // Unknown numbers of header and footer rows
|
||||||
Marks->Header =
|
Marks->Header =
|
||||||
|
@ -268,7 +268,7 @@ static void Mrk_ChangeNumRowsHeaderOrFooter (Brw_HeadOrFoot_t HeaderOrFooter)
|
||||||
NumRows);
|
NumRows);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("Wrong number of rows.");
|
Lay_WrongNumberOfRowsExit ();
|
||||||
|
|
||||||
/***** Show again the file browser *****/
|
/***** Show again the file browser *****/
|
||||||
Brw_ShowAgainFileBrowserOrWorks ();
|
Brw_ShowAgainFileBrowserOrWorks ();
|
||||||
|
@ -764,11 +764,11 @@ void Mrk_GetNotifMyMarks (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
|
||||||
{
|
{
|
||||||
/* Header (row[3]) */
|
/* Header (row[3]) */
|
||||||
if (sscanf (row[3],"%u",&(Marks.Header)) != 1)
|
if (sscanf (row[3],"%u",&(Marks.Header)) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong number of header rows.");
|
Lay_WrongNumberOfRowsExit ();
|
||||||
|
|
||||||
/* Footer (row[4]) */
|
/* Footer (row[4]) */
|
||||||
if (sscanf (row[4],"%u",&(Marks.Footer)) != 1)
|
if (sscanf (row[4],"%u",&(Marks.Footer)) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong number of footer rows.");
|
Lay_WrongNumberOfRowsExit ();
|
||||||
|
|
||||||
if (UsrDat.IDs.Num)
|
if (UsrDat.IDs.Num)
|
||||||
{
|
{
|
||||||
|
|
16
swad_match.c
16
swad_match.c
|
@ -886,7 +886,7 @@ static void Mch_ListOneOrMoreMatchesResult (struct Gam_Games *Games,
|
||||||
Mch_ListOneOrMoreMatchesResultTch (Games,Match);
|
Mch_ListOneOrMoreMatchesResultTch (Games,Match);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1829,18 +1829,18 @@ static void Mch_CreateIndexes (long GamCod,long MchCod)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Get question code (row[0]) */
|
/* Get question code (row[0]) */
|
||||||
if ((Question.QstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((Question.QstCod = Str_ConvertStrCodToLongCod (row[0])) <= 0)
|
||||||
Lay_WrongQuestionExit ();
|
Lay_WrongQuestionExit ();
|
||||||
|
|
||||||
/* Get question index (row[1]) */
|
/* Get question index (row[1]) */
|
||||||
if ((LongNum = Str_ConvertStrCodToLongCod (row[1])) < 0)
|
if ((LongNum = Str_ConvertStrCodToLongCod (row[1])) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong question index.");
|
Lay_WrongQuestionIndexExit ();
|
||||||
QstInd = (unsigned) LongNum;
|
QstInd = (unsigned) LongNum;
|
||||||
|
|
||||||
/* Get answer type (row[2]) */
|
/* Get answer type (row[2]) */
|
||||||
Question.Answer.Type = Tst_ConvertFromStrAnsTypDBToAnsTyp (row[2]);
|
Question.Answer.Type = Tst_ConvertFromStrAnsTypDBToAnsTyp (row[2]);
|
||||||
if (Question.Answer.Type != Tst_ANS_UNIQUE_CHOICE)
|
if (Question.Answer.Type != Tst_ANS_UNIQUE_CHOICE)
|
||||||
Lay_ShowErrorAndExit ("Wrong answer type.");
|
Lay_WrongAnswerExit ();
|
||||||
|
|
||||||
/* Get shuffle (row[3]) */
|
/* Get shuffle (row[3]) */
|
||||||
Question.Answer.Shuffle = (row[3][0] == 'Y');
|
Question.Answer.Shuffle = (row[3][0] == 'Y');
|
||||||
|
@ -1894,8 +1894,8 @@ static void Mch_ReorderAnswer (long MchCod,unsigned QstInd,
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get answer index (row[0]) */
|
/* Get answer index (row[0]) */
|
||||||
if ((LongNum = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((LongNum = Str_ConvertStrCodToLongCod (row[0])) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong answer index.");
|
Lay_WrongAnswerIndexExit ();
|
||||||
AnsInd = (unsigned) LongNum;
|
AnsInd = (unsigned) LongNum;
|
||||||
snprintf (StrOneAnswer,sizeof (StrOneAnswer),"%u",AnsInd);
|
snprintf (StrOneAnswer,sizeof (StrOneAnswer),"%u",AnsInd);
|
||||||
|
|
||||||
|
@ -3274,7 +3274,7 @@ static void Mch_ShowQuestionAndAnswersTch (const struct Mch_Match *Match)
|
||||||
/***** Show question *****/
|
/***** Show question *****/
|
||||||
/* Check answer type */
|
/* Check answer type */
|
||||||
if (Question.Answer.Type != Tst_ANS_UNIQUE_CHOICE)
|
if (Question.Answer.Type != Tst_ANS_UNIQUE_CHOICE)
|
||||||
Lay_ShowErrorAndExit ("Wrong answer type.");
|
Lay_WrongAnswerExit ();
|
||||||
|
|
||||||
/* Begin container */
|
/* Begin container */
|
||||||
HTM_DIV_Begin ("class=\"MCH_BOTTOM\""); // Bottom
|
HTM_DIV_Begin ("class=\"MCH_BOTTOM\""); // Bottom
|
||||||
|
|
|
@ -257,7 +257,7 @@ static void Msg_PutFormMsgUsrs (struct Msg_Messages *Messages,
|
||||||
if ((Messages->Reply.IsReply = Par_GetParToBool ("IsReply")))
|
if ((Messages->Reply.IsReply = Par_GetParToBool ("IsReply")))
|
||||||
/* Get original message code */
|
/* Get original message code */
|
||||||
if ((Messages->Reply.OriginalMsgCod = Msg_GetParamMsgCod ()) <= 0)
|
if ((Messages->Reply.OriginalMsgCod = Msg_GetParamMsgCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of message.");
|
Lay_WrongMessageExit ();
|
||||||
|
|
||||||
/***** Get user's code of possible preselected recipient *****/
|
/***** Get user's code of possible preselected recipient *****/
|
||||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ()) // There is a preselected recipient
|
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ()) // There is a preselected recipient
|
||||||
|
@ -620,7 +620,7 @@ static void Msg_WriteFormSubjectAndContentMsgToUsrs (struct Msg_Messages *Messag
|
||||||
" FROM msg_content"
|
" FROM msg_content"
|
||||||
" WHERE MsgCod=%ld",
|
" WHERE MsgCod=%ld",
|
||||||
MsgCod) != 1)
|
MsgCod) != 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting message.");
|
Lay_WrongMessageExit ();
|
||||||
|
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
|
@ -770,7 +770,7 @@ void Msg_RecMsgFromUsr (void)
|
||||||
if ((IsReply = Par_GetParToBool ("IsReply")))
|
if ((IsReply = Par_GetParToBool ("IsReply")))
|
||||||
/* Get original message code */
|
/* Get original message code */
|
||||||
if ((OriginalMsgCod = Msg_GetParamMsgCod ()) <= 0)
|
if ((OriginalMsgCod = Msg_GetParamMsgCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of message.");
|
Lay_WrongMessageExit ();
|
||||||
|
|
||||||
/* Get user's code of possible preselected recipient */
|
/* Get user's code of possible preselected recipient */
|
||||||
Usr_GetParamOtherUsrCodEncryptedAndGetListIDs ();
|
Usr_GetParamOtherUsrCodEncryptedAndGetListIDs ();
|
||||||
|
@ -1197,7 +1197,7 @@ void Msg_DelSntMsg (void)
|
||||||
|
|
||||||
/***** Get the code of the message to delete *****/
|
/***** Get the code of the message to delete *****/
|
||||||
if ((MsgCod = Msg_GetParamMsgCod ()) <= 0)
|
if ((MsgCod = Msg_GetParamMsgCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of message.");
|
Lay_WrongMessageExit ();
|
||||||
|
|
||||||
/***** Delete the message *****/
|
/***** Delete the message *****/
|
||||||
/* Delete the sent message */
|
/* Delete the sent message */
|
||||||
|
@ -1219,7 +1219,7 @@ void Msg_DelRecMsg (void)
|
||||||
|
|
||||||
/***** Get the code of the message to delete *****/
|
/***** Get the code of the message to delete *****/
|
||||||
if ((MsgCod = Msg_GetParamMsgCod ()) <= 0)
|
if ((MsgCod = Msg_GetParamMsgCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of message.");
|
Lay_WrongMessageExit ();
|
||||||
|
|
||||||
/***** Delete the message *****/
|
/***** Delete the message *****/
|
||||||
/* Delete the received message */
|
/* Delete the received message */
|
||||||
|
@ -1243,7 +1243,7 @@ void Msg_ExpSntMsg (void)
|
||||||
|
|
||||||
/***** Get the code of the message to expand *****/
|
/***** Get the code of the message to expand *****/
|
||||||
if ((Messages.ExpandedMsgCod = Msg_GetParamMsgCod ()) <= 0)
|
if ((Messages.ExpandedMsgCod = Msg_GetParamMsgCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of message.");
|
Lay_WrongMessageExit ();
|
||||||
|
|
||||||
/***** Expand the message *****/
|
/***** Expand the message *****/
|
||||||
Msg_ExpandSentMsg (Messages.ExpandedMsgCod);
|
Msg_ExpandSentMsg (Messages.ExpandedMsgCod);
|
||||||
|
@ -1265,7 +1265,7 @@ void Msg_ExpRecMsg (void)
|
||||||
|
|
||||||
/***** Get the code of the message to expand *****/
|
/***** Get the code of the message to expand *****/
|
||||||
if ((Messages.ExpandedMsgCod = Msg_GetParamMsgCod ()) <= 0)
|
if ((Messages.ExpandedMsgCod = Msg_GetParamMsgCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of message.");
|
Lay_WrongMessageExit ();
|
||||||
|
|
||||||
/***** Expand the message *****/
|
/***** Expand the message *****/
|
||||||
Msg_ExpandReceivedMsg (Messages.ExpandedMsgCod);
|
Msg_ExpandReceivedMsg (Messages.ExpandedMsgCod);
|
||||||
|
@ -1289,7 +1289,7 @@ void Msg_ConSntMsg (void)
|
||||||
|
|
||||||
/***** Get the code of the message to contract *****/
|
/***** Get the code of the message to contract *****/
|
||||||
if ((MsgCod = Msg_GetParamMsgCod ()) <= 0)
|
if ((MsgCod = Msg_GetParamMsgCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of message.");
|
Lay_WrongMessageExit ();
|
||||||
|
|
||||||
/***** Contract the message *****/
|
/***** Contract the message *****/
|
||||||
Msg_ContractSentMsg (MsgCod);
|
Msg_ContractSentMsg (MsgCod);
|
||||||
|
@ -1308,7 +1308,7 @@ void Msg_ConRecMsg (void)
|
||||||
|
|
||||||
/***** Get the code of the message to contract *****/
|
/***** Get the code of the message to contract *****/
|
||||||
if ((MsgCod = Msg_GetParamMsgCod ()) <= 0)
|
if ((MsgCod = Msg_GetParamMsgCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of message.");
|
Lay_WrongMessageExit ();
|
||||||
|
|
||||||
/***** Contract the message *****/
|
/***** Contract the message *****/
|
||||||
Msg_ContractReceivedMsg (MsgCod);
|
Msg_ContractReceivedMsg (MsgCod);
|
||||||
|
@ -1480,9 +1480,8 @@ static unsigned long Msg_DelSomeRecOrSntMsgsUsr (const struct Msg_Messages *Mess
|
||||||
NumMsg < NumMsgs;
|
NumMsg < NumMsgs;
|
||||||
NumMsg++)
|
NumMsg++)
|
||||||
{
|
{
|
||||||
MsgCod = DB_GetNextCode (mysql_res);
|
if ((MsgCod = DB_GetNextCode (mysql_res)) <= 0)
|
||||||
if (MsgCod <= 0)
|
Lay_WrongMessageExit ();
|
||||||
Lay_ShowErrorAndExit ("Wrong code of message.");
|
|
||||||
|
|
||||||
switch (Messages->TypeOfMessages)
|
switch (Messages->TypeOfMessages)
|
||||||
{
|
{
|
||||||
|
@ -2011,7 +2010,7 @@ static void Msg_ShowSentOrReceivedMessages (struct Msg_Messages *Messages)
|
||||||
{
|
{
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
if (sscanf (row[0],"%ld",&MsgCod) != 1)
|
if (sscanf (row[0],"%ld",&MsgCod) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of message when searching for a page.");
|
Lay_WrongMessageExit ();
|
||||||
|
|
||||||
if (MsgCod == Messages->ExpandedMsgCod) // Expanded message found
|
if (MsgCod == Messages->ExpandedMsgCod) // Expanded message found
|
||||||
{
|
{
|
||||||
|
@ -2046,7 +2045,7 @@ static void Msg_ShowSentOrReceivedMessages (struct Msg_Messages *Messages)
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
if (sscanf (row[0],"%ld",&MsgCod) != 1)
|
if (sscanf (row[0],"%ld",&MsgCod) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of message when listing the messages in a page.");
|
Lay_WrongMessageExit ();
|
||||||
NumMsg = NumRows - NumRow + 1;
|
NumMsg = NumRows - NumRow + 1;
|
||||||
Msg_ShowASentOrReceivedMessage (Messages,NumMsg,MsgCod);
|
Msg_ShowASentOrReceivedMessage (Messages,NumMsg,MsgCod);
|
||||||
}
|
}
|
||||||
|
@ -3106,7 +3105,7 @@ static void Msg_GetMsgSntData (long MsgCod,long *CrsCod,long *UsrCod,
|
||||||
|
|
||||||
/* Result should have a unique row */
|
/* Result should have a unique row */
|
||||||
if (NumRows != 1)
|
if (NumRows != 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting data of a message.");
|
Lay_WrongMessageExit ();
|
||||||
|
|
||||||
/* Get number of rows */
|
/* Get number of rows */
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
@ -3159,7 +3158,7 @@ static void Msg_GetMsgContent (long MsgCod,char Content[Cns_MAX_BYTES_LONG_TEXT
|
||||||
" FROM msg_content"
|
" FROM msg_content"
|
||||||
" WHERE MsgCod=%ld",
|
" WHERE MsgCod=%ld",
|
||||||
MsgCod) != 1)
|
MsgCod) != 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting content of a message.");
|
Lay_WrongMessageExit ();
|
||||||
|
|
||||||
/***** Get number of rows *****/
|
/***** Get number of rows *****/
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
@ -4054,7 +4053,7 @@ void Msg_BanSenderWhenShowingMsgs (void)
|
||||||
if (!Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,
|
if (!Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,
|
||||||
Usr_DONT_GET_PREFS,
|
Usr_DONT_GET_PREFS,
|
||||||
Usr_DONT_GET_ROLE_IN_CURRENT_CRS))
|
Usr_DONT_GET_ROLE_IN_CURRENT_CRS))
|
||||||
Lay_ShowErrorAndExit ("Sender does not exist.");
|
Lay_WrongUserExit ();
|
||||||
|
|
||||||
/***** Insert pair (sender's code - my code) in table of banned senders if not inserted *****/
|
/***** Insert pair (sender's code - my code) in table of banned senders if not inserted *****/
|
||||||
DB_QueryREPLACE ("can not ban sender",
|
DB_QueryREPLACE ("can not ban sender",
|
||||||
|
@ -4114,7 +4113,7 @@ static void Msg_UnbanSender (void)
|
||||||
if (!Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,
|
if (!Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,
|
||||||
Usr_DONT_GET_PREFS,
|
Usr_DONT_GET_PREFS,
|
||||||
Usr_DONT_GET_ROLE_IN_CURRENT_CRS))
|
Usr_DONT_GET_ROLE_IN_CURRENT_CRS))
|
||||||
Lay_ShowErrorAndExit ("Sender does not exist.");
|
Lay_WrongUserExit ();
|
||||||
|
|
||||||
/***** Remove pair (sender's code - my code) from table of banned senders *****/
|
/***** Remove pair (sender's code - my code) from table of banned senders *****/
|
||||||
DB_QueryDELETE ("can not ban sender",
|
DB_QueryDELETE ("can not ban sender",
|
||||||
|
|
|
@ -447,7 +447,7 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing,long HighlightNotCod)
|
||||||
|
|
||||||
/* Get notice code (row[0]) */
|
/* Get notice code (row[0]) */
|
||||||
if (sscanf (row[0],"%ld",&NotCod) != 1)
|
if (sscanf (row[0],"%ld",&NotCod) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of notice.");
|
Lay_WrongNoticeExit ();
|
||||||
|
|
||||||
/* Get creation time (row[1] holds the UTC date-time) */
|
/* Get creation time (row[1] holds the UTC date-time) */
|
||||||
TimeUTC = Dat_GetUNIXTimeFromStr (row[1]);
|
TimeUTC = Dat_GetUNIXTimeFromStr (row[1]);
|
||||||
|
|
|
@ -455,7 +455,7 @@ void Ntf_ShowMyNotifications (void)
|
||||||
|
|
||||||
/* Get status (row[8]) */
|
/* Get status (row[8]) */
|
||||||
if (sscanf (row[8],"%u",&Status) != 1)
|
if (sscanf (row[8],"%u",&Status) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong notification status.");
|
Lay_WrongStatusExit ();
|
||||||
StatusTxt = Ntf_GetStatusTxtFromStatusBits (Status);
|
StatusTxt = Ntf_GetStatusTxtFromStatusBits (Status);
|
||||||
|
|
||||||
if (Status & Ntf_STATUS_BIT_REMOVED) // The source of the notification was removed
|
if (Status & Ntf_STATUS_BIT_REMOVED) // The source of the notification was removed
|
||||||
|
|
14
swad_place.c
14
swad_place.c
|
@ -412,8 +412,8 @@ void Plc_GetListPlaces (struct Plc_Places *Places)
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get place code (row[0]) */
|
/* Get place code (row[0]) */
|
||||||
if ((Plc->PlcCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((Plc->PlcCod = Str_ConvertStrCodToLongCod (row[0])) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of place.");
|
Lay_WrongPlaceExit ();
|
||||||
|
|
||||||
/* Get the short (row[1]) and full (row[2]) names of the place */
|
/* Get the short (row[1]) and full (row[2]) names of the place */
|
||||||
Str_Copy (Plc->ShrtName,row[1],sizeof (Plc->ShrtName) - 1);
|
Str_Copy (Plc->ShrtName,row[1],sizeof (Plc->ShrtName) - 1);
|
||||||
|
@ -615,8 +615,8 @@ void Plc_RemovePlace (void)
|
||||||
Plc_EditingPlaceConstructor ();
|
Plc_EditingPlaceConstructor ();
|
||||||
|
|
||||||
/***** Get place code *****/
|
/***** Get place code *****/
|
||||||
if ((Plc_EditingPlc->PlcCod = Plc_GetParamPlcCod ()) == -1L)
|
if ((Plc_EditingPlc->PlcCod = Plc_GetParamPlcCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of place is missing.");
|
Lay_WrongPlaceExit ();
|
||||||
|
|
||||||
/***** Get data of the place from database *****/
|
/***** Get data of the place from database *****/
|
||||||
Plc_GetDataOfPlaceByCod (Plc_EditingPlc);
|
Plc_GetDataOfPlaceByCod (Plc_EditingPlc);
|
||||||
|
@ -699,8 +699,8 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the place */
|
/* Get the code of the place */
|
||||||
if ((Plc_EditingPlc->PlcCod = Plc_GetParamPlcCod ()) == -1L)
|
if ((Plc_EditingPlc->PlcCod = Plc_GetParamPlcCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of place is missing.");
|
Lay_WrongPlaceExit ();
|
||||||
|
|
||||||
/* Get the new name for the place */
|
/* Get the new name for the place */
|
||||||
Par_GetParToText (ParamName,NewPlcName,MaxBytes);
|
Par_GetParToText (ParamName,NewPlcName,MaxBytes);
|
||||||
|
@ -941,7 +941,7 @@ static void Plc_EditingPlaceConstructor (void)
|
||||||
{
|
{
|
||||||
/***** Pointer must be NULL *****/
|
/***** Pointer must be NULL *****/
|
||||||
if (Plc_EditingPlc != NULL)
|
if (Plc_EditingPlc != NULL)
|
||||||
Lay_ShowErrorAndExit ("Error initializing place.");
|
Lay_WrongPlaceExit ();
|
||||||
|
|
||||||
/***** Allocate memory for place *****/
|
/***** Allocate memory for place *****/
|
||||||
if ((Plc_EditingPlc = malloc (sizeof (*Plc_EditingPlc))) == NULL)
|
if ((Plc_EditingPlc = malloc (sizeof (*Plc_EditingPlc))) == NULL)
|
||||||
|
|
|
@ -260,8 +260,8 @@ static void Plg_GetListPlugins (void)
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get plugin code (row[0]) */
|
/* Get plugin code (row[0]) */
|
||||||
if ((Plg->PlgCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((Plg->PlgCod = Str_ConvertStrCodToLongCod (row[0])) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of plugin.");
|
Lay_WrongPluginExit ();
|
||||||
|
|
||||||
/* Get name (row[1]), description (row[2), logo (row[3]),
|
/* Get name (row[1]), description (row[2), logo (row[3]),
|
||||||
* application key (row[4]), URL (row[5]) and IP (row[6]) of the plugin */
|
* application key (row[4]), URL (row[5]) and IP (row[6]) of the plugin */
|
||||||
|
@ -492,8 +492,8 @@ void Plg_RemovePlugin (void)
|
||||||
Plg_EditingPluginConstructor ();
|
Plg_EditingPluginConstructor ();
|
||||||
|
|
||||||
/***** Get plugin code *****/
|
/***** Get plugin code *****/
|
||||||
if ((Plg_EditingPlg->PlgCod = Plg_GetParamPlgCod ()) == -1L)
|
if ((Plg_EditingPlg->PlgCod = Plg_GetParamPlgCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of plugin is missing.");
|
Lay_WrongPluginExit ();
|
||||||
|
|
||||||
/***** Get data of the plugin from database *****/
|
/***** Get data of the plugin from database *****/
|
||||||
Plg_GetDataOfPluginByCod (Plg_EditingPlg);
|
Plg_GetDataOfPluginByCod (Plg_EditingPlg);
|
||||||
|
@ -526,8 +526,8 @@ void Plg_RenamePlugin (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the plugin */
|
/* Get the code of the plugin */
|
||||||
if ((Plg_EditingPlg->PlgCod = Plg_GetParamPlgCod ()) == -1L)
|
if ((Plg_EditingPlg->PlgCod = Plg_GetParamPlgCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of plugin is missing.");
|
Lay_WrongPluginExit ();
|
||||||
|
|
||||||
/* Get the new name for the plugin */
|
/* Get the new name for the plugin */
|
||||||
Par_GetParToText ("Name",NewPlgName,Plg_MAX_BYTES_PLUGIN_NAME);
|
Par_GetParToText ("Name",NewPlgName,Plg_MAX_BYTES_PLUGIN_NAME);
|
||||||
|
@ -605,8 +605,8 @@ void Plg_ChangePlgDescription (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the plugin */
|
/* Get the code of the plugin */
|
||||||
if ((Plg_EditingPlg->PlgCod = Plg_GetParamPlgCod ()) == -1L)
|
if ((Plg_EditingPlg->PlgCod = Plg_GetParamPlgCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of plugin is missing.");
|
Lay_WrongPluginExit ();
|
||||||
|
|
||||||
/* Get the new description for the plugin */
|
/* Get the new description for the plugin */
|
||||||
Par_GetParToText ("Description",NewDescription,Plg_MAX_BYTES_PLUGIN_DESCRIPTION);
|
Par_GetParToText ("Description",NewDescription,Plg_MAX_BYTES_PLUGIN_DESCRIPTION);
|
||||||
|
@ -652,8 +652,8 @@ void Plg_ChangePlgLogo (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the plugin */
|
/* Get the code of the plugin */
|
||||||
if ((Plg_EditingPlg->PlgCod = Plg_GetParamPlgCod ()) == -1L)
|
if ((Plg_EditingPlg->PlgCod = Plg_GetParamPlgCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of plugin is missing.");
|
Lay_WrongPluginExit ();
|
||||||
|
|
||||||
/* Get the new logo for the plugin */
|
/* Get the new logo for the plugin */
|
||||||
Par_GetParToText ("Logo",NewLogo,Plg_MAX_BYTES_PLUGIN_LOGO);
|
Par_GetParToText ("Logo",NewLogo,Plg_MAX_BYTES_PLUGIN_LOGO);
|
||||||
|
@ -698,8 +698,8 @@ void Plg_ChangePlgAppKey (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the plugin */
|
/* Get the code of the plugin */
|
||||||
if ((Plg_EditingPlg->PlgCod = Plg_GetParamPlgCod ()) == -1L)
|
if ((Plg_EditingPlg->PlgCod = Plg_GetParamPlgCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of plugin is missing.");
|
Lay_WrongPluginExit ();
|
||||||
|
|
||||||
/* Get the new logo for the plugin */
|
/* Get the new logo for the plugin */
|
||||||
Par_GetParToText ("AppKey",NewAppKey,Plg_MAX_BYTES_PLUGIN_APP_KEY);
|
Par_GetParToText ("AppKey",NewAppKey,Plg_MAX_BYTES_PLUGIN_APP_KEY);
|
||||||
|
@ -744,8 +744,8 @@ void Plg_ChangePlgURL (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the plugin */
|
/* Get the code of the plugin */
|
||||||
if ((Plg_EditingPlg->PlgCod = Plg_GetParamPlgCod ()) == -1L)
|
if ((Plg_EditingPlg->PlgCod = Plg_GetParamPlgCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of plugin is missing.");
|
Lay_WrongPluginExit ();
|
||||||
|
|
||||||
/* Get the new URL for the plugin */
|
/* Get the new URL for the plugin */
|
||||||
Par_GetParToText ("URL",NewURL,Cns_MAX_BYTES_WWW);
|
Par_GetParToText ("URL",NewURL,Cns_MAX_BYTES_WWW);
|
||||||
|
@ -790,8 +790,8 @@ void Plg_ChangePlgIP (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get the code of the plugin */
|
/* Get the code of the plugin */
|
||||||
if ((Plg_EditingPlg->PlgCod = Plg_GetParamPlgCod ()) == -1L)
|
if ((Plg_EditingPlg->PlgCod = Plg_GetParamPlgCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of plugin is missing.");
|
Lay_WrongPluginExit ();
|
||||||
|
|
||||||
/* Get the new IP for the plugin */
|
/* Get the new IP for the plugin */
|
||||||
Par_GetParToText ("IP",NewIP,Cns_MAX_BYTES_IP);
|
Par_GetParToText ("IP",NewIP,Cns_MAX_BYTES_IP);
|
||||||
|
@ -1047,7 +1047,7 @@ static void Plg_EditingPluginConstructor (void)
|
||||||
{
|
{
|
||||||
/***** Pointer must be NULL *****/
|
/***** Pointer must be NULL *****/
|
||||||
if (Plg_EditingPlg != NULL)
|
if (Plg_EditingPlg != NULL)
|
||||||
Lay_ShowErrorAndExit ("Error initializing plugin.");
|
Lay_WrongPluginExit ();
|
||||||
|
|
||||||
/***** Allocate memory for plugin *****/
|
/***** Allocate memory for plugin *****/
|
||||||
if ((Plg_EditingPlg = malloc (sizeof (*Plg_EditingPlg))) == NULL)
|
if ((Plg_EditingPlg = malloc (sizeof (*Plg_EditingPlg))) == NULL)
|
||||||
|
|
|
@ -1004,8 +1004,8 @@ static void Prg_GetListItems (void)
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get code of the program item (row[0]) */
|
/* Get code of the program item (row[0]) */
|
||||||
if ((Prg_Gbl.List.Items[NumItem].ItmCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((Prg_Gbl.List.Items[NumItem].ItmCod = Str_ConvertStrCodToLongCod (row[0])) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Error: wrong program item code.");
|
Lay_WrongItemExit ();
|
||||||
|
|
||||||
/* Get index of the program item (row[1]) */
|
/* Get index of the program item (row[1]) */
|
||||||
Prg_Gbl.List.Items[NumItem].Index = Str_ConvertStrToUnsigned (row[1]);
|
Prg_Gbl.List.Items[NumItem].Index = Str_ConvertStrToUnsigned (row[1]);
|
||||||
|
@ -1201,7 +1201,7 @@ static unsigned Prg_GetNumItemFromItmCod (long ItmCod)
|
||||||
|
|
||||||
/***** List of items must be filled *****/
|
/***** List of items must be filled *****/
|
||||||
if (!Prg_Gbl.List.IsRead || Prg_Gbl.List.Items == NULL)
|
if (!Prg_Gbl.List.IsRead || Prg_Gbl.List.Items == NULL)
|
||||||
Lay_ShowErrorAndExit ("Wrong list of items.");
|
Lay_WrongItemsListExit ();
|
||||||
|
|
||||||
/***** Find item code in list *****/
|
/***** Find item code in list *****/
|
||||||
for (NumItem = 0;
|
for (NumItem = 0;
|
||||||
|
@ -1211,7 +1211,7 @@ static unsigned Prg_GetNumItemFromItmCod (long ItmCod)
|
||||||
return NumItem;
|
return NumItem;
|
||||||
|
|
||||||
/***** Not found *****/
|
/***** Not found *****/
|
||||||
Lay_ShowErrorAndExit ("Wrong item code.");
|
Lay_WrongItemExit ();
|
||||||
return 0; // Not reached
|
return 0; // Not reached
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1233,7 +1233,7 @@ void Prg_ReqRemItem (void)
|
||||||
Item.Hierarchy.ItmCod = Prg_GetParamItmCod ();
|
Item.Hierarchy.ItmCod = Prg_GetParamItmCod ();
|
||||||
Prg_GetDataOfItemByCod (&Item);
|
Prg_GetDataOfItemByCod (&Item);
|
||||||
if (Item.Hierarchy.ItmCod <= 0)
|
if (Item.Hierarchy.ItmCod <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong item code.");
|
Lay_WrongItemExit ();
|
||||||
|
|
||||||
/***** Show question and button to remove the program item *****/
|
/***** Show question and button to remove the program item *****/
|
||||||
Ale_ShowAlertAndButton (ActRemPrgItm,NULL,NULL,
|
Ale_ShowAlertAndButton (ActRemPrgItm,NULL,NULL,
|
||||||
|
@ -1269,7 +1269,7 @@ void Prg_RemoveItem (void)
|
||||||
Item.Hierarchy.ItmCod = Prg_GetParamItmCod ();
|
Item.Hierarchy.ItmCod = Prg_GetParamItmCod ();
|
||||||
Prg_GetDataOfItemByCod (&Item);
|
Prg_GetDataOfItemByCod (&Item);
|
||||||
if (Item.Hierarchy.ItmCod <= 0)
|
if (Item.Hierarchy.ItmCod <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong item code.");
|
Lay_WrongItemExit ();
|
||||||
|
|
||||||
/***** Indexes of items *****/
|
/***** Indexes of items *****/
|
||||||
Prg_SetItemRangeWithAllChildren (Prg_GetNumItemFromItmCod (Item.Hierarchy.ItmCod),
|
Prg_SetItemRangeWithAllChildren (Prg_GetNumItemFromItmCod (Item.Hierarchy.ItmCod),
|
||||||
|
@ -1326,7 +1326,7 @@ static void Prg_HideUnhideItem (char YN)
|
||||||
Item.Hierarchy.ItmCod = Prg_GetParamItmCod ();
|
Item.Hierarchy.ItmCod = Prg_GetParamItmCod ();
|
||||||
Prg_GetDataOfItemByCod (&Item);
|
Prg_GetDataOfItemByCod (&Item);
|
||||||
if (Item.Hierarchy.ItmCod <= 0)
|
if (Item.Hierarchy.ItmCod <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong item code.");
|
Lay_WrongItemExit ();
|
||||||
|
|
||||||
/***** Hide/unhide program item *****/
|
/***** Hide/unhide program item *****/
|
||||||
DB_QueryUPDATE ("can not change program item",
|
DB_QueryUPDATE ("can not change program item",
|
||||||
|
@ -1381,7 +1381,7 @@ static void Prg_MoveUpDownItem (Prg_MoveUpDown_t UpDown)
|
||||||
Item.Hierarchy.ItmCod = Prg_GetParamItmCod ();
|
Item.Hierarchy.ItmCod = Prg_GetParamItmCod ();
|
||||||
Prg_GetDataOfItemByCod (&Item);
|
Prg_GetDataOfItemByCod (&Item);
|
||||||
if (Item.Hierarchy.ItmCod <= 0)
|
if (Item.Hierarchy.ItmCod <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong item code.");
|
Lay_WrongItemExit ();
|
||||||
|
|
||||||
/***** Move up/down item *****/
|
/***** Move up/down item *****/
|
||||||
NumItem = Prg_GetNumItemFromItmCod (Item.Hierarchy.ItmCod);
|
NumItem = Prg_GetNumItemFromItmCod (Item.Hierarchy.ItmCod);
|
||||||
|
@ -1615,7 +1615,7 @@ static void Prg_MoveLeftRightItem (Prg_MoveLeftRight_t LeftRight)
|
||||||
Item.Hierarchy.ItmCod = Prg_GetParamItmCod ();
|
Item.Hierarchy.ItmCod = Prg_GetParamItmCod ();
|
||||||
Prg_GetDataOfItemByCod (&Item);
|
Prg_GetDataOfItemByCod (&Item);
|
||||||
if (Item.Hierarchy.ItmCod <= 0)
|
if (Item.Hierarchy.ItmCod <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong item code.");
|
Lay_WrongItemExit ();
|
||||||
|
|
||||||
/***** Move up/down item *****/
|
/***** Move up/down item *****/
|
||||||
NumItem = Prg_GetNumItemFromItmCod (Item.Hierarchy.ItmCod);
|
NumItem = Prg_GetNumItemFromItmCod (Item.Hierarchy.ItmCod);
|
||||||
|
@ -1663,7 +1663,7 @@ static void Prg_SetItemRangeEmpty (struct ItemRange *ItemRange)
|
||||||
{
|
{
|
||||||
/***** List of items must be filled *****/
|
/***** List of items must be filled *****/
|
||||||
if (!Prg_Gbl.List.IsRead)
|
if (!Prg_Gbl.List.IsRead)
|
||||||
Lay_ShowErrorAndExit ("Wrong list of items.");
|
Lay_WrongItemsListExit ();
|
||||||
|
|
||||||
/***** Range is empty *****/
|
/***** Range is empty *****/
|
||||||
if (Prg_Gbl.List.NumItems)
|
if (Prg_Gbl.List.NumItems)
|
||||||
|
@ -1678,7 +1678,7 @@ static void Prg_SetItemRangeOnlyItem (unsigned Index,struct ItemRange *ItemRange
|
||||||
{
|
{
|
||||||
/***** List of items must be filled *****/
|
/***** List of items must be filled *****/
|
||||||
if (!Prg_Gbl.List.IsRead)
|
if (!Prg_Gbl.List.IsRead)
|
||||||
Lay_ShowErrorAndExit ("Wrong list of items.");
|
Lay_WrongItemsListExit ();
|
||||||
|
|
||||||
/***** Range includes only this item *****/
|
/***** Range includes only this item *****/
|
||||||
ItemRange->Begin =
|
ItemRange->Begin =
|
||||||
|
@ -1689,11 +1689,11 @@ static void Prg_SetItemRangeWithAllChildren (unsigned NumItem,struct ItemRange *
|
||||||
{
|
{
|
||||||
/***** List of items must be filled *****/
|
/***** List of items must be filled *****/
|
||||||
if (!Prg_Gbl.List.IsRead)
|
if (!Prg_Gbl.List.IsRead)
|
||||||
Lay_ShowErrorAndExit ("Wrong list of items.");
|
Lay_WrongItemsListExit ();
|
||||||
|
|
||||||
/***** Number of item must be in the correct range *****/
|
/***** Number of item must be in the correct range *****/
|
||||||
if (NumItem >= Prg_Gbl.List.NumItems)
|
if (NumItem >= Prg_Gbl.List.NumItems)
|
||||||
Lay_ShowErrorAndExit ("Wrong item number.");
|
Lay_WrongItemExit ();
|
||||||
|
|
||||||
/***** Range includes this item and all its children *****/
|
/***** Range includes this item and all its children *****/
|
||||||
ItemRange->Begin = Prg_Gbl.List.Items[NumItem ].Index;
|
ItemRange->Begin = Prg_Gbl.List.Items[NumItem ].Index;
|
||||||
|
@ -1712,7 +1712,7 @@ static unsigned Prg_GetLastChild (int NumItem)
|
||||||
/***** Trivial check: if item is wrong, there are no children *****/
|
/***** Trivial check: if item is wrong, there are no children *****/
|
||||||
if (NumItem < 0 ||
|
if (NumItem < 0 ||
|
||||||
NumItem >= (int) Prg_Gbl.List.NumItems)
|
NumItem >= (int) Prg_Gbl.List.NumItems)
|
||||||
Lay_ShowErrorAndExit ("Wrong number of item.");
|
Lay_WrongItemExit ();
|
||||||
|
|
||||||
/***** Get next brother after item *****/
|
/***** Get next brother after item *****/
|
||||||
// 0 <= NumItem < Prg_Gbl.List.NumItems
|
// 0 <= NumItem < Prg_Gbl.List.NumItems
|
||||||
|
@ -2013,7 +2013,7 @@ void Prg_ReceiveFormChgItem (void)
|
||||||
NewItem.Hierarchy.ItmCod = Prg_GetParamItmCod ();
|
NewItem.Hierarchy.ItmCod = Prg_GetParamItmCod ();
|
||||||
Prg_GetDataOfItemByCod (&NewItem);
|
Prg_GetDataOfItemByCod (&NewItem);
|
||||||
if (NewItem.Hierarchy.ItmCod <= 0)
|
if (NewItem.Hierarchy.ItmCod <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong item code.");
|
Lay_WrongItemExit ();
|
||||||
|
|
||||||
/***** Get data of the old (current) program item from database *****/
|
/***** Get data of the old (current) program item from database *****/
|
||||||
OldItem.Hierarchy.ItmCod = NewItem.Hierarchy.ItmCod;
|
OldItem.Hierarchy.ItmCod = NewItem.Hierarchy.ItmCod;
|
||||||
|
|
|
@ -876,7 +876,7 @@ static Prj_HiddenVisibl_t Prj_GetHiddenParamHidVis (void)
|
||||||
(unsigned) Prj_FILTER_HIDDEN_DEFAULT |
|
(unsigned) Prj_FILTER_HIDDEN_DEFAULT |
|
||||||
(unsigned) Prj_FILTER_VISIBL_DEFAULT);
|
(unsigned) Prj_FILTER_VISIBL_DEFAULT);
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
return Prj_NEW_PRJ_HIDDEN_VISIBL_DEFAULT; // Not reached
|
return Prj_NEW_PRJ_HIDDEN_VISIBL_DEFAULT; // Not reached
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2430,7 +2430,7 @@ static void Prj_FormToSelectUsrs (struct Prj_Projects *Projects,
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
Prj_GetParams (Projects);
|
Prj_GetParams (Projects);
|
||||||
if ((Projects->PrjCod = Prj.PrjCod = Prj_GetParamPrjCod ()) == -1L)
|
if ((Projects->PrjCod = Prj.PrjCod = Prj_GetParamPrjCod ()) <= 0)
|
||||||
Lay_WrongProjectExit ();
|
Lay_WrongProjectExit ();
|
||||||
|
|
||||||
/***** Put form to select users *****/
|
/***** Put form to select users *****/
|
||||||
|
@ -2508,7 +2508,7 @@ static void Prj_AddUsrsToProject (Prj_RoleInProject_t RoleInProject)
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
Prj_GetParams (&Projects);
|
Prj_GetParams (&Projects);
|
||||||
if ((Projects.PrjCod = Prj.PrjCod = Prj_GetParamPrjCod ()) == -1L)
|
if ((Projects.PrjCod = Prj.PrjCod = Prj_GetParamPrjCod ()) <= 0)
|
||||||
Lay_WrongProjectExit ();
|
Lay_WrongProjectExit ();
|
||||||
|
|
||||||
/***** Add the selected users to project *****/
|
/***** Add the selected users to project *****/
|
||||||
|
@ -2918,7 +2918,7 @@ static void Prj_GetListProjects (struct Prj_Projects *Projects)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -230,8 +230,8 @@ void Rec_GetListRecordFieldsInCurrentCrs (void)
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get the code of field (row[0]) */
|
/* Get the code of field (row[0]) */
|
||||||
if ((Gbl.Crs.Records.LstFields.Lst[NumRow].FieldCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((Gbl.Crs.Records.LstFields.Lst[NumRow].FieldCod = Str_ConvertStrCodToLongCod (row[0])) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of field.");
|
Lay_WrongRecordFieldExit ();
|
||||||
|
|
||||||
/* Name of the field (row[1]) */
|
/* Name of the field (row[1]) */
|
||||||
Str_Copy (Gbl.Crs.Records.LstFields.Lst[NumRow].Name,row[1],
|
Str_Copy (Gbl.Crs.Records.LstFields.Lst[NumRow].Name,row[1],
|
||||||
|
@ -242,7 +242,7 @@ void Rec_GetListRecordFieldsInCurrentCrs (void)
|
||||||
|
|
||||||
/* Visible or editable by students? (row[3]) */
|
/* Visible or editable by students? (row[3]) */
|
||||||
if (sscanf (row[3],"%u",&Vis) != 1)
|
if (sscanf (row[3],"%u",&Vis) != 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting field of record in current course.");
|
Lay_WrongRecordFieldExit ();
|
||||||
if (Vis < Rec_NUM_TYPES_VISIBILITY)
|
if (Vis < Rec_NUM_TYPES_VISIBILITY)
|
||||||
Gbl.Crs.Records.LstFields.Lst[NumRow].Visibility = (Rec_VisibilityRecordFields_t) Vis;
|
Gbl.Crs.Records.LstFields.Lst[NumRow].Visibility = (Rec_VisibilityRecordFields_t) Vis;
|
||||||
else
|
else
|
||||||
|
@ -567,8 +567,8 @@ void Rec_ReqRemField (void)
|
||||||
unsigned NumRecords;
|
unsigned NumRecords;
|
||||||
|
|
||||||
/***** Get the code of field *****/
|
/***** Get the code of field *****/
|
||||||
if ((Gbl.Crs.Records.Field.FieldCod = Rec_GetFieldCod ()) == -1)
|
if ((Gbl.Crs.Records.Field.FieldCod = Rec_GetFieldCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of field is missing.");
|
Lay_WrongRecordFieldExit ();
|
||||||
|
|
||||||
/***** Check if exists any record with that field filled *****/
|
/***** Check if exists any record with that field filled *****/
|
||||||
if ((NumRecords = Rec_CountNumRecordsInCurrCrsWithField (Gbl.Crs.Records.Field.FieldCod))) // There are records with that field filled
|
if ((NumRecords = Rec_CountNumRecordsInCurrCrsWithField (Gbl.Crs.Records.Field.FieldCod))) // There are records with that field filled
|
||||||
|
@ -694,7 +694,7 @@ static void Rec_GetFieldByCod (long FieldCod,char Name[Rec_MAX_BYTES_NAME_FIELD
|
||||||
" WHERE CrsCod=%ld"
|
" WHERE CrsCod=%ld"
|
||||||
" AND FieldCod=%ld",
|
" AND FieldCod=%ld",
|
||||||
Gbl.Hierarchy.Crs.CrsCod,FieldCod) != 1)
|
Gbl.Hierarchy.Crs.CrsCod,FieldCod) != 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting a field of a record in a course.");
|
Lay_WrongRecordFieldExit ();
|
||||||
|
|
||||||
/***** Get the field *****/
|
/***** Get the field *****/
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
@ -707,7 +707,7 @@ static void Rec_GetFieldByCod (long FieldCod,char Name[Rec_MAX_BYTES_NAME_FIELD
|
||||||
|
|
||||||
/* Visible or editable by students? (row[2]) */
|
/* Visible or editable by students? (row[2]) */
|
||||||
if (sscanf (row[2],"%u",&Vis) != 1)
|
if (sscanf (row[2],"%u",&Vis) != 1)
|
||||||
Lay_ShowErrorAndExit ("Error when getting a field of a record in a course.");
|
Lay_WrongRecordFieldExit ();
|
||||||
if (Vis < Rec_NUM_TYPES_VISIBILITY)
|
if (Vis < Rec_NUM_TYPES_VISIBILITY)
|
||||||
*Visibility = (Rec_VisibilityRecordFields_t) Vis;
|
*Visibility = (Rec_VisibilityRecordFields_t) Vis;
|
||||||
else
|
else
|
||||||
|
@ -724,8 +724,8 @@ static void Rec_GetFieldByCod (long FieldCod,char Name[Rec_MAX_BYTES_NAME_FIELD
|
||||||
void Rec_RemoveField (void)
|
void Rec_RemoveField (void)
|
||||||
{
|
{
|
||||||
/***** Get the code of the field *****/
|
/***** Get the code of the field *****/
|
||||||
if ((Gbl.Crs.Records.Field.FieldCod = Rec_GetFieldCod ()) == -1)
|
if ((Gbl.Crs.Records.Field.FieldCod = Rec_GetFieldCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of field is missing.");
|
Lay_WrongRecordFieldExit ();
|
||||||
|
|
||||||
/***** Borrarlo from the database *****/
|
/***** Borrarlo from the database *****/
|
||||||
Rec_RemoveFieldFromDB ();
|
Rec_RemoveFieldFromDB ();
|
||||||
|
@ -744,8 +744,8 @@ void Rec_RenameField (void)
|
||||||
|
|
||||||
/***** Get parameters of the form *****/
|
/***** Get parameters of the form *****/
|
||||||
/* Get the code of the field */
|
/* Get the code of the field */
|
||||||
if ((Gbl.Crs.Records.Field.FieldCod = Rec_GetFieldCod ()) == -1)
|
if ((Gbl.Crs.Records.Field.FieldCod = Rec_GetFieldCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of field is missing.");
|
Lay_WrongRecordFieldExit ();
|
||||||
|
|
||||||
/* Get the new group name */
|
/* Get the new group name */
|
||||||
Par_GetParToText ("FieldName",NewFieldName,Rec_MAX_BYTES_NAME_FIELD);
|
Par_GetParToText ("FieldName",NewFieldName,Rec_MAX_BYTES_NAME_FIELD);
|
||||||
|
@ -807,8 +807,8 @@ void Rec_ChangeLinesField (void)
|
||||||
|
|
||||||
/***** Get parameters of the form *****/
|
/***** Get parameters of the form *****/
|
||||||
/* Get the code of field */
|
/* Get the code of field */
|
||||||
if ((Gbl.Crs.Records.Field.FieldCod = Rec_GetFieldCod ()) == -1)
|
if ((Gbl.Crs.Records.Field.FieldCod = Rec_GetFieldCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of field is missing.");
|
Lay_WrongRecordFieldExit ();
|
||||||
|
|
||||||
/* Get the new number of lines */
|
/* Get the new number of lines */
|
||||||
NewNumLines = (unsigned)
|
NewNumLines = (unsigned)
|
||||||
|
@ -857,8 +857,8 @@ void Rec_ChangeVisibilityField (void)
|
||||||
|
|
||||||
/***** Get parameters of the form *****/
|
/***** Get parameters of the form *****/
|
||||||
/* Get the code of field */
|
/* Get the code of field */
|
||||||
if ((Gbl.Crs.Records.Field.FieldCod = Rec_GetFieldCod ()) == -1)
|
if ((Gbl.Crs.Records.Field.FieldCod = Rec_GetFieldCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of field is missing.");
|
Lay_WrongRecordFieldExit ();
|
||||||
|
|
||||||
/* Get the new visibility of the field */
|
/* Get the new visibility of the field */
|
||||||
NewVisibility = (Rec_VisibilityRecordFields_t)
|
NewVisibility = (Rec_VisibilityRecordFields_t)
|
||||||
|
@ -1727,7 +1727,7 @@ static void Rec_ShowCrsRecord (Rec_CourseRecordViewType_t TypeOfView,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Begin box and table *****/
|
/***** Begin box and table *****/
|
||||||
|
@ -3697,7 +3697,7 @@ Rol_Role_t Rec_GetRoleFromRecordForm (void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!RoleOK)
|
if (!RoleOK)
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
return Role;
|
return Role;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1285,7 +1285,7 @@ static void Rep_ShowMyHitsPerYear (bool AnyCourse,long CrsCod,Rol_Role_t Role,
|
||||||
|
|
||||||
/* Get the year (in row[0] is the date in YYYY format) */
|
/* Get the year (in row[0] is the date in YYYY format) */
|
||||||
if (sscanf (row[0],"%04u",&ReadYear) != 1)
|
if (sscanf (row[0],"%04u",&ReadYear) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong date.");
|
Lay_WrongDateExit ();
|
||||||
|
|
||||||
/* Get number hits (in row[1]) */
|
/* Get number hits (in row[1]) */
|
||||||
if (sscanf (row[1],"%lu",&Report->Hits.Num) != 1)
|
if (sscanf (row[1],"%lu",&Report->Hits.Num) != 1)
|
||||||
|
|
|
@ -646,12 +646,3 @@ Rol_Role_t Rol_GetRequestedRole (long UsrCod)
|
||||||
Gbl.Hierarchy.Crs.CrsCod,
|
Gbl.Hierarchy.Crs.CrsCod,
|
||||||
UsrCod);
|
UsrCod);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/************* Show error message about wrong role and exit ******************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
void Rol_WrongRoleExit (void)
|
|
||||||
{
|
|
||||||
Lay_ShowErrorAndExit ("Wrong role.");
|
|
||||||
}
|
|
||||||
|
|
|
@ -64,6 +64,4 @@ unsigned Rol_GetSelectedRoles (void);
|
||||||
|
|
||||||
Rol_Role_t Rol_GetRequestedRole (long UsrCod);
|
Rol_Role_t Rol_GetRequestedRole (long UsrCod);
|
||||||
|
|
||||||
void Rol_WrongRoleExit (void);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
34
swad_room.c
34
swad_room.c
|
@ -380,8 +380,8 @@ void Roo_ChangeMAC (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get room code */
|
/* Get room code */
|
||||||
if ((Roo_EditingRoom->RooCod = Par_GetParToLong ("Cod")) == -1L)
|
if ((Roo_EditingRoom->RooCod = Par_GetParToLong ("Cod")) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of room is missing.");
|
Lay_WrongRoomExit ();
|
||||||
|
|
||||||
/* Get the old MAC address of the room */
|
/* Get the old MAC address of the room */
|
||||||
OldMACnum = MAC_GetMACnumFromForm ("MAC");
|
OldMACnum = MAC_GetMACnumFromForm ("MAC");
|
||||||
|
@ -619,8 +619,8 @@ void Roo_GetListRooms (struct Roo_Rooms *Rooms,
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get room code (row[0]) */
|
/* Get room code (row[0]) */
|
||||||
if ((Room->RooCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((Room->RooCod = Str_ConvertStrCodToLongCod (row[0])) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of room.");
|
Lay_WrongRoomExit ();
|
||||||
|
|
||||||
switch (WhichData)
|
switch (WhichData)
|
||||||
{
|
{
|
||||||
|
@ -1005,8 +1005,8 @@ void Roo_RemoveRoom (void)
|
||||||
Roo_EditingRoomConstructor ();
|
Roo_EditingRoomConstructor ();
|
||||||
|
|
||||||
/***** Get room code *****/
|
/***** Get room code *****/
|
||||||
if ((Roo_EditingRoom->RooCod = Roo_GetParamRooCod ()) == -1L)
|
if ((Roo_EditingRoom->RooCod = Roo_GetParamRooCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of room is missing.");
|
Lay_WrongRoomExit ();
|
||||||
|
|
||||||
/***** Get data of the room from database *****/
|
/***** Get data of the room from database *****/
|
||||||
Roo_GetDataOfRoomByCod (Roo_EditingRoom);
|
Roo_GetDataOfRoomByCod (Roo_EditingRoom);
|
||||||
|
@ -1058,8 +1058,8 @@ void Roo_ChangeBuilding (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get room code */
|
/* Get room code */
|
||||||
if ((Roo_EditingRoom->RooCod = Roo_GetParamRooCod ()) == -1L)
|
if ((Roo_EditingRoom->RooCod = Roo_GetParamRooCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of room is missing.");
|
Lay_WrongRoomExit ();
|
||||||
|
|
||||||
/* Get room building */
|
/* Get room building */
|
||||||
NewBldCod = Bld_GetParamBldCod ();
|
NewBldCod = Bld_GetParamBldCod ();
|
||||||
|
@ -1111,8 +1111,8 @@ void Roo_ChangeFloor (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get room code */
|
/* Get room code */
|
||||||
if ((Roo_EditingRoom->RooCod = Roo_GetParamRooCod ()) == -1L)
|
if ((Roo_EditingRoom->RooCod = Roo_GetParamRooCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of room is missing.");
|
Lay_WrongRoomExit ();
|
||||||
|
|
||||||
/* Get room floor */
|
/* Get room floor */
|
||||||
NewFloor = Roo_GetParamFloor ();
|
NewFloor = Roo_GetParamFloor ();
|
||||||
|
@ -1163,8 +1163,8 @@ void Roo_ChangeType (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get room code */
|
/* Get room code */
|
||||||
if ((Roo_EditingRoom->RooCod = Roo_GetParamRooCod ()) == -1L)
|
if ((Roo_EditingRoom->RooCod = Roo_GetParamRooCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of room is missing.");
|
Lay_WrongRoomExit ();
|
||||||
|
|
||||||
/* Get room type */
|
/* Get room type */
|
||||||
NewType = Roo_GetParamType ();
|
NewType = Roo_GetParamType ();
|
||||||
|
@ -1260,8 +1260,8 @@ static void Roo_RenameRoom (Cns_ShrtOrFullName_t ShrtOrFullName)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get room code */
|
/* Get room code */
|
||||||
if ((Roo_EditingRoom->RooCod = Roo_GetParamRooCod ()) == -1L)
|
if ((Roo_EditingRoom->RooCod = Roo_GetParamRooCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of room is missing.");
|
Lay_WrongRoomExit ();
|
||||||
|
|
||||||
/* Get the new name for the room */
|
/* Get the new name for the room */
|
||||||
Par_GetParToText (ParamName,NewClaName,MaxBytes);
|
Par_GetParToText (ParamName,NewClaName,MaxBytes);
|
||||||
|
@ -1354,8 +1354,8 @@ void Roo_ChangeCapacity (void)
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
/* Get room code */
|
/* Get room code */
|
||||||
if ((Roo_EditingRoom->RooCod = Roo_GetParamRooCod ()) == -1L)
|
if ((Roo_EditingRoom->RooCod = Roo_GetParamRooCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of room is missing.");
|
Lay_WrongRoomExit ();
|
||||||
|
|
||||||
/* Get the seating capacity of the room */
|
/* Get the seating capacity of the room */
|
||||||
NewCapacity = (unsigned)
|
NewCapacity = (unsigned)
|
||||||
|
@ -1656,7 +1656,7 @@ static void Roo_EditingRoomConstructor (void)
|
||||||
{
|
{
|
||||||
/***** Pointer must be NULL *****/
|
/***** Pointer must be NULL *****/
|
||||||
if (Roo_EditingRoom != NULL)
|
if (Roo_EditingRoom != NULL)
|
||||||
Lay_ShowErrorAndExit ("Error initializing room.");
|
Lay_WrongRoomExit ();
|
||||||
|
|
||||||
/***** Allocate memory for room *****/
|
/***** Allocate memory for room *****/
|
||||||
if ((Roo_EditingRoom = malloc (sizeof (*Roo_EditingRoom))) == NULL)
|
if ((Roo_EditingRoom = malloc (sizeof (*Roo_EditingRoom))) == NULL)
|
||||||
|
|
|
@ -1726,7 +1726,7 @@ static void Sta_ShowDetailedAccessesList (const struct Sta_Stats *Stats,
|
||||||
|
|
||||||
/* Get logged role */
|
/* Get logged role */
|
||||||
if (sscanf (row[2],"%u",&RoleFromLog) != 1)
|
if (sscanf (row[2],"%u",&RoleFromLog) != 1)
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
|
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
|
@ -1764,7 +1764,7 @@ static void Sta_ShowDetailedAccessesList (const struct Sta_Stats *Stats,
|
||||||
|
|
||||||
/* Write the action */
|
/* Write the action */
|
||||||
if (sscanf (row[4],"%ld",&ActCod) != 1)
|
if (sscanf (row[4],"%ld",&ActCod) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong action code.");
|
Lay_WrongActionExit ();
|
||||||
HTM_TD_Begin ("class=\"LOG LT COLOR%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"LOG LT COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
if (ActCod >= 0)
|
if (ActCod >= 0)
|
||||||
HTM_TxtF ("%s ",Act_GetActionText (Act_FromActCodToAction[ActCod]));
|
HTM_TxtF ("%s ",Act_GetActionText (Act_FromActCodToAction[ActCod]));
|
||||||
|
@ -1964,7 +1964,7 @@ static void Sta_ShowNumHitsPerDay (Sta_CountType_t CountType,
|
||||||
|
|
||||||
/* Get year, month and day (row[0] holds the date in YYYYMMDD format) */
|
/* Get year, month and day (row[0] holds the date in YYYYMMDD format) */
|
||||||
if (!(Dat_GetDateFromYYYYMMDD (&ReadDate,row[0])))
|
if (!(Dat_GetDateFromYYYYMMDD (&ReadDate,row[0])))
|
||||||
Lay_ShowErrorAndExit ("Wrong date.");
|
Lay_WrongDateExit ();
|
||||||
|
|
||||||
/* Get number of pages generated (in row[1]) */
|
/* Get number of pages generated (in row[1]) */
|
||||||
Hits.Num = Str_GetDoubleFromStr (row[1]);
|
Hits.Num = Str_GetDoubleFromStr (row[1]);
|
||||||
|
@ -2172,11 +2172,11 @@ static void Sta_ShowDistrAccessesPerDayAndHour (const struct Sta_Stats *Stats,
|
||||||
|
|
||||||
/* Get year, month and day (row[0] holds the date in YYYYMMDD format) */
|
/* Get year, month and day (row[0] holds the date in YYYYMMDD format) */
|
||||||
if (!(Dat_GetDateFromYYYYMMDD (&CurrentReadDate,row[0])))
|
if (!(Dat_GetDateFromYYYYMMDD (&CurrentReadDate,row[0])))
|
||||||
Lay_ShowErrorAndExit ("Wrong date.");
|
Lay_WrongDateExit ();
|
||||||
|
|
||||||
/* Get the hour (in row[1] is the hour in formato HH) */
|
/* Get the hour (in row[1] is the hour in formato HH) */
|
||||||
if (sscanf (row[1],"%02u",&ReadHour) != 1)
|
if (sscanf (row[1],"%02u",&ReadHour) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong hour.");
|
Lay_WrongDateExit ();
|
||||||
|
|
||||||
/* Get number of pages generated (in row[2]) */
|
/* Get number of pages generated (in row[2]) */
|
||||||
Hits.Num = Str_GetDoubleFromStr (row[2]);
|
Hits.Num = Str_GetDoubleFromStr (row[2]);
|
||||||
|
@ -2542,7 +2542,7 @@ static void Sta_ShowNumHitsPerWeek (Sta_CountType_t CountType,
|
||||||
|
|
||||||
/* Get year and week (row[0] holds date in YYYYWW format) */
|
/* Get year and week (row[0] holds date in YYYYWW format) */
|
||||||
if (sscanf (row[0],"%04u%02u",&ReadDate.Year,&ReadDate.Week) != 2)
|
if (sscanf (row[0],"%04u%02u",&ReadDate.Year,&ReadDate.Week) != 2)
|
||||||
Lay_ShowErrorAndExit ("Wrong date.");
|
Lay_WrongDateExit ();
|
||||||
|
|
||||||
/* Get number of pages generated (in row[1]) */
|
/* Get number of pages generated (in row[1]) */
|
||||||
Hits.Num = Str_GetDoubleFromStr (row[1]);
|
Hits.Num = Str_GetDoubleFromStr (row[1]);
|
||||||
|
@ -2643,7 +2643,7 @@ static void Sta_ShowNumHitsPerMonth (Sta_CountType_t CountType,
|
||||||
|
|
||||||
/* Get the year and the month (in row[0] is the date in YYYYMM format) */
|
/* Get the year and the month (in row[0] is the date in YYYYMM format) */
|
||||||
if (sscanf (row[0],"%04u%02u",&ReadDate.Year,&ReadDate.Month) != 2)
|
if (sscanf (row[0],"%04u%02u",&ReadDate.Year,&ReadDate.Month) != 2)
|
||||||
Lay_ShowErrorAndExit ("Wrong date.");
|
Lay_WrongDateExit ();
|
||||||
|
|
||||||
/* Get number of pages generated (in row[1]) */
|
/* Get number of pages generated (in row[1]) */
|
||||||
Hits.Num = Str_GetDoubleFromStr (row[1]);
|
Hits.Num = Str_GetDoubleFromStr (row[1]);
|
||||||
|
@ -2744,7 +2744,7 @@ static void Sta_ShowNumHitsPerYear (Sta_CountType_t CountType,
|
||||||
|
|
||||||
/* Get the year (in row[0] is the date in YYYY format) */
|
/* Get the year (in row[0] is the date in YYYY format) */
|
||||||
if (sscanf (row[0],"%04u",&ReadDate.Year) != 1)
|
if (sscanf (row[0],"%04u",&ReadDate.Year) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong date.");
|
Lay_WrongDateExit ();
|
||||||
|
|
||||||
/* Get number of pages generated (in row[1]) */
|
/* Get number of pages generated (in row[1]) */
|
||||||
Hits.Num = Str_GetDoubleFromStr (row[1]);
|
Hits.Num = Str_GetDoubleFromStr (row[1]);
|
||||||
|
@ -2844,7 +2844,7 @@ static void Sta_ShowNumHitsPerHour (unsigned NumHits,
|
||||||
row = mysql_fetch_row (mysql_res); // Get next result
|
row = mysql_fetch_row (mysql_res); // Get next result
|
||||||
NumHit++;
|
NumHit++;
|
||||||
if (sscanf (row[0],"%02u",&ReadHour) != 1) // In row[0] is the date in HH format
|
if (sscanf (row[0],"%02u",&ReadHour) != 1) // In row[0] is the date in HH format
|
||||||
Lay_ShowErrorAndExit ("Wrong hour.");
|
Lay_WrongDateExit ();
|
||||||
|
|
||||||
for (H = Hour;
|
for (H = Hour;
|
||||||
H < ReadHour;
|
H < ReadHour;
|
||||||
|
@ -2939,7 +2939,7 @@ static void Sta_ShowAverageAccessesPerMinute (unsigned NumHits,MYSQL_RES *mysql_
|
||||||
row = mysql_fetch_row (mysql_res); // Get next result
|
row = mysql_fetch_row (mysql_res); // Get next result
|
||||||
NumHit++;
|
NumHit++;
|
||||||
if (sscanf (row[0],"%02u%02u",&ReadHour,&MinuteRead) != 2) // In row[0] is the date in formato HHMM
|
if (sscanf (row[0],"%02u%02u",&ReadHour,&MinuteRead) != 2) // In row[0] is the date in formato HHMM
|
||||||
Lay_ShowErrorAndExit ("Wrong hour-minute.");
|
Lay_WrongDateExit ();
|
||||||
/* Get number of pages generated */
|
/* Get number of pages generated */
|
||||||
Hits.Num = Str_GetDoubleFromStr (row[1]);
|
Hits.Num = Str_GetDoubleFromStr (row[1]);
|
||||||
MinuteDayRead = ReadHour * 60 + MinuteRead;
|
MinuteDayRead = ReadHour * 60 + MinuteRead;
|
||||||
|
@ -3221,7 +3221,7 @@ static void Sta_ShowNumHitsPerPlugin (Sta_CountType_t CountType,
|
||||||
|
|
||||||
/* Write the plugin */
|
/* Write the plugin */
|
||||||
if (sscanf (row[0],"%ld",&Plg.PlgCod) != 1)
|
if (sscanf (row[0],"%ld",&Plg.PlgCod) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong plugin code.");
|
Lay_WrongPluginExit ();
|
||||||
HTM_TD_Begin ("class=\"LOG RT\"");
|
HTM_TD_Begin ("class=\"LOG RT\"");
|
||||||
if (Plg_GetDataOfPluginByCod (&Plg))
|
if (Plg_GetDataOfPluginByCod (&Plg))
|
||||||
HTM_Txt (Plg.Name);
|
HTM_Txt (Plg.Name);
|
||||||
|
@ -3343,7 +3343,7 @@ static void Sta_ShowNumHitsPerBanner (Sta_CountType_t CountType,
|
||||||
|
|
||||||
/* Write the banner */
|
/* Write the banner */
|
||||||
if (sscanf (row[0],"%ld",&(Ban.BanCod)) != 1)
|
if (sscanf (row[0],"%ld",&(Ban.BanCod)) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong banner code.");
|
Lay_WrongBannerExit ();
|
||||||
Ban_GetDataOfBannerByCod (&Ban);
|
Ban_GetDataOfBannerByCod (&Ban);
|
||||||
HTM_TD_Begin ("class=\"LOG LT\"");
|
HTM_TD_Begin ("class=\"LOG LT\"");
|
||||||
HTM_A_Begin ("href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\"",
|
HTM_A_Begin ("href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\"",
|
||||||
|
|
|
@ -1894,7 +1894,7 @@ void Svy_RequestCreatOrEditSvy (void)
|
||||||
Surveys.CurrentPage = Pag_GetParamPagNum (Pag_SURVEYS);
|
Surveys.CurrentPage = Pag_GetParamPagNum (Pag_SURVEYS);
|
||||||
|
|
||||||
/***** Get the code of the survey *****/
|
/***** Get the code of the survey *****/
|
||||||
ItsANewSurvey = ((Svy.SvyCod = Svy_GetParamSvyCod ()) == -1L);
|
ItsANewSurvey = ((Svy.SvyCod = Svy_GetParamSvyCod ()) <= 0);
|
||||||
|
|
||||||
/***** Get from the database the data of the survey *****/
|
/***** Get from the database the data of the survey *****/
|
||||||
if (ItsANewSurvey)
|
if (ItsANewSurvey)
|
||||||
|
@ -2205,7 +2205,7 @@ void Svy_ReceiveFormSurvey (void)
|
||||||
Surveys.CurrentPage = Pag_GetParamPagNum (Pag_SURVEYS);
|
Surveys.CurrentPage = Pag_GetParamPagNum (Pag_SURVEYS);
|
||||||
|
|
||||||
/***** Get the code of the survey *****/
|
/***** Get the code of the survey *****/
|
||||||
ItsANewSurvey = ((NewSvy.SvyCod = Svy_GetParamSvyCod ()) == -1L);
|
ItsANewSurvey = ((NewSvy.SvyCod = Svy_GetParamSvyCod ()) <= 0);
|
||||||
|
|
||||||
if (ItsANewSurvey)
|
if (ItsANewSurvey)
|
||||||
NewSvy.Scope = Hie_Lvl_UNK;
|
NewSvy.Scope = Hie_Lvl_UNK;
|
||||||
|
@ -2767,7 +2767,7 @@ static void Svy_ShowFormEditOneQst (struct Svy_Surveys *Surveys,
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
if (NumAnswers > Svy_MAX_ANSWERS_PER_QUESTION)
|
if (NumAnswers > Svy_MAX_ANSWERS_PER_QUESTION)
|
||||||
Lay_ShowErrorAndExit ("Wrong answer.");
|
Lay_WrongAnswerExit ();
|
||||||
if (!Svy_AllocateTextChoiceAnswer (SvyQst,NumAns))
|
if (!Svy_AllocateTextChoiceAnswer (SvyQst,NumAns))
|
||||||
/* Abort on error */
|
/* Abort on error */
|
||||||
Ale_ShowAlertsAndExit ();
|
Ale_ShowAlertsAndExit ();
|
||||||
|
|
|
@ -350,7 +350,7 @@ static void Syl_SetSyllabusTypeFromAction (struct Syl_Syllabus *Syllabus)
|
||||||
Gbl.Crs.Info.Type = Inf_PRACTICALS;
|
Gbl.Crs.Info.Type = Inf_PRACTICALS;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Lay_ShowErrorAndExit ("Wrong action.");
|
Lay_WrongActionExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -381,7 +381,7 @@ void Syl_LoadListItemsSyllabusIntoMemory (struct Syl_Syllabus *Syllabus,
|
||||||
|
|
||||||
/***** Go to the start of the list of items *****/
|
/***** Go to the start of the list of items *****/
|
||||||
if (!Str_FindStrInFile (Gbl.F.XML,"<lista>",Str_NO_SKIP_HTML_COMMENTS))
|
if (!Str_FindStrInFile (Gbl.F.XML,"<lista>",Str_NO_SKIP_HTML_COMMENTS))
|
||||||
Lay_ShowErrorAndExit ("Wrong syllabus format.");
|
Lay_WrongSyllabusFormatExit ();
|
||||||
|
|
||||||
/***** Save the position of the start of the list *****/
|
/***** Save the position of the start of the list *****/
|
||||||
PostBeginList = ftell (Gbl.F.XML);
|
PostBeginList = ftell (Gbl.F.XML);
|
||||||
|
@ -429,7 +429,7 @@ void Syl_LoadListItemsSyllabusIntoMemory (struct Syl_Syllabus *Syllabus,
|
||||||
{
|
{
|
||||||
/* Go to the start of the item */
|
/* Go to the start of the item */
|
||||||
if (!Str_FindStrInFile (Gbl.F.XML,"<item",Str_NO_SKIP_HTML_COMMENTS))
|
if (!Str_FindStrInFile (Gbl.F.XML,"<item",Str_NO_SKIP_HTML_COMMENTS))
|
||||||
Lay_ShowErrorAndExit ("Wrong syllabus format.");
|
Lay_WrongSyllabusFormatExit ();
|
||||||
|
|
||||||
/* Get the level */
|
/* Get the level */
|
||||||
Syl_LstItemsSyllabus.Lst[NumItem].Level = Syl_ReadLevelItemSyllabus ();
|
Syl_LstItemsSyllabus.Lst[NumItem].Level = Syl_ReadLevelItemSyllabus ();
|
||||||
|
@ -454,10 +454,10 @@ void Syl_LoadListItemsSyllabusIntoMemory (struct Syl_Syllabus *Syllabus,
|
||||||
if (Result == 0) // Str too long
|
if (Result == 0) // Str too long
|
||||||
{
|
{
|
||||||
if (!Str_FindStrInFile (Gbl.F.XML,"</item>",Str_NO_SKIP_HTML_COMMENTS)) // End the search
|
if (!Str_FindStrInFile (Gbl.F.XML,"</item>",Str_NO_SKIP_HTML_COMMENTS)) // End the search
|
||||||
Lay_ShowErrorAndExit ("Wrong syllabus format.");
|
Lay_WrongSyllabusFormatExit ();
|
||||||
}
|
}
|
||||||
else if (Result == -1)
|
else if (Result == -1)
|
||||||
Lay_ShowErrorAndExit ("Wrong syllabus format.");
|
Lay_WrongSyllabusFormatExit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Close the file with the syllabus *****/
|
/***** Close the file with the syllabus *****/
|
||||||
|
@ -507,12 +507,12 @@ int Syl_ReadLevelItemSyllabus (void)
|
||||||
char StrlLevel[11 + 1];
|
char StrlLevel[11 + 1];
|
||||||
|
|
||||||
if (!Str_FindStrInFile (Gbl.F.XML,"nivel=\"",Str_NO_SKIP_HTML_COMMENTS))
|
if (!Str_FindStrInFile (Gbl.F.XML,"nivel=\"",Str_NO_SKIP_HTML_COMMENTS))
|
||||||
Lay_ShowErrorAndExit ("Wrong syllabus format.");
|
Lay_WrongSyllabusFormatExit ();
|
||||||
if (Str_ReadFileUntilBoundaryStr (Gbl.F.XML,StrlLevel,"\"",1,
|
if (Str_ReadFileUntilBoundaryStr (Gbl.F.XML,StrlLevel,"\"",1,
|
||||||
(unsigned long long) (11 + 1)) != 1)
|
(unsigned long long) (11 + 1)) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong syllabus format.");
|
Lay_WrongSyllabusFormatExit ();
|
||||||
if (sscanf (StrlLevel,"%d",&Level) != 1)
|
if (sscanf (StrlLevel,"%d",&Level) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong syllabus format.");
|
Lay_WrongSyllabusFormatExit ();
|
||||||
Str_FindStrInFile (Gbl.F.XML,">",Str_NO_SKIP_HTML_COMMENTS);
|
Str_FindStrInFile (Gbl.F.XML,">",Str_NO_SKIP_HTML_COMMENTS);
|
||||||
if (Level < 1)
|
if (Level < 1)
|
||||||
Level = 1;
|
Level = 1;
|
||||||
|
|
10
swad_tag.c
10
swad_tag.c
|
@ -230,7 +230,7 @@ static long Tag_GetParamTagCode (void)
|
||||||
|
|
||||||
/***** Get tag code *****/
|
/***** Get tag code *****/
|
||||||
if ((TagCod = Par_GetParToLong ("TagCod")) <= 0)
|
if ((TagCod = Par_GetParToLong ("TagCod")) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of tag is missing.");
|
Lay_WrongTagExit ();
|
||||||
|
|
||||||
return TagCod;
|
return TagCod;
|
||||||
}
|
}
|
||||||
|
@ -285,8 +285,8 @@ void Tag_RenameTag (void)
|
||||||
- If the new tag did not exist for a question ==>
|
- If the new tag did not exist for a question ==>
|
||||||
change old tag to new tag in tst_question_tags *****/
|
change old tag to new tag in tst_question_tags *****/
|
||||||
/* Get tag code of the old tag */
|
/* Get tag code of the old tag */
|
||||||
if ((OldTagCod = Tag_GetTagCodFromTagTxt (OldTagTxt)) < 0)
|
if ((OldTagCod = Tag_GetTagCodFromTagTxt (OldTagTxt)) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Tag does not exists.");
|
Lay_WrongTagExit ();
|
||||||
|
|
||||||
/* Create a temporary table with all the question codes
|
/* Create a temporary table with all the question codes
|
||||||
that had the new tag as one of their tags */
|
that had the new tag as one of their tags */
|
||||||
|
@ -577,8 +577,8 @@ void Tag_ShowFormEditTags (void)
|
||||||
row[1] TagTxt
|
row[1] TagTxt
|
||||||
row[2] TagHidden
|
row[2] TagHidden
|
||||||
*/
|
*/
|
||||||
if ((TagCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((TagCod = Str_ConvertStrCodToLongCod (row[0])) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of tag.");
|
Lay_WrongTagExit ();
|
||||||
|
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
|
|
16
swad_test.c
16
swad_test.c
|
@ -435,7 +435,7 @@ void Tst_ReceiveTestDraft (void)
|
||||||
/* Get test exam code from form */
|
/* Get test exam code from form */
|
||||||
TstPrn_ResetPrint (&Print);
|
TstPrn_ResetPrint (&Print);
|
||||||
if ((Print.PrnCod = TstPrn_GetParamPrnCod ()) <= 0)
|
if ((Print.PrnCod = TstPrn_GetParamPrnCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong test exam.");
|
Lay_WrongTestExit ();
|
||||||
|
|
||||||
/* Get number of this test from form */
|
/* Get number of this test from form */
|
||||||
NumTst = Tst_GetParamNumTst ();
|
NumTst = Tst_GetParamNumTst ();
|
||||||
|
@ -491,7 +491,7 @@ void Tst_AssessTest (void)
|
||||||
/* Get test exam code from form */
|
/* Get test exam code from form */
|
||||||
TstPrn_ResetPrint (&Print);
|
TstPrn_ResetPrint (&Print);
|
||||||
if ((Print.PrnCod = TstPrn_GetParamPrnCod ()) <= 0)
|
if ((Print.PrnCod = TstPrn_GetParamPrnCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong test exam.");
|
Lay_WrongTestExit ();
|
||||||
|
|
||||||
/* Get number of this test from form */
|
/* Get number of this test from form */
|
||||||
NumTst = Tst_GetParamNumTst ();
|
NumTst = Tst_GetParamNumTst ();
|
||||||
|
@ -2903,7 +2903,7 @@ void Tst_WriteParamQstCod (unsigned NumQst,long QstCod)
|
||||||
void Tst_CheckIfNumberOfAnswersIsOne (const struct Tst_Question *Question)
|
void Tst_CheckIfNumberOfAnswersIsOne (const struct Tst_Question *Question)
|
||||||
{
|
{
|
||||||
if (Question->Answer.NumOptions != 1)
|
if (Question->Answer.NumOptions != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong answer.");
|
Lay_WrongAnswerExit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -3944,7 +3944,7 @@ bool Tst_GetQstDataFromDB (struct Tst_Question *Question)
|
||||||
break;
|
break;
|
||||||
case Tst_ANS_FLOAT:
|
case Tst_ANS_FLOAT:
|
||||||
if (Question->Answer.NumOptions != 2)
|
if (Question->Answer.NumOptions != 2)
|
||||||
Lay_ShowErrorAndExit ("Wrong answer.");
|
Lay_WrongAnswerExit ();
|
||||||
Question->Answer.FloatingPoint[NumOpt] = Str_GetDoubleFromStr (row[1]);
|
Question->Answer.FloatingPoint[NumOpt] = Str_GetDoubleFromStr (row[1]);
|
||||||
break;
|
break;
|
||||||
case Tst_ANS_TRUE_FALSE:
|
case Tst_ANS_TRUE_FALSE:
|
||||||
|
@ -3956,7 +3956,7 @@ bool Tst_GetQstDataFromDB (struct Tst_Question *Question)
|
||||||
case Tst_ANS_TEXT:
|
case Tst_ANS_TEXT:
|
||||||
/* Check number of options */
|
/* Check number of options */
|
||||||
if (Question->Answer.NumOptions > Tst_MAX_OPTIONS_PER_QUESTION)
|
if (Question->Answer.NumOptions > Tst_MAX_OPTIONS_PER_QUESTION)
|
||||||
Lay_ShowErrorAndExit ("Wrong answer.");
|
Lay_WrongAnswerExit ();
|
||||||
|
|
||||||
/* Allocate space for text and feedback */
|
/* Allocate space for text and feedback */
|
||||||
if (!Tst_AllocateTextChoiceAnswer (Question,NumOpt))
|
if (!Tst_AllocateTextChoiceAnswer (Question,NumOpt))
|
||||||
|
@ -4142,7 +4142,7 @@ static void Tst_GetQstFromForm (struct Tst_Question *Question)
|
||||||
Tst_NUM_ANS_TYPES - 1,
|
Tst_NUM_ANS_TYPES - 1,
|
||||||
(unsigned long) Tst_ANS_UNKNOWN);
|
(unsigned long) Tst_ANS_UNKNOWN);
|
||||||
if (Question->Answer.Type == Tst_ANS_UNKNOWN)
|
if (Question->Answer.Type == Tst_ANS_UNKNOWN)
|
||||||
Lay_ShowErrorAndExit ("Wrong type of answer.");
|
Lay_WrongAnswerExit ();
|
||||||
|
|
||||||
/***** Get question tags *****/
|
/***** Get question tags *****/
|
||||||
for (NumTag = 0;
|
for (NumTag = 0;
|
||||||
|
@ -4279,9 +4279,9 @@ static void Tst_GetQstFromForm (struct Tst_Question *Question)
|
||||||
{
|
{
|
||||||
Par_GetNextStrUntilSeparParamMult (&Ptr,UnsignedStr,Cns_MAX_DECIMAL_DIGITS_UINT);
|
Par_GetNextStrUntilSeparParamMult (&Ptr,UnsignedStr,Cns_MAX_DECIMAL_DIGITS_UINT);
|
||||||
if (sscanf (UnsignedStr,"%u",&NumCorrectAns) != 1)
|
if (sscanf (UnsignedStr,"%u",&NumCorrectAns) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong selected answer.");
|
Lay_WrongAnswerExit ();
|
||||||
if (NumCorrectAns >= Tst_MAX_OPTIONS_PER_QUESTION)
|
if (NumCorrectAns >= Tst_MAX_OPTIONS_PER_QUESTION)
|
||||||
Lay_ShowErrorAndExit ("Wrong selected answer.");
|
Lay_WrongAnswerExit ();
|
||||||
Question->Answer.Options[NumCorrectAns].Correct = true;
|
Question->Answer.Options[NumCorrectAns].Correct = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,8 +218,8 @@ void TsI_CreateXML (unsigned NumQsts,MYSQL_RES *mysql_res)
|
||||||
|
|
||||||
/* Get question code (row[0]) */
|
/* Get question code (row[0]) */
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
if ((Question.QstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((Question.QstCod = Str_ConvertStrCodToLongCod (row[0])) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of question.");
|
Lay_WrongQuestionExit ();
|
||||||
|
|
||||||
TsI_ExportQuestion (&Question,FileXML);
|
TsI_ExportQuestion (&Question,FileXML);
|
||||||
|
|
||||||
|
@ -651,7 +651,7 @@ static void TsI_ImportQuestionsFromXMLBuffer (const char *XMLBuffer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // Answer type not found
|
else // Answer type not found
|
||||||
Lay_ShowErrorAndExit ("Wrong type of answer.");
|
Lay_WrongAnswerExit ();
|
||||||
|
|
||||||
/***** Destroy test question *****/
|
/***** Destroy test question *****/
|
||||||
Tst_QstDestructor (&Question);
|
Tst_QstDestructor (&Question);
|
||||||
|
@ -687,7 +687,7 @@ static Tst_AnswerType_t TsI_ConvertFromStrAnsTypXMLToAnsTyp (const char *StrAnsT
|
||||||
if (!strcasecmp (StrAnsTypeXML,Tst_StrAnswerTypesXML[AnsType]))
|
if (!strcasecmp (StrAnsTypeXML,Tst_StrAnswerTypesXML[AnsType]))
|
||||||
return AnsType;
|
return AnsType;
|
||||||
|
|
||||||
Lay_ShowErrorAndExit ("Wrong type of answer.");
|
Lay_WrongAnswerExit ();
|
||||||
return (Tst_AnswerType_t) 0; // Not reached
|
return (Tst_AnswerType_t) 0; // Not reached
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -890,7 +890,7 @@ static void TstPrn_GetCorrectIntAnswerFromDB (struct Tst_Question *Question)
|
||||||
/***** Get correct answer *****/
|
/***** Get correct answer *****/
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
if (sscanf (row[0],"%ld",&Question->Answer.Integer) != 1)
|
if (sscanf (row[0],"%ld",&Question->Answer.Integer) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong integer answer.");
|
Lay_WrongAnswerExit ();
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
@ -913,7 +913,7 @@ static void TstPrn_GetCorrectFltAnswerFromDB (struct Tst_Question *Question)
|
||||||
|
|
||||||
/***** Check if number of rows is correct *****/
|
/***** Check if number of rows is correct *****/
|
||||||
if (Question->Answer.NumOptions != 2)
|
if (Question->Answer.NumOptions != 2)
|
||||||
Lay_ShowErrorAndExit ("Wrong float range.");
|
Lay_WrongAnswerExit ();
|
||||||
|
|
||||||
/***** Get float range *****/
|
/***** Get float range *****/
|
||||||
for (NumOpt = 0;
|
for (NumOpt = 0;
|
||||||
|
@ -1257,10 +1257,10 @@ void TstPrn_GetIndexesFromStr (const char StrIndexesOneQst[Tst_MAX_BYTES_INDEXES
|
||||||
Par_GetNextStrUntilComma (&Ptr,StrOneIndex,Cns_MAX_DECIMAL_DIGITS_UINT);
|
Par_GetNextStrUntilComma (&Ptr,StrOneIndex,Cns_MAX_DECIMAL_DIGITS_UINT);
|
||||||
|
|
||||||
if (sscanf (StrOneIndex,"%u",&(Indexes[NumOpt])) != 1)
|
if (sscanf (StrOneIndex,"%u",&(Indexes[NumOpt])) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong index of answer.");
|
Lay_WrongAnswerIndexExit ();
|
||||||
|
|
||||||
if (Indexes[NumOpt] >= Tst_MAX_OPTIONS_PER_QUESTION)
|
if (Indexes[NumOpt] >= Tst_MAX_OPTIONS_PER_QUESTION)
|
||||||
Lay_ShowErrorAndExit ("Wrong index of answer.");
|
Lay_WrongAnswerIndexExit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Initialize remaining to 0 *****/
|
/***** Initialize remaining to 0 *****/
|
||||||
|
@ -1296,10 +1296,10 @@ void TstPrn_GetAnswersFromStr (const char StrAnswersOneQst[Tst_MAX_BYTES_ANSWERS
|
||||||
Par_GetNextStrUntilComma (&Ptr,StrOneAnswer,Cns_MAX_DECIMAL_DIGITS_UINT);
|
Par_GetNextStrUntilComma (&Ptr,StrOneAnswer,Cns_MAX_DECIMAL_DIGITS_UINT);
|
||||||
|
|
||||||
if (sscanf (StrOneAnswer,"%u",&AnsUsr) != 1)
|
if (sscanf (StrOneAnswer,"%u",&AnsUsr) != 1)
|
||||||
Lay_ShowErrorAndExit ("Bad user's answer.");
|
Lay_WrongAnswerExit ();
|
||||||
|
|
||||||
if (AnsUsr >= Tst_MAX_OPTIONS_PER_QUESTION)
|
if (AnsUsr >= Tst_MAX_OPTIONS_PER_QUESTION)
|
||||||
Lay_ShowErrorAndExit ("Bad user's answer.");
|
Lay_WrongAnswerExit ();
|
||||||
|
|
||||||
UsrAnswers[AnsUsr] = true;
|
UsrAnswers[AnsUsr] = true;
|
||||||
}
|
}
|
||||||
|
@ -1454,7 +1454,7 @@ static void TstPrn_WriteFltAnsPrint (struct UsrData *UsrDat,
|
||||||
|
|
||||||
/***** Check if number of rows is correct *****/
|
/***** Check if number of rows is correct *****/
|
||||||
if (Question->Answer.NumOptions != 2)
|
if (Question->Answer.NumOptions != 2)
|
||||||
Lay_ShowErrorAndExit ("Wrong float range.");
|
Lay_WrongAnswerExit ();
|
||||||
|
|
||||||
/***** Header with the title of each column *****/
|
/***** Header with the title of each column *****/
|
||||||
HTM_TABLE_BeginPadding (2);
|
HTM_TABLE_BeginPadding (2);
|
||||||
|
@ -2104,7 +2104,7 @@ static void TstPrn_ShowUsrPrints (struct UsrData *UsrDat)
|
||||||
|
|
||||||
/* Get print code (row[0]) */
|
/* Get print code (row[0]) */
|
||||||
if ((Print.PrnCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((Print.PrnCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of test exam.");
|
Lay_WrongTestExit ();
|
||||||
|
|
||||||
/* Get print data */
|
/* Get print data */
|
||||||
TstPrn_GetPrintDataByPrnCod (&Print);
|
TstPrn_GetPrintDataByPrnCod (&Print);
|
||||||
|
@ -2398,8 +2398,8 @@ void TstPrn_ShowOnePrint (void)
|
||||||
|
|
||||||
/***** Get the code of the test *****/
|
/***** Get the code of the test *****/
|
||||||
TstPrn_ResetPrint (&Print);
|
TstPrn_ResetPrint (&Print);
|
||||||
if ((Print.PrnCod = TstPrn_GetParamPrnCod ()) == -1L)
|
if ((Print.PrnCod = TstPrn_GetParamPrnCod ()) <= 0)
|
||||||
Lay_ShowErrorAndExit ("Code of test is missing.");
|
Lay_WrongTestExit ();
|
||||||
|
|
||||||
/***** Get test exam data *****/
|
/***** Get test exam data *****/
|
||||||
TstPrn_GetPrintDataByPrnCod (&Print);
|
TstPrn_GetPrintDataByPrnCod (&Print);
|
||||||
|
|
|
@ -344,7 +344,7 @@ void Tmt_ShowClassTimeTable (void)
|
||||||
Timetable.Type = Tmt_MY_TIMETABLE;
|
Timetable.Type = Tmt_MY_TIMETABLE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Lay_ShowErrorAndExit ("Wrong action.");
|
Lay_WrongActionExit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
Timetable.ContextualIcons.PutIconEditCrsTT = (Timetable.Type == Tmt_COURSE_TIMETABLE &&
|
Timetable.ContextualIcons.PutIconEditCrsTT = (Timetable.Type == Tmt_COURSE_TIMETABLE &&
|
||||||
|
|
16
swad_user.c
16
swad_user.c
|
@ -1145,7 +1145,7 @@ unsigned Usr_GetNumUsrsInCrssOfAUsr (long UsrCod,Rol_Role_t UsrRole,
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SubQueryRole[0] = '\0';
|
SubQueryRole[0] = '\0';
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
DB_Query ("can not create temporary table",
|
DB_Query ("can not create temporary table",
|
||||||
|
@ -2980,8 +2980,8 @@ void Usr_GetParamOtherUsrCodEncrypted (struct UsrData *UsrDat)
|
||||||
if (UsrDat->EnUsrCod[0]) // If parameter exists...
|
if (UsrDat->EnUsrCod[0]) // If parameter exists...
|
||||||
{
|
{
|
||||||
Usr_GetUsrCodFromEncryptedUsrCod (UsrDat);
|
Usr_GetUsrCodFromEncryptedUsrCod (UsrDat);
|
||||||
if (UsrDat->UsrCod < 0) // Check is user's code is valid
|
if (UsrDat->UsrCod <= 0) // Check is user's code is valid
|
||||||
Lay_ShowErrorAndExit ("Wrong user's code.");
|
Lay_WrongUserExit ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
UsrDat->UsrCod = -1L;
|
UsrDat->UsrCod = -1L;
|
||||||
|
@ -5087,7 +5087,7 @@ void Usr_SearchListUsrs (Rol_Role_t Role)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5656,7 +5656,7 @@ static void Usr_GetListUsrsFromQuery (char *Query,Rol_Role_t Role,Hie_Lvl_Level_
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6621,7 +6621,7 @@ static void Usr_PutCheckboxToSelectAllUsers (Rol_Role_t Role,
|
||||||
free (ParamName);
|
free (ParamName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
Sex = Usr_GetSexOfUsrsLst (Role);
|
Sex = Usr_GetSexOfUsrsLst (Role);
|
||||||
HTM_TxtColon (Gbl.Usrs.LstUsrs[Role].NumUsrs == 1 ? Txt_ROLES_SINGUL_Abc[Role][Sex] :
|
HTM_TxtColon (Gbl.Usrs.LstUsrs[Role].NumUsrs == 1 ? Txt_ROLES_SINGUL_Abc[Role][Sex] :
|
||||||
Txt_ROLES_PLURAL_Abc[Role][Sex]);
|
Txt_ROLES_PLURAL_Abc[Role][Sex]);
|
||||||
|
@ -6701,7 +6701,7 @@ static void Usr_PutCheckboxToSelectUser (Rol_Role_t Role,
|
||||||
free (ParamName);
|
free (ParamName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -9712,7 +9712,7 @@ static FigCch_FigureCached_t Usr_GetFigureNumUsrsInCrss (unsigned Roles)
|
||||||
1 << Rol_TCH: // Any user in courses
|
1 << Rol_TCH: // Any user in courses
|
||||||
return FigCch_NUM_USRS_IN_CRSS;
|
return FigCch_NUM_USRS_IN_CRSS;
|
||||||
default:
|
default:
|
||||||
Rol_WrongRoleExit ();
|
Lay_WrongRoleExit ();
|
||||||
return FigCch_UNKNOWN; // Not reached
|
return FigCch_UNKNOWN; // Not reached
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user