mirror of https://github.com/acanas/swad-core.git
Version 23.74: Apr 07, 2024 New type CloOpe_ClosedOrOpen_t.
This commit is contained in:
parent
d6df495d93
commit
c9a75eb0ad
11
Makefile
11
Makefile
|
@ -37,11 +37,12 @@ OBJS = swad_account.o swad_account_database.o swad_action.o swad_action_list.o \
|
||||||
swad_building.o swad_building_database.o swad_button.o \
|
swad_building.o swad_building_database.o swad_button.o \
|
||||||
swad_calendar.o swad_call_for_exam.o swad_call_for_exam_resource.o \
|
swad_calendar.o swad_call_for_exam.o swad_call_for_exam_resource.o \
|
||||||
swad_call_for_exam_database.o swad_center.o swad_center_config.o \
|
swad_call_for_exam_database.o swad_center.o swad_center_config.o \
|
||||||
swad_center_database.o swad_chat.o swad_chat_database.o swad_config.o \
|
swad_center_database.o swad_chat.o swad_chat_database.o \
|
||||||
swad_connected.o swad_connected_database.o swad_constant.o \
|
swad_closed_open.o swad_config.o swad_connected.o \
|
||||||
swad_cookie.o swad_cookie_database.o swad_country.o \
|
swad_connected_database.o swad_constant.o swad_cookie.o \
|
||||||
swad_country_config.o swad_country_database.o swad_course.o \
|
swad_cookie_database.o swad_country.o swad_country_config.o \
|
||||||
swad_course_config.o swad_course_database.o swad_cryptography.o \
|
swad_country_database.o swad_course.o swad_course_config.o \
|
||||||
|
swad_course_database.o swad_cryptography.o \
|
||||||
swad_database.o swad_date.o swad_degree.o swad_degree_config.o \
|
swad_database.o swad_date.o swad_degree.o swad_degree_config.o \
|
||||||
swad_degree_database.o swad_degree_type.o swad_department.o \
|
swad_degree_database.o swad_degree_type.o swad_department.o \
|
||||||
swad_department_database.o swad_duplicate.o swad_duplicate_database.o \
|
swad_department_database.o swad_duplicate.o swad_duplicate_database.o \
|
||||||
|
|
|
@ -2351,8 +2351,8 @@ int swad__getAttendanceEvents (struct soap *soap,
|
||||||
|
|
||||||
getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].startTime = (int) Event.TimeUTC[Dat_STR_TIME];
|
getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].startTime = (int) Event.TimeUTC[Dat_STR_TIME];
|
||||||
getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].endTime = (int) Event.TimeUTC[Dat_END_TIME];
|
getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].endTime = (int) Event.TimeUTC[Dat_END_TIME];
|
||||||
getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].commentsTeachersVisible = Event.Open ? 1 :
|
getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].commentsTeachersVisible = Event.Open == CloOpe_OPEN ? 1 :
|
||||||
0;
|
0;
|
||||||
Length = strlen (Event.Title);
|
Length = strlen (Event.Title);
|
||||||
getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].title =
|
getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].title =
|
||||||
soap_malloc (soap,Length + 1);
|
soap_malloc (soap,Length + 1);
|
||||||
|
|
|
@ -511,16 +511,16 @@ static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments,
|
||||||
case Vie_VIEW:
|
case Vie_VIEW:
|
||||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s %s\"",
|
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s %s\"",
|
||||||
Id,
|
Id,
|
||||||
Assignments->Asg.Open ? HidVis_DateGreenClass[Assignments->Asg.HiddenOrVisible] :
|
Assignments->Asg.Open == CloOpe_OPEN ? HidVis_DateGreenClass[Assignments->Asg.HiddenOrVisible] :
|
||||||
HidVis_DateRedClass[Assignments->Asg.HiddenOrVisible],
|
HidVis_DateRedClass[Assignments->Asg.HiddenOrVisible],
|
||||||
The_GetSuffix (),
|
The_GetSuffix (),
|
||||||
The_GetColorRows ());
|
The_GetColorRows ());
|
||||||
break;
|
break;
|
||||||
case Vie_PRINT:
|
case Vie_PRINT:
|
||||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s\"",
|
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s\"",
|
||||||
Id,
|
Id,
|
||||||
Assignments->Asg.Open ? HidVis_DateGreenClass[Assignments->Asg.HiddenOrVisible] :
|
Assignments->Asg.Open == CloOpe_OPEN ? HidVis_DateGreenClass[Assignments->Asg.HiddenOrVisible] :
|
||||||
HidVis_DateRedClass[Assignments->Asg.HiddenOrVisible],
|
HidVis_DateRedClass[Assignments->Asg.HiddenOrVisible],
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -659,7 +659,7 @@ static void Asg_WriteAssignmentFolder (struct Asg_Assignment *Asg,
|
||||||
extern const char *Txt_Folder;
|
extern const char *Txt_Folder;
|
||||||
Act_Action_t NextAction;
|
Act_Action_t NextAction;
|
||||||
bool ICanSendFiles = Asg->HiddenOrVisible == HidVis_VISIBLE && // It's visible (not hidden)
|
bool ICanSendFiles = Asg->HiddenOrVisible == HidVis_VISIBLE && // It's visible (not hidden)
|
||||||
Asg->Open && // It's open (inside dates)
|
Asg->Open == CloOpe_OPEN && // It's open (inside dates)
|
||||||
Asg->IBelongToCrsOrGrps; // I belong to course or groups
|
Asg->IBelongToCrsOrGrps; // I belong to course or groups
|
||||||
|
|
||||||
/***** Folder icon *****/
|
/***** Folder icon *****/
|
||||||
|
@ -933,7 +933,8 @@ static void Asg_GetAssignmentDataFromRow (MYSQL_RES **mysql_res,
|
||||||
Asg->TimeUTC[Dat_END_TIME] = Dat_GetUNIXTimeFromStr (row[4]);
|
Asg->TimeUTC[Dat_END_TIME] = Dat_GetUNIXTimeFromStr (row[4]);
|
||||||
|
|
||||||
/* Get whether the assignment is open or closed (row(5)) */
|
/* Get whether the assignment is open or closed (row(5)) */
|
||||||
Asg->Open = (row[5][0] == '1');
|
Asg->Open = (row[5][0] == '1') ? CloOpe_OPEN :
|
||||||
|
CloOpe_CLOSED;
|
||||||
|
|
||||||
/* Get the title (row[6]) and the folder (row[7]) of the assignment */
|
/* Get the title (row[6]) and the folder (row[7]) of the assignment */
|
||||||
Str_Copy (Asg->Title ,row[6],sizeof (Asg->Title ) - 1);
|
Str_Copy (Asg->Title ,row[6],sizeof (Asg->Title ) - 1);
|
||||||
|
@ -961,7 +962,7 @@ static void Asg_ResetAssignment (struct Asg_Assignment *Asg)
|
||||||
Asg->UsrCod = -1L;
|
Asg->UsrCod = -1L;
|
||||||
Asg->TimeUTC[Dat_STR_TIME] =
|
Asg->TimeUTC[Dat_STR_TIME] =
|
||||||
Asg->TimeUTC[Dat_END_TIME] = (time_t) 0;
|
Asg->TimeUTC[Dat_END_TIME] = (time_t) 0;
|
||||||
Asg->Open = false;
|
Asg->Open = CloOpe_CLOSED;
|
||||||
Asg->Title[0] = '\0';
|
Asg->Title[0] = '\0';
|
||||||
Asg->SendWork = Asg_DO_NOT_SEND_WORK;
|
Asg->SendWork = Asg_DO_NOT_SEND_WORK;
|
||||||
Asg->Folder[0] = '\0';
|
Asg->Folder[0] = '\0';
|
||||||
|
@ -1184,7 +1185,7 @@ void Asg_ReqCreatOrEditAsg (void)
|
||||||
Assignments.Asg.AsgCod = -1L;
|
Assignments.Asg.AsgCod = -1L;
|
||||||
Assignments.Asg.TimeUTC[Dat_STR_TIME] = Dat_GetStartExecutionTimeUTC ();
|
Assignments.Asg.TimeUTC[Dat_STR_TIME] = Dat_GetStartExecutionTimeUTC ();
|
||||||
Assignments.Asg.TimeUTC[Dat_END_TIME] = Assignments.Asg.TimeUTC[Dat_STR_TIME] + (2 * 60 * 60); // +2 hours
|
Assignments.Asg.TimeUTC[Dat_END_TIME] = Assignments.Asg.TimeUTC[Dat_STR_TIME] + (2 * 60 * 60); // +2 hours
|
||||||
Assignments.Asg.Open = true;
|
Assignments.Asg.Open = CloOpe_OPEN;
|
||||||
Assignments.Asg.Title[0] = '\0';
|
Assignments.Asg.Title[0] = '\0';
|
||||||
Assignments.Asg.SendWork = Asg_DO_NOT_SEND_WORK;
|
Assignments.Asg.SendWork = Asg_DO_NOT_SEND_WORK;
|
||||||
Assignments.Asg.Folder[0] = '\0';
|
Assignments.Asg.Folder[0] = '\0';
|
||||||
|
@ -1661,8 +1662,8 @@ void Asg_WriteDatesAssignment (const struct Asg_Assignment *Asg)
|
||||||
|
|
||||||
/***** Begin table cell *****/
|
/***** Begin table cell *****/
|
||||||
HTM_TD_Begin ("colspan=\"2\" class=\"RM %s_%s %s\"",
|
HTM_TD_Begin ("colspan=\"2\" class=\"RM %s_%s %s\"",
|
||||||
Asg->Open ? "ASG_LST_DATE_GREEN" :
|
Asg->Open == CloOpe_OPEN ? "ASG_LST_DATE_GREEN" :
|
||||||
"ASG_LST_DATE_RED",
|
"ASG_LST_DATE_RED",
|
||||||
The_GetSuffix (),
|
The_GetSuffix (),
|
||||||
The_GetColorRows ());
|
The_GetColorRows ());
|
||||||
|
|
||||||
|
@ -1724,8 +1725,9 @@ Usr_ICan_t Asg_CheckIfICanCreateIntoAssigment (const struct Asg_Assignment *Asg)
|
||||||
{
|
{
|
||||||
case Rol_STD: // Students...
|
case Rol_STD: // Students...
|
||||||
case Rol_NET: // ...and non-editing teachers...
|
case Rol_NET: // ...and non-editing teachers...
|
||||||
return Asg->Open ? Usr_I_CAN : // ...can create inside open assignments
|
// ...can create inside open assignments
|
||||||
Usr_I_CAN_NOT;
|
return (Asg->Open == CloOpe_OPEN) ? Usr_I_CAN :
|
||||||
|
Usr_I_CAN_NOT;
|
||||||
case Rol_TCH: // Teachers...
|
case Rol_TCH: // Teachers...
|
||||||
return Usr_I_CAN; // ...can create inside open or closed assignments
|
return Usr_I_CAN; // ...can create inside open or closed assignments
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -52,7 +52,7 @@ struct Asg_Assignment
|
||||||
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
||||||
long UsrCod;
|
long UsrCod;
|
||||||
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||||
bool Open;
|
CloOpe_ClosedOrOpen_t Open;
|
||||||
char Title[Asg_MAX_BYTES_ASSIGNMENT_TITLE + 1];
|
char Title[Asg_MAX_BYTES_ASSIGNMENT_TITLE + 1];
|
||||||
Asg_SendWork_t SendWork;
|
Asg_SendWork_t SendWork;
|
||||||
char Folder[Brw_MAX_BYTES_FOLDER + 1];
|
char Folder[Brw_MAX_BYTES_FOLDER + 1];
|
||||||
|
|
|
@ -467,14 +467,14 @@ static void Att_ShowOneEventRow (struct Att_Events *Events,
|
||||||
if (ShowOnlyThisAttEventComplete)
|
if (ShowOnlyThisAttEventComplete)
|
||||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s\"",
|
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s\"",
|
||||||
Id,
|
Id,
|
||||||
Events->Event.Open ? HidVis_DateGreenClass[Events->Event.HiddenOrVisible] :
|
Events->Event.Open == CloOpe_OPEN ? HidVis_DateGreenClass[Events->Event.HiddenOrVisible] :
|
||||||
HidVis_DateRedClass[Events->Event.HiddenOrVisible],
|
HidVis_DateRedClass[Events->Event.HiddenOrVisible],
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
else
|
else
|
||||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s %s\"",
|
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s %s\"",
|
||||||
Id,
|
Id,
|
||||||
Events->Event.Open ? HidVis_DateGreenClass[Events->Event.HiddenOrVisible] :
|
Events->Event.Open == CloOpe_OPEN ? HidVis_DateGreenClass[Events->Event.HiddenOrVisible] :
|
||||||
HidVis_DateRedClass[Events->Event.HiddenOrVisible],
|
HidVis_DateRedClass[Events->Event.HiddenOrVisible],
|
||||||
The_GetSuffix (),
|
The_GetSuffix (),
|
||||||
The_GetColorRows ());
|
The_GetColorRows ());
|
||||||
Dat_WriteLocalDateHMSFromUTC (Id,Events->Event.TimeUTC[StartEndTime],
|
Dat_WriteLocalDateHMSFromUTC (Id,Events->Event.TimeUTC[StartEndTime],
|
||||||
|
@ -746,7 +746,7 @@ static void Att_ResetEvent (struct Att_Event *Event)
|
||||||
Event->UsrCod = -1L;
|
Event->UsrCod = -1L;
|
||||||
Event->TimeUTC[Dat_STR_TIME] =
|
Event->TimeUTC[Dat_STR_TIME] =
|
||||||
Event->TimeUTC[Dat_END_TIME] = (time_t) 0;
|
Event->TimeUTC[Dat_END_TIME] = (time_t) 0;
|
||||||
Event->Open = false;
|
Event->Open = CloOpe_CLOSED;
|
||||||
Event->CommentTchVisible = false;
|
Event->CommentTchVisible = false;
|
||||||
Event->Title[0] = '\0';
|
Event->Title[0] = '\0';
|
||||||
}
|
}
|
||||||
|
@ -772,7 +772,8 @@ void Att_GetEventDataFromRow (MYSQL_ROW row,struct Att_Event *Event)
|
||||||
Event->TimeUTC[Dat_END_TIME] = Dat_GetUNIXTimeFromStr (row[5]);
|
Event->TimeUTC[Dat_END_TIME] = Dat_GetUNIXTimeFromStr (row[5]);
|
||||||
|
|
||||||
/***** Get whether the attendance event is open or closed (row(6)) *****/
|
/***** Get whether the attendance event is open or closed (row(6)) *****/
|
||||||
Event->Open = (row[6][0] == '1');
|
Event->Open = (row[6][0] == '1') ? CloOpe_OPEN :
|
||||||
|
CloOpe_CLOSED;
|
||||||
|
|
||||||
/***** Get whether the attendance event is visible or not (row[7]) *****/
|
/***** Get whether the attendance event is visible or not (row[7]) *****/
|
||||||
Event->CommentTchVisible = (row[7][0] == 'Y');
|
Event->CommentTchVisible = (row[7][0] == 'Y');
|
||||||
|
@ -952,7 +953,7 @@ void Att_ReqCreatOrEditEvent (void)
|
||||||
Events.Event.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
|
Events.Event.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
|
||||||
Events.Event.TimeUTC[Dat_STR_TIME] = Dat_GetStartExecutionTimeUTC ();
|
Events.Event.TimeUTC[Dat_STR_TIME] = Dat_GetStartExecutionTimeUTC ();
|
||||||
Events.Event.TimeUTC[Dat_END_TIME] = Events.Event.TimeUTC[Dat_STR_TIME] + (2 * 60 * 60); // +2 hours
|
Events.Event.TimeUTC[Dat_END_TIME] = Events.Event.TimeUTC[Dat_STR_TIME] + (2 * 60 * 60); // +2 hours
|
||||||
Events.Event.Open = true;
|
Events.Event.Open = CloOpe_OPEN;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1486,7 +1487,7 @@ static void Att_ListEventOnlyMeAsStudent (struct Att_Event *Event)
|
||||||
Hlp_USERS_Attendance,Box_NOT_CLOSABLE);
|
Hlp_USERS_Attendance,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Begin form *****/
|
/***** Begin form *****/
|
||||||
if (Event->Open)
|
if (Event->Open == CloOpe_OPEN)
|
||||||
{
|
{
|
||||||
Frm_BeginForm (ActRecAttMe);
|
Frm_BeginForm (ActRecAttMe);
|
||||||
ParCod_PutPar (ParCod_Att,Event->AttCod);
|
ParCod_PutPar (ParCod_Att,Event->AttCod);
|
||||||
|
@ -1515,7 +1516,7 @@ static void Att_ListEventOnlyMeAsStudent (struct Att_Event *Event)
|
||||||
HTM_TABLE_End ();
|
HTM_TABLE_End ();
|
||||||
|
|
||||||
/* Send button */
|
/* Send button */
|
||||||
if (Event->Open)
|
if (Event->Open == CloOpe_OPEN)
|
||||||
{
|
{
|
||||||
Btn_PutConfirmButton (Txt_Save_changes);
|
Btn_PutConfirmButton (Txt_Save_changes);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
@ -1668,8 +1669,8 @@ static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr,
|
||||||
if (Usr_ItsMe (UsrDat->UsrCod) == Usr_OTHER)
|
if (Usr_ItsMe (UsrDat->UsrCod) == Usr_OTHER)
|
||||||
Err_ShowErrorAndExit ("Wrong call.");
|
Err_ShowErrorAndExit ("Wrong call.");
|
||||||
ICanChangeStdAttendance = Usr_I_CAN_NOT;
|
ICanChangeStdAttendance = Usr_I_CAN_NOT;
|
||||||
ICanEditStdComment = Event->Open ? Usr_I_CAN : // Attendance event is open
|
ICanEditStdComment = (Event->Open == CloOpe_OPEN) ? Usr_I_CAN : // Attendance event is open
|
||||||
Usr_I_CAN_NOT;
|
Usr_I_CAN_NOT;
|
||||||
ICanEditTchComment = Usr_I_CAN_NOT;
|
ICanEditTchComment = Usr_I_CAN_NOT;
|
||||||
break;
|
break;
|
||||||
case Rol_TCH:
|
case Rol_TCH:
|
||||||
|
@ -1911,7 +1912,7 @@ void Att_RegisterMeAsStdInEvent (void)
|
||||||
Events.Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att);
|
Events.Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att);
|
||||||
Att_GetEventDataByCodAndCheckCrs (&Events.Event); // This checks that event belong to current course
|
Att_GetEventDataByCodAndCheckCrs (&Events.Event); // This checks that event belong to current course
|
||||||
|
|
||||||
if (Events.Event.Open)
|
if (Events.Event.Open == CloOpe_OPEN)
|
||||||
{
|
{
|
||||||
/***** Get comments for this student *****/
|
/***** Get comments for this student *****/
|
||||||
Present = Att_CheckIfUsrIsPresentInEventAndGetComments (Events.Event.AttCod,Gbl.Usrs.Me.UsrDat.UsrCod,
|
Present = Att_CheckIfUsrIsPresentInEventAndGetComments (Events.Event.AttCod,Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
|
|
|
@ -54,7 +54,7 @@ struct Att_Event
|
||||||
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
||||||
long UsrCod;
|
long UsrCod;
|
||||||
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||||
bool Open;
|
CloOpe_ClosedOrOpen_t Open;
|
||||||
bool CommentTchVisible;
|
bool CommentTchVisible;
|
||||||
char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1];
|
char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1];
|
||||||
|
|
||||||
|
|
116
swad_browser.c
116
swad_browser.c
|
@ -1161,9 +1161,9 @@ static void Brw_PutIconFolder (unsigned Level,
|
||||||
const char *FileBrowserId,const char *RowId,
|
const char *FileBrowserId,const char *RowId,
|
||||||
Brw_IconTree_t IconSubtree);
|
Brw_IconTree_t IconSubtree);
|
||||||
static void Brw_PutIconFolderWithoutPlus (const char *FileBrowserId,const char *RowId,
|
static void Brw_PutIconFolderWithoutPlus (const char *FileBrowserId,const char *RowId,
|
||||||
bool Open,HidVis_HiddenOrVisible_t HiddenOrVisible);
|
CloOpe_ClosedOrOpen_t Open,HidVis_HiddenOrVisible_t HiddenOrVisible);
|
||||||
static void Brw_PutIconFolderWithPlus (const char *FileBrowserId,const char *RowId,
|
static void Brw_PutIconFolderWithPlus (const char *FileBrowserId,const char *RowId,
|
||||||
bool Open,HidVis_HiddenOrVisible_t HiddenOrVisible);
|
CloOpe_ClosedOrOpen_t Open,HidVis_HiddenOrVisible_t HiddenOrVisible);
|
||||||
|
|
||||||
static void Brw_PutIconNewFileOrFolder (void);
|
static void Brw_PutIconNewFileOrFolder (void);
|
||||||
static void Brw_PutIconFileWithLinkToViewMetadata (const struct Brw_FileMetadata *FileMetadata);
|
static void Brw_PutIconFileWithLinkToViewMetadata (const struct Brw_FileMetadata *FileMetadata);
|
||||||
|
@ -3816,8 +3816,9 @@ static void Brw_ListDir (unsigned Level,const char *ParentRowId,
|
||||||
IconSubtree = Brw_ICON_TREE_NOTHING;
|
IconSubtree = Brw_ICON_TREE_NOTHING;
|
||||||
else
|
else
|
||||||
/***** Check if the tree starting at this subdirectory must be expanded *****/
|
/***** Check if the tree starting at this subdirectory must be expanded *****/
|
||||||
IconSubtree = Brw_DB_GetIfContractedOrExpandedFolder (Gbl.FileBrowser.FilFolLnk.Full) == ConExp_EXPANDED ? Brw_ICON_TREE_CONTRACT :
|
IconSubtree = Brw_DB_GetIfContractedOrExpandedFolder (Gbl.FileBrowser.FilFolLnk.Full)
|
||||||
Brw_ICON_TREE_EXPAND;
|
== ConExp_EXPANDED ? Brw_ICON_TREE_CONTRACT :
|
||||||
|
Brw_ICON_TREE_EXPAND;
|
||||||
for (NumFileInSubdir = 0;
|
for (NumFileInSubdir = 0;
|
||||||
NumFileInSubdir < NumFilesInSubdir;
|
NumFileInSubdir < NumFilesInSubdir;
|
||||||
NumFileInSubdir++)
|
NumFileInSubdir++)
|
||||||
|
@ -3835,7 +3836,8 @@ static void Brw_ListDir (unsigned Level,const char *ParentRowId,
|
||||||
if (Level < BrwSiz_MAX_DIR_LEVELS)
|
if (Level < BrwSiz_MAX_DIR_LEVELS)
|
||||||
/* List subtree starting at this this directory */
|
/* List subtree starting at this this directory */
|
||||||
Brw_ListDir (Level + 1,RowId,
|
Brw_ListDir (Level + 1,RowId,
|
||||||
TreeContracted || IconSubtree == Brw_ICON_TREE_EXPAND,
|
TreeContracted ||
|
||||||
|
IconSubtree == Brw_ICON_TREE_EXPAND,
|
||||||
PathFileRel,PathFileInExplTree);
|
PathFileRel,PathFileInExplTree);
|
||||||
}
|
}
|
||||||
else if (S_ISREG (FileStatus.st_mode)) // It's a regular file
|
else if (S_ISREG (FileStatus.st_mode)) // It's a regular file
|
||||||
|
@ -4480,56 +4482,64 @@ static void Brw_PutIconFolder (unsigned Level,
|
||||||
switch (Brw_CheckIfICanCreateIntoFolder (Level)) // I can create a new file or folder
|
switch (Brw_CheckIfICanCreateIntoFolder (Level)) // I can create a new file or folder
|
||||||
{
|
{
|
||||||
case Usr_I_CAN:
|
case Usr_I_CAN:
|
||||||
if (IconSubtree == Brw_ICON_TREE_EXPAND)
|
switch (IconSubtree)
|
||||||
{
|
{
|
||||||
/* Visible icon with folder closed */
|
case Brw_ICON_TREE_EXPAND:
|
||||||
Brw_PutIconFolderWithPlus (FileBrowserId,RowId,
|
/* Visible icon with folder closed */
|
||||||
false, // Closed
|
Brw_PutIconFolderWithPlus (FileBrowserId,RowId,
|
||||||
HidVis_VISIBLE); // Visible
|
CloOpe_CLOSED, // Closed
|
||||||
|
HidVis_VISIBLE); // Visible
|
||||||
|
|
||||||
/* Hidden icon with folder open */
|
/* Hidden icon with folder open */
|
||||||
Brw_PutIconFolderWithPlus (FileBrowserId,RowId,
|
Brw_PutIconFolderWithPlus (FileBrowserId,RowId,
|
||||||
true, // Open
|
CloOpe_OPEN, // Open
|
||||||
HidVis_HIDDEN); // Hidden
|
HidVis_HIDDEN); // Hidden
|
||||||
}
|
break;
|
||||||
else
|
case Brw_ICON_TREE_CONTRACT:
|
||||||
{
|
/* Hidden icon with folder closed */
|
||||||
/* Hidden icon with folder closed */
|
Brw_PutIconFolderWithPlus (FileBrowserId,RowId,
|
||||||
Brw_PutIconFolderWithPlus (FileBrowserId,RowId,
|
CloOpe_CLOSED, // Closed
|
||||||
false, // Closed
|
HidVis_HIDDEN); // Hidden
|
||||||
HidVis_HIDDEN); // Hidden
|
|
||||||
|
|
||||||
/* Visible icon with folder open */
|
/* Visible icon with folder open */
|
||||||
Brw_PutIconFolderWithPlus (FileBrowserId,RowId,
|
Brw_PutIconFolderWithPlus (FileBrowserId,RowId,
|
||||||
true, // Open
|
CloOpe_OPEN, // Open
|
||||||
HidVis_VISIBLE); // Visible
|
HidVis_VISIBLE); // Visible
|
||||||
|
break;
|
||||||
|
case Brw_ICON_TREE_NOTHING:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Usr_I_CAN_NOT:
|
case Usr_I_CAN_NOT:
|
||||||
default:
|
default:
|
||||||
if (IconSubtree == Brw_ICON_TREE_EXPAND)
|
switch (IconSubtree)
|
||||||
{
|
{
|
||||||
/* Visible icon with folder closed */
|
case Brw_ICON_TREE_EXPAND:
|
||||||
Brw_PutIconFolderWithoutPlus (FileBrowserId,RowId,
|
/* Visible icon with folder closed */
|
||||||
false, // Closed
|
Brw_PutIconFolderWithoutPlus (FileBrowserId,RowId,
|
||||||
HidVis_VISIBLE);
|
CloOpe_CLOSED, // Closed
|
||||||
|
HidVis_VISIBLE);
|
||||||
|
|
||||||
/* Hidden icon with folder open */
|
/* Hidden icon with folder open */
|
||||||
Brw_PutIconFolderWithoutPlus (FileBrowserId,RowId,
|
Brw_PutIconFolderWithoutPlus (FileBrowserId,RowId,
|
||||||
true, // Open
|
CloOpe_OPEN, // Open
|
||||||
HidVis_HIDDEN);
|
HidVis_HIDDEN);
|
||||||
}
|
break;
|
||||||
else
|
case Brw_ICON_TREE_CONTRACT:
|
||||||
{
|
/* Hidden icon with folder closed */
|
||||||
/* Hidden icon with folder closed */
|
Brw_PutIconFolderWithoutPlus (FileBrowserId,RowId,
|
||||||
Brw_PutIconFolderWithoutPlus (FileBrowserId,RowId,
|
CloOpe_CLOSED, // Closed
|
||||||
false, // Closed
|
HidVis_HIDDEN);
|
||||||
HidVis_HIDDEN);
|
|
||||||
|
|
||||||
/* Visible icon with folder open */
|
/* Visible icon with folder open */
|
||||||
Brw_PutIconFolderWithoutPlus (FileBrowserId,RowId,
|
Brw_PutIconFolderWithoutPlus (FileBrowserId,RowId,
|
||||||
true, // Open
|
CloOpe_OPEN, // Open
|
||||||
HidVis_VISIBLE);
|
HidVis_VISIBLE);
|
||||||
|
break;
|
||||||
|
case Brw_ICON_TREE_NOTHING:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -4543,22 +4553,22 @@ static void Brw_PutIconFolder (unsigned Level,
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Brw_PutIconFolderWithoutPlus (const char *FileBrowserId,const char *RowId,
|
static void Brw_PutIconFolderWithoutPlus (const char *FileBrowserId,const char *RowId,
|
||||||
bool Open,HidVis_HiddenOrVisible_t HiddenOrVisible)
|
CloOpe_ClosedOrOpen_t Open,HidVis_HiddenOrVisible_t HiddenOrVisible)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Folder;
|
extern const char *Txt_Folder;
|
||||||
extern const char *HidVis_ShownStyle[HidVis_NUM_HIDDEN_VISIBLE];
|
extern const char *HidVis_ShownStyle[HidVis_NUM_HIDDEN_VISIBLE];
|
||||||
|
|
||||||
/***** Begin container *****/
|
/***** Begin container *****/
|
||||||
HTM_DIV_Begin ("id=\"folder_%s_%s_%s\" class=\"%s\"%s",
|
HTM_DIV_Begin ("id=\"folder_%s_%s_%s\" class=\"%s\"%s",
|
||||||
Open ? "open" :
|
Open == CloOpe_OPEN ? "open" :
|
||||||
"closed",
|
"closed",
|
||||||
FileBrowserId,RowId,
|
FileBrowserId,RowId,
|
||||||
The_GetColorRows (),
|
The_GetColorRows (),
|
||||||
HidVis_ShownStyle[HiddenOrVisible]);
|
HidVis_ShownStyle[HiddenOrVisible]);
|
||||||
|
|
||||||
/***** Icon *****/
|
/***** Icon *****/
|
||||||
Ico_PutIcon (Open ? "folder-open-yellow.png" :
|
Ico_PutIcon (Open == CloOpe_OPEN ? "folder-open-yellow.png" :
|
||||||
"folder-yellow.png",
|
"folder-yellow.png",
|
||||||
Ico_UNCHANGED,
|
Ico_UNCHANGED,
|
||||||
Txt_Folder,"CONTEXT_OPT CONTEXT_ICO16x16");
|
Txt_Folder,"CONTEXT_OPT CONTEXT_ICO16x16");
|
||||||
|
|
||||||
|
@ -4571,14 +4581,14 @@ static void Brw_PutIconFolderWithoutPlus (const char *FileBrowserId,const char *
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Brw_PutIconFolderWithPlus (const char *FileBrowserId,const char *RowId,
|
static void Brw_PutIconFolderWithPlus (const char *FileBrowserId,const char *RowId,
|
||||||
bool Open,HidVis_HiddenOrVisible_t HiddenOrVisible)
|
CloOpe_ClosedOrOpen_t Open,HidVis_HiddenOrVisible_t HiddenOrVisible)
|
||||||
{
|
{
|
||||||
extern const char *HidVis_ShownStyle[HidVis_NUM_HIDDEN_VISIBLE];
|
extern const char *HidVis_ShownStyle[HidVis_NUM_HIDDEN_VISIBLE];
|
||||||
|
|
||||||
/***** Begin container *****/
|
/***** Begin container *****/
|
||||||
HTM_DIV_Begin ("id=\"folder_%s_%s_%s\" class=\"%s\"%s",
|
HTM_DIV_Begin ("id=\"folder_%s_%s_%s\" class=\"%s\"%s",
|
||||||
Open ? "open" :
|
Open == CloOpe_OPEN ? "open" :
|
||||||
"closed",
|
"closed",
|
||||||
FileBrowserId,RowId,
|
FileBrowserId,RowId,
|
||||||
The_GetColorRows (),
|
The_GetColorRows (),
|
||||||
HidVis_ShownStyle[HiddenOrVisible]);
|
HidVis_ShownStyle[HiddenOrVisible]);
|
||||||
|
|
|
@ -327,7 +327,7 @@ static void CtrCfg_Map (const struct Map_Coordinates *Coord)
|
||||||
/* Add popup */
|
/* Add popup */
|
||||||
Map_AddPopup (Gbl.Hierarchy.Node[Hie_CTR].ShrtName,
|
Map_AddPopup (Gbl.Hierarchy.Node[Hie_CTR].ShrtName,
|
||||||
Gbl.Hierarchy.Node[Hie_INS].ShrtName,
|
Gbl.Hierarchy.Node[Hie_INS].ShrtName,
|
||||||
true); // Open
|
CloOpe_OPEN); // Open
|
||||||
|
|
||||||
HTM_SCRIPT_End ();
|
HTM_SCRIPT_End ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -633,10 +633,11 @@ Me sale este error, no s
|
||||||
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
|
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 23.73 (2024-04-06)"
|
#define Log_PLATFORM_VERSION "SWAD 23.74 (2024-04-07)"
|
||||||
#define CSS_FILE "swad23.67.2.css"
|
#define CSS_FILE "swad23.67.2.css"
|
||||||
#define JS_FILE "swad23.53.6.js"
|
#define JS_FILE "swad23.53.6.js"
|
||||||
/*
|
/*
|
||||||
|
Version 23.74: Apr 07, 2024 New type CloOpe_ClosedOrOpen_t. (335553 lines)
|
||||||
Version 23.73: Apr 06, 2024 Code refactoring related to new type Usr_ICan_t. (335399 lines)
|
Version 23.73: Apr 06, 2024 Code refactoring related to new type Usr_ICan_t. (335399 lines)
|
||||||
Version 23.72.2: Apr 02, 2024 Code refactoring related to new type Usr_ICan_t. (334970 lines)
|
Version 23.72.2: Apr 02, 2024 Code refactoring related to new type Usr_ICan_t. (334970 lines)
|
||||||
Version 23.72.1: Apr 01, 2024 Code refactoring related to new type Usr_ICan_t. (334912 lines)
|
Version 23.72.1: Apr 01, 2024 Code refactoring related to new type Usr_ICan_t. (334912 lines)
|
||||||
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
// swad_closed_open.c: types and constants related to closed/open
|
||||||
|
|
||||||
|
/*
|
||||||
|
SWAD (Shared Workspace At a Distance),
|
||||||
|
is a web platform developed at the University of Granada (Spain),
|
||||||
|
and used to support university teaching.
|
||||||
|
|
||||||
|
This file is part of SWAD core.
|
||||||
|
Copyright (C) 1999-2024 Antonio Cañas Vargas
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General 3 License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*********************************** Headers *********************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include "swad_closed_open.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/****************************** Public constants *****************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/* Open in database fields */
|
||||||
|
const char CloOpe_YN[CloOpe_NUM_CLOSED_OPEN] =
|
||||||
|
{
|
||||||
|
[CloOpe_CLOSED] = 'Y',
|
||||||
|
[CloOpe_OPEN ] = 'N',
|
||||||
|
};
|
||||||
|
/*
|
||||||
|
const char *CloOpe_DateGreenClass[CloOpe_NUM_CLOSED_OPEN] =
|
||||||
|
{
|
||||||
|
[CloOpe_CLOSED] = "DATE_GREEN_LIGHT",
|
||||||
|
[CloOpe_OPEN ] = "DATE_GREEN",
|
||||||
|
};
|
||||||
|
const char *CloOpe_DateRedClass[CloOpe_NUM_CLOSED_OPEN] =
|
||||||
|
{
|
||||||
|
[CloOpe_CLOSED] = "DATE_RED_LIGHT",
|
||||||
|
[CloOpe_OPEN ] = "DATE_RED",
|
||||||
|
};
|
||||||
|
const char *CloOpe_DateBlueClass[CloOpe_NUM_CLOSED_OPEN] =
|
||||||
|
{
|
||||||
|
[CloOpe_CLOSED ] = "DATE_BLUE_LIGHT",
|
||||||
|
[CloOpe_OPEN] = "DATE_BLUE",
|
||||||
|
};
|
||||||
|
const char *CloOpe_TitleClass[CloOpe_NUM_CLOSED_OPEN] =
|
||||||
|
{
|
||||||
|
[CloOpe_CLOSED] = "ASG_TITLE_LIGHT",
|
||||||
|
[CloOpe_OPEN ] = "ASG_TITLE",
|
||||||
|
};
|
||||||
|
const char *CloOpe_GroupClass[CloOpe_NUM_CLOSED_OPEN] =
|
||||||
|
{
|
||||||
|
[CloOpe_CLOSED] = "ASG_GRP_LIGHT",
|
||||||
|
[CloOpe_OPEN ] = "ASG_GRP",
|
||||||
|
};
|
||||||
|
const char *CloOpe_LabelClass[CloOpe_NUM_CLOSED_OPEN] =
|
||||||
|
{
|
||||||
|
[CloOpe_CLOSED] = "ASG_LABEL_LIGHT",
|
||||||
|
[CloOpe_OPEN ] = "ASG_LABEL",
|
||||||
|
};
|
||||||
|
const char *CloOpe_DataClass[CloOpe_NUM_CLOSED_OPEN] =
|
||||||
|
{
|
||||||
|
[CloOpe_CLOSED] = "DAT_LIGHT",
|
||||||
|
[CloOpe_OPEN ] = "DAT",
|
||||||
|
};
|
||||||
|
const char *CloOpe_MsgClass[CloOpe_NUM_CLOSED_OPEN] =
|
||||||
|
{
|
||||||
|
[CloOpe_CLOSED] = "MSG_AUT_LIGHT",
|
||||||
|
[CloOpe_OPEN ] = "MSG_AUT",
|
||||||
|
};
|
||||||
|
const char *CloOpe_PrgClass[CloOpe_NUM_CLOSED_OPEN] =
|
||||||
|
{
|
||||||
|
[CloOpe_CLOSED] = " PRG_HIDDEN",
|
||||||
|
[CloOpe_OPEN ] = "",
|
||||||
|
};
|
||||||
|
const char *CloOpe_ShownStyle[CloOpe_NUM_CLOSED_OPEN] =
|
||||||
|
{
|
||||||
|
[CloOpe_CLOSED] = " style=\"display:none;\"",
|
||||||
|
[CloOpe_OPEN ] = "",
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
/*****************************************************************************/
|
||||||
|
/****************** Get if closed or open from a character *******************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
CloOpe_ClosedOrOpen_t CloOpe_GetClosedOrOpen (char Ch)
|
||||||
|
{
|
||||||
|
return (Ch == 'Y') ? CloOpe_OPEN :
|
||||||
|
CloOpe_CLOSED;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
// swad_closed_open.h: types and constants related to closed/open
|
||||||
|
|
||||||
|
#ifndef _SWAD_CLO_OPE
|
||||||
|
#define _SWAD_CLO_OPE
|
||||||
|
/*
|
||||||
|
SWAD (Shared Workspace At a Distance in Spanish),
|
||||||
|
is a web platform developed at the University of Granada (Spain),
|
||||||
|
and used to support university teaching.
|
||||||
|
|
||||||
|
This file is part of SWAD core.
|
||||||
|
Copyright (C) 1999-2024 Antonio Cañas Vargas
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/***************************** Public constants ******************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#define CloOpe_NUM_CLOSED_OPEN 2
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/******************************* Public types ********************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
CloOpe_CLOSED = 0,
|
||||||
|
CloOpe_OPEN = 1,
|
||||||
|
} CloOpe_ClosedOrOpen_t;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/****************************** Public prototypes ****************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
CloOpe_ClosedOrOpen_t CloOpe_GetClosedOrOpen (char c);
|
||||||
|
|
||||||
|
#endif
|
|
@ -127,7 +127,7 @@ void ExaSes_ResetSession (struct ExaSes_Session *Session)
|
||||||
Session->TimeUTC[StartEndTime] = (time_t) 0;
|
Session->TimeUTC[StartEndTime] = (time_t) 0;
|
||||||
Session->Title[0] = '\0';
|
Session->Title[0] = '\0';
|
||||||
Session->HiddenOrVisible = HidVis_VISIBLE;
|
Session->HiddenOrVisible = HidVis_VISIBLE;
|
||||||
Session->Open = false;
|
Session->Open = CloOpe_CLOSED;
|
||||||
Session->ShowUsrResults = false;
|
Session->ShowUsrResults = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -469,8 +469,8 @@ static void ExaSes_ListOneOrMoreSessionsTimes (const struct ExaSes_Session *Sess
|
||||||
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
||||||
StartEndTime++)
|
StartEndTime++)
|
||||||
{
|
{
|
||||||
DateClass = Session->Open ? HidVis_DateGreenClass[Session->HiddenOrVisible] :
|
DateClass = Session->Open == CloOpe_OPEN ? HidVis_DateGreenClass[Session->HiddenOrVisible] :
|
||||||
HidVis_DateRedClass[Session->HiddenOrVisible];
|
HidVis_DateRedClass[Session->HiddenOrVisible];
|
||||||
|
|
||||||
if (asprintf (&Id,"exa_time_%u_%u",(unsigned) StartEndTime,UniqueId) < 0)
|
if (asprintf (&Id,"exa_time_%u_%u",(unsigned) StartEndTime,UniqueId) < 0)
|
||||||
Err_NotEnoughMemoryExit ();
|
Err_NotEnoughMemoryExit ();
|
||||||
|
@ -751,7 +751,8 @@ static void ExaSes_GetSessionDataFromRow (MYSQL_RES *mysql_res,
|
||||||
Session->TimeUTC[StartEndTime] = Dat_GetUNIXTimeFromStr (row[4 + StartEndTime]);
|
Session->TimeUTC[StartEndTime] = Dat_GetUNIXTimeFromStr (row[4 + StartEndTime]);
|
||||||
|
|
||||||
/* Get whether the session is open or closed (row(6)) */
|
/* Get whether the session is open or closed (row(6)) */
|
||||||
Session->Open = (row[6][0] == '1');
|
Session->Open = (row[6][0] == '1') ? CloOpe_OPEN :
|
||||||
|
CloOpe_CLOSED;
|
||||||
|
|
||||||
/* Get the title of the session (row[7]) */
|
/* Get the title of the session (row[7]) */
|
||||||
if (row[7])
|
if (row[7])
|
||||||
|
@ -1218,7 +1219,7 @@ Usr_ICan_t ExaSes_CheckIfICanAnswerThisSession (const struct Exa_Exam *Exam,
|
||||||
2. Hidden or closed sessions are not accesible *****/
|
2. Hidden or closed sessions are not accesible *****/
|
||||||
if (Exam->HiddenOrVisible == HidVis_HIDDEN ||
|
if (Exam->HiddenOrVisible == HidVis_HIDDEN ||
|
||||||
Session->HiddenOrVisible == HidVis_HIDDEN ||
|
Session->HiddenOrVisible == HidVis_HIDDEN ||
|
||||||
!Session->Open)
|
Session->Open == CloOpe_CLOSED)
|
||||||
return Usr_I_CAN_NOT;
|
return Usr_I_CAN_NOT;
|
||||||
|
|
||||||
/***** Exam is visible, session is visible and open ==>
|
/***** Exam is visible, session is visible and open ==>
|
||||||
|
|
|
@ -148,8 +148,8 @@ struct ExaSes_Session
|
||||||
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||||
char Title[ExaSes_MAX_BYTES_TITLE + 1];
|
char Title[ExaSes_MAX_BYTES_TITLE + 1];
|
||||||
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
||||||
bool Open; // If now is between start and end dates
|
CloOpe_ClosedOrOpen_t Open; // If now is between start and end dates
|
||||||
bool ShowUsrResults; // Show exam with results of all questions for the student
|
bool ShowUsrResults; // Show exam with results of all questions for the student
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -174,7 +174,7 @@ void Gbl_InitializeGlobals (void)
|
||||||
Gbl.Crs.Grps.GrpName[0] = '\0';
|
Gbl.Crs.Grps.GrpName[0] = '\0';
|
||||||
Gbl.Crs.Grps.RooCod = -1L; // -1L stands for no room assigned
|
Gbl.Crs.Grps.RooCod = -1L; // -1L stands for no room assigned
|
||||||
Gbl.Crs.Grps.MaxStudents = Grp_NUM_STUDENTS_NOT_LIMITED;
|
Gbl.Crs.Grps.MaxStudents = Grp_NUM_STUDENTS_NOT_LIMITED;
|
||||||
Gbl.Crs.Grps.Open = false;
|
Gbl.Crs.Grps.Open = CloOpe_CLOSED;
|
||||||
Gbl.Crs.Grps.LstGrpsSel.GrpCods = NULL;
|
Gbl.Crs.Grps.LstGrpsSel.GrpCods = NULL;
|
||||||
Gbl.Crs.Grps.LstGrpsSel.NumGrps = 0;
|
Gbl.Crs.Grps.LstGrpsSel.NumGrps = 0;
|
||||||
Gbl.Crs.Grps.LstGrpsSel.NestedCalls = 0;
|
Gbl.Crs.Grps.LstGrpsSel.NestedCalls = 0;
|
||||||
|
|
70
swad_group.c
70
swad_group.c
|
@ -778,7 +778,7 @@ bool Grp_ChangeMyGrpsAtomically (struct ListCodGrps *LstGrpsIWant)
|
||||||
NumGrpThisType < GrpTyp->NumGrps && !ITryToLeaveAClosedGroup;
|
NumGrpThisType < GrpTyp->NumGrps && !ITryToLeaveAClosedGroup;
|
||||||
NumGrpThisType++)
|
NumGrpThisType++)
|
||||||
if ((GrpTyp->LstGrps[NumGrpThisType]).GrpCod == LstGrpsIBelong.GrpCods[NumGrpIBelong])
|
if ((GrpTyp->LstGrps[NumGrpThisType]).GrpCod == LstGrpsIBelong.GrpCods[NumGrpIBelong])
|
||||||
if (!((GrpTyp->LstGrps[NumGrpThisType]).Open))
|
if ((GrpTyp->LstGrps[NumGrpThisType]).Open == CloOpe_CLOSED)
|
||||||
ITryToLeaveAClosedGroup = true;
|
ITryToLeaveAClosedGroup = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -814,7 +814,7 @@ bool Grp_ChangeMyGrpsAtomically (struct ListCodGrps *LstGrpsIWant)
|
||||||
if ((GrpTyp->LstGrps[NumGrpThisType]).GrpCod == LstGrpsIWant->GrpCods[NumGrpIWant])
|
if ((GrpTyp->LstGrps[NumGrpThisType]).GrpCod == LstGrpsIWant->GrpCods[NumGrpIWant])
|
||||||
{
|
{
|
||||||
/* Check if the group is closed */
|
/* Check if the group is closed */
|
||||||
if (!((GrpTyp->LstGrps[NumGrpThisType]).Open))
|
if ((GrpTyp->LstGrps[NumGrpThisType]).Open == CloOpe_CLOSED)
|
||||||
ITryToRegisterInAClosedGroup = true;
|
ITryToRegisterInAClosedGroup = true;
|
||||||
/* Check if the group is full */
|
/* Check if the group is full */
|
||||||
else if ((GrpTyp->LstGrps[NumGrpThisType]).NumUsrs[Rol_STD] >=
|
else if ((GrpTyp->LstGrps[NumGrpThisType]).NumUsrs[Rol_STD] >=
|
||||||
|
@ -1428,16 +1428,16 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms)
|
||||||
|
|
||||||
/***** Icon to open/close group *****/
|
/***** Icon to open/close group *****/
|
||||||
HTM_TD_Begin ("class=\"BM\"");
|
HTM_TD_Begin ("class=\"BM\"");
|
||||||
Frm_BeginFormAnchor (Grp->Open ? ActCloGrp :
|
Frm_BeginFormAnchor (Grp->Open == CloOpe_OPEN ? ActCloGrp :
|
||||||
ActOpeGrp,
|
ActOpeGrp,
|
||||||
Grp_GROUPS_SECTION_ID);
|
Grp_GROUPS_SECTION_ID);
|
||||||
ParCod_PutPar (ParCod_Grp,Grp->GrpCod);
|
ParCod_PutPar (ParCod_Grp,Grp->GrpCod);
|
||||||
Ico_PutIconLink (Grp->Open ? "unlock.svg" :
|
Ico_PutIconLink (Grp->Open == CloOpe_OPEN ? "unlock.svg" :
|
||||||
"lock.svg",
|
"lock.svg",
|
||||||
Grp->Open ? Ico_GREEN :
|
Grp->Open == CloOpe_OPEN ? Ico_GREEN :
|
||||||
Ico_RED,
|
Ico_RED,
|
||||||
Grp->Open ? ActCloGrp :
|
Grp->Open == CloOpe_OPEN ? ActCloGrp :
|
||||||
ActOpeGrp);
|
ActOpeGrp);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
@ -1863,7 +1863,7 @@ static Usr_ICan_t Grp_ListGrpsForChangeMySelection (struct GroupType *GrpTyp,
|
||||||
NumGrpThisType++)
|
NumGrpThisType++)
|
||||||
{
|
{
|
||||||
Grp = &(GrpTyp->LstGrps[NumGrpThisType]);
|
Grp = &(GrpTyp->LstGrps[NumGrpThisType]);
|
||||||
if (Grp->Open) // If group is open
|
if (Grp->Open == CloOpe_OPEN) // If group is open
|
||||||
{
|
{
|
||||||
IBelongToThisGroup = Grp_CheckIfGrpIsInList (Grp->GrpCod,&LstGrpsIBelong);
|
IBelongToThisGroup = Grp_CheckIfGrpIsInList (Grp->GrpCod,&LstGrpsIBelong);
|
||||||
if (IBelongToThisGroup) // I belong to this group
|
if (IBelongToThisGroup) // I belong to this group
|
||||||
|
@ -1882,7 +1882,7 @@ static Usr_ICan_t Grp_ListGrpsForChangeMySelection (struct GroupType *GrpTyp,
|
||||||
NumGrpThisType++)
|
NumGrpThisType++)
|
||||||
{
|
{
|
||||||
Grp = &(GrpTyp->LstGrps[NumGrpThisType]);
|
Grp = &(GrpTyp->LstGrps[NumGrpThisType]);
|
||||||
if (!Grp->Open) // If group is closed
|
if (Grp->Open == CloOpe_CLOSED) // If group is closed
|
||||||
{
|
{
|
||||||
IBelongToThisGroup = Grp_CheckIfGrpIsInList (Grp->GrpCod,&LstGrpsIBelong);
|
IBelongToThisGroup = Grp_CheckIfGrpIsInList (Grp->GrpCod,&LstGrpsIBelong);
|
||||||
if (IBelongToThisGroup) // I belong to this group
|
if (IBelongToThisGroup) // I belong to this group
|
||||||
|
@ -1900,7 +1900,7 @@ static Usr_ICan_t Grp_ListGrpsForChangeMySelection (struct GroupType *GrpTyp,
|
||||||
NumGrpThisType++)
|
NumGrpThisType++)
|
||||||
{
|
{
|
||||||
Grp = &(GrpTyp->LstGrps[NumGrpThisType]);
|
Grp = &(GrpTyp->LstGrps[NumGrpThisType]);
|
||||||
if (Grp->Open && // If group is open...
|
if (Grp->Open == CloOpe_OPEN && // If group is open...
|
||||||
Grp->NumUsrs[Rol_STD] < Grp->MaxStudents) // ...and not full
|
Grp->NumUsrs[Rol_STD] < Grp->MaxStudents) // ...and not full
|
||||||
{
|
{
|
||||||
IBelongToThisGroup = Grp_CheckIfGrpIsInList (Grp->GrpCod,&LstGrpsIBelong);
|
IBelongToThisGroup = Grp_CheckIfGrpIsInList (Grp->GrpCod,&LstGrpsIBelong);
|
||||||
|
@ -1933,16 +1933,18 @@ static Usr_ICan_t Grp_ListGrpsForChangeMySelection (struct GroupType *GrpTyp,
|
||||||
case Usr_I_CAN:
|
case Usr_I_CAN:
|
||||||
ICanChangeMySelectionForThisGrp = Usr_I_CAN;
|
ICanChangeMySelectionForThisGrp = Usr_I_CAN;
|
||||||
if (Gbl.Usrs.Me.Role.Logged == Rol_STD)
|
if (Gbl.Usrs.Me.Role.Logged == Rol_STD)
|
||||||
{
|
switch (Grp->Open)
|
||||||
if (Grp->Open) // If group is open
|
{
|
||||||
{
|
case CloOpe_OPEN: // If group is open
|
||||||
if (!IBelongToThisGroup && // I don't belong to group
|
if (!IBelongToThisGroup && // I don't belong to group
|
||||||
Grp->NumUsrs[Rol_STD] >= Grp->MaxStudents) // Group is full
|
Grp->NumUsrs[Rol_STD] >= Grp->MaxStudents) // Group is full
|
||||||
|
ICanChangeMySelectionForThisGrp = Usr_I_CAN_NOT;
|
||||||
|
break;
|
||||||
|
case CloOpe_CLOSED: // If group is closed
|
||||||
|
default:
|
||||||
ICanChangeMySelectionForThisGrp = Usr_I_CAN_NOT;
|
ICanChangeMySelectionForThisGrp = Usr_I_CAN_NOT;
|
||||||
}
|
break;
|
||||||
else // If group is closed
|
}
|
||||||
ICanChangeMySelectionForThisGrp = Usr_I_CAN_NOT;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case Usr_I_CAN_NOT: // I can not change my selection for this group type
|
case Usr_I_CAN_NOT: // I can not change my selection for this group type
|
||||||
default:
|
default:
|
||||||
|
@ -2337,14 +2339,14 @@ static void Grp_WriteRowGrp (struct Group *Grp,Lay_Highlight_t Highlight)
|
||||||
|
|
||||||
/***** Write icon to show if group is open or closed *****/
|
/***** Write icon to show if group is open or closed *****/
|
||||||
HTM_TD_Begin ("class=\"BM%s\"",HighlightClass[Highlight]);
|
HTM_TD_Begin ("class=\"BM%s\"",HighlightClass[Highlight]);
|
||||||
if (asprintf (&Title,Grp->Open ? Txt_Group_X_open :
|
if (asprintf (&Title,Grp->Open == CloOpe_OPEN ? Txt_Group_X_open :
|
||||||
Txt_Group_X_closed,
|
Txt_Group_X_closed,
|
||||||
Grp->GrpName) < 0)
|
Grp->GrpName) < 0)
|
||||||
Err_NotEnoughMemoryExit ();
|
Err_NotEnoughMemoryExit ();
|
||||||
Ico_PutIconOff (Grp->Open ? "unlock.svg" :
|
Ico_PutIconOff (Grp->Open == CloOpe_OPEN ? "unlock.svg" :
|
||||||
"lock.svg",
|
"lock.svg",
|
||||||
Grp->Open ? Ico_GREEN :
|
Grp->Open == CloOpe_OPEN ? Ico_GREEN :
|
||||||
Ico_RED,
|
Ico_RED,
|
||||||
Title);
|
Title);
|
||||||
free (Title);
|
free (Title);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
@ -2846,7 +2848,8 @@ void Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_WhichGroupTypes_t WhichGroupTypes)
|
||||||
|
|
||||||
/* Get whether group is open ('Y') or closed ('N') (row[5]),
|
/* Get whether group is open ('Y') or closed ('N') (row[5]),
|
||||||
and whether group have file zones ('Y') or not ('N') (row[6]) */
|
and whether group have file zones ('Y') or not ('N') (row[6]) */
|
||||||
Grp->Open = (row[5][0] == 'Y');
|
Grp->Open = (row[5][0] == 'Y') ? CloOpe_OPEN :
|
||||||
|
CloOpe_CLOSED;
|
||||||
Grp->FileZones = (row[6][0] == 'Y');
|
Grp->FileZones = (row[6][0] == 'Y');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2959,7 +2962,7 @@ void Grp_GetGroupDataByCod (struct GroupData *GrpDat)
|
||||||
GrpDat->Room.ShrtName[0] = '\0';
|
GrpDat->Room.ShrtName[0] = '\0';
|
||||||
GrpDat->MaxStudents = 0;
|
GrpDat->MaxStudents = 0;
|
||||||
GrpDat->Vacant = 0;
|
GrpDat->Vacant = 0;
|
||||||
GrpDat->Open = false;
|
GrpDat->Open = CloOpe_CLOSED;
|
||||||
GrpDat->FileZones = false;
|
GrpDat->FileZones = false;
|
||||||
GrpDat->MultipleEnrolment = false;
|
GrpDat->MultipleEnrolment = false;
|
||||||
|
|
||||||
|
@ -3003,7 +3006,8 @@ void Grp_GetGroupDataByCod (struct GroupData *GrpDat)
|
||||||
|
|
||||||
/* Get whether group is open or closed (row[8]),
|
/* Get whether group is open or closed (row[8]),
|
||||||
and whether group has file zones (row[9]) */
|
and whether group has file zones (row[9]) */
|
||||||
GrpDat->Open = (row[8][0] == 'Y');
|
GrpDat->Open = (row[8][0] == 'Y') ? CloOpe_OPEN :
|
||||||
|
CloOpe_CLOSED;
|
||||||
GrpDat->FileZones = (row[9][0] == 'Y');
|
GrpDat->FileZones = (row[9][0] == 'Y');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3598,7 +3602,7 @@ void Grp_OpenGroup (void)
|
||||||
GrpDat.GrpName);
|
GrpDat.GrpName);
|
||||||
|
|
||||||
/***** Show the form again *****/
|
/***** Show the form again *****/
|
||||||
Gbl.Crs.Grps.Open = true;
|
Gbl.Crs.Grps.Open = CloOpe_OPEN;
|
||||||
Grp_ReqEditGroupsInternal (Ale_INFO,NULL,
|
Grp_ReqEditGroupsInternal (Ale_INFO,NULL,
|
||||||
Ale_SUCCESS,AlertTxt);
|
Ale_SUCCESS,AlertTxt);
|
||||||
}
|
}
|
||||||
|
@ -3628,7 +3632,7 @@ void Grp_CloseGroup (void)
|
||||||
GrpDat.GrpName);
|
GrpDat.GrpName);
|
||||||
|
|
||||||
/***** Show the form again *****/
|
/***** Show the form again *****/
|
||||||
Gbl.Crs.Grps.Open = false;
|
Gbl.Crs.Grps.Open = CloOpe_CLOSED;
|
||||||
Grp_ReqEditGroupsInternal (Ale_INFO,NULL,
|
Grp_ReqEditGroupsInternal (Ale_INFO,NULL,
|
||||||
Ale_SUCCESS,AlertTxt);
|
Ale_SUCCESS,AlertTxt);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ struct GroupData
|
||||||
} Room;
|
} Room;
|
||||||
unsigned MaxStudents;
|
unsigned MaxStudents;
|
||||||
int Vacant;
|
int Vacant;
|
||||||
bool Open; // Group is open?
|
CloOpe_ClosedOrOpen_t Open; // Group is open?
|
||||||
bool FileZones; // Group has file zones?
|
bool FileZones; // Group has file zones?
|
||||||
bool MultipleEnrolment;
|
bool MultipleEnrolment;
|
||||||
};
|
};
|
||||||
|
@ -87,7 +87,7 @@ struct Group
|
||||||
} Room;
|
} Room;
|
||||||
unsigned NumUsrs[Rol_NUM_ROLES]; // Number of users in the group
|
unsigned NumUsrs[Rol_NUM_ROLES]; // Number of users in the group
|
||||||
unsigned MaxStudents; // Maximum number of students in the group
|
unsigned MaxStudents; // Maximum number of students in the group
|
||||||
bool Open; // Group is open?
|
CloOpe_ClosedOrOpen_t Open; // Group is open?
|
||||||
bool FileZones; // Group has file zones?
|
bool FileZones; // Group has file zones?
|
||||||
bool ShowFileZone; // Show file zone of this group?
|
bool ShowFileZone; // Show file zone of this group?
|
||||||
};
|
};
|
||||||
|
@ -152,7 +152,7 @@ struct Grp_Groups
|
||||||
char GrpName[Grp_MAX_BYTES_GROUP_NAME + 1];
|
char GrpName[Grp_MAX_BYTES_GROUP_NAME + 1];
|
||||||
long RooCod;
|
long RooCod;
|
||||||
unsigned MaxStudents;
|
unsigned MaxStudents;
|
||||||
bool Open;
|
CloOpe_ClosedOrOpen_t Open;
|
||||||
bool FileZones;
|
bool FileZones;
|
||||||
bool AllGrps; // All groups selected?
|
bool AllGrps; // All groups selected?
|
||||||
struct ListCodGrps LstGrpsSel;
|
struct ListCodGrps LstGrpsSel;
|
||||||
|
|
|
@ -380,12 +380,12 @@ void Ico_PutContextualIconToPaste (Act_Action_t NextAction,
|
||||||
|
|
||||||
void Ico_PutContextualIconToCreateInFolder (Act_Action_t NextAction,
|
void Ico_PutContextualIconToCreateInFolder (Act_Action_t NextAction,
|
||||||
void (*FuncPars) (void *Args),void *Args,
|
void (*FuncPars) (void *Args),void *Args,
|
||||||
bool Open)
|
CloOpe_ClosedOrOpen_t Open)
|
||||||
{
|
{
|
||||||
Lay_PutContextualLinkOnlyIcon (NextAction,NULL,
|
Lay_PutContextualLinkOnlyIcon (NextAction,NULL,
|
||||||
FuncPars,Args,
|
FuncPars,Args,
|
||||||
Open ? "folder-open-yellow-plus.png" :
|
Open == CloOpe_OPEN ? "folder-open-yellow-plus.png" :
|
||||||
"folder-yellow-plus.png",
|
"folder-yellow-plus.png",
|
||||||
Ico_UNCHANGED);
|
Ico_UNCHANGED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
/********************************* Headers ***********************************/
|
/********************************* Headers ***********************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include "swad_closed_open.h"
|
||||||
#include "swad_hidden_visible.h"
|
#include "swad_hidden_visible.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -113,7 +114,7 @@ void Ico_PutContextualIconToPaste (Act_Action_t NextAction,
|
||||||
void (*FuncPars) (void *Args),void *Args);
|
void (*FuncPars) (void *Args),void *Args);
|
||||||
void Ico_PutContextualIconToCreateInFolder (Act_Action_t NextAction,
|
void Ico_PutContextualIconToCreateInFolder (Act_Action_t NextAction,
|
||||||
void (*FuncPars) (void *Args),void *Args,
|
void (*FuncPars) (void *Args),void *Args,
|
||||||
bool Open);
|
CloOpe_ClosedOrOpen_t Open);
|
||||||
void Ico_PutContextualIconToShowResults (Act_Action_t NextAction,const char *Anchor,
|
void Ico_PutContextualIconToShowResults (Act_Action_t NextAction,const char *Anchor,
|
||||||
void (*FuncPars) (void *Args),void *Args);
|
void (*FuncPars) (void *Args),void *Args);
|
||||||
void Ico_PutContextualIconToShowAttendanceList (Act_Action_t NextAction,
|
void Ico_PutContextualIconToShowAttendanceList (Act_Action_t NextAction,
|
||||||
|
|
|
@ -131,7 +131,7 @@ void Map_AddMarker (const struct Map_Coordinates *Coord)
|
||||||
/************************* Add a marker to our map ***************************/
|
/************************* Add a marker to our map ***************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Map_AddPopup (const char *Title,const char *Subtitle,bool Open)
|
void Map_AddPopup (const char *Title,const char *Subtitle,CloOpe_ClosedOrOpen_t Open)
|
||||||
{
|
{
|
||||||
/* The bindPopup method attaches a popup with the specified HTML content
|
/* The bindPopup method attaches a popup with the specified HTML content
|
||||||
to your marker so the popup appears when you click on the object,
|
to your marker so the popup appears when you click on the object,
|
||||||
|
@ -140,7 +140,7 @@ void Map_AddPopup (const char *Title,const char *Subtitle,bool Open)
|
||||||
HTM_TxtF ("\t"
|
HTM_TxtF ("\t"
|
||||||
"marker.bindPopup(\"<strong>%s</strong><br />%s\")",
|
"marker.bindPopup(\"<strong>%s</strong><br />%s\")",
|
||||||
Title,Subtitle);
|
Title,Subtitle);
|
||||||
if (Open)
|
if (Open == CloOpe_OPEN)
|
||||||
HTM_Txt (".openPopup()");
|
HTM_Txt (".openPopup()");
|
||||||
HTM_Txt (";\n");
|
HTM_Txt (";\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
|
|
||||||
#include <stdbool.h> // For boolean type
|
#include <stdbool.h> // For boolean type
|
||||||
|
|
||||||
|
#include "swad_closed_open.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************** Public types and constants ***********************/
|
/************************** Public types and constants ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -50,7 +52,7 @@ void Map_CreateMap (const char *ContainerId,
|
||||||
const struct Map_Coordinates *Coord,unsigned Zoom);
|
const struct Map_Coordinates *Coord,unsigned Zoom);
|
||||||
void Map_AddTileLayer (void);
|
void Map_AddTileLayer (void);
|
||||||
void Map_AddMarker (const struct Map_Coordinates *Coord);
|
void Map_AddMarker (const struct Map_Coordinates *Coord);
|
||||||
void Map_AddPopup (const char *Title,const char *Subtitle,bool Open);
|
void Map_AddPopup (const char *Title,const char *Subtitle,CloOpe_ClosedOrOpen_t Open);
|
||||||
void Map_GetCoordAndZoom (struct Map_Coordinates *Coord,unsigned *Zoom,
|
void Map_GetCoordAndZoom (struct Map_Coordinates *Coord,unsigned *Zoom,
|
||||||
const char *Query);
|
const char *Query);
|
||||||
double Map_GetLatitudeFromStr (char *Str);
|
double Map_GetLatitudeFromStr (char *Str);
|
||||||
|
|
|
@ -154,7 +154,7 @@ static void Msg_GetMsgContent (long MsgCod,
|
||||||
|
|
||||||
static void Msg_WriteSentOrReceivedMsgSubject (struct Msg_Messages *Messages,
|
static void Msg_WriteSentOrReceivedMsgSubject (struct Msg_Messages *Messages,
|
||||||
long MsgCod,const char *Subject,
|
long MsgCod,const char *Subject,
|
||||||
bool Open,bool Expanded);
|
CloOpe_ClosedOrOpen_t Open,bool Expanded);
|
||||||
|
|
||||||
static bool Msg_WriteCrsOrgMsg (long CrsCod);
|
static bool Msg_WriteCrsOrgMsg (long CrsCod);
|
||||||
|
|
||||||
|
@ -2015,7 +2015,7 @@ static void Msg_ShowASentOrReceivedMessage (struct Msg_Messages *Messages,
|
||||||
char Content[Cns_MAX_BYTES_LONG_TEXT + 1];
|
char Content[Cns_MAX_BYTES_LONG_TEXT + 1];
|
||||||
struct Med_Media Media;
|
struct Med_Media Media;
|
||||||
bool Deleted;
|
bool Deleted;
|
||||||
bool Open = true;
|
CloOpe_ClosedOrOpen_t Open = CloOpe_OPEN;
|
||||||
bool Replied = false; // Initialized to avoid warning
|
bool Replied = false; // Initialized to avoid warning
|
||||||
bool Expanded = false;
|
bool Expanded = false;
|
||||||
|
|
||||||
|
@ -2040,9 +2040,9 @@ static void Msg_ShowASentOrReceivedMessage (struct Msg_Messages *Messages,
|
||||||
switch (Messages->TypeOfMessages)
|
switch (Messages->TypeOfMessages)
|
||||||
{
|
{
|
||||||
case Msg_RECEIVED:
|
case Msg_RECEIVED:
|
||||||
Title = (Open ? (Replied ? Txt_MSG_Replied :
|
Title = (Open == CloOpe_OPEN ? (Replied ? Txt_MSG_Replied :
|
||||||
Txt_MSG_Not_replied) :
|
Txt_MSG_Not_replied) :
|
||||||
Txt_MSG_Unopened);
|
Txt_MSG_Unopened);
|
||||||
break;
|
break;
|
||||||
case Msg_SENT:
|
case Msg_SENT:
|
||||||
Title = Txt_MSG_Sent;
|
Title = Txt_MSG_Sent;
|
||||||
|
@ -2055,15 +2055,15 @@ static void Msg_ShowASentOrReceivedMessage (struct Msg_Messages *Messages,
|
||||||
|
|
||||||
/***** Icons *****/
|
/***** Icons *****/
|
||||||
HTM_TD_Begin ("class=\"CONTEXT_COL %s_%s\"",
|
HTM_TD_Begin ("class=\"CONTEXT_COL %s_%s\"",
|
||||||
Messages->TypeOfMessages == Msg_RECEIVED ? (Open ? "MSG_BG" :
|
Messages->TypeOfMessages == Msg_RECEIVED ? (Open == CloOpe_OPEN ? "MSG_BG" :
|
||||||
"MSG_BG_NEW") :
|
"MSG_BG_NEW") :
|
||||||
"MSG_BG",
|
"MSG_BG",
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
|
|
||||||
/* Type of message icon (envelope, reply...) */
|
/* Type of message icon (envelope, reply...) */
|
||||||
Ico_PutIcon (Messages->TypeOfMessages == Msg_RECEIVED ? (Open ? (Replied ? "reply.svg" :
|
Ico_PutIcon (Messages->TypeOfMessages == Msg_RECEIVED ? (Open == CloOpe_OPEN ? (Replied ? "reply.svg" :
|
||||||
"envelope-open-text.svg") :
|
"envelope-open-text.svg") :
|
||||||
"envelope.svg") :
|
"envelope.svg") :
|
||||||
"share.svg",
|
"share.svg",
|
||||||
Ico_BLACK,Title,"ICO16x16");
|
Ico_BLACK,Title,"ICO16x16");
|
||||||
|
|
||||||
|
@ -2076,14 +2076,14 @@ static void Msg_ShowASentOrReceivedMessage (struct Msg_Messages *Messages,
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Number *****/
|
/***** Number *****/
|
||||||
Msg_WriteMsgNumber (MsgNum,!Open);
|
Msg_WriteMsgNumber (MsgNum,Open == CloOpe_CLOSED);
|
||||||
|
|
||||||
/***** Author *****/
|
/***** Author *****/
|
||||||
HTM_TD_Begin ("class=\"LT %s_%s %s_%s\"",
|
HTM_TD_Begin ("class=\"LT %s_%s %s_%s\"",
|
||||||
Open ? "MSG_AUT" :
|
Open == CloOpe_OPEN ? "MSG_AUT" :
|
||||||
"MSG_AUT_NEW",The_GetSuffix (),
|
"MSG_AUT_NEW",The_GetSuffix (),
|
||||||
Open ? "MSG_BG" :
|
Open == CloOpe_OPEN ? "MSG_BG" :
|
||||||
"MSG_BG_NEW",The_GetSuffix ());
|
"MSG_BG_NEW",The_GetSuffix ());
|
||||||
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,
|
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,
|
||||||
Usr_DONT_GET_PREFS,
|
Usr_DONT_GET_PREFS,
|
||||||
Usr_DONT_GET_ROLE_IN_CRS);
|
Usr_DONT_GET_ROLE_IN_CRS);
|
||||||
|
@ -2095,10 +2095,10 @@ static void Msg_ShowASentOrReceivedMessage (struct Msg_Messages *Messages,
|
||||||
|
|
||||||
/***** Date-time *****/
|
/***** Date-time *****/
|
||||||
Msg_WriteMsgDate (CreatTimeUTC,
|
Msg_WriteMsgDate (CreatTimeUTC,
|
||||||
Open ? "MSG_TIT" :
|
Open == CloOpe_OPEN ? "MSG_TIT" :
|
||||||
"MSG_TIT_NEW",
|
"MSG_TIT_NEW",
|
||||||
Open ? "MSG_BG" :
|
Open == CloOpe_OPEN ? "MSG_BG" :
|
||||||
"MSG_BG_NEW");
|
"MSG_BG_NEW");
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
|
@ -2249,7 +2249,7 @@ void Msg_WriteMsgNumber (unsigned long MsgNum,bool NewMsg)
|
||||||
|
|
||||||
static void Msg_WriteSentOrReceivedMsgSubject (struct Msg_Messages *Messages,
|
static void Msg_WriteSentOrReceivedMsgSubject (struct Msg_Messages *Messages,
|
||||||
long MsgCod,const char *Subject,
|
long MsgCod,const char *Subject,
|
||||||
bool Open,bool Expanded)
|
CloOpe_ClosedOrOpen_t Open,bool Expanded)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Hide_message;
|
extern const char *Txt_Hide_message;
|
||||||
extern const char *Txt_See_message;
|
extern const char *Txt_See_message;
|
||||||
|
@ -2257,10 +2257,10 @@ static void Msg_WriteSentOrReceivedMsgSubject (struct Msg_Messages *Messages,
|
||||||
|
|
||||||
/***** Begin cell *****/
|
/***** Begin cell *****/
|
||||||
HTM_TD_Begin ("class=\"LT %s_%s %s_%s\"",
|
HTM_TD_Begin ("class=\"LT %s_%s %s_%s\"",
|
||||||
Open ? "MSG_TIT" :
|
Open == CloOpe_OPEN ? "MSG_TIT" :
|
||||||
"MSG_TIT_NEW",The_GetSuffix (),
|
"MSG_TIT_NEW",The_GetSuffix (),
|
||||||
Open ? "MSG_BG" :
|
Open == CloOpe_OPEN ? "MSG_BG" :
|
||||||
"MSG_BG_NEW" ,The_GetSuffix ());
|
"MSG_BG_NEW" ,The_GetSuffix ());
|
||||||
|
|
||||||
/***** Begin form to expand/contract the message *****/
|
/***** Begin form to expand/contract the message *****/
|
||||||
Frm_BeginForm (Messages->TypeOfMessages == Msg_RECEIVED ? (Expanded ? ActConRcvMsg :
|
Frm_BeginForm (Messages->TypeOfMessages == Msg_RECEIVED ? (Expanded ? ActConRcvMsg :
|
||||||
|
|
|
@ -727,7 +727,7 @@ bool Msg_DB_GetStatusOfSntMsg (long MsgCod)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Msg_DB_GetStatusOfRcvMsg (long MsgCod,
|
void Msg_DB_GetStatusOfRcvMsg (long MsgCod,
|
||||||
bool *Open,bool *Replied,bool *Expanded)
|
CloOpe_ClosedOrOpen_t *Open,bool *Replied,bool *Expanded)
|
||||||
{
|
{
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
|
@ -751,7 +751,8 @@ void Msg_DB_GetStatusOfRcvMsg (long MsgCod,
|
||||||
/***** Get if message has been read by me (row[0]),
|
/***** Get if message has been read by me (row[0]),
|
||||||
if message has been replied (row[1]), and
|
if message has been replied (row[1]), and
|
||||||
if message is expanded (row[2]) *****/
|
if message is expanded (row[2]) *****/
|
||||||
*Open = (row[0][0] == 'Y');
|
*Open = (row[0][0] == 'Y') ? CloOpe_OPEN :
|
||||||
|
CloOpe_CLOSED;
|
||||||
*Replied = (row[1][0] == 'Y');
|
*Replied = (row[1][0] == 'Y');
|
||||||
*Expanded = (row[2][0] == 'Y');
|
*Expanded = (row[2][0] == 'Y');
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ unsigned Msg_DB_GetMsgContent (MYSQL_RES **mysql_res,long MsgCod);
|
||||||
unsigned Msg_DB_GetMsgSntData (MYSQL_RES **mysql_res,long MsgCod,bool *Deleted);
|
unsigned Msg_DB_GetMsgSntData (MYSQL_RES **mysql_res,long MsgCod,bool *Deleted);
|
||||||
bool Msg_DB_GetStatusOfSntMsg (long MsgCod);
|
bool Msg_DB_GetStatusOfSntMsg (long MsgCod);
|
||||||
void Msg_DB_GetStatusOfRcvMsg (long MsgCod,
|
void Msg_DB_GetStatusOfRcvMsg (long MsgCod,
|
||||||
bool *Open,bool *Replied,bool *Expanded);
|
CloOpe_ClosedOrOpen_t *Open,bool *Replied,bool *Expanded);
|
||||||
bool Msg_DB_CheckIfSntMsgIsDeleted (long MsgCod);
|
bool Msg_DB_CheckIfSntMsgIsDeleted (long MsgCod);
|
||||||
bool Msg_DB_CheckIfRcvMsgIsDeletedForAllItsRecipients (long MsgCod);
|
bool Msg_DB_CheckIfRcvMsgIsDeletedForAllItsRecipients (long MsgCod);
|
||||||
long Msg_DB_GetSender (long MsgCod);
|
long Msg_DB_GetSender (long MsgCod);
|
||||||
|
|
|
@ -557,8 +557,8 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
||||||
Err_NotEnoughMemoryExit ();
|
Err_NotEnoughMemoryExit ();
|
||||||
HTM_DIV_Begin ("id=\"%s\" class=\"%s_%s%s\"",
|
HTM_DIV_Begin ("id=\"%s\" class=\"%s_%s%s\"",
|
||||||
Id,
|
Id,
|
||||||
Item->Open ? "DATE_GREEN" :
|
Item->Open == CloOpe_OPEN ? "DATE_GREEN" :
|
||||||
"DATE_RED",
|
"DATE_RED",
|
||||||
The_GetSuffix (),
|
The_GetSuffix (),
|
||||||
HidVis_PrgClass[HiddenOrVisible]);
|
HidVis_PrgClass[HiddenOrVisible]);
|
||||||
Dat_WriteLocalDateHMSFromUTC (Id,Item->TimeUTC[StartEndTime],
|
Dat_WriteLocalDateHMSFromUTC (Id,Item->TimeUTC[StartEndTime],
|
||||||
|
@ -1223,7 +1223,8 @@ static void Prg_GetItemDataFromRow (MYSQL_RES **mysql_res,
|
||||||
Item->TimeUTC[Dat_END_TIME] = Dat_GetUNIXTimeFromStr (row[6]);
|
Item->TimeUTC[Dat_END_TIME] = Dat_GetUNIXTimeFromStr (row[6]);
|
||||||
|
|
||||||
/* Get whether the program item is open or closed (row(7)) */
|
/* Get whether the program item is open or closed (row(7)) */
|
||||||
Item->Open = (row[7][0] == '1');
|
Item->Open = (row[7][0] == '1') ? CloOpe_OPEN :
|
||||||
|
CloOpe_CLOSED;
|
||||||
|
|
||||||
/* Get the title of the program item (row[8]) */
|
/* Get the title of the program item (row[8]) */
|
||||||
Str_Copy (Item->Title,row[8],sizeof (Item->Title) - 1);
|
Str_Copy (Item->Title,row[8],sizeof (Item->Title) - 1);
|
||||||
|
@ -1265,7 +1266,7 @@ void Prg_ResetItem (struct Prg_Item *Item)
|
||||||
Item->UsrCod = -1L;
|
Item->UsrCod = -1L;
|
||||||
Item->TimeUTC[Dat_STR_TIME] =
|
Item->TimeUTC[Dat_STR_TIME] =
|
||||||
Item->TimeUTC[Dat_END_TIME] = (time_t) 0;
|
Item->TimeUTC[Dat_END_TIME] = (time_t) 0;
|
||||||
Item->Open = false;
|
Item->Open = CloOpe_CLOSED;
|
||||||
Item->Title[0] = '\0';
|
Item->Title[0] = '\0';
|
||||||
Prg_ResetResource (Item);
|
Prg_ResetResource (Item);
|
||||||
}
|
}
|
||||||
|
@ -1894,7 +1895,7 @@ static void Prg_ShowFormToCreateItem (long ParentItmCod)
|
||||||
Prg_ResetItem (&Item);
|
Prg_ResetItem (&Item);
|
||||||
Item.TimeUTC[Dat_STR_TIME] = Dat_GetStartExecutionTimeUTC ();
|
Item.TimeUTC[Dat_STR_TIME] = Dat_GetStartExecutionTimeUTC ();
|
||||||
Item.TimeUTC[Dat_END_TIME] = Item.TimeUTC[Dat_STR_TIME] + (2 * 60 * 60); // +2 hours
|
Item.TimeUTC[Dat_END_TIME] = Item.TimeUTC[Dat_STR_TIME] + (2 * 60 * 60); // +2 hours
|
||||||
Item.Open = true;
|
Item.Open = CloOpe_OPEN;
|
||||||
|
|
||||||
/***** Show pending alerts */
|
/***** Show pending alerts */
|
||||||
Ale_ShowAlerts (NULL);
|
Ale_ShowAlerts (NULL);
|
||||||
|
|
|
@ -62,7 +62,7 @@ struct Prg_Item
|
||||||
unsigned NumItem;
|
unsigned NumItem;
|
||||||
long UsrCod;
|
long UsrCod;
|
||||||
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||||
bool Open;
|
CloOpe_ClosedOrOpen_t Open;
|
||||||
char Title[Prg_MAX_BYTES_PROGRAM_ITEM_TITLE + 1];
|
char Title[Prg_MAX_BYTES_PROGRAM_ITEM_TITLE + 1];
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
|
|
@ -450,14 +450,14 @@ static void Svy_ShowOneSurvey (struct Svy_Surveys *Surveys,
|
||||||
if (ShowOnlyThisSvyComplete)
|
if (ShowOnlyThisSvyComplete)
|
||||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s\"",
|
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s\"",
|
||||||
Id,
|
Id,
|
||||||
Surveys->Svy.Status.Open ? HidVis_DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
Surveys->Svy.Status.Open == CloOpe_OPEN ? HidVis_DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
||||||
HidVis_DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
HidVis_DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
else
|
else
|
||||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s %s\"",
|
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s %s\"",
|
||||||
Id,
|
Id,
|
||||||
Surveys->Svy.Status.Open ? HidVis_DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
Surveys->Svy.Status.Open == CloOpe_OPEN ? HidVis_DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
||||||
HidVis_DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
HidVis_DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||||
The_GetSuffix (),
|
The_GetSuffix (),
|
||||||
The_GetColorRows ());
|
The_GetColorRows ());
|
||||||
Dat_WriteLocalDateHMSFromUTC (Id,Surveys->Svy.TimeUTC[Dat_STR_TIME],
|
Dat_WriteLocalDateHMSFromUTC (Id,Surveys->Svy.TimeUTC[Dat_STR_TIME],
|
||||||
|
@ -472,14 +472,14 @@ static void Svy_ShowOneSurvey (struct Svy_Surveys *Surveys,
|
||||||
if (ShowOnlyThisSvyComplete)
|
if (ShowOnlyThisSvyComplete)
|
||||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s\"",
|
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s\"",
|
||||||
Id,
|
Id,
|
||||||
Surveys->Svy.Status.Open ? HidVis_DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
Surveys->Svy.Status.Open == CloOpe_OPEN ? HidVis_DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
||||||
HidVis_DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
HidVis_DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
else
|
else
|
||||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s %s\"",
|
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s %s\"",
|
||||||
Id,
|
Id,
|
||||||
Surveys->Svy.Status.Open ? HidVis_DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
Surveys->Svy.Status.Open == CloOpe_OPEN ? HidVis_DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
||||||
HidVis_DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
HidVis_DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||||
The_GetSuffix (),
|
The_GetSuffix (),
|
||||||
The_GetColorRows ());
|
The_GetColorRows ());
|
||||||
Dat_WriteLocalDateHMSFromUTC (Id,Surveys->Svy.TimeUTC[Dat_END_TIME],
|
Dat_WriteLocalDateHMSFromUTC (Id,Surveys->Svy.TimeUTC[Dat_END_TIME],
|
||||||
|
@ -736,19 +736,21 @@ static void Svy_WriteStatus (struct Svy_Survey *Svy)
|
||||||
HTM_LI_End ();
|
HTM_LI_End ();
|
||||||
|
|
||||||
/* Write whether survey is open or closed */
|
/* Write whether survey is open or closed */
|
||||||
if (Svy->Status.Open)
|
switch (Svy->Status.Open)
|
||||||
{
|
{
|
||||||
HTM_LI_Begin ("class=\"%s_%s\"",
|
case CloOpe_OPEN:
|
||||||
HidVis_DateGreenClass[Svy->Status.HiddenOrVisible],
|
HTM_LI_Begin ("class=\"%s_%s\"",
|
||||||
The_GetSuffix ());
|
HidVis_DateGreenClass[Svy->Status.HiddenOrVisible],
|
||||||
HTM_Txt (Txt_Open_survey);
|
The_GetSuffix ());
|
||||||
}
|
HTM_Txt (Txt_Open_survey);
|
||||||
else
|
break;
|
||||||
{
|
case CloOpe_CLOSED:
|
||||||
HTM_LI_Begin ("class=\"%s_%s\"",
|
default:
|
||||||
HidVis_DateRedClass[Svy->Status.HiddenOrVisible],
|
HTM_LI_Begin ("class=\"%s_%s\"",
|
||||||
The_GetSuffix ());
|
HidVis_DateRedClass[Svy->Status.HiddenOrVisible],
|
||||||
HTM_Txt (Txt_Closed_survey);
|
The_GetSuffix ());
|
||||||
|
HTM_Txt (Txt_Closed_survey);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
HTM_LI_End ();
|
HTM_LI_End ();
|
||||||
|
|
||||||
|
@ -1134,7 +1136,8 @@ void Svy_GetSurveyDataByCod (struct Svy_Survey *Svy)
|
||||||
Svy->TimeUTC[Dat_END_TIME] = Dat_GetUNIXTimeFromStr (row[7]);
|
Svy->TimeUTC[Dat_END_TIME] = Dat_GetUNIXTimeFromStr (row[7]);
|
||||||
|
|
||||||
/* Get whether the survey is open or closed (row(8)) */
|
/* Get whether the survey is open or closed (row(8)) */
|
||||||
Svy->Status.Open = (row[8][0] == '1');
|
Svy->Status.Open = (row[8][0] == '1') ? CloOpe_OPEN :
|
||||||
|
CloOpe_CLOSED;
|
||||||
|
|
||||||
/* Get the title of the survey (row[9]) */
|
/* Get the title of the survey (row[9]) */
|
||||||
Str_Copy (Svy->Title,row[9],sizeof (Svy->Title) - 1);
|
Str_Copy (Svy->Title,row[9],sizeof (Svy->Title) - 1);
|
||||||
|
@ -1173,7 +1176,7 @@ void Svy_GetSurveyDataByCod (struct Svy_Survey *Svy)
|
||||||
/* Can I answer survey? */
|
/* Can I answer survey? */
|
||||||
Svy->Status.ICanAnswer = ( Svy->NumQsts != 0) &&
|
Svy->Status.ICanAnswer = ( Svy->NumQsts != 0) &&
|
||||||
Svy->Status.HiddenOrVisible == HidVis_VISIBLE &&
|
Svy->Status.HiddenOrVisible == HidVis_VISIBLE &&
|
||||||
Svy->Status.Open &&
|
Svy->Status.Open == CloOpe_OPEN &&
|
||||||
Svy->Status.IAmLoggedWithAValidRoleToAnswer &&
|
Svy->Status.IAmLoggedWithAValidRoleToAnswer &&
|
||||||
Svy->Status.IBelongToScope &&
|
Svy->Status.IBelongToScope &&
|
||||||
!Svy->Status.IHaveAnswered;
|
!Svy->Status.IHaveAnswered;
|
||||||
|
@ -1191,7 +1194,7 @@ void Svy_GetSurveyDataByCod (struct Svy_Survey *Svy)
|
||||||
Svy->Level == Hie_SYS) &&
|
Svy->Level == Hie_SYS) &&
|
||||||
(Svy->NumQsts != 0) &&
|
(Svy->NumQsts != 0) &&
|
||||||
Svy->Status.HiddenOrVisible == HidVis_VISIBLE &&
|
Svy->Status.HiddenOrVisible == HidVis_VISIBLE &&
|
||||||
Svy->Status.Open &&
|
Svy->Status.Open == CloOpe_OPEN &&
|
||||||
Svy->Status.IAmLoggedWithAValidRoleToAnswer &&
|
Svy->Status.IAmLoggedWithAValidRoleToAnswer &&
|
||||||
Svy->Status.IBelongToScope &&
|
Svy->Status.IBelongToScope &&
|
||||||
Svy->Status.IHaveAnswered;
|
Svy->Status.IHaveAnswered;
|
||||||
|
@ -1280,7 +1283,7 @@ void Svy_GetSurveyDataByCod (struct Svy_Survey *Svy)
|
||||||
Svy->NumQsts = 0;
|
Svy->NumQsts = 0;
|
||||||
Svy->NumUsrs = 0;
|
Svy->NumUsrs = 0;
|
||||||
Svy->Status.HiddenOrVisible = HidVis_VISIBLE;
|
Svy->Status.HiddenOrVisible = HidVis_VISIBLE;
|
||||||
Svy->Status.Open = false;
|
Svy->Status.Open = CloOpe_CLOSED;
|
||||||
Svy->Status.IAmLoggedWithAValidRoleToAnswer = false;
|
Svy->Status.IAmLoggedWithAValidRoleToAnswer = false;
|
||||||
Svy->Status.IBelongToScope = false;
|
Svy->Status.IBelongToScope = false;
|
||||||
Svy->Status.IHaveAnswered = false;
|
Svy->Status.IHaveAnswered = false;
|
||||||
|
@ -1605,7 +1608,7 @@ void Svy_ReqCreatOrEditSvy (void)
|
||||||
Surveys.Svy.NumQsts = 0;
|
Surveys.Svy.NumQsts = 0;
|
||||||
Surveys.Svy.NumUsrs = 0;
|
Surveys.Svy.NumUsrs = 0;
|
||||||
Surveys.Svy.Status.HiddenOrVisible = HidVis_VISIBLE;
|
Surveys.Svy.Status.HiddenOrVisible = HidVis_VISIBLE;
|
||||||
Surveys.Svy.Status.Open = true;
|
Surveys.Svy.Status.Open = CloOpe_OPEN;
|
||||||
Surveys.Svy.Status.IAmLoggedWithAValidRoleToAnswer = false;
|
Surveys.Svy.Status.IAmLoggedWithAValidRoleToAnswer = false;
|
||||||
Surveys.Svy.Status.IBelongToScope = false;
|
Surveys.Svy.Status.IBelongToScope = false;
|
||||||
Surveys.Svy.Status.IHaveAnswered = false;
|
Surveys.Svy.Status.IHaveAnswered = false;
|
||||||
|
|
|
@ -54,7 +54,7 @@ struct Svy_Survey
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
HidVis_HiddenOrVisible_t HiddenOrVisible; // Survey is hidden or visible?
|
HidVis_HiddenOrVisible_t HiddenOrVisible; // Survey is hidden or visible?
|
||||||
bool Open; // Start date <= now <= end date
|
CloOpe_ClosedOrOpen_t Open; // Start date <= now <= end date
|
||||||
bool IAmLoggedWithAValidRoleToAnswer; // I am logged with a valid role to answer this survey
|
bool IAmLoggedWithAValidRoleToAnswer; // I am logged with a valid role to answer this survey
|
||||||
bool IBelongToScope; // I belong to the scope of this survey
|
bool IBelongToScope; // I belong to the scope of this survey
|
||||||
bool IHaveAnswered; // I have already answered this survey
|
bool IHaveAnswered; // I have already answered this survey
|
||||||
|
|
Loading…
Reference in New Issue