mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-08 01:35:32 +02:00
Version 16.167.5
This commit is contained in:
parent
59ae205953
commit
305244b153
|
@ -1649,9 +1649,9 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
||||||
/* ActRemHld */{ 716,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x180, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Hld_RemoveHoliday ,NULL},
|
/* ActRemHld */{ 716,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x180, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Hld_RemoveHoliday ,NULL},
|
||||||
/* ActChgHldPlc */{ 896,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x180, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Hld_ChangeHolidayPlace ,NULL},
|
/* ActChgHldPlc */{ 896,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x180, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Hld_ChangeHolidayPlace ,NULL},
|
||||||
/* ActChgHldTyp */{ 715,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x180, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Hld_ChangeHolidayType ,NULL},
|
/* ActChgHldTyp */{ 715,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x180, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Hld_ChangeHolidayType ,NULL},
|
||||||
/* ActChgHldStrDat */{ 717,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x180, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Hld_ChangeStartDate ,NULL},
|
/* ActChgHldStrDat */{ 717,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x180, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,Hld_ChangeStartDate1 ,Hld_ChangeDate2 ,NULL},
|
||||||
/* ActChgHldEndDat */{ 718,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x180, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Hld_ChangeEndDate ,NULL},
|
/* ActChgHldEndDat */{ 718,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x180, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,Hld_ChangeEndDate1 ,Hld_ChangeDate2 ,NULL},
|
||||||
/* ActRenHld */{ 766,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x180, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Hld_RenameHoliday ,NULL},
|
/* ActRenHld */{ 766,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x180, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,Hld_RenameHoliday1 ,Hld_RenameHoliday2 ,NULL},
|
||||||
|
|
||||||
/* ActPrnCalIns */{1629,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x1FF, 0, 0,Act_CONT_NORM,Act_BLNK_WINDOW,NULL ,Cal_PrintCalendar ,NULL},
|
/* ActPrnCalIns */{1629,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x1FF, 0, 0,Act_CONT_NORM,Act_BLNK_WINDOW,NULL ,Cal_PrintCalendar ,NULL},
|
||||||
/* ActChgCalIns1stDay*/{1630,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x1FF, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,Cal_ChangeFirstDayOfWeek ,Cal_DrawCalendarIns ,NULL},
|
/* ActChgCalIns1stDay*/{1630,-1,TabUnk,ActSeeCalIns , 0, 0, 0, 0,0x1FF, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,Cal_ChangeFirstDayOfWeek ,Cal_DrawCalendarIns ,NULL},
|
||||||
|
|
|
@ -209,13 +209,14 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 16.167.4 (2017-03-26)"
|
#define Log_PLATFORM_VERSION "SWAD 16.167.5 (2017-03-26)"
|
||||||
#define CSS_FILE "swad16.166.css"
|
#define CSS_FILE "swad16.166.css"
|
||||||
#define JS_FILE "swad16.144.js"
|
#define JS_FILE "swad16.144.js"
|
||||||
|
|
||||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
||||||
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
|
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
|
||||||
/*
|
/*
|
||||||
|
Version 16.167.5: Mar 26, 2017 Changes in edition of holidays. (? lines)
|
||||||
Version 16.167.4: Mar 26, 2017 Changes in edition of holidays. (217643 lines)
|
Version 16.167.4: Mar 26, 2017 Changes in edition of holidays. (217643 lines)
|
||||||
Version 16.167.3: Mar 25, 2017 Changes in edition of holidays. (217632 lines)
|
Version 16.167.3: Mar 25, 2017 Changes in edition of holidays. (217632 lines)
|
||||||
Version 16.167.2: Mar 25, 2017 Contextual link to holidays is changed to a left-top contextual icon. (217577 lines)
|
Version 16.167.2: Mar 25, 2017 Contextual link to holidays is changed to a left-top contextual icon. (217577 lines)
|
||||||
|
|
|
@ -121,6 +121,7 @@ void Gbl_InitializeGlobals (void)
|
||||||
Gbl.Form.Inside = false; // Set to true inside a form to avoid nested forms
|
Gbl.Form.Inside = false; // Set to true inside a form to avoid nested forms
|
||||||
|
|
||||||
Gbl.Error = false;
|
Gbl.Error = false;
|
||||||
|
Gbl.AlertType = Lay_SUCCESS; // Used to show alert in a posteriori function
|
||||||
|
|
||||||
Gbl.DB.DatabaseIsOpen = false;
|
Gbl.DB.DatabaseIsOpen = false;
|
||||||
Gbl.DB.LockedTables = false;
|
Gbl.DB.LockedTables = false;
|
||||||
|
|
|
@ -101,6 +101,7 @@ struct Globals
|
||||||
bool Inside; // Set to true inside a form to avoid nested forms
|
bool Inside; // Set to true inside a form to avoid nested forms
|
||||||
} Form;
|
} Form;
|
||||||
bool Error;
|
bool Error;
|
||||||
|
Lay_AlertType_t AlertType;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
|
|
@ -754,7 +754,7 @@ void Hld_ChangeHolidayType (void)
|
||||||
/*** Change the date of a holiday / the start date of a non school period ****/
|
/*** Change the date of a holiday / the start date of a non school period ****/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Hld_ChangeStartDate (void)
|
void Hld_ChangeStartDate1 (void)
|
||||||
{
|
{
|
||||||
Hld_ChangeDate (HLD_START_DATE);
|
Hld_ChangeDate (HLD_START_DATE);
|
||||||
}
|
}
|
||||||
|
@ -763,7 +763,7 @@ void Hld_ChangeStartDate (void)
|
||||||
/*************** Change the end date of a non school period ******************/
|
/*************** Change the end date of a non school period ******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Hld_ChangeEndDate (void)
|
void Hld_ChangeEndDate1 (void)
|
||||||
{
|
{
|
||||||
Hld_ChangeDate (HLD_END_DATE);
|
Hld_ChangeDate (HLD_END_DATE);
|
||||||
}
|
}
|
||||||
|
@ -832,16 +832,26 @@ static void Hld_ChangeDate (Hld_StartOrEndDate_t StartOrEndDate)
|
||||||
NewDate.Day,
|
NewDate.Day,
|
||||||
Hld->HldCod);
|
Hld->HldCod);
|
||||||
DB_QueryUPDATE (Query,"can not update the date of a holiday");
|
DB_QueryUPDATE (Query,"can not update the date of a holiday");
|
||||||
|
Dat_AssignDate (PtrDate,&NewDate);
|
||||||
|
|
||||||
/***** Write message to show the change made *****/
|
/***** Write message to show the change made *****/
|
||||||
|
Gbl.AlertType = Lay_SUCCESS;
|
||||||
sprintf (StrDate,"%04u-%02u-%02u",
|
sprintf (StrDate,"%04u-%02u-%02u",
|
||||||
NewDate.Year,NewDate.Month,NewDate.Day); // Change format depending on location
|
NewDate.Year,NewDate.Month,NewDate.Day); // Change format depending on location
|
||||||
sprintf (Gbl.Message,Txt_The_date_of_the_holiday_X_has_changed_to_Y,
|
sprintf (Gbl.Message,Txt_The_date_of_the_holiday_X_has_changed_to_Y,
|
||||||
Hld->Name,StrDate);
|
Hld->Name,StrDate);
|
||||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*********** Show message and form after changing a holiday date *************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Hld_ChangeDate2 (void)
|
||||||
|
{
|
||||||
|
/***** Show success message *****/
|
||||||
|
Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
|
||||||
|
|
||||||
/***** Show the form again *****/
|
/***** Show the form again *****/
|
||||||
Dat_AssignDate (PtrDate,&NewDate);
|
|
||||||
Hld_EditHolidays ();
|
Hld_EditHolidays ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -849,7 +859,7 @@ static void Hld_ChangeDate (Hld_StartOrEndDate_t StartOrEndDate)
|
||||||
/************************ Change the name of a degree ************************/
|
/************************ Change the name of a degree ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Hld_RenameHoliday (void)
|
void Hld_RenameHoliday1 (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_You_can_not_leave_the_name_of_the_holiday_X_empty;
|
extern const char *Txt_You_can_not_leave_the_name_of_the_holiday_X_empty;
|
||||||
extern const char *Txt_The_name_of_the_holiday_X_has_changed_to_Y;
|
extern const char *Txt_The_name_of_the_holiday_X_has_changed_to_Y;
|
||||||
|
@ -874,9 +884,9 @@ void Hld_RenameHoliday (void)
|
||||||
/***** Check if new name is empty *****/
|
/***** Check if new name is empty *****/
|
||||||
if (!NewHldName[0])
|
if (!NewHldName[0])
|
||||||
{
|
{
|
||||||
|
Gbl.AlertType = Lay_WARNING;
|
||||||
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_holiday_X_empty,
|
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_holiday_X_empty,
|
||||||
Hld->Name);
|
Hld->Name);
|
||||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -888,23 +898,29 @@ void Hld_RenameHoliday (void)
|
||||||
sprintf (Query,"UPDATE holidays SET Name='%s' WHERE HldCod=%ld",
|
sprintf (Query,"UPDATE holidays SET Name='%s' WHERE HldCod=%ld",
|
||||||
NewHldName,Hld->HldCod);
|
NewHldName,Hld->HldCod);
|
||||||
DB_QueryUPDATE (Query,"can not update the text of a holiday");
|
DB_QueryUPDATE (Query,"can not update the text of a holiday");
|
||||||
|
Str_Copy (Hld->Name,NewHldName,
|
||||||
|
Hld_MAX_BYTES_HOLIDAY_NAME);
|
||||||
|
|
||||||
/***** Write message to show the change made *****/
|
/***** Write message to show the change made *****/
|
||||||
|
Gbl.AlertType = Lay_SUCCESS;
|
||||||
sprintf (Gbl.Message,Txt_The_name_of_the_holiday_X_has_changed_to_Y,
|
sprintf (Gbl.Message,Txt_The_name_of_the_holiday_X_has_changed_to_Y,
|
||||||
Hld->Name,NewHldName);
|
Hld->Name,NewHldName);
|
||||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
|
||||||
}
|
}
|
||||||
else // The same name
|
else // The same name
|
||||||
{
|
{
|
||||||
|
Gbl.AlertType = Lay_INFO;
|
||||||
sprintf (Gbl.Message,Txt_The_name_of_the_holiday_X_has_not_changed,
|
sprintf (Gbl.Message,Txt_The_name_of_the_holiday_X_has_not_changed,
|
||||||
Hld->Name);
|
Hld->Name);
|
||||||
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Hld_RenameHoliday2 (void)
|
||||||
|
{
|
||||||
|
/***** Write error/success message *****/
|
||||||
|
Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
|
||||||
|
|
||||||
/***** Show the form again *****/
|
/***** Show the form again *****/
|
||||||
Str_Copy (Hld->Name,NewHldName,
|
|
||||||
Hld_MAX_BYTES_HOLIDAY_NAME);
|
|
||||||
Hld_EditHolidays ();
|
Hld_EditHolidays ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1123,12 +1139,13 @@ void Hld_RecFormNewHoliday1 (void)
|
||||||
Hld_CreateHoliday (Hld);
|
Hld_CreateHoliday (Hld);
|
||||||
|
|
||||||
/* Success message */
|
/* Success message */
|
||||||
|
Gbl.AlertType = Lay_SUCCESS;
|
||||||
sprintf (Gbl.Message,Txt_Created_new_holiday_X,Hld->Name);
|
sprintf (Gbl.Message,Txt_Created_new_holiday_X,Hld->Name);
|
||||||
}
|
}
|
||||||
else // If there is not a holiday name
|
else // If there is not a holiday name
|
||||||
{
|
{
|
||||||
/* Error message */
|
/* Error message */
|
||||||
Gbl.Error = true;
|
Gbl.AlertType = Lay_WARNING;
|
||||||
sprintf (Gbl.Message,"%s",Txt_You_must_specify_the_name_of_the_new_holiday);
|
sprintf (Gbl.Message,"%s",Txt_You_must_specify_the_name_of_the_new_holiday);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1136,9 +1153,7 @@ void Hld_RecFormNewHoliday1 (void)
|
||||||
void Hld_RecFormNewHoliday2 (void)
|
void Hld_RecFormNewHoliday2 (void)
|
||||||
{
|
{
|
||||||
/***** Write error/success message *****/
|
/***** Write error/success message *****/
|
||||||
Lay_ShowAlert (Gbl.Error ? Lay_WARNING :
|
Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
|
||||||
Lay_SUCCESS,
|
|
||||||
Gbl.Message);
|
|
||||||
|
|
||||||
/***** Show the form again *****/
|
/***** Show the form again *****/
|
||||||
Hld_EditHolidays ();
|
Hld_EditHolidays ();
|
||||||
|
|
|
@ -83,9 +83,14 @@ long Hld_GetParamHldCod (void);
|
||||||
void Hld_RemoveHoliday (void);
|
void Hld_RemoveHoliday (void);
|
||||||
void Hld_ChangeHolidayPlace (void);
|
void Hld_ChangeHolidayPlace (void);
|
||||||
void Hld_ChangeHolidayType (void);
|
void Hld_ChangeHolidayType (void);
|
||||||
void Hld_ChangeStartDate (void);
|
|
||||||
void Hld_ChangeEndDate (void);
|
void Hld_ChangeStartDate1 (void);
|
||||||
void Hld_RenameHoliday (void);
|
void Hld_ChangeEndDate1 (void);
|
||||||
|
void Hld_ChangeDate2 (void);
|
||||||
|
|
||||||
|
void Hld_RenameHoliday1 (void);
|
||||||
|
void Hld_RenameHoliday2 (void);
|
||||||
|
|
||||||
void Hld_RecFormNewHoliday1 (void);
|
void Hld_RecFormNewHoliday1 (void);
|
||||||
void Hld_RecFormNewHoliday2 (void);
|
void Hld_RecFormNewHoliday2 (void);
|
||||||
|
|
||||||
|
|
|
@ -1570,7 +1570,7 @@ void Lay_ShowErrorAndExit (const char *Message)
|
||||||
/******************** Show an alert message to the user **********************/
|
/******************** Show an alert message to the user **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Lay_ShowAlert (Lay_AlertType_t MsgType,const char *Message)
|
void Lay_ShowAlert (Lay_AlertType_t AlertType,const char *Message)
|
||||||
{
|
{
|
||||||
static const char *MsgIcons[Lay_NUM_ALERT_TYPES] =
|
static const char *MsgIcons[Lay_NUM_ALERT_TYPES] =
|
||||||
{
|
{
|
||||||
|
@ -1592,7 +1592,7 @@ void Lay_ShowAlert (Lay_AlertType_t MsgType,const char *Message)
|
||||||
"%s"
|
"%s"
|
||||||
"</div>"
|
"</div>"
|
||||||
"</div>",
|
"</div>",
|
||||||
Gbl.Prefs.IconsURL,MsgIcons[MsgType],
|
Gbl.Prefs.IconsURL,MsgIcons[AlertType],
|
||||||
Message);
|
Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ void Lay_EndRoundFrameWithButton (Lay_Button_t Button,const char *TxtButton);
|
||||||
void Lay_EndRoundFrame (void);
|
void Lay_EndRoundFrame (void);
|
||||||
|
|
||||||
void Lay_ShowErrorAndExit (const char *Message);
|
void Lay_ShowErrorAndExit (const char *Message);
|
||||||
void Lay_ShowAlert (Lay_AlertType_t MsgType,const char *Message);
|
void Lay_ShowAlert (Lay_AlertType_t AlertType,const char *Message);
|
||||||
|
|
||||||
void Lay_RefreshNotifsAndConnected (void);
|
void Lay_RefreshNotifsAndConnected (void);
|
||||||
void Lay_RefreshLastClicks (void);
|
void Lay_RefreshLastClicks (void);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user