mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-10 10:45:23 +02:00
Version19.134.1
This commit is contained in:
parent
2156852d42
commit
6b437f020d
|
@ -398,16 +398,16 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
[ActChgCrsYeaCfg ] = {1573,-1,TabUnk,ActSeeCrsInf ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,CrsCfg_ChangeCrsYear ,CrsCfg_ContEditAfterChgCrs ,NULL},
|
||||
[ActEdiCrsInf ] = { 848,-1,TabUnk,ActSeeCrsInf ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Inf_FormsToSelSendInfo ,NULL},
|
||||
|
||||
[ActFrmNewPrgIte ] = {1822,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_RequestCreatOrEditPrgItem ,NULL},
|
||||
[ActEdiOnePrgIte ] = {1823,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_RequestCreatOrEditPrgItem ,NULL},
|
||||
[ActNewPrgIte ] = {1825,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_RecFormPrgItem ,NULL},
|
||||
[ActChgPrgIte ] = {1826,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_RecFormPrgItem ,NULL},
|
||||
[ActReqRemPrgIte ] = {1827,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_ReqRemPrgItem ,NULL},
|
||||
[ActRemPrgIte ] = {1828,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_RemovePrgItem ,NULL},
|
||||
[ActHidPrgIte ] = {1829,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_HidePrgItem ,NULL},
|
||||
[ActShoPrgIte ] = {1830,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_ShowPrgItem ,NULL},
|
||||
[ActUp_PrgIte ] = {1831,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_MoveUpPrgItem ,NULL},
|
||||
[ActDwnPrgIte ] = {1832,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_MoveDownPrgItem ,NULL},
|
||||
[ActFrmNewPrgItm ] = {1822,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_RequestCreatOrEditPrgItem ,NULL},
|
||||
[ActEdiOnePrgItm ] = {1823,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_RequestCreatOrEditPrgItem ,NULL},
|
||||
[ActNewPrgItm ] = {1825,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_RecFormPrgItem ,NULL},
|
||||
[ActChgPrgItm ] = {1826,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_RecFormPrgItem ,NULL},
|
||||
[ActReqRemPrgItm ] = {1827,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_ReqRemPrgItem ,NULL},
|
||||
[ActRemPrgItm ] = {1828,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_RemovePrgItem ,NULL},
|
||||
[ActHidPrgItm ] = {1829,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_HidePrgItem ,NULL},
|
||||
[ActShoPrgItm ] = {1830,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_ShowPrgItem ,NULL},
|
||||
[ActUp_PrgItm ] = {1831,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_MoveUpPrgItem ,NULL},
|
||||
[ActDwnPrgItm ] = {1832,-1,TabUnk,ActSeePrg ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_MoveDownPrgItem ,NULL},
|
||||
|
||||
[ActEdiTchGui ] = { 785,-1,TabUnk,ActSeeTchGui ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Inf_FormsToSelSendInfo ,NULL},
|
||||
|
||||
|
@ -3549,17 +3549,17 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
|
|||
ActPrnSysInf, // #1819
|
||||
ActMtn, // #1820
|
||||
ActSeePrg, // #1821
|
||||
ActFrmNewPrgIte, // #1822
|
||||
ActEdiOnePrgIte, // #1823
|
||||
ActFrmNewPrgItm, // #1822
|
||||
ActEdiOnePrgItm, // #1823
|
||||
-1, // #1824
|
||||
ActNewPrgIte, // #1825
|
||||
ActChgPrgIte, // #1826
|
||||
ActReqRemPrgIte, // #1827
|
||||
ActRemPrgIte, // #1828
|
||||
ActHidPrgIte, // #1829
|
||||
ActShoPrgIte, // #1830
|
||||
ActUp_PrgIte, // #1832
|
||||
ActDwnPrgIte, // #1833
|
||||
ActNewPrgItm, // #1825
|
||||
ActChgPrgItm, // #1826
|
||||
ActReqRemPrgItm, // #1827
|
||||
ActRemPrgItm, // #1828
|
||||
ActHidPrgItm, // #1829
|
||||
ActShoPrgItm, // #1830
|
||||
ActUp_PrgItm, // #1832
|
||||
ActDwnPrgItm, // #1833
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -384,16 +384,16 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to
|
|||
#define ActChgInsCrsCodCfg (ActChgCrsSta + 13)
|
||||
#define ActChgCrsYeaCfg (ActChgCrsSta + 14)
|
||||
#define ActEdiCrsInf (ActChgCrsSta + 15)
|
||||
#define ActFrmNewPrgIte (ActChgCrsSta + 16)
|
||||
#define ActEdiOnePrgIte (ActChgCrsSta + 17)
|
||||
#define ActNewPrgIte (ActChgCrsSta + 18)
|
||||
#define ActChgPrgIte (ActChgCrsSta + 19)
|
||||
#define ActReqRemPrgIte (ActChgCrsSta + 20)
|
||||
#define ActRemPrgIte (ActChgCrsSta + 21)
|
||||
#define ActHidPrgIte (ActChgCrsSta + 22)
|
||||
#define ActShoPrgIte (ActChgCrsSta + 23)
|
||||
#define ActUp_PrgIte (ActChgCrsSta + 24)
|
||||
#define ActDwnPrgIte (ActChgCrsSta + 25)
|
||||
#define ActFrmNewPrgItm (ActChgCrsSta + 16)
|
||||
#define ActEdiOnePrgItm (ActChgCrsSta + 17)
|
||||
#define ActNewPrgItm (ActChgCrsSta + 18)
|
||||
#define ActChgPrgItm (ActChgCrsSta + 19)
|
||||
#define ActReqRemPrgItm (ActChgCrsSta + 20)
|
||||
#define ActRemPrgItm (ActChgCrsSta + 21)
|
||||
#define ActHidPrgItm (ActChgCrsSta + 22)
|
||||
#define ActShoPrgItm (ActChgCrsSta + 23)
|
||||
#define ActUp_PrgItm (ActChgCrsSta + 24)
|
||||
#define ActDwnPrgItm (ActChgCrsSta + 25)
|
||||
#define ActEdiTchGui (ActChgCrsSta + 26)
|
||||
#define ActSeeSylLec (ActChgCrsSta + 27)
|
||||
#define ActSeeSylPra (ActChgCrsSta + 28)
|
||||
|
|
|
@ -1453,6 +1453,11 @@ void Agd_RequestCreatOrEditEvent (void)
|
|||
struct AgendaEvent AgdEvent;
|
||||
bool ItsANewEvent;
|
||||
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
||||
static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] =
|
||||
{
|
||||
Dat_HMS_TO_000000,
|
||||
Dat_HMS_TO_235959
|
||||
};
|
||||
|
||||
/***** Get parameters *****/
|
||||
Agd_GetParams (Agd_MY_AGENDA);
|
||||
|
@ -1534,7 +1539,8 @@ void Agd_RequestCreatOrEditEvent (void)
|
|||
|
||||
/***** Start and end dates *****/
|
||||
Dat_PutFormStartEndClientLocalDateTimes (AgdEvent.TimeUTC,
|
||||
Dat_FORM_SECONDS_OFF);
|
||||
Dat_FORM_SECONDS_OFF,
|
||||
SetHMS);
|
||||
|
||||
/***** Text *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
|
|
@ -1106,6 +1106,11 @@ void Asg_RequestCreatOrEditAsg (void)
|
|||
struct Assignment Asg;
|
||||
bool ItsANewAssignment;
|
||||
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
||||
static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] =
|
||||
{
|
||||
Dat_HMS_TO_000000,
|
||||
Dat_HMS_TO_235959
|
||||
};
|
||||
|
||||
/***** Get parameters *****/
|
||||
Asg_GetParamAsgOrder ();
|
||||
|
@ -1178,7 +1183,9 @@ void Asg_RequestCreatOrEditAsg (void)
|
|||
HTM_TR_End ();
|
||||
|
||||
/***** Assignment start and end dates *****/
|
||||
Dat_PutFormStartEndClientLocalDateTimes (Asg.TimeUTC,Dat_FORM_SECONDS_ON);
|
||||
Dat_PutFormStartEndClientLocalDateTimes (Asg.TimeUTC,
|
||||
Dat_FORM_SECONDS_ON,
|
||||
SetHMS);
|
||||
|
||||
/***** Send work? *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
|
|
@ -1013,6 +1013,11 @@ void Att_RequestCreatOrEditAttEvent (void)
|
|||
struct AttendanceEvent Att;
|
||||
bool ItsANewAttEvent;
|
||||
char Description[Cns_MAX_BYTES_TEXT + 1];
|
||||
static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] =
|
||||
{
|
||||
Dat_HMS_DO_NOT_SET,
|
||||
Dat_HMS_DO_NOT_SET
|
||||
};
|
||||
|
||||
/***** Get parameters *****/
|
||||
Att_GetParamAttOrder ();
|
||||
|
@ -1085,7 +1090,9 @@ void Att_RequestCreatOrEditAttEvent (void)
|
|||
HTM_TR_End ();
|
||||
|
||||
/***** Assignment start and end dates *****/
|
||||
Dat_PutFormStartEndClientLocalDateTimes (Att.TimeUTC,Dat_FORM_SECONDS_ON);
|
||||
Dat_PutFormStartEndClientLocalDateTimes (Att.TimeUTC,
|
||||
Dat_FORM_SECONDS_ON,
|
||||
SetHMS);
|
||||
|
||||
/***** Visibility of comments *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
|
|
@ -497,7 +497,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
|||
En OpenSWAD:
|
||||
ps2pdf source.ps destination.pdf
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 19.134 (2020-02-26)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 19.134.1 (2020-02-26)"
|
||||
#define CSS_FILE "swad19.133.1.css"
|
||||
#define JS_FILE "swad19.91.1.js"
|
||||
/*
|
||||
|
@ -522,13 +522,13 @@ Param
|
|||
// TODO: En la lista de conectados central, poner el logo de la institución a la que pertenece el usuario
|
||||
// TODO: Miguel Damas: por defecto, marcar "Permitir que los profesores..." en los test (que ya esté marcado en lugar de desmarcado)
|
||||
// TODO: Si el alumno ha marcado "Permitir que los profesores...", entonces pedir confirmación al pulsar el botón azul, para evitar que se envíe por error antes de tiempo
|
||||
// TODO: Order program items on indexes
|
||||
|
||||
Version 19.134.1: Feb 26, 2020 Order course program items by indexes. (282022 lines)
|
||||
Version 19.134: Feb 26, 2020 Move up and down a course program item. Not finished. (281991 lines)
|
||||
5 changes necessary in database:
|
||||
ALTER TABLE prg_items CHANGE COLUMN PrgIteCod ItmCod INT NOT NULL AUTO_INCREMENT;
|
||||
ALTER TABLE prg_items CHANGE COLUMN PrgItmCod ItmCod INT NOT NULL AUTO_INCREMENT;
|
||||
ALTER TABLE prg_items ADD COLUMN ItmInd INT NOT NULL DEFAULT 0 AFTER ItmCod;
|
||||
ALTER TABLE prg_grp CHANGE COLUMN PrgIteCod ItmCod INT NOT NULL;
|
||||
ALTER TABLE prg_grp CHANGE COLUMN PrgItmCod ItmCod INT NOT NULL;
|
||||
Only if you use MyISAM:
|
||||
ALTER TABLE prg_items ENGINE=MyISAM;
|
||||
ALTER TABLE prg_grp ENGINE=MyISAM;
|
||||
|
@ -544,8 +544,8 @@ ALTER TABLE prg_grp ENGINE=MyISAM;
|
|||
Version 19.130.1: Feb 24, 2020 Fixed bugs related to database. (281259 lines)
|
||||
Version 19.130: Feb 20, 2020 New module swad_program. (281273 lines)
|
||||
2 changes necessary in database:
|
||||
CREATE TABLE IF NOT EXISTS prg_grp (PrgIteCod INT NOT NULL,GrpCod INT NOT NULL,UNIQUE INDEX(PrgIteCod,GrpCod));
|
||||
CREATE TABLE IF NOT EXISTS prg_items (PrgIteCod INT NOT NULL AUTO_INCREMENT,CrsCod INT NOT NULL DEFAULT -1,Hidden ENUM('N','Y') NOT NULL DEFAULT 'N',UsrCod INT NOT NULL,StartTime DATETIME NOT NULL,EndTime DATETIME NOT NULL,Title VARCHAR(2047) NOT NULL,Txt TEXT NOT NULL,UNIQUE INDEX(PrgIteCod),INDEX(CrsCod,Hidden));
|
||||
CREATE TABLE IF NOT EXISTS prg_grp (PrgItmCod INT NOT NULL,GrpCod INT NOT NULL,UNIQUE INDEX(PrgItmCod,GrpCod));
|
||||
CREATE TABLE IF NOT EXISTS prg_items (PrgItmCod INT NOT NULL AUTO_INCREMENT,CrsCod INT NOT NULL DEFAULT -1,Hidden ENUM('N','Y') NOT NULL DEFAULT 'N',UsrCod INT NOT NULL,StartTime DATETIME NOT NULL,EndTime DATETIME NOT NULL,Title VARCHAR(2047) NOT NULL,Txt TEXT NOT NULL,UNIQUE INDEX(PrgItmCod),INDEX(CrsCod,Hidden));
|
||||
|
||||
Version 19.129: Feb 20, 2020 New option for schedule in course. (279240 lines)
|
||||
Copy the following icons to icon public directory:
|
||||
|
|
25
swad_date.c
25
swad_date.c
|
@ -422,7 +422,7 @@ void Dat_ConvDateToDateStr (struct Date *Date,char StrDate[Cns_MAX_BYTES_DATE +
|
|||
/*************** Show forms to enter initial and ending dates ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (bool SetHMS000000To235959)
|
||||
void Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME])
|
||||
{
|
||||
extern const char *Txt_START_END_TIME[Dat_NUM_START_END_TIME];
|
||||
extern const char *Txt_Yesterday;
|
||||
|
@ -432,7 +432,7 @@ void Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (bool SetHMS00000
|
|||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RM",NULL,Txt_START_END_TIME[Dat_START_TIME]);
|
||||
Frm_LabelColumn ("RM","",Txt_START_END_TIME[Dat_START_TIME]);
|
||||
|
||||
/* Data (date-time) */
|
||||
HTM_TD_Begin ("class=\"LM\"");
|
||||
|
@ -442,9 +442,8 @@ void Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (bool SetHMS00000
|
|||
Cfg_LOG_START_YEAR,
|
||||
Gbl.Now.Date.Year,
|
||||
Dat_FORM_SECONDS_ON,
|
||||
SetHMS000000To235959 ? Dat_HMS_TO_000000 : // Set hour, minute and second to 00:00:00
|
||||
Dat_HMS_DO_NOT_SET, // Don't set hour, minute and second to 00:00:00
|
||||
false); // Don't submit on change
|
||||
SetHMS[Dat_START_TIME],
|
||||
false); // Don't submit on change
|
||||
|
||||
/* "Yesterday" and "Today" buttons */
|
||||
HTM_NBSP ();
|
||||
|
@ -460,7 +459,7 @@ void Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (bool SetHMS00000
|
|||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RM",NULL,Txt_START_END_TIME[Dat_END_TIME]);
|
||||
Frm_LabelColumn ("RM","",Txt_START_END_TIME[Dat_END_TIME]);
|
||||
|
||||
/* Data (date-time) */
|
||||
HTM_TD_Begin ("class=\"LM\"");
|
||||
|
@ -470,9 +469,8 @@ void Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (bool SetHMS00000
|
|||
Cfg_LOG_START_YEAR,
|
||||
Gbl.Now.Date.Year,
|
||||
Dat_FORM_SECONDS_ON,
|
||||
SetHMS000000To235959 ? Dat_HMS_TO_235959 : // Set hour, minute and second to 23:59:59
|
||||
Dat_HMS_DO_NOT_SET, // Don't set hour, minute and second
|
||||
false); // Don't submit on change
|
||||
SetHMS[Dat_END_TIME],
|
||||
false); // Don't submit on change
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
@ -483,7 +481,8 @@ void Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (bool SetHMS00000
|
|||
/*****************************************************************************/
|
||||
|
||||
void Dat_PutFormStartEndClientLocalDateTimes (time_t TimeUTC[2],
|
||||
Dat_FormSeconds FormSeconds)
|
||||
Dat_FormSeconds FormSeconds,
|
||||
const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME])
|
||||
{
|
||||
extern const char *Txt_START_END_TIME[Dat_NUM_START_END_TIME];
|
||||
Dat_StartEndTime_t StartEndTime;
|
||||
|
@ -501,7 +500,7 @@ void Dat_PutFormStartEndClientLocalDateTimes (time_t TimeUTC[2],
|
|||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RM",NULL,Txt_START_END_TIME[StartEndTime]);
|
||||
Frm_LabelColumn ("RM","",Txt_START_END_TIME[StartEndTime]);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LM\"");
|
||||
|
@ -511,8 +510,8 @@ void Dat_PutFormStartEndClientLocalDateTimes (time_t TimeUTC[2],
|
|||
Cfg_LOG_START_YEAR,
|
||||
Gbl.Now.Date.Year + 1,
|
||||
FormSeconds,
|
||||
Dat_HMS_DO_NOT_SET, // Don't set hour, minute and second
|
||||
false); // Don't submit on change
|
||||
SetHMS[StartEndTime], // Set hour, minute and second?
|
||||
false); // Don't submit on change
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
|
|
@ -143,9 +143,10 @@ void Dat_ShowClientLocalTime (void);
|
|||
struct tm *Dat_GetLocalTimeFromClock (const time_t *timep);
|
||||
void Dat_ConvDateToDateStr (struct Date *Date,char StrDate[Cns_MAX_BYTES_DATE + 1]);
|
||||
|
||||
void Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (bool SetHMS000000To235959);
|
||||
void Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME]);
|
||||
void Dat_PutFormStartEndClientLocalDateTimes (time_t TimeUTC[2],
|
||||
Dat_FormSeconds FormSeconds);
|
||||
Dat_FormSeconds FormSeconds,
|
||||
const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME]);
|
||||
|
||||
void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
||||
const char *ParamName,
|
||||
|
|
|
@ -300,7 +300,6 @@ void Gbl_InitializeGlobals (void)
|
|||
Gbl.Prg.LstIsRead = false; // List is not read
|
||||
Gbl.Prg.Num = 0;
|
||||
Gbl.Prg.LstItmCods = NULL;
|
||||
Gbl.Prg.SelectedOrder = Prg_ORDER_DEFAULT;
|
||||
|
||||
Gbl.Asgs.LstIsRead = false; // List is not read
|
||||
Gbl.Asgs.Num = 0;
|
||||
|
|
|
@ -543,8 +543,6 @@ struct Globals
|
|||
bool LstIsRead; // Is the list already read from database, or it needs to be read?
|
||||
unsigned Num; // Number of items
|
||||
long *LstItmCods; // List of items codes
|
||||
Dat_StartEndTime_t SelectedOrder;
|
||||
// long ItmCodToEdit; // Used as parameter in contextual links
|
||||
unsigned CurrentPage;
|
||||
} Prg;
|
||||
struct
|
||||
|
|
|
@ -170,7 +170,6 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
|
|||
case Pag_COURSE_PROGRAM:
|
||||
Frm_StartFormAnchor (ActSeePrg,Pagination->Anchor);
|
||||
Pag_PutHiddenParamPagNum (WhatPaginate,1);
|
||||
Prg_PutHiddenParamPrgOrder ();
|
||||
Grp_PutParamWhichGrps ();
|
||||
break;
|
||||
case Pag_ASSIGNMENTS:
|
||||
|
@ -290,7 +289,6 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
|
|||
case Pag_COURSE_PROGRAM:
|
||||
Frm_StartFormAnchor (ActSeePrg,Pagination->Anchor);
|
||||
Pag_PutHiddenParamPagNum (WhatPaginate,1);
|
||||
Prg_PutHiddenParamPrgOrder ();
|
||||
Grp_PutParamWhichGrps ();
|
||||
break;
|
||||
case Pag_ASSIGNMENTS:
|
||||
|
@ -396,7 +394,6 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
|
|||
case Pag_COURSE_PROGRAM:
|
||||
Frm_StartFormAnchor (ActSeePrg,Pagination->Anchor);
|
||||
Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->LeftPage);
|
||||
Prg_PutHiddenParamPrgOrder ();
|
||||
Grp_PutParamWhichGrps ();
|
||||
break;
|
||||
case Pag_ASSIGNMENTS:
|
||||
|
@ -514,7 +511,6 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
|
|||
case Pag_COURSE_PROGRAM:
|
||||
Frm_StartFormAnchor (ActSeePrg,Pagination->Anchor);
|
||||
Pag_PutHiddenParamPagNum (WhatPaginate,NumPage);
|
||||
Prg_PutHiddenParamPrgOrder ();
|
||||
Grp_PutParamWhichGrps ();
|
||||
break;
|
||||
case Pag_ASSIGNMENTS:
|
||||
|
@ -619,7 +615,6 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
|
|||
case Pag_COURSE_PROGRAM:
|
||||
Frm_StartFormAnchor (ActSeePrg,Pagination->Anchor);
|
||||
Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->RightPage);
|
||||
Prg_PutHiddenParamPrgOrder ();
|
||||
Grp_PutParamWhichGrps ();
|
||||
break;
|
||||
case Pag_ASSIGNMENTS:
|
||||
|
@ -725,7 +720,6 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate,
|
|||
case Pag_COURSE_PROGRAM:
|
||||
Frm_StartFormAnchor (ActSeePrg,Pagination->Anchor);
|
||||
Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->NumPags);
|
||||
Prg_PutHiddenParamPrgOrder ();
|
||||
Grp_PutParamWhichGrps ();
|
||||
break;
|
||||
case Pag_ASSIGNMENTS:
|
||||
|
|
188
swad_program.c
188
swad_program.c
|
@ -73,7 +73,7 @@ unsigned Prg_CurrentItmInd; // Used as parameter in contextual links
|
|||
/*****************************************************************************/
|
||||
|
||||
static void Prg_ShowAllItems (void);
|
||||
static void Prg_PutHeadForSeeing (bool PrintView);
|
||||
static void Prg_PutHeadForSeeing (void);
|
||||
static bool Prg_CheckIfICanCreateItems (void);
|
||||
static void Prg_PutIconsListItems (void);
|
||||
static void Prg_PutIconToCreateNewItem (void);
|
||||
|
@ -83,7 +83,6 @@ static void Prg_ShowOneItem (long ItmCod,
|
|||
unsigned ItmInd,unsigned MaxItmInd,
|
||||
bool PrintView);
|
||||
static void Prg_WritePrgItemAuthor (struct ProgramItem *Item);
|
||||
static void Prg_GetParamPrgOrder (void);
|
||||
|
||||
static void Prg_PutFormsToRemEditOnePrgItem (const struct ProgramItem *Item,
|
||||
unsigned ItmInd,unsigned MaxItmInd,
|
||||
|
@ -128,7 +127,6 @@ static bool Prg_CheckIfIBelongToCrsOrGrpsThisItem (long ItmCod);
|
|||
void Prg_SeeCourseProgram (void)
|
||||
{
|
||||
/***** Get parameters *****/
|
||||
Prg_GetParamPrgOrder ();
|
||||
Grp_GetParamWhichGrps ();
|
||||
Gbl.Prg.CurrentPage = Pag_GetParamPagNum (Pag_COURSE_PROGRAM);
|
||||
|
||||
|
@ -178,15 +176,15 @@ static void Prg_ShowAllItems (void)
|
|||
{
|
||||
/***** Table head *****/
|
||||
HTM_TABLE_BeginWideMarginPadding (2);
|
||||
Prg_PutHeadForSeeing (false); // Not print view
|
||||
Prg_PutHeadForSeeing ();
|
||||
|
||||
/***** Write all the program items *****/
|
||||
for (NumItem = Pagination.FirstItemVisible;
|
||||
NumItem <= Pagination.LastItemVisible;
|
||||
NumItem++)
|
||||
Prg_ShowOneItem (Gbl.Prg.LstItmCods[NumItem - 1],
|
||||
NumItem,Gbl.Prg.Num,
|
||||
false); // Not print view
|
||||
NumItem,Gbl.Prg.Num,
|
||||
false); // Not print view
|
||||
|
||||
/***** End table *****/
|
||||
HTM_TABLE_End ();
|
||||
|
@ -214,44 +212,17 @@ static void Prg_ShowAllItems (void)
|
|||
/***************** Write header with fields of a program item ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Prg_PutHeadForSeeing (bool PrintView)
|
||||
static void Prg_PutHeadForSeeing (void)
|
||||
{
|
||||
extern const char *Txt_START_END_TIME_HELP[Dat_NUM_START_END_TIME];
|
||||
extern const char *Txt_START_END_TIME[Dat_NUM_START_END_TIME];
|
||||
extern const char *Txt_Item;
|
||||
Dat_StartEndTime_t Order;
|
||||
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
HTM_TH (1,1,"CONTEXT_COL",NULL); // Column for contextual icons
|
||||
HTM_TH (1,1,"LM",Txt_Item);
|
||||
for (Order = Dat_START_TIME;
|
||||
Order <= Dat_END_TIME;
|
||||
Order++)
|
||||
{
|
||||
HTM_TH_Begin (1,1,"LM");
|
||||
|
||||
if (!PrintView)
|
||||
{
|
||||
Frm_StartForm (ActSeePrg);
|
||||
Grp_PutParamWhichGrps ();
|
||||
Pag_PutHiddenParamPagNum (Pag_COURSE_PROGRAM,Gbl.Prg.CurrentPage);
|
||||
Par_PutHiddenParamUnsigned (NULL,"Order",(unsigned) Order);
|
||||
HTM_BUTTON_SUBMIT_Begin (Txt_START_END_TIME_HELP[Order],"BT_LINK TIT_TBL",NULL);
|
||||
if (Order == Gbl.Prg.SelectedOrder)
|
||||
HTM_U_Begin ();
|
||||
}
|
||||
HTM_Txt (Txt_START_END_TIME[Order]);
|
||||
if (!PrintView)
|
||||
{
|
||||
if (Order == Gbl.Prg.SelectedOrder)
|
||||
HTM_U_End ();
|
||||
HTM_BUTTON_End ();
|
||||
Frm_EndForm ();
|
||||
}
|
||||
|
||||
HTM_TH_End ();
|
||||
}
|
||||
HTM_TH (1,1,"LM",Txt_START_END_TIME[Dat_START_TIME]);
|
||||
HTM_TH (1,1,"LM",Txt_START_END_TIME[Dat_END_TIME ]);
|
||||
|
||||
HTM_TR_End ();
|
||||
}
|
||||
|
@ -292,7 +263,7 @@ static void Prg_PutIconToCreateNewItem (void)
|
|||
/***** Put form to create a new program item *****/
|
||||
Prg_SetCurrentItmCod (-1L);
|
||||
Prg_SetCurrentItmInd (0);
|
||||
Ico_PutContextualIconToAdd (ActFrmNewPrgIte,NULL,Prg_PutParams,
|
||||
Ico_PutContextualIconToAdd (ActFrmNewPrgItm,NULL,Prg_PutParams,
|
||||
Txt_New_item);
|
||||
}
|
||||
|
||||
|
@ -306,7 +277,7 @@ static void Prg_PutButtonToCreateNewItem (void)
|
|||
|
||||
Prg_SetCurrentItmCod (-1L);
|
||||
Prg_SetCurrentItmInd (0);
|
||||
Frm_StartForm (ActFrmNewPrgIte);
|
||||
Frm_StartForm (ActFrmNewPrgItm);
|
||||
Prg_PutParams ();
|
||||
Btn_PutConfirmButton (Txt_New_item);
|
||||
Frm_EndForm ();
|
||||
|
@ -318,7 +289,6 @@ static void Prg_PutButtonToCreateNewItem (void)
|
|||
|
||||
static void Prg_ParamsWhichGroupsToShow (void)
|
||||
{
|
||||
Prg_PutHiddenParamPrgOrder ();
|
||||
Pag_PutHiddenParamPagNum (Pag_COURSE_PROGRAM,Gbl.Prg.CurrentPage);
|
||||
}
|
||||
|
||||
|
@ -452,28 +422,6 @@ static void Prg_WritePrgItemAuthor (struct ProgramItem *Item)
|
|||
Usr_WriteAuthor1Line (Item->UsrCod,Item->Hidden);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******* Get parameter with the type or order in list of program items *******/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Prg_GetParamPrgOrder (void)
|
||||
{
|
||||
Gbl.Prg.SelectedOrder = (Dat_StartEndTime_t)
|
||||
Par_GetParToUnsignedLong ("Order",
|
||||
0,
|
||||
Dat_NUM_START_END_TIME - 1,
|
||||
(unsigned long) Prg_ORDER_DEFAULT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/** Put a hidden parameter with the type of order in list of program items ***/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Prg_PutHiddenParamPrgOrder (void)
|
||||
{
|
||||
Par_PutHiddenParamUnsigned (NULL,"Order",(unsigned) Gbl.Prg.SelectedOrder);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**************** Put a link (form) to edit one program item *****************/
|
||||
/*****************************************************************************/
|
||||
|
@ -500,18 +448,18 @@ static void Prg_PutFormsToRemEditOnePrgItem (const struct ProgramItem *Item,
|
|||
case Rol_TCH:
|
||||
case Rol_SYS_ADM:
|
||||
/***** Put form to remove program item *****/
|
||||
Ico_PutContextualIconToRemove (ActReqRemPrgIte,Prg_PutParams);
|
||||
Ico_PutContextualIconToRemove (ActReqRemPrgItm,Prg_PutParams);
|
||||
|
||||
/***** Put form to hide/show program item *****/
|
||||
if (Item->Hidden)
|
||||
Ico_PutContextualIconToUnhide (ActShoPrgIte,Anchor,Prg_PutParams);
|
||||
Ico_PutContextualIconToUnhide (ActShoPrgItm,Anchor,Prg_PutParams);
|
||||
else
|
||||
Ico_PutContextualIconToHide (ActHidPrgIte,Anchor,Prg_PutParams);
|
||||
Ico_PutContextualIconToHide (ActHidPrgItm,Anchor,Prg_PutParams);
|
||||
|
||||
/***** Put icon to move up the item *****/
|
||||
if (ItmInd > 1)
|
||||
{
|
||||
Lay_PutContextualLinkOnlyIcon (ActUp_PrgIte,NULL,Prg_PutParams,
|
||||
Lay_PutContextualLinkOnlyIcon (ActUp_PrgItm,NULL,Prg_PutParams,
|
||||
"arrow-up.svg",
|
||||
Str_BuildStringStr (Txt_Move_up_X,
|
||||
StrItemIndex));
|
||||
|
@ -523,7 +471,7 @@ static void Prg_PutFormsToRemEditOnePrgItem (const struct ProgramItem *Item,
|
|||
/***** Put icon to move down the item *****/
|
||||
if (ItmInd < MaxItmInd)
|
||||
{
|
||||
Lay_PutContextualLinkOnlyIcon (ActDwnPrgIte,NULL,Prg_PutParams,
|
||||
Lay_PutContextualLinkOnlyIcon (ActDwnPrgItm,NULL,Prg_PutParams,
|
||||
"arrow-down.svg",
|
||||
Str_BuildStringStr (Txt_Move_down_X,
|
||||
StrItemIndex));
|
||||
|
@ -533,7 +481,7 @@ static void Prg_PutFormsToRemEditOnePrgItem (const struct ProgramItem *Item,
|
|||
Ico_PutIconOff ("arrow-down.svg",Txt_Movement_not_allowed);
|
||||
|
||||
/***** Put form to edit program item *****/
|
||||
Ico_PutContextualIconToEdit (ActEdiOnePrgIte,Prg_PutParams);
|
||||
Ico_PutContextualIconToEdit (ActEdiOnePrgItm,Prg_PutParams);
|
||||
break;
|
||||
case Rol_STD:
|
||||
case Rol_NET:
|
||||
|
@ -580,7 +528,6 @@ static void Prg_PutParams (void)
|
|||
Prg_PutParamItmCod (CurrentItmCod);
|
||||
if (CurrentItmInd > 0)
|
||||
Prg_PutParamItmInd (CurrentItmInd);
|
||||
Prg_PutHiddenParamPrgOrder ();
|
||||
Grp_PutParamWhichGrps ();
|
||||
Pag_PutHiddenParamPagNum (Pag_COURSE_PROGRAM,Gbl.Prg.CurrentPage);
|
||||
}
|
||||
|
@ -628,15 +575,10 @@ void Prg_GetListPrgItems (void)
|
|||
[Rol_INS_ADM] = " AND Hidden='N'",
|
||||
[Rol_SYS_ADM] = "",
|
||||
};
|
||||
static const char *OrderBySubQuery[Dat_NUM_START_END_TIME] =
|
||||
{
|
||||
[Dat_START_TIME] = "StartTime DESC,EndTime DESC,Title DESC",
|
||||
[Dat_END_TIME ] = "EndTime DESC,StartTime DESC,Title DESC",
|
||||
};
|
||||
MYSQL_RES *mysql_res;
|
||||
MYSQL_ROW row;
|
||||
unsigned long NumRows;
|
||||
unsigned NumAsg;
|
||||
unsigned NumItem;
|
||||
|
||||
if (Gbl.Prg.LstIsRead)
|
||||
Prg_FreeListItems ();
|
||||
|
@ -647,23 +589,24 @@ void Prg_GetListPrgItems (void)
|
|||
"SELECT ItmCod"
|
||||
" FROM prg_items"
|
||||
" WHERE CrsCod=%ld%s"
|
||||
" AND (ItmCod NOT IN (SELECT ItmCod FROM prg_grp) OR"
|
||||
" ItmCod IN (SELECT prg_grp.ItmCod FROM prg_grp,crs_grp_usr"
|
||||
" WHERE crs_grp_usr.UsrCod=%ld AND prg_grp.GrpCod=crs_grp_usr.GrpCod))"
|
||||
" ORDER BY %s",
|
||||
" AND "
|
||||
"(ItmCod NOT IN (SELECT ItmCod FROM prg_grp) OR"
|
||||
" ItmCod IN (SELECT prg_grp.ItmCod"
|
||||
" FROM prg_grp,crs_grp_usr"
|
||||
" WHERE crs_grp_usr.UsrCod=%ld"
|
||||
" AND prg_grp.GrpCod=crs_grp_usr.GrpCod))"
|
||||
" ORDER BY ItmInd",
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
HiddenSubQuery[Gbl.Usrs.Me.Role.Logged],
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
OrderBySubQuery[Gbl.Prg.SelectedOrder]);
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
else // Gbl.Crs.Grps.WhichGrps == Grp_ALL_GROUPS
|
||||
NumRows = DB_QuerySELECT (&mysql_res,"can not get program items",
|
||||
"SELECT ItmCod"
|
||||
" FROM prg_items"
|
||||
" WHERE CrsCod=%ld%s"
|
||||
" ORDER BY %s",
|
||||
" ORDER BY ItmInd",
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
HiddenSubQuery[Gbl.Usrs.Me.Role.Logged],
|
||||
OrderBySubQuery[Gbl.Prg.SelectedOrder]);
|
||||
HiddenSubQuery[Gbl.Usrs.Me.Role.Logged]);
|
||||
|
||||
if (NumRows) // Items found...
|
||||
{
|
||||
|
@ -674,13 +617,13 @@ void Prg_GetListPrgItems (void)
|
|||
Lay_NotEnoughMemoryExit ();
|
||||
|
||||
/***** Get the program items codes *****/
|
||||
for (NumAsg = 0;
|
||||
NumAsg < Gbl.Prg.Num;
|
||||
NumAsg++)
|
||||
for (NumItem = 0;
|
||||
NumItem < Gbl.Prg.Num;
|
||||
NumItem++)
|
||||
{
|
||||
/* Get next program item code */
|
||||
row = mysql_fetch_row (mysql_res);
|
||||
if ((Gbl.Prg.LstItmCods[NumAsg] = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
||||
if ((Gbl.Prg.LstItmCods[NumItem] = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
||||
Lay_ShowErrorAndExit ("Error: wrong program item code.");
|
||||
}
|
||||
}
|
||||
|
@ -898,7 +841,6 @@ void Prg_ReqRemPrgItem (void)
|
|||
struct ProgramItem Item;
|
||||
|
||||
/***** Get parameters *****/
|
||||
Prg_GetParamPrgOrder ();
|
||||
Grp_GetParamWhichGrps ();
|
||||
Gbl.Prg.CurrentPage = Pag_GetParamPagNum (Pag_COURSE_PROGRAM);
|
||||
|
||||
|
@ -912,7 +854,7 @@ void Prg_ReqRemPrgItem (void)
|
|||
/***** Show question and button to remove the program item *****/
|
||||
Prg_SetCurrentItmCod (Item.ItmCod);
|
||||
Prg_SetCurrentItmInd (Item.ItmInd);
|
||||
Ale_ShowAlertAndButton (ActRemAsg,NULL,NULL,Prg_PutParams,
|
||||
Ale_ShowAlertAndButton (ActRemPrgItm,NULL,NULL,Prg_PutParams,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_item,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_item_X,
|
||||
Item.Title);
|
||||
|
@ -1256,11 +1198,14 @@ static long Prg_GetItmCodFromItmInd (unsigned ItmInd)
|
|||
MYSQL_ROW row;
|
||||
long ItmCod;
|
||||
|
||||
/***** Get item code of the item to be moved up *****/
|
||||
/***** Get item code from item index *****/
|
||||
if (!DB_QuerySELECT (&mysql_res,"can not get item code",
|
||||
"SELECT QstCod FROM prg_items"
|
||||
" WHERE CrsCod=%ld AND QstInd=%u",
|
||||
Gbl.Hierarchy.Crs.CrsCod,ItmInd))
|
||||
"SELECT ItmCod" // row[0]
|
||||
" FROM prg_items"
|
||||
" WHERE CrsCod=%ld"
|
||||
" AND ItmInd=%u",
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
ItmInd))
|
||||
Lay_ShowErrorAndExit ("Error: wrong item index.");
|
||||
|
||||
/***** Get item code (row[0]) *****/
|
||||
|
@ -1306,9 +1251,13 @@ void Prg_RequestCreatOrEditPrgItem (void)
|
|||
struct ProgramItem Item;
|
||||
bool ItsANewItem;
|
||||
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
||||
static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] =
|
||||
{
|
||||
Dat_HMS_TO_000000,
|
||||
Dat_HMS_TO_235959
|
||||
};
|
||||
|
||||
/***** Get parameters *****/
|
||||
Prg_GetParamPrgOrder ();
|
||||
Grp_GetParamWhichGrps ();
|
||||
Gbl.Prg.CurrentPage = Pag_GetParamPagNum (Pag_COURSE_PROGRAM);
|
||||
|
||||
|
@ -1319,12 +1268,10 @@ void Prg_RequestCreatOrEditPrgItem (void)
|
|||
if (ItsANewItem)
|
||||
{
|
||||
/* Initialize to empty program item */
|
||||
Item.ItmCod = -1L;
|
||||
Prg_ResetItem (&Item);
|
||||
Item.TimeUTC[Dat_START_TIME] = Gbl.StartExecutionTimeUTC;
|
||||
Item.TimeUTC[Dat_END_TIME ] = Gbl.StartExecutionTimeUTC + (2 * 60 * 60); // +2 hours
|
||||
Item.Open = true;
|
||||
Item.Title[0] = '\0';
|
||||
Item.IBelongToCrsOrGrps = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1338,13 +1285,13 @@ void Prg_RequestCreatOrEditPrgItem (void)
|
|||
/***** Begin form *****/
|
||||
if (ItsANewItem)
|
||||
{
|
||||
Frm_StartForm (ActNewPrgIte);
|
||||
Frm_StartForm (ActNewPrgItm);
|
||||
Prg_SetCurrentItmCod (-1L);
|
||||
Prg_SetCurrentItmInd (0);
|
||||
}
|
||||
else
|
||||
{
|
||||
Frm_StartForm (ActChgPrgIte);
|
||||
Frm_StartForm (ActChgPrgItm);
|
||||
Prg_SetCurrentItmCod (Item.ItmCod);
|
||||
Prg_SetCurrentItmInd (Item.ItmInd);
|
||||
}
|
||||
|
@ -1377,10 +1324,12 @@ void Prg_RequestCreatOrEditPrgItem (void)
|
|||
|
||||
HTM_TR_End ();
|
||||
|
||||
/***** Schedule item start and end dates *****/
|
||||
Dat_PutFormStartEndClientLocalDateTimes (Item.TimeUTC,Dat_FORM_SECONDS_ON);
|
||||
/***** Program item start and end dates *****/
|
||||
Dat_PutFormStartEndClientLocalDateTimes (Item.TimeUTC,
|
||||
Dat_FORM_SECONDS_ON,
|
||||
SetHMS);
|
||||
|
||||
/***** Schedule item text *****/
|
||||
/***** Program item text *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
|
@ -1579,14 +1528,26 @@ void Prg_RecFormPrgItem (void)
|
|||
|
||||
static void Prg_CreatePrgItem (struct ProgramItem *Item,const char *Txt)
|
||||
{
|
||||
unsigned MaxItmInd;
|
||||
|
||||
/***** Lock table to create program item *****/
|
||||
DB_Query ("can not lock tables to create program item",
|
||||
"LOCK TABLES prg_items WRITE");
|
||||
Gbl.DB.LockedTables = true;
|
||||
|
||||
/***** Get maximum item index *****/
|
||||
MaxItmInd = Prg_GetMaxItemIndex ();
|
||||
|
||||
/***** Create a new program item *****/
|
||||
Item->ItmInd = MaxItmInd + 1;
|
||||
Item->ItmCod =
|
||||
DB_QueryINSERTandReturnCode ("can not create new program item",
|
||||
"INSERT INTO prg_items"
|
||||
" (CrsCod,UsrCod,StartTime,EndTime,Title,Txt)"
|
||||
" (ItmInd,CrsCod,UsrCod,StartTime,EndTime,Title,Txt)"
|
||||
" VALUES"
|
||||
" (%ld,%ld,FROM_UNIXTIME(%ld),FROM_UNIXTIME(%ld),"
|
||||
" (%u,%ld,%ld,FROM_UNIXTIME(%ld),FROM_UNIXTIME(%ld),"
|
||||
"'%s','%s')",
|
||||
Item->ItmInd,
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
Item->TimeUTC[Dat_START_TIME],
|
||||
|
@ -1594,6 +1555,12 @@ static void Prg_CreatePrgItem (struct ProgramItem *Item,const char *Txt)
|
|||
Item->Title,
|
||||
Txt);
|
||||
|
||||
/***** Unlock table *****/
|
||||
Gbl.DB.LockedTables = false; // Set to false before the following unlock...
|
||||
// ...to not retry the unlock if error in unlocking
|
||||
DB_Query ("can not unlock tables after moving items",
|
||||
"UNLOCK TABLES");
|
||||
|
||||
/***** Create groups *****/
|
||||
if (Gbl.Crs.Grps.LstGrpsSel.NumGrps)
|
||||
Prg_CreateGrps (Item->ItmCod);
|
||||
|
@ -1733,12 +1700,15 @@ static void Prg_GetAndWriteNamesOfGrpsAssociatedToItem (struct ProgramItem *Item
|
|||
|
||||
/***** Get groups associated to a program item from database *****/
|
||||
NumRows = DB_QuerySELECT (&mysql_res,"can not get groups of a program item",
|
||||
"SELECT crs_grp_types.GrpTypName,crs_grp.GrpName"
|
||||
" FROM prg_grp,crs_grp,crs_grp_types"
|
||||
"SELECT crs_grp_types.GrpTypName," // row[0]
|
||||
"crs_grp.GrpName" // row[1]
|
||||
" FROM prg_grp,crs_grp,"
|
||||
"crs_grp_types"
|
||||
" WHERE prg_grp.ItmCod=%ld"
|
||||
" AND prg_grp.GrpCod=crs_grp.GrpCod"
|
||||
" AND crs_grp.GrpTypCod=crs_grp_types.GrpTypCod"
|
||||
" ORDER BY crs_grp_types.GrpTypName,crs_grp.GrpName",
|
||||
" AND prg_grp.GrpCod=crs_grp.GrpCod"
|
||||
" AND crs_grp.GrpTypCod=crs_grp_types.GrpTypCod"
|
||||
" ORDER BY crs_grp_types.GrpTypName,"
|
||||
"crs_grp.GrpName",
|
||||
Item->ItmCod);
|
||||
|
||||
/***** Write heading *****/
|
||||
|
|
|
@ -62,7 +62,6 @@ struct ProgramItem
|
|||
|
||||
void Prg_SeeCourseProgram (void);
|
||||
|
||||
void Prg_PutHiddenParamPrgOrder (void);
|
||||
void Prg_RequestCreatOrEditPrgItem (void);
|
||||
void Prg_GetListPrgItems (void);
|
||||
void Prg_GetDataOfItemByCod (struct ProgramItem *PrgItem);
|
||||
|
@ -76,7 +75,7 @@ void Prg_ShowPrgItem (void);
|
|||
void Prg_MoveUpPrgItem (void);
|
||||
void Prg_MoveDownPrgItem (void);
|
||||
void Prg_RecFormPrgItem (void);
|
||||
bool Prg_CheckIfItemIsAssociatedToGrp (long PrgIteCod,long GrpCod);
|
||||
bool Prg_CheckIfItemIsAssociatedToGrp (long PrgItmCod,long GrpCod);
|
||||
void Prg_RemoveGroup (long GrpCod);
|
||||
void Prg_RemoveGroupsOfType (long GrpTypCod);
|
||||
void Prg_RemoveCrsItems (long CrsCod);
|
||||
|
|
|
@ -202,6 +202,7 @@ void Sta_AskShowCrsHits (void)
|
|||
Sta_MAX_ROWS_PER_PAGE,
|
||||
};
|
||||
#define NUM_OPTIONS_ROWS_PER_PAGE (sizeof (RowsPerPage) / sizeof (RowsPerPage[0]))
|
||||
Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME];
|
||||
unsigned NumTotalUsrs;
|
||||
Sta_ClicksGroupedBy_t ClicksGroupedBy;
|
||||
unsigned ClicksGroupedByUnsigned;
|
||||
|
@ -278,7 +279,17 @@ void Sta_AskShowCrsHits (void)
|
|||
HTM_TR_End ();
|
||||
|
||||
/***** Initial and final dates of the search *****/
|
||||
Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (Gbl.Action.Act == ActReqAccCrs);
|
||||
if (Gbl.Action.Act == ActReqAccCrs)
|
||||
{
|
||||
SetHMS[Dat_START_TIME] = Dat_HMS_TO_000000;
|
||||
SetHMS[Dat_END_TIME ] = Dat_HMS_TO_235959;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetHMS[Dat_START_TIME] = Dat_HMS_DO_NOT_SET;
|
||||
SetHMS[Dat_END_TIME ] = Dat_HMS_DO_NOT_SET;
|
||||
}
|
||||
Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (SetHMS);
|
||||
|
||||
/***** Selection of action *****/
|
||||
Sta_WriteSelectorAction ();
|
||||
|
@ -402,6 +413,7 @@ void Sta_AskShowGblHits (void)
|
|||
extern const char *Txt_distributed_by;
|
||||
extern const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY];
|
||||
extern const char *Txt_Show_hits;
|
||||
Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME];
|
||||
Sta_Role_t RoleStat;
|
||||
unsigned RoleStatUnsigned;
|
||||
Sta_ClicksGroupedBy_t ClicksGroupedBy;
|
||||
|
@ -421,7 +433,17 @@ void Sta_AskShowGblHits (void)
|
|||
Hlp_ANALYTICS_Visits_global_visits,Box_NOT_CLOSABLE,2);
|
||||
|
||||
/***** Start and end dates for the search *****/
|
||||
Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (Gbl.Action.Act == ActReqAccGbl);
|
||||
if (Gbl.Action.Act == ActReqAccCrs)
|
||||
{
|
||||
SetHMS[Dat_START_TIME] = Dat_HMS_TO_000000;
|
||||
SetHMS[Dat_END_TIME ] = Dat_HMS_TO_235959;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetHMS[Dat_START_TIME] = Dat_HMS_DO_NOT_SET;
|
||||
SetHMS[Dat_END_TIME ] = Dat_HMS_DO_NOT_SET;
|
||||
}
|
||||
Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (SetHMS);
|
||||
|
||||
/***** Users' roles whose accesses we want to see *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
|
|
@ -1796,6 +1796,11 @@ void Svy_RequestCreatOrEditSvy (void)
|
|||
struct Survey Svy;
|
||||
bool ItsANewSurvey;
|
||||
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
||||
static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] =
|
||||
{
|
||||
Dat_HMS_TO_000000,
|
||||
Dat_HMS_TO_235959
|
||||
};
|
||||
|
||||
/***** Get parameters *****/
|
||||
Svy_GetParamSvyOrder ();
|
||||
|
@ -1889,7 +1894,9 @@ void Svy_RequestCreatOrEditSvy (void)
|
|||
HTM_TR_End ();
|
||||
|
||||
/***** Survey start and end dates *****/
|
||||
Dat_PutFormStartEndClientLocalDateTimes (Svy.TimeUTC,Dat_FORM_SECONDS_ON);
|
||||
Dat_PutFormStartEndClientLocalDateTimes (Svy.TimeUTC,
|
||||
Dat_FORM_SECONDS_ON,
|
||||
SetHMS);
|
||||
|
||||
/***** Survey text *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
|
14
swad_test.c
14
swad_test.c
|
@ -1216,6 +1216,11 @@ void Tst_ShowFormAskEditTsts (void)
|
|||
extern const char *Txt_Show_questions;
|
||||
MYSQL_RES *mysql_res;
|
||||
unsigned long NumRows;
|
||||
static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] =
|
||||
{
|
||||
Dat_HMS_DO_NOT_SET,
|
||||
Dat_HMS_DO_NOT_SET
|
||||
};
|
||||
|
||||
/***** Contextual menu *****/
|
||||
Mnu_ContextMenuBegin ();
|
||||
|
@ -1241,7 +1246,7 @@ void Tst_ShowFormAskEditTsts (void)
|
|||
Tst_ShowFormAnswerTypes ();
|
||||
|
||||
/***** Starting and ending dates in the search *****/
|
||||
Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (false);
|
||||
Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (SetHMS);
|
||||
|
||||
HTM_TABLE_End ();
|
||||
|
||||
|
@ -1277,6 +1282,11 @@ void Tst_ShowFormAskSelectTstsForGame (void)
|
|||
extern const char *Txt_Show_questions;
|
||||
MYSQL_RES *mysql_res;
|
||||
unsigned long NumRows;
|
||||
static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] =
|
||||
{
|
||||
Dat_HMS_DO_NOT_SET,
|
||||
Dat_HMS_DO_NOT_SET
|
||||
};
|
||||
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,Txt_Select_questions,NULL,
|
||||
|
@ -1294,7 +1304,7 @@ void Tst_ShowFormAskSelectTstsForGame (void)
|
|||
Tst_ShowFormSelTags (NumRows,mysql_res,false);
|
||||
|
||||
/***** Starting and ending dates in the search *****/
|
||||
Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (false);
|
||||
Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (SetHMS);
|
||||
|
||||
HTM_TABLE_End ();
|
||||
|
||||
|
|
|
@ -117,6 +117,11 @@ void TsR_SelDatesToSeeMyTstResults (void)
|
|||
extern const char *Hlp_ASSESSMENT_Tests_results;
|
||||
extern const char *Txt_Results;
|
||||
extern const char *Txt_View_test_results;
|
||||
static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] =
|
||||
{
|
||||
Dat_HMS_DO_NOT_SET,
|
||||
Dat_HMS_DO_NOT_SET
|
||||
};
|
||||
|
||||
/***** Begin form *****/
|
||||
Frm_StartForm (ActSeeMyTstRes);
|
||||
|
@ -124,7 +129,7 @@ void TsR_SelDatesToSeeMyTstResults (void)
|
|||
/***** Begin box and table *****/
|
||||
Box_BoxTableBegin (NULL,Txt_Results,NULL,
|
||||
Hlp_ASSESSMENT_Tests_results,Box_NOT_CLOSABLE,2);
|
||||
Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (false);
|
||||
Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (SetHMS);
|
||||
|
||||
/***** End table, send button and end box *****/
|
||||
Box_BoxTableWithButtonEnd (Btn_CONFIRM_BUTTON,Txt_View_test_results);
|
||||
|
|
|
@ -4787,7 +4787,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
|
|||
"" // Precisa de tradução
|
||||
#endif
|
||||
,
|
||||
[ActFrmNewPrgIte] =
|
||||
[ActFrmNewPrgItm] =
|
||||
#if L==1 // ca
|
||||
"" // Necessita traducció
|
||||
#elif L==2 // de
|
||||
|
@ -4808,7 +4808,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
|
|||
"" // Precisa de tradução
|
||||
#endif
|
||||
,
|
||||
[ActEdiOnePrgIte] =
|
||||
[ActEdiOnePrgItm] =
|
||||
#if L==1 // ca
|
||||
"" // Necessita traducció
|
||||
#elif L==2 // de
|
||||
|
@ -4829,7 +4829,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
|
|||
"" // Precisa de tradução
|
||||
#endif
|
||||
,
|
||||
[ActNewPrgIte] =
|
||||
[ActNewPrgItm] =
|
||||
#if L==1 // ca
|
||||
"" // Necessita traducció
|
||||
#elif L==2 // de
|
||||
|
@ -4850,7 +4850,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
|
|||
"" // Precisa de tradução
|
||||
#endif
|
||||
,
|
||||
[ActChgPrgIte] =
|
||||
[ActChgPrgItm] =
|
||||
#if L==1 // ca
|
||||
"" // Necessita traducció
|
||||
#elif L==2 // de
|
||||
|
@ -4871,7 +4871,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
|
|||
"" // Precisa de tradução
|
||||
#endif
|
||||
,
|
||||
[ActReqRemPrgIte] =
|
||||
[ActReqRemPrgItm] =
|
||||
#if L==1 // ca
|
||||
"" // Necessita traducció
|
||||
#elif L==2 // de
|
||||
|
@ -4892,7 +4892,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
|
|||
"" // Precisa de tradução
|
||||
#endif
|
||||
,
|
||||
[ActRemPrgIte] =
|
||||
[ActRemPrgItm] =
|
||||
#if L==1 // ca
|
||||
"" // Necessita traducció
|
||||
#elif L==2 // de
|
||||
|
@ -4913,7 +4913,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
|
|||
"" // Precisa de tradução
|
||||
#endif
|
||||
,
|
||||
[ActHidPrgIte] =
|
||||
[ActHidPrgItm] =
|
||||
#if L==1 // ca
|
||||
"" // Necessita traducció
|
||||
#elif L==2 // de
|
||||
|
@ -4934,7 +4934,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
|
|||
"" // Precisa de tradução
|
||||
#endif
|
||||
,
|
||||
[ActShoPrgIte] =
|
||||
[ActShoPrgItm] =
|
||||
#if L==1 // ca
|
||||
"" // Necessita traducció
|
||||
#elif L==2 // de
|
||||
|
@ -4955,7 +4955,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
|
|||
"" // Precisa de tradução
|
||||
#endif
|
||||
,
|
||||
[ActUp_PrgIte] =
|
||||
[ActUp_PrgItm] =
|
||||
#if L==1 // ca
|
||||
"" // Necessita traducció
|
||||
#elif L==2 // de
|
||||
|
@ -4976,7 +4976,7 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
|
|||
"" // Precisa de tradução
|
||||
#endif
|
||||
,
|
||||
[ActDwnPrgIte] =
|
||||
[ActDwnPrgItm] =
|
||||
#if L==1 // ca
|
||||
"" // Necessita traducció
|
||||
#elif L==2 // de
|
||||
|
|
|
@ -6311,6 +6311,11 @@ void Usr_PutFormToSelectUsrsToGoToAct (struct SelectedUsrs *SelectedUsrs,
|
|||
extern const char *Txt_Select_users;
|
||||
extern const char *Txt_Users;
|
||||
unsigned NumTotalUsrs;
|
||||
static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] =
|
||||
{
|
||||
Dat_HMS_DO_NOT_SET,
|
||||
Dat_HMS_DO_NOT_SET
|
||||
};
|
||||
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,Title,NULL,HelpLink,Box_NOT_CLOSABLE);
|
||||
|
@ -6385,7 +6390,7 @@ void Usr_PutFormToSelectUsrsToGoToAct (struct SelectedUsrs *SelectedUsrs,
|
|||
|
||||
/* Starting and ending dates in the search */
|
||||
if (PutFormDateRange)
|
||||
Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (false);
|
||||
Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (SetHMS);
|
||||
|
||||
HTM_TABLE_End ();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user