mirror of https://github.com/acanas/swad-core.git
Version 22.120: Jun 06, 2023 Code refactoring related to hidden-visible.
This commit is contained in:
parent
6bf4b5f2aa
commit
bc35e2cdfe
6
Makefile
6
Makefile
|
@ -56,9 +56,9 @@ OBJS = swad_account.o swad_account_database.o swad_action.o swad_action_list.o \
|
|||
swad_forum_resource.o \
|
||||
swad_game.o swad_game_database.o swad_game_resource.o swad_global.o \
|
||||
swad_group.o swad_group_database.o \
|
||||
swad_help.o swad_hierarchy.o swad_hierarchy_config.o \
|
||||
swad_hierarchy_database.o swad_holiday.o swad_holiday_database.o \
|
||||
swad_HTML.o \
|
||||
swad_help.o swad_hidden_visible.o swad_hierarchy.o \
|
||||
swad_hierarchy_config.o swad_hierarchy_database.o swad_holiday.o \
|
||||
swad_holiday_database.o swad_HTML.o \
|
||||
swad_icon.o swad_ID.o swad_ID_database.o swad_indicator.o \
|
||||
swad_indicator_database.o swad_info.o swad_info_database.o \
|
||||
swad_institution.o swad_institution_config.o \
|
||||
|
|
|
@ -2830,6 +2830,14 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
|
|||
.DAT_GREEN_PINK {color:#246600; font-size:12pt;}
|
||||
.DAT_GREEN_DARK {color:#80c040; font-size:12pt;}
|
||||
|
||||
.DAT_GREEN_LIGHT_WHITE,
|
||||
.DAT_GREEN_LIGHT_GREY,
|
||||
.DAT_GREEN_LIGHT_PURPLE,
|
||||
.DAT_GREEN_LIGHT_BLUE,
|
||||
.DAT_GREEN_LIGHT_YELLOW,
|
||||
.DAT_GREEN_LIGHT_PINK {color:rgba( 36,102, 0,0.3); font-size:12pt;}
|
||||
.DAT_GREEN_LIGHT_DARK {color:rgba(128,192, 64,0.3); font-size:12pt;}
|
||||
|
||||
.DAT_RED_WHITE,
|
||||
.DAT_RED_GREY,
|
||||
.DAT_RED_PURPLE,
|
||||
|
@ -2838,6 +2846,14 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
|
|||
.DAT_RED_PINK {color:#660000; font-size:12pt;}
|
||||
.DAT_RED_DARK {color:#ff8080; font-size:12pt;}
|
||||
|
||||
.DAT_RED_LIGHT_WHITE,
|
||||
.DAT_RED_LIGHT_GREY,
|
||||
.DAT_RED_LIGHT_PURPLE,
|
||||
.DAT_RED_LIGHT_BLUE,
|
||||
.DAT_RED_LIGHT_YELLOW,
|
||||
.DAT_RED_LIGHT_PINK {color:rgba(102, 0, 0,0.3); font-size:12pt;}
|
||||
.DAT_RED_LIGHT_DARK {color:rgba(255,128,128,0.3); font-size:12pt;}
|
||||
|
||||
.NOWRAP {white-space:nowrap;}
|
||||
.BOLD {font-weight:bold;}
|
||||
|
||||
|
@ -3221,38 +3237,6 @@ legend {font-size:12pt;}
|
|||
.ASG_LST_DATE_RED_PINK {color:#660000; font-size:11pt; white-space:nowrap;}
|
||||
.ASG_LST_DATE_RED_DARK {color:#ff8080; font-size:11pt; white-space:nowrap;}
|
||||
|
||||
.STATUS_GREEN_WHITE,
|
||||
.STATUS_GREEN_GREY,
|
||||
.STATUS_GREEN_PURPLE,
|
||||
.STATUS_GREEN_BLUE,
|
||||
.STATUS_GREEN_YELLOW,
|
||||
.STATUS_GREEN_PINK {color:#246600; font-size:12pt;}
|
||||
.STATUS_GREEN_DARK {color:#80c040; font-size:12pt;}
|
||||
|
||||
.STATUS_GREEN_LIGHT_WHITE,
|
||||
.STATUS_GREEN_LIGHT_GREY,
|
||||
.STATUS_GREEN_LIGHT_PURPLE,
|
||||
.STATUS_GREEN_LIGHT_BLUE,
|
||||
.STATUS_GREEN_LIGHT_YELLOW,
|
||||
.STATUS_GREEN_LIGHT_PINK {color:rgba( 36,102, 0,0.3); font-size:12pt;}
|
||||
.STATUS_GREEN_LIGHT_DARK {color:rgba(128,192, 64,0.3); font-size:12pt;}
|
||||
|
||||
.STATUS_RED_WHITE,
|
||||
.STATUS_RED_GREY,
|
||||
.STATUS_RED_PURPLE,
|
||||
.STATUS_RED_BLUE,
|
||||
.STATUS_RED_YELLOW,
|
||||
.STATUS_RED_PINK {color:#660000; font-size:12pt;}
|
||||
.STATUS_RED_DARK {color:#ff8080; font-size:12pt;}
|
||||
|
||||
.STATUS_RED_LIGHT_WHITE,
|
||||
.STATUS_RED_LIGHT_GREY,
|
||||
.STATUS_RED_LIGHT_PURPLE,
|
||||
.STATUS_RED_LIGHT_BLUE,
|
||||
.STATUS_RED_LIGHT_YELLOW,
|
||||
.STATUS_RED_LIGHT_PINK {color:rgba(102, 0, 0,0.3); font-size:12pt;}
|
||||
.STATUS_RED_LIGHT_DARK {color:rgba(255,128,128,0.3); font-size:12pt;}
|
||||
|
||||
/********************** Number of question, project, etc. ********************/
|
||||
.BIG_INDEX_WHITE,
|
||||
.BIG_INDEX_GREY,
|
10
swad_API.c
10
swad_API.c
|
@ -2309,7 +2309,7 @@ int swad__getAttendanceEvents (struct soap *soap,
|
|||
Att_GetEventDataFromRow (row,&Event);
|
||||
|
||||
getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].attendanceEventCode = (int) Event.AttCod;
|
||||
getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].hidden = (Event.HiddenOrVisible == Cns_HIDDEN) ? 1 :
|
||||
getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].hidden = (Event.HiddenOrVisible == HidVis_HIDDEN) ? 1 :
|
||||
0;
|
||||
Gbl.Usrs.Other.UsrDat.UsrCod = Event.UsrCod;
|
||||
if (API_GetSomeUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,Gbl.Hierarchy.Crs.CrsCod)) // Get some user's data from database
|
||||
|
@ -2485,8 +2485,8 @@ int swad__sendAttendanceEvent (struct soap *soap,
|
|||
}
|
||||
|
||||
/* Is event hidden? */
|
||||
Event.HiddenOrVisible = (hidden ? Cns_HIDDEN :
|
||||
Cns_VISIBLE);
|
||||
Event.HiddenOrVisible = (hidden ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE);
|
||||
|
||||
/* User's code (really not used) */
|
||||
Event.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
|
||||
|
@ -4704,7 +4704,7 @@ int swad__getDirectoryTree (struct soap *soap,
|
|||
/* Get directory tree into XML file */
|
||||
XML_WriteStartFile (XML,"tree",false);
|
||||
if (Brw_CheckIfFileOrFolderIsSetAsHiddenInDB (Brw_IS_FOLDER,
|
||||
Gbl.FileBrowser.FilFolLnk.Full) == Cns_VISIBLE)
|
||||
Gbl.FileBrowser.FilFolLnk.Full) == HidVis_VISIBLE)
|
||||
API_ListDir (XML,1,
|
||||
Gbl.FileBrowser.Priv.PathRootFolder,
|
||||
Brw_RootFolderInternalNames[Gbl.FileBrowser.Type]);
|
||||
|
@ -4818,7 +4818,7 @@ static bool API_WriteRowFileBrowser (FILE *XML,unsigned Level,
|
|||
if (Gbl.FileBrowser.Type == Brw_SHOW_DOC_CRS ||
|
||||
Gbl.FileBrowser.Type == Brw_SHOW_DOC_GRP)
|
||||
if (Brw_CheckIfFileOrFolderIsSetAsHiddenInDB (FileType,
|
||||
Gbl.FileBrowser.FilFolLnk.Full) == Cns_HIDDEN)
|
||||
Gbl.FileBrowser.FilFolLnk.Full) == HidVis_HIDDEN)
|
||||
return false;
|
||||
|
||||
/***** XML row *****/
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_group.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_notification.h"
|
||||
#include "swad_pagination.h"
|
||||
|
@ -280,21 +281,13 @@ static void Agd_ShowFormToSelPrivatPublicEvents (const struct Agd_Agenda *Agenda
|
|||
|
||||
static void Agd_ShowFormToSelHiddenVisiblEvents (const struct Agd_Agenda *Agenda)
|
||||
{
|
||||
extern const char *Txt_AGENDA_HIDDEN_VISIBLE_EVENTS[Cns_NUM_HIDDEN_VISIBLE];
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible;
|
||||
static const struct
|
||||
{
|
||||
const char *Icon;
|
||||
Ico_Color_t Color;
|
||||
} Icon[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = {"eye-slash.svg",Ico_RED },
|
||||
[Cns_VISIBLE] = {"eye.svg" ,Ico_GREEN},
|
||||
};
|
||||
extern struct Ico_IconColor Ico_HiddenVisible[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *Txt_AGENDA_HIDDEN_VISIBLE_EVENTS[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
||||
|
||||
Set_BeginOneSettingSelector ();
|
||||
for (HiddenOrVisible = Cns_HIDDEN;
|
||||
HiddenOrVisible <= Cns_VISIBLE;
|
||||
for (HiddenOrVisible = HidVis_HIDDEN;
|
||||
HiddenOrVisible <= HidVis_VISIBLE;
|
||||
HiddenOrVisible++)
|
||||
{
|
||||
Set_BeginPref ((Agenda->HiddenVisiblEvents & (1 << HiddenOrVisible)));
|
||||
|
@ -305,7 +298,8 @@ static void Agd_ShowFormToSelHiddenVisiblEvents (const struct Agd_Agenda *Agenda
|
|||
Agenda->SelectedOrder,
|
||||
Agenda->CurrentPage,
|
||||
-1L);
|
||||
Ico_PutSettingIconLink (Icon[HiddenOrVisible].Icon,Icon[HiddenOrVisible].Color,
|
||||
Ico_PutSettingIconLink (Ico_HiddenVisible[HiddenOrVisible].Icon,
|
||||
Ico_HiddenVisible[HiddenOrVisible].Color,
|
||||
Txt_AGENDA_HIDDEN_VISIBLE_EVENTS[HiddenOrVisible]);
|
||||
Frm_EndForm ();
|
||||
Set_EndPref ();
|
||||
|
@ -360,8 +354,8 @@ static unsigned Agd_GetParsHiddenVisiblEvents (void)
|
|||
{
|
||||
return (unsigned) Par_GetParUnsignedLong (ParHiddenVisiblName,
|
||||
0,
|
||||
(1 << Cns_HIDDEN) |
|
||||
(1 << Cns_VISIBLE),
|
||||
(1 << HidVis_HIDDEN) |
|
||||
(1 << HidVis_VISIBLE),
|
||||
Agd_DEFAULT_HIDDEN_EVENTS |
|
||||
Agd_DEFAULT_VISIBL_EVENTS);
|
||||
}
|
||||
|
@ -748,17 +742,9 @@ static void Agd_PutIconsOtherPublicAgenda (void *EncryptedUsrCod)
|
|||
static void Agd_ShowOneEvent (struct Agd_Agenda *Agenda,
|
||||
Agd_AgendaType_t AgendaType,long AgdCod)
|
||||
{
|
||||
extern const char *Dat_TimeStatusClass[Dat_NUM_TIME_STATUS][Cns_NUM_HIDDEN_VISIBLE];
|
||||
static const char *TitleClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "ASG_TITLE_LIGHT",
|
||||
[Cns_VISIBLE] = "ASG_TITLE",
|
||||
};
|
||||
static const char *DataClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DAT_LIGHT",
|
||||
[Cns_VISIBLE] = "DAT",
|
||||
};
|
||||
extern const char *Dat_TimeStatusClass[Dat_NUM_TIME_STATUS][HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_TitleClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_DataClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
char *Anchor = NULL;
|
||||
static unsigned UniqueId = 0;
|
||||
char *Id;
|
||||
|
@ -811,7 +797,7 @@ static void Agd_ShowOneEvent (struct Agd_Agenda *Agenda,
|
|||
HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ());
|
||||
HTM_ARTICLE_Begin (Anchor);
|
||||
HTM_SPAN_Begin ("class=\"%s_%s\"",
|
||||
TitleClass[AgdEvent.HiddenOrVisible],
|
||||
HidVis_TitleClass[AgdEvent.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (AgdEvent.Title);
|
||||
HTM_SPAN_End ();
|
||||
|
@ -821,7 +807,7 @@ static void Agd_ShowOneEvent (struct Agd_Agenda *Agenda,
|
|||
/* Location */
|
||||
HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ());
|
||||
HTM_SPAN_Begin ("class=\"%s_%s\"",
|
||||
TitleClass[AgdEvent.HiddenOrVisible],
|
||||
HidVis_TitleClass[AgdEvent.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (AgdEvent.Location);
|
||||
HTM_SPAN_End ();
|
||||
|
@ -848,7 +834,7 @@ static void Agd_ShowOneEvent (struct Agd_Agenda *Agenda,
|
|||
/* Text of the event */
|
||||
HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"",The_GetColorRows ());
|
||||
HTM_DIV_Begin ("class=\"PAR %s_%s\"",
|
||||
DataClass[AgdEvent.HiddenOrVisible],
|
||||
HidVis_DataClass[AgdEvent.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
Agd_DB_GetEventTxt (&AgdEvent,Txt);
|
||||
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
|
||||
|
@ -872,10 +858,10 @@ static void Agd_PutFormsToRemEditOneEvent (struct Agd_Agenda *Agenda,
|
|||
struct Agd_Event *AgdEvent,
|
||||
const char *Anchor)
|
||||
{
|
||||
static Act_Action_t ActionHideUnhide[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static Act_Action_t ActionHideUnhide[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = ActUnhEvtMyAgd, // Hidden ==> action to unhide
|
||||
[Cns_VISIBLE] = ActHidEvtMyAgd, // Visible ==> action to hide
|
||||
[HidVis_HIDDEN ] = ActUnhEvtMyAgd, // Hidden ==> action to unhide
|
||||
[HidVis_VISIBLE] = ActHidEvtMyAgd, // Visible ==> action to hide
|
||||
};
|
||||
|
||||
Agenda->AgdCodToEdit = AgdEvent->AgdCod; // Used as parameter in contextual links
|
||||
|
@ -1092,8 +1078,8 @@ static void Agd_GetventDataByCod (struct Agd_Event *AgdEvent)
|
|||
/* Get whether the event is public or not (row[1])
|
||||
and whether it is hidden or not (row[2]) */
|
||||
AgdEvent->Public = (row[1][0] == 'Y');
|
||||
AgdEvent->HiddenOrVisible = (row[2][0] == 'Y') ? Cns_HIDDEN :
|
||||
Cns_VISIBLE;
|
||||
AgdEvent->HiddenOrVisible = (row[2][0] == 'Y') ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE;
|
||||
|
||||
/* Get start date (row[3]) and end date (row[4]) in UTC time */
|
||||
AgdEvent->TimeUTC[Dat_STR_TIME] = Dat_GetUNIXTimeFromStr (row[3]);
|
||||
|
@ -1113,7 +1099,7 @@ static void Agd_GetventDataByCod (struct Agd_Event *AgdEvent)
|
|||
/***** Clear all event data *****/
|
||||
AgdEvent->AgdCod = -1L;
|
||||
AgdEvent->Public = false;
|
||||
AgdEvent->HiddenOrVisible = Cns_VISIBLE;
|
||||
AgdEvent->HiddenOrVisible = HidVis_VISIBLE;
|
||||
AgdEvent->TimeUTC[Dat_STR_TIME] =
|
||||
AgdEvent->TimeUTC[Dat_END_TIME] = (time_t) 0;
|
||||
AgdEvent->TimeStatus = Dat_FUTURE;
|
||||
|
|
|
@ -45,7 +45,7 @@ struct Agd_Event
|
|||
long AgdCod;
|
||||
long UsrCod;
|
||||
bool Public;
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible;
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
||||
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||
Dat_TimeStatus_t TimeStatus;
|
||||
char Title[Agd_MAX_BYTES_EVENT + 1];
|
||||
|
@ -70,8 +70,8 @@ typedef enum
|
|||
#define Agd_DEFAULT_PRIVAT_EVENTS (1 << Agd_PRIVAT_EVENTS) // on
|
||||
#define Agd_DEFAULT_PUBLIC_EVENTS (1 << Agd_PUBLIC_EVENTS) // on
|
||||
|
||||
#define Agd_DEFAULT_HIDDEN_EVENTS (0 << Cns_HIDDEN) // off
|
||||
#define Agd_DEFAULT_VISIBL_EVENTS (1 << Cns_VISIBLE) // on
|
||||
#define Agd_DEFAULT_HIDDEN_EVENTS (0 << HidVis_HIDDEN) // off
|
||||
#define Agd_DEFAULT_VISIBL_EVENTS (1 << HidVis_VISIBLE) // on
|
||||
|
||||
#define Agd_ORDER_DEFAULT Dat_STR_TIME
|
||||
|
||||
|
|
|
@ -116,11 +116,11 @@ unsigned Agd_DB_GetListEvents (MYSQL_RES **mysql_res,
|
|||
}
|
||||
switch (Agenda->HiddenVisiblEvents)
|
||||
{
|
||||
case (1 << Cns_HIDDEN):
|
||||
case (1 << HidVis_HIDDEN):
|
||||
Str_Copy (HiddenVisiblEventsSubQuery," AND Hidden='Y'",
|
||||
sizeof (HiddenVisiblEventsSubQuery) - 1); // Hidden events
|
||||
break;
|
||||
case (1 << Cns_VISIBLE):
|
||||
case (1 << HidVis_VISIBLE):
|
||||
Str_Copy (HiddenVisiblEventsSubQuery," AND Hidden='N'",
|
||||
sizeof (HiddenVisiblEventsSubQuery) - 1); // Visible events
|
||||
break;
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "swad_error.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_parameter.h"
|
||||
#include "swad_parameter_code.h"
|
||||
|
@ -216,10 +217,10 @@ static void Ann_DrawAnAnnouncement (struct Ann_Announcement *Announcement,
|
|||
[Ann_ACTIVE_ANNOUNCEMENT ] = "NOTICE_BOX NOTICE_BOX_WIDE",
|
||||
[Ann_OBSOLETE_ANNOUNCEMENT] = "NOTICE_BOX NOTICE_BOX_WIDE LIGHT",
|
||||
};
|
||||
static Act_Action_t ActionHideUnhide[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static Act_Action_t ActionHideUnhide[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = ActUnhAnn, // Hidden ==> action to unhide
|
||||
[Cns_VISIBLE] = ActHidAnn, // Visible ==> action to hide
|
||||
[HidVis_HIDDEN ] = ActUnhAnn, // Hidden ==> action to unhide
|
||||
[HidVis_VISIBLE] = ActHidAnn, // Visible ==> action to hide
|
||||
};
|
||||
Rol_Role_t Role;
|
||||
bool SomeRolesAreSelected;
|
||||
|
@ -236,8 +237,8 @@ static void Ann_DrawAnAnnouncement (struct Ann_Announcement *Announcement,
|
|||
/***** Icon to hide/unhide the announcement *****/
|
||||
Ico_PutContextualIconToHideUnhide (ActionHideUnhide,NULL, // TODO: Put anchor
|
||||
Ann_PutParAnnCod,&Announcement->AnnCod,
|
||||
(Announcement->Status == Ann_OBSOLETE_ANNOUNCEMENT) ? Cns_HIDDEN :
|
||||
Cns_VISIBLE);
|
||||
(Announcement->Status == Ann_OBSOLETE_ANNOUNCEMENT) ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE);
|
||||
}
|
||||
|
||||
/***** Write the subject of the announcement *****/
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "swad_global.h"
|
||||
#include "swad_group.h"
|
||||
#include "swad_group_database.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_notification.h"
|
||||
#include "swad_notification_database.h"
|
||||
|
@ -467,16 +468,10 @@ static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments,
|
|||
bool PrintView)
|
||||
{
|
||||
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
||||
static const char *TitleClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "ASG_TITLE_LIGHT",
|
||||
[Cns_VISIBLE] = "ASG_TITLE",
|
||||
};
|
||||
static const char *DataClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DAT_LIGHT",
|
||||
[Cns_VISIBLE] = "DAT",
|
||||
};
|
||||
extern const char *HidVis_DateGreenClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_DateRedClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_TitleClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_DataClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
char *Anchor = NULL;
|
||||
static unsigned UniqueId = 0;
|
||||
char *Id;
|
||||
|
@ -510,18 +505,14 @@ static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments,
|
|||
if (PrintView)
|
||||
HTM_TD_Begin ("id=\"%s\" class=\"LB %s_%s\"",
|
||||
Id,
|
||||
Assignments->Asg.HiddenOrVisible == Cns_HIDDEN ? (Assignments->Asg.Open ? "DATE_GREEN_LIGHT" :
|
||||
"DATE_RED_LIGHT") :
|
||||
(Assignments->Asg.Open ? "DATE_GREEN" :
|
||||
"DATE_RED"),
|
||||
Assignments->Asg.Open == HidVis_HIDDEN ? HidVis_DateGreenClass[Assignments->Asg.HiddenOrVisible] :
|
||||
HidVis_DateRedClass[Assignments->Asg.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
else
|
||||
HTM_TD_Begin ("id=\"%s\" class=\"LB %s_%s %s\"",
|
||||
Id,
|
||||
Assignments->Asg.HiddenOrVisible == Cns_HIDDEN ? (Assignments->Asg.Open ? "DATE_GREEN_LIGHT" :
|
||||
"DATE_RED_LIGHT") :
|
||||
(Assignments->Asg.Open ? "DATE_GREEN" :
|
||||
"DATE_RED"),
|
||||
Assignments->Asg.Open == HidVis_HIDDEN ? HidVis_DateGreenClass[Assignments->Asg.HiddenOrVisible] :
|
||||
HidVis_DateRedClass[Assignments->Asg.HiddenOrVisible],
|
||||
The_GetSuffix (),
|
||||
The_GetColorRows ());
|
||||
Dat_WriteLocalDateHMSFromUTC (Id,Assignments->Asg.TimeUTC[StartEndTime],
|
||||
|
@ -542,7 +533,7 @@ static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments,
|
|||
Asg_PutPars (Assignments);
|
||||
HTM_BUTTON_Submit_Begin (Txt_Actions[ActSeeOneAsg],
|
||||
"class=\"LT BT_LINK %s_%s\"",
|
||||
TitleClass[Assignments->Asg.HiddenOrVisible],
|
||||
HidVis_TitleClass[Assignments->Asg.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Assignments->Asg.Title);
|
||||
HTM_BUTTON_End ();
|
||||
|
@ -590,7 +581,7 @@ static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments,
|
|||
Asg_GetAndWriteNamesOfGrpsAssociatedToAsg (&Assignments->Asg);
|
||||
|
||||
HTM_DIV_Begin ("class=\"PAR %s_%s\"",
|
||||
DataClass[Assignments->Asg.HiddenOrVisible],
|
||||
HidVis_DataClass[Assignments->Asg.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Txt);
|
||||
HTM_DIV_End ();
|
||||
|
@ -623,7 +614,7 @@ static void Asg_WriteAssignmentFolder (struct Asg_Assignment *Asg,bool PrintView
|
|||
{
|
||||
extern const char *Txt_Folder;
|
||||
Act_Action_t NextAction;
|
||||
bool ICanSendFiles = Asg->HiddenOrVisible == Cns_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->IBelongToCrsOrGrps; // I belong to course or groups
|
||||
|
||||
|
@ -710,10 +701,10 @@ Dat_StartEndTime_t Asg_GetParAsgOrder (void)
|
|||
static void Asg_PutIconsToRemEditOneAsg (struct Asg_Assignments *Assignments,
|
||||
const char *Anchor)
|
||||
{
|
||||
static Act_Action_t ActionHideUnhide[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static Act_Action_t ActionHideUnhide[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = ActUnhAsg, // Hidden ==> action to unhide
|
||||
[Cns_VISIBLE] = ActHidAsg, // Visible ==> action to hide
|
||||
[HidVis_HIDDEN ] = ActUnhAsg, // Hidden ==> action to unhide
|
||||
[HidVis_VISIBLE] = ActHidAsg, // Visible ==> action to hide
|
||||
};
|
||||
|
||||
switch (Gbl.Usrs.Me.Role.Logged)
|
||||
|
@ -889,8 +880,8 @@ static void Asg_GetAssignmentDataFromRow (MYSQL_RES **mysql_res,
|
|||
Asg->AsgCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||
|
||||
/* Get whether the assignment is hidden or not (row[1]) */
|
||||
Asg->HiddenOrVisible = (row[1][0] == 'Y') ? Cns_HIDDEN :
|
||||
Cns_VISIBLE;
|
||||
Asg->HiddenOrVisible = (row[1][0] == 'Y') ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE;
|
||||
|
||||
/* Get author of the assignment (row[2]) */
|
||||
Asg->UsrCod = Str_ConvertStrCodToLongCod (row[2]);
|
||||
|
@ -924,7 +915,7 @@ static void Asg_ResetAssignment (struct Asg_Assignment *Asg)
|
|||
if (Asg->AsgCod <= 0) // If > 0 ==> keep value
|
||||
Asg->AsgCod = -1L;
|
||||
Asg->AsgCod = -1L;
|
||||
Asg->HiddenOrVisible = Cns_VISIBLE;
|
||||
Asg->HiddenOrVisible = HidVis_VISIBLE;
|
||||
Asg->UsrCod = -1L;
|
||||
Asg->TimeUTC[Dat_STR_TIME] =
|
||||
Asg->TimeUTC[Dat_END_TIME] = (time_t) 0;
|
||||
|
@ -1564,11 +1555,7 @@ static void Asg_GetAndWriteNamesOfGrpsAssociatedToAsg (struct Asg_Assignment *As
|
|||
extern const char *Txt_Groups;
|
||||
extern const char *Txt_and;
|
||||
extern const char *Txt_The_whole_course;
|
||||
static const char *GroupClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "ASG_GRP_LIGHT",
|
||||
[Cns_VISIBLE] = "ASG_GRP",
|
||||
};
|
||||
extern const char *HidVis_GroupClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
MYSQL_RES *mysql_res;
|
||||
MYSQL_ROW row;
|
||||
unsigned NumGrps;
|
||||
|
@ -1579,8 +1566,7 @@ static void Asg_GetAndWriteNamesOfGrpsAssociatedToAsg (struct Asg_Assignment *As
|
|||
|
||||
/***** Write heading *****/
|
||||
HTM_DIV_Begin ("class=\"%s_%s\"",
|
||||
GroupClass[Asg->HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HidVis_GroupClass[Asg->HiddenOrVisible],The_GetSuffix ());
|
||||
|
||||
HTM_TxtColonNBSP (NumGrps == 1 ? Txt_Group :
|
||||
Txt_Groups);
|
||||
|
|
|
@ -49,7 +49,7 @@ typedef enum
|
|||
struct Asg_Assignment
|
||||
{
|
||||
long AsgCod;
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible;
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
||||
long UsrCod;
|
||||
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||
bool Open;
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "swad_global.h"
|
||||
#include "swad_group.h"
|
||||
#include "swad_group_database.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_hierarchy_level.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_ID.h"
|
||||
|
@ -427,16 +428,10 @@ static void Att_ShowOneEventRow (struct Att_Events *Events,
|
|||
bool ShowOnlyThisAttEventComplete)
|
||||
{
|
||||
extern const char *Txt_View_event;
|
||||
static const char *TitleClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "ASG_TITLE_LIGHT",
|
||||
[Cns_VISIBLE] = "ASG_TITLE",
|
||||
};
|
||||
static const char *DataClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DAT_LIGHT",
|
||||
[Cns_VISIBLE] = "DAT",
|
||||
};
|
||||
extern const char *HidVis_DateGreenClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_DateRedClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_TitleClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_DataClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
char *Anchor = NULL;
|
||||
static unsigned UniqueId = 0;
|
||||
char *Id;
|
||||
|
@ -469,18 +464,14 @@ static void Att_ShowOneEventRow (struct Att_Events *Events,
|
|||
if (ShowOnlyThisAttEventComplete)
|
||||
HTM_TD_Begin ("id=\"%s\" class=\"LB %s_%s\"",
|
||||
Id,
|
||||
Events->Event.HiddenOrVisible == Cns_HIDDEN ? (Events->Event.Open ? "DATE_GREEN_LIGHT" :
|
||||
"DATE_RED_LIGHT") :
|
||||
(Events->Event.Open ? "DATE_GREEN" :
|
||||
"DATE_RED"),
|
||||
Events->Event.Open ? HidVis_DateGreenClass[Events->Event.HiddenOrVisible] :
|
||||
HidVis_DateRedClass[Events->Event.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
else
|
||||
HTM_TD_Begin ("id=\"%s\" class=\"LB %s_%s %s\"",
|
||||
Id,
|
||||
Events->Event.HiddenOrVisible == Cns_HIDDEN ? (Events->Event.Open ? "DATE_GREEN_LIGHT" :
|
||||
"DATE_RED_LIGHT") :
|
||||
(Events->Event.Open ? "DATE_GREEN" :
|
||||
"DATE_RED"),
|
||||
Events->Event.Open ? HidVis_DateGreenClass[Events->Event.HiddenOrVisible] :
|
||||
HidVis_DateRedClass[Events->Event.HiddenOrVisible],
|
||||
The_GetSuffix (),
|
||||
The_GetColorRows ());
|
||||
Dat_WriteLocalDateHMSFromUTC (Id,Events->Event.TimeUTC[StartEndTime],
|
||||
|
@ -506,7 +497,7 @@ static void Att_ShowOneEventRow (struct Att_Events *Events,
|
|||
else
|
||||
HTM_TD_Begin ("class=\"RT %s\"",The_GetColorRows ());
|
||||
HTM_SPAN_Begin ("class=\"%s_%s\"",
|
||||
TitleClass[Events->Event.HiddenOrVisible],
|
||||
HidVis_TitleClass[Events->Event.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Unsigned (Events->Event.NumStdsTotal);
|
||||
HTM_SPAN_End ();
|
||||
|
@ -538,7 +529,7 @@ static void Att_ShowOneEventRow (struct Att_Events *Events,
|
|||
Att_GetAndWriteNamesOfGrpsAssociatedToEvent (&Events->Event);
|
||||
|
||||
HTM_DIV_Begin ("class=\"%s_%s\"",
|
||||
DataClass[Events->Event.HiddenOrVisible],
|
||||
HidVis_DataClass[Events->Event.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Description);
|
||||
HTM_DIV_End ();
|
||||
|
@ -580,10 +571,10 @@ static Dat_StartEndTime_t Att_GetParAttOrder (void)
|
|||
static void Att_PutFormsToRemEditOneEvent (struct Att_Events *Events,
|
||||
const char *Anchor)
|
||||
{
|
||||
static Act_Action_t ActionHideUnhide[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static Act_Action_t ActionHideUnhide[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = ActUnhAtt, // Hidden ==> action to unhide
|
||||
[Cns_VISIBLE] = ActHidAtt, // Visible ==> action to hide
|
||||
[HidVis_HIDDEN ] = ActUnhAtt, // Hidden ==> action to unhide
|
||||
[HidVis_VISIBLE] = ActHidAtt, // Visible ==> action to hide
|
||||
};
|
||||
|
||||
if (Att_CheckIfICanEditEvents ())
|
||||
|
@ -751,7 +742,7 @@ static void Att_ResetEvent (struct Att_Event *Event)
|
|||
Event->NumStdsTotal = 0;
|
||||
}
|
||||
Event->CrsCod = -1L;
|
||||
Event->HiddenOrVisible = Cns_VISIBLE;
|
||||
Event->HiddenOrVisible = HidVis_VISIBLE;
|
||||
Event->UsrCod = -1L;
|
||||
Event->TimeUTC[Dat_STR_TIME] =
|
||||
Event->TimeUTC[Dat_END_TIME] = (time_t) 0;
|
||||
|
@ -771,8 +762,8 @@ void Att_GetEventDataFromRow (MYSQL_ROW row,struct Att_Event *Event)
|
|||
Event->CrsCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||
|
||||
/***** Get whether the attendance event is hidden or not (row[2]) *****/
|
||||
Event->HiddenOrVisible = (row[2][0] == 'Y') ? Cns_HIDDEN :
|
||||
Cns_VISIBLE;
|
||||
Event->HiddenOrVisible = (row[2][0] == 'Y') ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE;
|
||||
|
||||
/***** Get author of the attendance event (row[3]) *****/
|
||||
Event->UsrCod = Str_ConvertStrCodToLongCod (row[3]);
|
||||
|
@ -1224,7 +1215,7 @@ void Att_ReceiveFormEvent (void)
|
|||
|
||||
if (ItsANewAttEvent)
|
||||
{
|
||||
ReceivedAtt.HiddenOrVisible = Cns_VISIBLE; // New attendance events are visible by default
|
||||
ReceivedAtt.HiddenOrVisible = HidVis_VISIBLE; // New attendance events are visible by default
|
||||
Att_CreateEvent (&ReceivedAtt,Description); // Add new attendance event to database
|
||||
|
||||
/***** Write success message *****/
|
||||
|
@ -1306,11 +1297,7 @@ static void Att_GetAndWriteNamesOfGrpsAssociatedToEvent (struct Att_Event *Event
|
|||
extern const char *Txt_Groups;
|
||||
extern const char *Txt_and;
|
||||
extern const char *Txt_The_whole_course;
|
||||
static const char *GroupClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "ASG_GRP_LIGHT",
|
||||
[Cns_VISIBLE] = "ASG_GRP",
|
||||
};
|
||||
extern const char *HidVis_GroupClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
MYSQL_RES *mysql_res;
|
||||
MYSQL_ROW row;
|
||||
unsigned NumGrps;
|
||||
|
@ -1321,8 +1308,7 @@ static void Att_GetAndWriteNamesOfGrpsAssociatedToEvent (struct Att_Event *Event
|
|||
|
||||
/***** Begin container *****/
|
||||
HTM_DIV_Begin ("class=\"%s_%s\"",
|
||||
GroupClass[Event->HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HidVis_GroupClass[Event->HiddenOrVisible],The_GetSuffix ());
|
||||
|
||||
/***** Write heading *****/
|
||||
HTM_TxtColonNBSP (NumGrps == 1 ? Txt_Group :
|
||||
|
@ -1845,11 +1831,7 @@ static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr,
|
|||
static void Att_PutLinkEvent (struct Att_Event *Event,
|
||||
const char *Title,const char *Txt)
|
||||
{
|
||||
static const char *TitleClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "ASG_TITLE_LIGHT",
|
||||
[Cns_VISIBLE] = "ASG_TITLE",
|
||||
};
|
||||
extern const char *HidVis_TitleClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
|
||||
/***** Begin form *****/
|
||||
Frm_BeginForm (ActSeeOneAtt);
|
||||
|
@ -1858,7 +1840,7 @@ static void Att_PutLinkEvent (struct Att_Event *Event,
|
|||
|
||||
/***** Link to view attendance event *****/
|
||||
HTM_BUTTON_Submit_Begin (Title,"class=\"LT BT_LINK %s_%s\"",
|
||||
TitleClass[Event->HiddenOrVisible],
|
||||
HidVis_TitleClass[Event->HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Txt);
|
||||
HTM_BUTTON_End ();
|
||||
|
|
|
@ -51,7 +51,7 @@ struct Att_Event
|
|||
/* Fields stored in database */
|
||||
long AttCod;
|
||||
long CrsCod;
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible;
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
||||
long UsrCod;
|
||||
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||
bool Open;
|
||||
|
|
|
@ -254,7 +254,7 @@ long Att_DB_CreateEvent (const struct Att_Event *Event,const char *Description)
|
|||
"FROM_UNIXTIME(%ld),FROM_UNIXTIME(%ld),"
|
||||
"'%c','%s','%s')",
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
Event->HiddenOrVisible == Cns_HIDDEN ? 'Y' :
|
||||
Event->HiddenOrVisible == HidVis_HIDDEN ? 'Y' :
|
||||
'N',
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
Event->TimeUTC[Dat_STR_TIME],
|
||||
|
@ -281,7 +281,7 @@ void Att_DB_UpdateEvent (const struct Att_Event *Event,const char *Description)
|
|||
"Txt='%s'"
|
||||
" WHERE AttCod=%ld"
|
||||
" AND CrsCod=%ld", // Extra check
|
||||
Event->HiddenOrVisible == Cns_HIDDEN ? 'Y' :
|
||||
Event->HiddenOrVisible == HidVis_HIDDEN ? 'Y' :
|
||||
'N',
|
||||
Event->TimeUTC[Dat_STR_TIME],
|
||||
Event->TimeUTC[Dat_END_TIME],
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "swad_error.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_language.h"
|
||||
#include "swad_link.h"
|
||||
|
@ -94,7 +95,7 @@ static void Ban_PutIconsEditingBanners (__attribute__((unused)) void *Args);
|
|||
static void Ban_ListBannersForEdition (struct Ban_Banners *Banners);
|
||||
static void Ban_PutParBanCod (void *BanCod);
|
||||
static void Ban_ShowOrHideBanner (struct Ban_Banner *Ban,
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible);
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible);
|
||||
|
||||
static void Ban_RenameBanner (struct Ban_Banner *Ban,
|
||||
Cns_ShrtOrFullName_t ShrtOrFullName);
|
||||
|
@ -294,7 +295,7 @@ void Ban_GetBannerDataByCod (struct Ban_Banner *Ban)
|
|||
MYSQL_RES *mysql_res;
|
||||
|
||||
/***** Clear data *****/
|
||||
Ban->HiddenOrVisible = Cns_VISIBLE;
|
||||
Ban->HiddenOrVisible = HidVis_VISIBLE;
|
||||
Ban->ShrtName[0] = Ban->FullName[0] = Ban->Img[0] = Ban->WWW[0] = '\0';
|
||||
|
||||
/***** Check if banner code is correct *****/
|
||||
|
@ -341,8 +342,8 @@ static void Ban_GetBannerDataFromRow (MYSQL_RES *mysql_res,
|
|||
Err_WrongBannerExit ();
|
||||
|
||||
/***** Get if the banner is hidden (row[1]) *****/
|
||||
Ban->HiddenOrVisible = (row[1][0] == 'Y') ? Cns_HIDDEN :
|
||||
Cns_VISIBLE;
|
||||
Ban->HiddenOrVisible = (row[1][0] == 'Y') ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE;
|
||||
|
||||
/***** Get short name (row[2]), full name (row[3]),
|
||||
image (row[4]) and URL (row[5]) of the banner *****/
|
||||
|
@ -383,16 +384,12 @@ void Ban_PutIconToViewBanners (void)
|
|||
|
||||
static void Ban_ListBannersForEdition (struct Ban_Banners *Banners)
|
||||
{
|
||||
static Act_Action_t ActionHideUnhide[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static Act_Action_t ActionHideUnhide[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = ActUnhBan, // Hidden ==> action to unhide
|
||||
[Cns_VISIBLE] = ActHidBan, // Visible ==> action to hide
|
||||
};
|
||||
static const char *DataClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DAT_LIGHT",
|
||||
[Cns_VISIBLE] = "DAT",
|
||||
[HidVis_HIDDEN ] = ActUnhBan, // Hidden ==> action to unhide
|
||||
[HidVis_VISIBLE] = ActHidBan, // Visible ==> action to hide
|
||||
};
|
||||
extern const char *HidVis_DataClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
unsigned NumBan;
|
||||
struct Ban_Banner *Ban;
|
||||
char *Anchor = NULL;
|
||||
|
@ -434,7 +431,7 @@ static void Ban_ListBannersForEdition (struct Ban_Banners *Banners)
|
|||
|
||||
/* Banner code */
|
||||
HTM_TD_Begin ("class=\"RM %s_%s\"",
|
||||
DataClass[Ban->HiddenOrVisible],
|
||||
HidVis_DataClass[Ban->HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_ARTICLE_Begin (Anchor);
|
||||
HTM_Long (Ban->BanCod);
|
||||
|
@ -544,7 +541,7 @@ void Ban_UnhideBanner (void)
|
|||
Ban_ResetBanner (Ban);
|
||||
|
||||
/***** Set banner as visible *****/
|
||||
Ban_ShowOrHideBanner (Ban,Cns_VISIBLE);
|
||||
Ban_ShowOrHideBanner (Ban,HidVis_VISIBLE);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -559,7 +556,7 @@ void Ban_HideBanner (void)
|
|||
Ban_ResetBanner (Ban);
|
||||
|
||||
/***** Set banner as hidden *****/
|
||||
Ban_ShowOrHideBanner (Ban,Cns_HIDDEN);
|
||||
Ban_ShowOrHideBanner (Ban,HidVis_HIDDEN);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -567,7 +564,7 @@ void Ban_HideBanner (void)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void Ban_ShowOrHideBanner (struct Ban_Banner *Ban,
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible)
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible)
|
||||
{
|
||||
/***** Get banner code *****/
|
||||
Ban->BanCod = ParCod_GetAndCheckPar (ParCod_Ban);
|
||||
|
@ -1040,7 +1037,7 @@ static void Ban_ResetBanner (struct Ban_Banner *Ban)
|
|||
{
|
||||
/***** Reset banner *****/
|
||||
Ban->BanCod = -1L;
|
||||
Ban->HiddenOrVisible = Cns_HIDDEN;
|
||||
Ban->HiddenOrVisible = HidVis_HIDDEN;
|
||||
Ban->ShrtName[0] = '\0';
|
||||
Ban->FullName[0] = '\0';
|
||||
Ban->Img[0] = '\0';
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
#include "swad_constant.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_string.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************** Public types and constants ***********************/
|
||||
|
@ -45,7 +47,7 @@
|
|||
struct Ban_Banner
|
||||
{
|
||||
long BanCod;
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible;
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
||||
char ShrtName[Ban_MAX_BYTES_SHRT_NAME + 1];
|
||||
char FullName[Ban_MAX_BYTES_FULL_NAME + 1];
|
||||
char Img[Ban_MAX_BYTES_IMAGE + 1];
|
||||
|
|
|
@ -156,13 +156,13 @@ void Ban_DB_CreateBanner (const struct Ban_Banner *Ban)
|
|||
/**************************** Hide/unhide a banner ***************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Ban_DB_HideOrUnhideBanner (long BanCod,Cns_HiddenOrVisible_t HiddenOrVisible)
|
||||
void Ban_DB_HideOrUnhideBanner (long BanCod,HidVis_HiddenOrVisible_t HiddenOrVisible)
|
||||
{
|
||||
DB_QueryUPDATE ("can not hide/unhide banner",
|
||||
"UPDATE ban_banners"
|
||||
" SET Hidden='%c'"
|
||||
" WHERE BanCod=%ld",
|
||||
HiddenOrVisible == Cns_HIDDEN ? 'Y' :
|
||||
HiddenOrVisible == HidVis_HIDDEN ? 'Y' :
|
||||
'N',
|
||||
BanCod);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ unsigned Ban_DB_GetBannerDataByCod (MYSQL_RES **mysql_res,long BanCod);
|
|||
bool Ban_DB_CheckIfBannerNameExists (const char *FldName,const char *Name,long BanCod);
|
||||
|
||||
void Ban_DB_CreateBanner (const struct Ban_Banner *Ban);
|
||||
void Ban_DB_HideOrUnhideBanner (long BanCod,Cns_HiddenOrVisible_t HiddenOrVisible);
|
||||
void Ban_DB_HideOrUnhideBanner (long BanCod,HidVis_HiddenOrVisible_t HiddenOrVisible);
|
||||
void Ban_DB_UpdateBanName (long BanCod,const char *FldName,
|
||||
const char *NewBanName);
|
||||
void Ban_DB_UpdateBanImg (long BanCod,
|
||||
|
|
149
swad_browser.c
149
swad_browser.c
|
@ -55,6 +55,7 @@
|
|||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_group_database.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_hierarchy.h"
|
||||
#include "swad_hierarchy_level.h"
|
||||
#include "swad_HTML.h"
|
||||
|
@ -1077,21 +1078,21 @@ static void Brw_IndentAndWriteIconExpandContract (unsigned Level,
|
|||
Brw_IconTree_t IconThisRow);
|
||||
static void Brw_IndentDependingOnLevel (unsigned Level);
|
||||
static void Brw_PutIconToExpandFolder (const char *FileBrowserId,const char *RowId,
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible);
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible);
|
||||
static void Brw_PutIconToContractFolder (const char *FileBrowserId,const char *RowId,
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible);
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible);
|
||||
|
||||
static void Brw_PutIconHideUnhide (const char *Anchor,
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible);
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible);
|
||||
static bool Brw_CheckIfAnyHigherLevelIsHidden (unsigned CurrentLevel);
|
||||
|
||||
static void Brw_PutIconFolder (unsigned Level,
|
||||
const char *FileBrowserId,const char *RowId,
|
||||
Brw_IconTree_t IconSubtree);
|
||||
static void Brw_PutIconFolderWithoutPlus (const char *FileBrowserId,const char *RowId,
|
||||
bool Open,Cns_HiddenOrVisible_t HiddenOrVisible);
|
||||
bool Open,HidVis_HiddenOrVisible_t HiddenOrVisible);
|
||||
static void Brw_PutIconFolderWithPlus (const char *FileBrowserId,const char *RowId,
|
||||
bool Open,Cns_HiddenOrVisible_t HiddenOrVisible);
|
||||
bool Open,HidVis_HiddenOrVisible_t HiddenOrVisible);
|
||||
|
||||
static void Brw_PutIconNewFileOrFolder (void);
|
||||
static void Brw_PutIconFileWithLinkToViewMetadata (const struct Brw_FileMetadata *FileMetadata);
|
||||
|
@ -4006,7 +4007,7 @@ static bool Brw_WriteRowFileBrowser (unsigned Level,const char *RowId,
|
|||
Brw_IconTree_t IconThisRow)
|
||||
{
|
||||
char *Anchor;
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible = Cns_VISIBLE;
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible = HidVis_VISIBLE;
|
||||
bool RowSetAsPublic = false;
|
||||
bool LightStyle = false;
|
||||
bool IsRecent = false;
|
||||
|
@ -4045,18 +4046,18 @@ static bool Brw_WriteRowFileBrowser (unsigned Level,const char *RowId,
|
|||
{
|
||||
HiddenOrVisible = Brw_CheckIfFileOrFolderIsSetAsHiddenInDB (Gbl.FileBrowser.FilFolLnk.Type,
|
||||
Gbl.FileBrowser.FilFolLnk.Full);
|
||||
if (HiddenOrVisible == Cns_HIDDEN && Level && (SeeDocsZone || SeeMarks))
|
||||
if (HiddenOrVisible == HidVis_HIDDEN && Level && (SeeDocsZone || SeeMarks))
|
||||
return false;
|
||||
if (AdminDocsZone || AdminMarks)
|
||||
{
|
||||
if (Gbl.FileBrowser.FilFolLnk.Type == Brw_IS_FOLDER)
|
||||
Gbl.FileBrowser.HiddenLevels[Level] = (HiddenOrVisible == Cns_HIDDEN);
|
||||
Gbl.FileBrowser.HiddenLevels[Level] = (HiddenOrVisible == HidVis_HIDDEN);
|
||||
switch (HiddenOrVisible)
|
||||
{
|
||||
case Cns_HIDDEN: // this row is marked as hidden
|
||||
case HidVis_HIDDEN: // this row is marked as hidden
|
||||
LightStyle = true;
|
||||
break;
|
||||
case Cns_VISIBLE: // this row is not marked as hidden
|
||||
case HidVis_VISIBLE: // this row is not marked as hidden
|
||||
LightStyle = Brw_CheckIfAnyHigherLevelIsHidden (Level);
|
||||
break;
|
||||
}
|
||||
|
@ -4239,7 +4240,7 @@ static bool Brw_WriteRowFileBrowser (unsigned Level,const char *RowId,
|
|||
HTM_TD_Begin ("class=\"BM %s\"",The_GetColorRows ());
|
||||
if (Gbl.Usrs.Me.Role.Logged >= Rol_STD && // Only ZIP folders if I am student, teacher...
|
||||
!SeeMarks && // Do not ZIP folders when seeing marks
|
||||
!(SeeDocsZone && HiddenOrVisible == Cns_HIDDEN)) // When seeing docs, if folder is not hidden (this could happen for Level == 0)
|
||||
!(SeeDocsZone && HiddenOrVisible == HidVis_HIDDEN)) // When seeing docs, if folder is not hidden (this could happen for Level == 0)
|
||||
Brw_PutButtonToDownloadZIPOfAFolder ();
|
||||
HTM_TD_End ();
|
||||
}
|
||||
|
@ -4253,7 +4254,7 @@ static bool Brw_WriteRowFileBrowser (unsigned Level,const char *RowId,
|
|||
|
||||
The_ChangeRowColor ();
|
||||
|
||||
if (HiddenOrVisible == Cns_HIDDEN && (SeeDocsZone || SeeMarks))
|
||||
if (HiddenOrVisible == HidVis_HIDDEN && (SeeDocsZone || SeeMarks))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
@ -4422,20 +4423,20 @@ static void Brw_IndentAndWriteIconExpandContract (unsigned Level,
|
|||
case Brw_ICON_TREE_EXPAND:
|
||||
/***** Visible icon to expand folder *****/
|
||||
Brw_PutIconToExpandFolder (FileBrowserId,RowId,
|
||||
Cns_VISIBLE);
|
||||
HidVis_VISIBLE);
|
||||
|
||||
/***** Hidden icon to contract folder *****/
|
||||
Brw_PutIconToContractFolder (FileBrowserId,RowId,
|
||||
Cns_HIDDEN);
|
||||
HidVis_HIDDEN);
|
||||
break;
|
||||
case Brw_ICON_TREE_CONTRACT:
|
||||
/***** Hidden icon to expand folder *****/
|
||||
Brw_PutIconToExpandFolder (FileBrowserId,RowId,
|
||||
Cns_HIDDEN);
|
||||
HidVis_HIDDEN);
|
||||
|
||||
/***** Visible icon to contract folder *****/
|
||||
Brw_PutIconToContractFolder (FileBrowserId,RowId,
|
||||
Cns_VISIBLE);
|
||||
HidVis_VISIBLE);
|
||||
break;
|
||||
}
|
||||
HTM_TD_End ();
|
||||
|
@ -4468,18 +4469,18 @@ static void Brw_IndentDependingOnLevel (unsigned Level)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void Brw_PutIconToExpandFolder (const char *FileBrowserId,const char *RowId,
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible)
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible)
|
||||
{
|
||||
char JavaScriptFuncToExpandFolder[256 + Brw_MAX_ROW_ID];
|
||||
|
||||
/***** Begin container *****/
|
||||
switch (HiddenOrVisible)
|
||||
{
|
||||
case Cns_HIDDEN:
|
||||
case HidVis_HIDDEN:
|
||||
HTM_DIV_Begin ("id=\"expand_%s_%s\" class=\"NOT_SHOWN\"",
|
||||
FileBrowserId,RowId);
|
||||
break;
|
||||
case Cns_VISIBLE:
|
||||
case HidVis_VISIBLE:
|
||||
HTM_DIV_Begin ("id=\"expand_%s_%s\"",
|
||||
FileBrowserId,RowId);
|
||||
break;
|
||||
|
@ -4506,18 +4507,18 @@ static void Brw_PutIconToExpandFolder (const char *FileBrowserId,const char *Row
|
|||
/*****************************************************************************/
|
||||
|
||||
static void Brw_PutIconToContractFolder (const char *FileBrowserId,const char *RowId,
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible)
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible)
|
||||
{
|
||||
char JavaScriptFuncToContractFolder[256 + Brw_MAX_ROW_ID];
|
||||
|
||||
/***** Begin container *****/
|
||||
switch (HiddenOrVisible)
|
||||
{
|
||||
case Cns_HIDDEN:
|
||||
case HidVis_HIDDEN:
|
||||
HTM_DIV_Begin ("id=\"contract_%s_%s\" style=\"display:none;\"",
|
||||
FileBrowserId,RowId);
|
||||
break;
|
||||
case Cns_VISIBLE:
|
||||
case HidVis_VISIBLE:
|
||||
HTM_DIV_Begin ("id=\"contract_%s_%s\"",
|
||||
FileBrowserId,RowId);
|
||||
break;
|
||||
|
@ -4544,39 +4545,39 @@ static void Brw_PutIconToContractFolder (const char *FileBrowserId,const char *R
|
|||
/*****************************************************************************/
|
||||
|
||||
static void Brw_PutIconHideUnhide (const char *Anchor,
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible)
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible)
|
||||
{
|
||||
static const Act_Action_t Brw_ActHideUnhide[Brw_NUM_TYPES_FILE_BROWSER][Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static const Act_Action_t Brw_ActHideUnhide[Brw_NUM_TYPES_FILE_BROWSER][HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Brw_UNKNOWN ] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_SHOW_DOC_CRS] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_SHOW_MRK_CRS] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_DOC_CRS] = {[Cns_HIDDEN] = ActUnhDocCrs ,[Cns_VISIBLE] = ActHidDocCrs },
|
||||
[Brw_ADMI_SHR_CRS] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_SHR_GRP] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_WRK_USR] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_WRK_CRS] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_MRK_CRS] = {[Cns_HIDDEN] = ActUnhMrkCrs ,[Cns_VISIBLE] = ActHidMrkCrs },
|
||||
[Brw_ADMI_BRF_USR] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_SHOW_DOC_GRP] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_DOC_GRP] = {[Cns_HIDDEN] = ActUnhDocGrp ,[Cns_VISIBLE] = ActHidDocGrp },
|
||||
[Brw_SHOW_MRK_GRP] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_MRK_GRP] = {[Cns_HIDDEN] = ActUnhMrkGrp ,[Cns_VISIBLE] = ActHidMrkGrp },
|
||||
[Brw_ADMI_ASG_USR] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_ASG_CRS] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_SHOW_DOC_DEG] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_DOC_DEG] = {[Cns_HIDDEN] = ActUnhDocDeg ,[Cns_VISIBLE] = ActHidDocDeg },
|
||||
[Brw_SHOW_DOC_CTR] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_DOC_CTR] = {[Cns_HIDDEN] = ActUnhDocCtr ,[Cns_VISIBLE] = ActHidDocCtr },
|
||||
[Brw_SHOW_DOC_INS] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_DOC_INS] = {[Cns_HIDDEN] = ActUnhDocIns ,[Cns_VISIBLE] = ActHidDocIns },
|
||||
[Brw_ADMI_SHR_DEG] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_SHR_CTR] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_SHR_INS] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_TCH_CRS] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_TCH_GRP] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_DOC_PRJ] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_ASS_PRJ] = {[Cns_HIDDEN] = ActUnk ,[Cns_VISIBLE] = ActUnk },
|
||||
[Brw_UNKNOWN ] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_SHOW_DOC_CRS] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_SHOW_MRK_CRS] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_DOC_CRS] = {[HidVis_HIDDEN] = ActUnhDocCrs ,[HidVis_VISIBLE] = ActHidDocCrs },
|
||||
[Brw_ADMI_SHR_CRS] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_SHR_GRP] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_WRK_USR] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_WRK_CRS] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_MRK_CRS] = {[HidVis_HIDDEN] = ActUnhMrkCrs ,[HidVis_VISIBLE] = ActHidMrkCrs },
|
||||
[Brw_ADMI_BRF_USR] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_SHOW_DOC_GRP] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_DOC_GRP] = {[HidVis_HIDDEN] = ActUnhDocGrp ,[HidVis_VISIBLE] = ActHidDocGrp },
|
||||
[Brw_SHOW_MRK_GRP] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_MRK_GRP] = {[HidVis_HIDDEN] = ActUnhMrkGrp ,[HidVis_VISIBLE] = ActHidMrkGrp },
|
||||
[Brw_ADMI_ASG_USR] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_ASG_CRS] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_SHOW_DOC_DEG] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_DOC_DEG] = {[HidVis_HIDDEN] = ActUnhDocDeg ,[HidVis_VISIBLE] = ActHidDocDeg },
|
||||
[Brw_SHOW_DOC_CTR] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_DOC_CTR] = {[HidVis_HIDDEN] = ActUnhDocCtr ,[HidVis_VISIBLE] = ActHidDocCtr },
|
||||
[Brw_SHOW_DOC_INS] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_DOC_INS] = {[HidVis_HIDDEN] = ActUnhDocIns ,[HidVis_VISIBLE] = ActHidDocIns },
|
||||
[Brw_ADMI_SHR_DEG] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_SHR_CTR] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_SHR_INS] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_TCH_CRS] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_TCH_GRP] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_DOC_PRJ] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
[Brw_ADMI_ASS_PRJ] = {[HidVis_HIDDEN] = ActUnk ,[HidVis_VISIBLE] = ActUnk },
|
||||
};
|
||||
|
||||
HTM_TD_Begin ("class=\"BM %s\"",The_GetColorRows ());
|
||||
|
@ -4651,24 +4652,24 @@ static void Brw_PutIconFolder (unsigned Level,
|
|||
/***** Visible icon with folder closed *****/
|
||||
Brw_PutIconFolderWithoutPlus (FileBrowserId,RowId,
|
||||
false, // Closed
|
||||
Cns_VISIBLE);
|
||||
HidVis_VISIBLE);
|
||||
|
||||
/***** Hidden icon with folder open *****/
|
||||
Brw_PutIconFolderWithoutPlus (FileBrowserId,RowId,
|
||||
true, // Open
|
||||
Cns_HIDDEN);
|
||||
HidVis_HIDDEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
/***** Hidden icon with folder closed *****/
|
||||
Brw_PutIconFolderWithoutPlus (FileBrowserId,RowId,
|
||||
false, // Closed
|
||||
Cns_HIDDEN);
|
||||
HidVis_HIDDEN);
|
||||
|
||||
/***** Visible icon with folder open *****/
|
||||
Brw_PutIconFolderWithoutPlus (FileBrowserId,RowId,
|
||||
true, // Open
|
||||
Cns_VISIBLE);
|
||||
HidVis_VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4681,21 +4682,17 @@ static void Brw_PutIconFolder (unsigned Level,
|
|||
/*****************************************************************************/
|
||||
|
||||
static void Brw_PutIconFolderWithoutPlus (const char *FileBrowserId,const char *RowId,
|
||||
bool Open,Cns_HiddenOrVisible_t HiddenOrVisible)
|
||||
bool Open,HidVis_HiddenOrVisible_t HiddenOrVisible)
|
||||
{
|
||||
extern const char *Txt_Folder;
|
||||
static const char *Class[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "NOT_SHOWN ",
|
||||
[Cns_VISIBLE] = "",
|
||||
};
|
||||
extern const char *HidVis_ShownClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
|
||||
/***** Begin container *****/
|
||||
HTM_DIV_Begin ("id=\"folder_%s_%s_%s\" class=\"%s%s\"",
|
||||
Open ? "open" :
|
||||
"closed",
|
||||
FileBrowserId,RowId,
|
||||
Class[HiddenOrVisible],The_GetColorRows ());
|
||||
The_GetColorRows (),HidVis_ShownClass[HiddenOrVisible]);
|
||||
|
||||
/***** Icon *****/
|
||||
Ico_PutIcon (Open ? "folder-open-yellow.png" :
|
||||
|
@ -4712,20 +4709,16 @@ static void Brw_PutIconFolderWithoutPlus (const char *FileBrowserId,const char *
|
|||
/*****************************************************************************/
|
||||
|
||||
static void Brw_PutIconFolderWithPlus (const char *FileBrowserId,const char *RowId,
|
||||
bool Open,Cns_HiddenOrVisible_t HiddenOrVisible)
|
||||
bool Open,HidVis_HiddenOrVisible_t HiddenOrVisible)
|
||||
{
|
||||
static const char *Class[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "NOT_SHOWN ",
|
||||
[Cns_VISIBLE] = "",
|
||||
};
|
||||
extern const char *HidVis_ShownClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
|
||||
/***** Begin container *****/
|
||||
HTM_DIV_Begin ("id=\"folder_%s_%s_%s\" class=\"%s%s\"",
|
||||
Open ? "open" :
|
||||
"closed",
|
||||
FileBrowserId,RowId,
|
||||
Class[HiddenOrVisible],The_GetColorRows ());
|
||||
The_GetColorRows (),HidVis_ShownClass[HiddenOrVisible]);
|
||||
|
||||
/***** Form and icon *****/
|
||||
Ico_PutContextualIconToCreateInFolder (Brw_ActFormCreate[Gbl.FileBrowser.Type],
|
||||
|
@ -7451,12 +7444,12 @@ void Brw_SetDocumentAsHidden (void)
|
|||
/** Check if a file / folder from the documents zone is set as hidden in DB **/
|
||||
/*****************************************************************************/
|
||||
|
||||
Cns_HiddenOrVisible_t Brw_CheckIfFileOrFolderIsSetAsHiddenInDB (Brw_FileType_t FileType,
|
||||
HidVis_HiddenOrVisible_t Brw_CheckIfFileOrFolderIsSetAsHiddenInDB (Brw_FileType_t FileType,
|
||||
const char *Path)
|
||||
{
|
||||
MYSQL_RES *mysql_res;
|
||||
MYSQL_ROW row;
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible;
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
||||
|
||||
/***** Get if a file or folder is hidden from database *****/
|
||||
if (Brw_DB_CheckIfFileOrFolderIsSetAsHiddenUsingPath (&mysql_res,Path))
|
||||
|
@ -7465,14 +7458,14 @@ Cns_HiddenOrVisible_t Brw_CheckIfFileOrFolderIsSetAsHiddenInDB (Brw_FileType_t F
|
|||
row = mysql_fetch_row (mysql_res);
|
||||
|
||||
/* File is hidden? (row[0]) */
|
||||
HiddenOrVisible = (row[0][0] == 'Y') ? Cns_HIDDEN :
|
||||
Cns_VISIBLE;
|
||||
HiddenOrVisible = (row[0][0] == 'Y') ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
Brw_DB_AddPath (-1L,FileType,
|
||||
Gbl.FileBrowser.FilFolLnk.Full,false,Brw_LICENSE_DEFAULT);
|
||||
HiddenOrVisible = Cns_VISIBLE;
|
||||
HiddenOrVisible = HidVis_VISIBLE;
|
||||
}
|
||||
|
||||
/***** Free structure that stores the query result *****/
|
||||
|
@ -8965,7 +8958,7 @@ static bool Brw_CheckIfICanEditFileOrFolder (unsigned Level)
|
|||
if (Gbl.FileBrowser.Asg.AsgCod <= 0) // If folder does not correspond to any assignment
|
||||
return true; // Folder can be removed or renamed
|
||||
|
||||
if (Gbl.FileBrowser.Asg.HiddenOrVisible == Cns_HIDDEN)
|
||||
if (Gbl.FileBrowser.Asg.HiddenOrVisible == HidVis_HIDDEN)
|
||||
return false; // Do not edit anything in hidden assigments
|
||||
|
||||
if (Gbl.FileBrowser.FilFolLnk.Type == Brw_IS_FOLDER && // The main folder of an assignment
|
||||
|
@ -9052,7 +9045,7 @@ static bool Brw_CheckIfICanCreateIntoFolder (unsigned Level)
|
|||
if (Gbl.FileBrowser.Asg.AsgCod <= 0) // If folder does not correspond to any assignment
|
||||
return false; // Do not create anything out of assignments
|
||||
|
||||
if (Gbl.FileBrowser.Asg.HiddenOrVisible == Cns_HIDDEN)
|
||||
if (Gbl.FileBrowser.Asg.HiddenOrVisible == HidVis_HIDDEN)
|
||||
return false; // Do not create anything in hidden assigments
|
||||
|
||||
if (!Gbl.FileBrowser.Asg.IBelongToCrsOrGrps) // If I do not belong to course / groups of this assignment
|
||||
|
|
|
@ -220,7 +220,7 @@ void Brw_RcvFileInFileBrwClassic (void);
|
|||
void Brw_RecLinkFileBrowser (void);
|
||||
void Brw_SetDocumentAsVisible (void);
|
||||
void Brw_SetDocumentAsHidden (void);
|
||||
Cns_HiddenOrVisible_t Brw_CheckIfFileOrFolderIsSetAsHiddenInDB (Brw_FileType_t FileType,
|
||||
HidVis_HiddenOrVisible_t Brw_CheckIfFileOrFolderIsSetAsHiddenInDB (Brw_FileType_t FileType,
|
||||
const char *Path);
|
||||
void Brw_ShowFileMetadata (void);
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "swad_error.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_hierarchy.h"
|
||||
#include "swad_hierarchy_level.h"
|
||||
#include "swad_HTML.h"
|
||||
|
@ -1472,10 +1473,10 @@ static void Cfe_ShowCallForExam (struct Cfe_CallsForExams *CallsForExams,
|
|||
|
||||
static void Cfe_PutIconsCallForExam (void *CallsForExams)
|
||||
{
|
||||
static Act_Action_t ActionHideUnhide[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static Act_Action_t ActionHideUnhide[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = ActUnhCfe, // Hidden ==> action to unhide
|
||||
[Cns_VISIBLE] = ActHidCfe, // Visible ==> action to hide
|
||||
[HidVis_HIDDEN ] = ActUnhCfe, // Hidden ==> action to unhide
|
||||
[HidVis_VISIBLE] = ActHidCfe, // Visible ==> action to hide
|
||||
};
|
||||
|
||||
if (CallsForExams)
|
||||
|
|
|
@ -629,10 +629,11 @@ TODO: Emilce Barrera Mesa: Podr
|
|||
TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen.
|
||||
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 22.119 (2023-06-06)"
|
||||
#define CSS_FILE "swad22.118.5.css"
|
||||
#define Log_PLATFORM_VERSION "SWAD 22.120 (2023-06-06)"
|
||||
#define CSS_FILE "swad22.120.css"
|
||||
#define JS_FILE "swad22.49.js"
|
||||
/*
|
||||
Version 22.120: Jun 06, 2023 Code refactoring related to hidden-visible. (337561 lines)
|
||||
Version 22.119: Jun 06, 2023 Code refactoring related to hidden-visible. (337588 lines)
|
||||
Version 22.118.13:May 31, 2023 Code refactoring in forums. (337417 lines)
|
||||
Version 22.118.12:May 30, 2023 Code refactoring in forums and messages. (337408 lines)
|
||||
|
|
|
@ -126,11 +126,4 @@ typedef enum
|
|||
Cns_ENABLED,
|
||||
} Cns_DisabledOrEnabled_t;
|
||||
|
||||
#define Cns_NUM_HIDDEN_VISIBLE 2
|
||||
typedef enum
|
||||
{
|
||||
Cns_HIDDEN,
|
||||
Cns_VISIBLE,
|
||||
} Cns_HiddenOrVisible_t;
|
||||
|
||||
#endif
|
||||
|
|
17
swad_date.c
17
swad_date.c
|
@ -41,6 +41,7 @@
|
|||
#include "swad_figure.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_parameter.h"
|
||||
#include "swad_setting.h"
|
||||
|
@ -57,14 +58,16 @@ extern struct Globals Gbl;
|
|||
/***************************** Public constants ******************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
const char *Dat_TimeStatusClass[Dat_NUM_TIME_STATUS][Cns_NUM_HIDDEN_VISIBLE] =
|
||||
const char *Dat_TimeStatusClass[Dat_NUM_TIME_STATUS][HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Dat_PAST ][Cns_HIDDEN ] = "DATE_RED_LIGHT",
|
||||
[Dat_PAST ][Cns_VISIBLE] = "DATE_RED",
|
||||
[Dat_PRESENT][Cns_HIDDEN ] = "DATE_GREEN_LIGHT",
|
||||
[Dat_PRESENT][Cns_VISIBLE] = "DATE_GREEN",
|
||||
[Dat_FUTURE ][Cns_HIDDEN ] = "DATE_BLUE_LIGHT",
|
||||
[Dat_FUTURE ][Cns_VISIBLE] = "DATE_BLUE",
|
||||
[Dat_PAST ][HidVis_HIDDEN ] = "DATE_RED_LIGHT",
|
||||
[Dat_PAST ][HidVis_VISIBLE] = "DATE_RED",
|
||||
|
||||
[Dat_PRESENT][HidVis_HIDDEN ] = "DATE_GREEN_LIGHT",
|
||||
[Dat_PRESENT][HidVis_VISIBLE] = "DATE_GREEN",
|
||||
|
||||
[Dat_FUTURE ][HidVis_HIDDEN ] = "DATE_BLUE_LIGHT",
|
||||
[Dat_FUTURE ][HidVis_VISIBLE] = "DATE_BLUE",
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
55
swad_exam.c
55
swad_exam.c
|
@ -48,6 +48,7 @@
|
|||
#include "swad_figure.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_hierarchy_level.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_match.h"
|
||||
|
@ -183,7 +184,7 @@ void Exa_ResetExam (struct Exa_Exam *Exam)
|
|||
Exam->TimeUTC[Dat_STR_TIME] = (time_t) 0;
|
||||
Exam->TimeUTC[Dat_END_TIME] = (time_t) 0;
|
||||
Exam->Title[0] = '\0';
|
||||
Exam->HiddenOrVisible = Cns_VISIBLE;
|
||||
Exam->HiddenOrVisible = HidVis_VISIBLE;
|
||||
Exam->NumSets = 0;
|
||||
Exam->NumQsts = 0;
|
||||
Exam->NumSess = 0;
|
||||
|
@ -455,31 +456,11 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,bool ShowOnlyThisExam)
|
|||
extern const char *Txt_Maximum_grade;
|
||||
extern const char *Txt_Result_visibility;
|
||||
extern const char *Txt_Sessions;
|
||||
static const char *DateGreenClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DATE_GREEN_LIGHT",
|
||||
[Cns_VISIBLE] = "DATE_GREEN",
|
||||
};
|
||||
static const char *DateRedClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DATE_RED_LIGHT",
|
||||
[Cns_VISIBLE] = "DATE_RED",
|
||||
};
|
||||
static const char *TitleClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "ASG_TITLE_LIGHT",
|
||||
[Cns_VISIBLE] = "ASG_TITLE",
|
||||
};
|
||||
static const char *GroupClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "ASG_GRP_LIGHT",
|
||||
[Cns_VISIBLE] = "ASG_GRP",
|
||||
};
|
||||
static const char *DataClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DAT_LIGHT",
|
||||
[Cns_VISIBLE] = "DAT",
|
||||
};
|
||||
extern const char *HidVis_DateGreenClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_DateRedClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_TitleClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_GroupClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_DataClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
char *Anchor;
|
||||
static unsigned UniqueId = 0;
|
||||
char *Id;
|
||||
|
@ -514,8 +495,8 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,bool ShowOnlyThisExam)
|
|||
{
|
||||
if (asprintf (&Id,"exa_date_%u_%u",(unsigned) StartEndTime,UniqueId) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
DateClass = Exams->Exam.NumOpenSess ? DateGreenClass[Exams->Exam.HiddenOrVisible] :
|
||||
DateRedClass[Exams->Exam.HiddenOrVisible];
|
||||
DateClass = Exams->Exam.NumOpenSess ? HidVis_DateGreenClass[Exams->Exam.HiddenOrVisible] :
|
||||
HidVis_DateRedClass[Exams->Exam.HiddenOrVisible];
|
||||
if (ShowOnlyThisExam)
|
||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s\"",
|
||||
Id,DateClass,The_GetSuffix ());
|
||||
|
@ -541,7 +522,7 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,bool ShowOnlyThisExam)
|
|||
Frm_BeginForm (ActSeeOneExa);
|
||||
Exa_PutPars (Exams);
|
||||
HTM_BUTTON_Submit_Begin (Txt_View_exam,"class=\"LT BT_LINK %s_%s\"",
|
||||
TitleClass[Exams->Exam.HiddenOrVisible],
|
||||
HidVis_TitleClass[Exams->Exam.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Exams->Exam.Title);
|
||||
HTM_BUTTON_End ();
|
||||
|
@ -550,7 +531,7 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,bool ShowOnlyThisExam)
|
|||
|
||||
/* Number of questions, maximum grade, visibility of results */
|
||||
HTM_DIV_Begin ("class=\"%s_%s\"",
|
||||
GroupClass[Exams->Exam.HiddenOrVisible],
|
||||
HidVis_GroupClass[Exams->Exam.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_TxtColonNBSP (Txt_Sets_of_questions);
|
||||
HTM_Unsigned (Exams->Exam.NumSets);
|
||||
|
@ -572,7 +553,7 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,bool ShowOnlyThisExam)
|
|||
Frm_BeginForm (ActSeeOneExa);
|
||||
Exa_PutPars (Exams);
|
||||
HTM_BUTTON_Submit_Begin (Txt_Sessions,"class=\"LT BT_LINK %s_%s\"",
|
||||
TitleClass[Exams->Exam.HiddenOrVisible],
|
||||
HidVis_TitleClass[Exams->Exam.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
if (ShowOnlyThisExam)
|
||||
HTM_TxtColonNBSP (Txt_Sessions);
|
||||
|
@ -608,7 +589,7 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,bool ShowOnlyThisExam)
|
|||
Txt,Cns_MAX_BYTES_TEXT,Str_DONT_REMOVE_SPACES);
|
||||
ALn_InsertLinks (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links
|
||||
HTM_DIV_Begin ("class=\"PAR %s_%s\"",
|
||||
DataClass[Exams->Exam.HiddenOrVisible],
|
||||
HidVis_DataClass[Exams->Exam.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Txt);
|
||||
HTM_DIV_End ();
|
||||
|
@ -681,10 +662,10 @@ static void Exa_PutParExamOrder (Exa_Order_t SelectedOrder)
|
|||
static void Exa_PutIconsToRemEditOneExam (struct Exa_Exams *Exams,
|
||||
const char *Anchor)
|
||||
{
|
||||
static Act_Action_t ActionHideUnhide[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static Act_Action_t ActionHideUnhide[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = ActUnhExa, // Hidden ==> action to unhide
|
||||
[Cns_VISIBLE] = ActHidExa, // Visible ==> action to hide
|
||||
[HidVis_HIDDEN ] = ActUnhExa, // Hidden ==> action to unhide
|
||||
[HidVis_VISIBLE] = ActHidExa, // Visible ==> action to hide
|
||||
};
|
||||
static const Act_Action_t ActionShowResults[Rol_NUM_ROLES] =
|
||||
{
|
||||
|
@ -914,8 +895,8 @@ void Exa_GetExamDataByCod (struct Exa_Exam *Exam)
|
|||
Exam->CrsCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||
|
||||
/* Get whether the exam is hidden (row[2]) */
|
||||
Exam->HiddenOrVisible = (row[2][0] == 'Y') ? Cns_HIDDEN :
|
||||
Cns_VISIBLE;
|
||||
Exam->HiddenOrVisible = (row[2][0] == 'Y') ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE;
|
||||
|
||||
/* Get author of the exam (row[3]) */
|
||||
Exam->UsrCod = Str_ConvertStrCodToLongCod (row[3]);
|
||||
|
|
|
@ -1303,7 +1303,7 @@ long Exa_DB_CreateSession (const struct ExaSes_Session *Session)
|
|||
"'%s'," // Title
|
||||
"'N')", // ShowUsrResults: Don't show user results initially
|
||||
Session->ExaCod,
|
||||
Session->HiddenOrVisible == Cns_HIDDEN ? 'Y' :
|
||||
Session->HiddenOrVisible == HidVis_HIDDEN ? 'Y' :
|
||||
'N',
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod, // Session creator
|
||||
Session->TimeUTC[Dat_STR_TIME], // Start time
|
||||
|
@ -1330,7 +1330,7 @@ void Exa_DB_UpdateSession (const struct ExaSes_Session *Session)
|
|||
" AND exa_sessions.ExaCod=%ld" // Extra check
|
||||
" AND exa_sessions.ExaCod=exa_exams.ExaCod"
|
||||
" AND exa_exams.CrsCod=%ld", // Extra check
|
||||
Session->HiddenOrVisible == Cns_HIDDEN ? 'Y' :
|
||||
Session->HiddenOrVisible == HidVis_HIDDEN ? 'Y' :
|
||||
'N',
|
||||
Session->TimeUTC[Dat_STR_TIME], // Start time
|
||||
Session->TimeUTC[Dat_END_TIME], // End time
|
||||
|
|
|
@ -1409,8 +1409,8 @@ static void ExaRes_CheckIfICanViewResult (const struct Exa_Exam *Exam,
|
|||
case Rol_STD:
|
||||
// Depends on visibility of exam, session and result (eye icons)
|
||||
ICanView->Result = (Usr_ItsMe (UsrCod) == Usr_ME && // The result is mine
|
||||
Exam->HiddenOrVisible == Cns_VISIBLE && // The exam is visible
|
||||
Session->HiddenOrVisible == Cns_VISIBLE && // The session is visible
|
||||
Exam->HiddenOrVisible == HidVis_VISIBLE && // The exam is visible
|
||||
Session->HiddenOrVisible == HidVis_VISIBLE && // The session is visible
|
||||
Session->ShowUsrResults); // The results of the session are visible to users
|
||||
// Whether I belong or not to groups of session is not checked here...
|
||||
// ...because I should be able to see old exams made in old groups to which I belonged
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_group_database.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_parameter_code.h"
|
||||
#include "swad_role.h"
|
||||
|
@ -123,7 +124,7 @@ void ExaSes_ResetSession (struct ExaSes_Session *Session)
|
|||
StartEndTime++)
|
||||
Session->TimeUTC[StartEndTime] = (time_t) 0;
|
||||
Session->Title[0] = '\0';
|
||||
Session->HiddenOrVisible = Cns_VISIBLE;
|
||||
Session->HiddenOrVisible = HidVis_VISIBLE;
|
||||
Session->Open = false;
|
||||
Session->ShowUsrResults = false;
|
||||
};
|
||||
|
@ -426,10 +427,10 @@ static void ExaSes_ListOneOrMoreSessionsIcons (struct Exa_Exams *Exams,
|
|||
const struct ExaSes_Session *Session,
|
||||
const char *Anchor)
|
||||
{
|
||||
static Act_Action_t ActionHideUnhide[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static Act_Action_t ActionHideUnhide[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = ActUnhExaSes, // Hidden ==> action to unhide
|
||||
[Cns_VISIBLE] = ActHidExaSes, // Visible ==> action to hide
|
||||
[HidVis_HIDDEN ] = ActUnhExaSes, // Hidden ==> action to unhide
|
||||
[HidVis_VISIBLE] = ActHidExaSes, // Visible ==> action to hide
|
||||
};
|
||||
|
||||
Exams->Exam.ExaCod = Session->ExaCod;
|
||||
|
@ -477,16 +478,8 @@ static void ExaSes_ListOneOrMoreSessionsAuthor (const struct ExaSes_Session *Ses
|
|||
static void ExaSes_ListOneOrMoreSessionsTimes (const struct ExaSes_Session *Session,
|
||||
unsigned UniqueId)
|
||||
{
|
||||
static const char *DateGreenClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DATE_GREEN_LIGHT",
|
||||
[Cns_VISIBLE] = "DATE_GREEN",
|
||||
};
|
||||
static const char *DateRedClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DATE_RED_LIGHT",
|
||||
[Cns_VISIBLE] = "DATE_RED",
|
||||
};
|
||||
extern const char *HidVis_DateGreenClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_DateRedClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
Dat_StartEndTime_t StartEndTime;
|
||||
const char *DateClass;
|
||||
char *Id;
|
||||
|
@ -495,8 +488,8 @@ static void ExaSes_ListOneOrMoreSessionsTimes (const struct ExaSes_Session *Sess
|
|||
StartEndTime <= (Dat_StartEndTime_t) (Dat_NUM_START_END_TIME - 1);
|
||||
StartEndTime++)
|
||||
{
|
||||
DateClass = Session->Open ? DateGreenClass[Session->HiddenOrVisible] :
|
||||
DateRedClass[Session->HiddenOrVisible];
|
||||
DateClass = Session->Open ? HidVis_DateGreenClass[Session->HiddenOrVisible] :
|
||||
HidVis_DateRedClass[Session->HiddenOrVisible];
|
||||
|
||||
if (asprintf (&Id,"exa_time_%u_%u",(unsigned) StartEndTime,UniqueId) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
|
@ -520,11 +513,7 @@ static void ExaSes_ListOneOrMoreSessionsTitleGrps (struct Exa_Exams *Exams,
|
|||
{
|
||||
extern const char *Txt_Play;
|
||||
extern const char *Txt_Resume;
|
||||
static const char *TitleClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "ASG_TITLE_LIGHT",
|
||||
[Cns_VISIBLE] = "ASG_TITLE",
|
||||
};
|
||||
extern const char *HidVis_TitleClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
|
||||
HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ());
|
||||
|
||||
|
@ -538,7 +527,7 @@ static void ExaSes_ListOneOrMoreSessionsTitleGrps (struct Exa_Exams *Exams,
|
|||
HTM_BUTTON_Submit_Begin (Gbl.Usrs.Me.Role.Logged == Rol_STD ? Txt_Play :
|
||||
Txt_Resume,
|
||||
"class=\"LT BT_LINK %s_%s\"",
|
||||
TitleClass[Session->HiddenOrVisible],
|
||||
HidVis_TitleClass[Session->HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Session->Title);
|
||||
HTM_BUTTON_End ();
|
||||
|
@ -547,7 +536,7 @@ static void ExaSes_ListOneOrMoreSessionsTitleGrps (struct Exa_Exams *Exams,
|
|||
else
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"%s_%s\"",
|
||||
TitleClass[Session->HiddenOrVisible],
|
||||
HidVis_TitleClass[Session->HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Session->Title);
|
||||
HTM_SPAN_End ();
|
||||
|
@ -571,11 +560,7 @@ static void ExaSes_GetAndWriteNamesOfGrpsAssociatedToSession (const struct ExaSe
|
|||
extern const char *Txt_Groups;
|
||||
extern const char *Txt_and;
|
||||
extern const char *Txt_The_whole_course;
|
||||
static const char *GroupClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "ASG_GRP_LIGHT",
|
||||
[Cns_VISIBLE] = "ASG_GRP",
|
||||
};
|
||||
extern const char *HidVis_GroupClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
MYSQL_RES *mysql_res;
|
||||
MYSQL_ROW row;
|
||||
unsigned NumGrps;
|
||||
|
@ -586,7 +571,7 @@ static void ExaSes_GetAndWriteNamesOfGrpsAssociatedToSession (const struct ExaSe
|
|||
|
||||
/***** Write heading *****/
|
||||
HTM_DIV_Begin ("class=\"%s_%s\"",
|
||||
GroupClass[Session->HiddenOrVisible],The_GetSuffix ());
|
||||
HidVis_GroupClass[Session->HiddenOrVisible],The_GetSuffix ());
|
||||
|
||||
HTM_TxtColonNBSP (NumGrps == 1 ? Txt_Group :
|
||||
Txt_Groups);
|
||||
|
@ -771,8 +756,8 @@ static void ExaSes_GetSessionDataFromRow (MYSQL_RES *mysql_res,
|
|||
Err_WrongExamExit ();
|
||||
|
||||
/* Get whether the session is hidden (row[2]) */
|
||||
Session->HiddenOrVisible = (row[2][0] == 'Y') ? Cns_HIDDEN :
|
||||
Cns_VISIBLE;
|
||||
Session->HiddenOrVisible = (row[2][0] == 'Y') ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE;
|
||||
|
||||
/* Get session teacher (row[3]) */
|
||||
Session->UsrCod = Str_ConvertStrCodToLongCod (row[3]);
|
||||
|
@ -1276,8 +1261,8 @@ bool ExaSes_CheckIfICanAnswerThisSession (const struct Exa_Exam *Exam,
|
|||
{
|
||||
/***** 1. Sessions in hidden exams are not accesible
|
||||
2. Hidden or closed sessions are not accesible *****/
|
||||
if (Exam->HiddenOrVisible == Cns_HIDDEN ||
|
||||
Session->HiddenOrVisible == Cns_HIDDEN ||
|
||||
if (Exam->HiddenOrVisible == HidVis_HIDDEN ||
|
||||
Session->HiddenOrVisible == HidVis_HIDDEN ||
|
||||
!Session->Open)
|
||||
return false;
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ struct Exa_Exam
|
|||
unsigned Visibility; // Visibility of results
|
||||
char Title[Exa_MAX_BYTES_TITLE + 1];
|
||||
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible; // Exam is hidden or visible?
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible; // Exam is hidden or visible?
|
||||
unsigned NumSets; // Number of sets in the exam
|
||||
unsigned NumQsts; // Number of questions in the exam
|
||||
unsigned NumSess; // Number of sessions in the exam
|
||||
|
@ -146,7 +146,7 @@ struct ExaSes_Session
|
|||
long UsrCod;
|
||||
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||
char Title[ExaSes_MAX_BYTES_TITLE + 1];
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible;
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
||||
bool Open; // If now is between start and end dates
|
||||
bool ShowUsrResults; // Show exam with results of all questions for the student
|
||||
};
|
||||
|
|
56
swad_game.c
56
swad_game.c
|
@ -43,6 +43,7 @@
|
|||
#include "swad_game.h"
|
||||
#include "swad_game_database.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_hierarchy_level.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_match.h"
|
||||
|
@ -198,7 +199,7 @@ void Gam_ResetGame (struct Gam_Game *Game)
|
|||
Game->NumQsts = 0;
|
||||
Game->NumMchs = 0;
|
||||
Game->NumUnfinishedMchs = 0;
|
||||
Game->HiddenOrVisible = Cns_VISIBLE;
|
||||
Game->HiddenOrVisible = HidVis_VISIBLE;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -499,31 +500,11 @@ static void Gam_ShowGameMainData (struct Gam_Games *Games,
|
|||
extern const char *Txt_Maximum_grade;
|
||||
extern const char *Txt_Result_visibility;
|
||||
extern const char *Txt_Matches;
|
||||
static const char *DateGreenClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DATE_GREEN_LIGHT",
|
||||
[Cns_VISIBLE] = "DATE_GREEN",
|
||||
};
|
||||
static const char *DateRedClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DATE_RED_LIGHT",
|
||||
[Cns_VISIBLE] = "DATE_RED",
|
||||
};
|
||||
static const char *TitleClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "ASG_TITLE_LIGHT",
|
||||
[Cns_VISIBLE] = "ASG_TITLE",
|
||||
};
|
||||
static const char *GroupClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "ASG_GRP_LIGHT",
|
||||
[Cns_VISIBLE] = "ASG_GRP",
|
||||
};
|
||||
static const char *DataClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DAT_LIGHT",
|
||||
[Cns_VISIBLE] = "DAT",
|
||||
};
|
||||
extern const char *HidVis_DateGreenClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_DateRedClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_TitleClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_GroupClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_DataClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
char *Anchor = NULL;
|
||||
static unsigned UniqueId = 0;
|
||||
char *Id;
|
||||
|
@ -558,8 +539,8 @@ static void Gam_ShowGameMainData (struct Gam_Games *Games,
|
|||
{
|
||||
if (asprintf (&Id,"gam_date_%u_%u",(unsigned) StartEndTime,UniqueId) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
DateClass = Games->Game.NumUnfinishedMchs ? DateGreenClass[Games->Game.HiddenOrVisible] :
|
||||
DateRedClass[Games->Game.HiddenOrVisible];
|
||||
DateClass = Games->Game.NumUnfinishedMchs ? HidVis_DateGreenClass[Games->Game.HiddenOrVisible] :
|
||||
HidVis_DateRedClass[Games->Game.HiddenOrVisible];
|
||||
if (ShowOnlyThisGame)
|
||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s\"",
|
||||
Id,DateClass,The_GetSuffix ());
|
||||
|
@ -585,7 +566,7 @@ static void Gam_ShowGameMainData (struct Gam_Games *Games,
|
|||
Frm_BeginForm (ActSeeOneGam);
|
||||
Gam_PutPars (Games);
|
||||
HTM_BUTTON_Submit_Begin (Txt_View_game,"class=\"LT BT_LINK %s_%s\"",
|
||||
TitleClass[Games->Game.HiddenOrVisible],
|
||||
HidVis_TitleClass[Games->Game.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Games->Game.Title);
|
||||
HTM_BUTTON_End ();
|
||||
|
@ -594,7 +575,7 @@ static void Gam_ShowGameMainData (struct Gam_Games *Games,
|
|||
|
||||
/* Number of questions, maximum grade, visibility of results */
|
||||
HTM_DIV_Begin ("class=\"%s_%s\"",
|
||||
GroupClass[Games->Game.HiddenOrVisible],The_GetSuffix ());
|
||||
HidVis_GroupClass[Games->Game.HiddenOrVisible],The_GetSuffix ());
|
||||
HTM_TxtColonNBSP (Txt_Number_of_questions);
|
||||
HTM_Unsigned (Games->Game.NumQsts);
|
||||
HTM_BR ();
|
||||
|
@ -615,7 +596,7 @@ static void Gam_ShowGameMainData (struct Gam_Games *Games,
|
|||
Frm_BeginForm (ActSeeOneGam);
|
||||
Gam_PutPars (Games);
|
||||
HTM_BUTTON_Submit_Begin (Txt_Matches,"class=\"LT BT_LINK %s_%s\"",
|
||||
TitleClass[Games->Game.HiddenOrVisible],
|
||||
HidVis_TitleClass[Games->Game.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
if (ShowOnlyThisGame)
|
||||
HTM_TxtColonNBSP (Txt_Matches);
|
||||
|
@ -651,7 +632,8 @@ static void Gam_ShowGameMainData (struct Gam_Games *Games,
|
|||
Txt,Cns_MAX_BYTES_TEXT,Str_DONT_REMOVE_SPACES);
|
||||
ALn_InsertLinks (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links
|
||||
HTM_DIV_Begin ("class=\"PAR %s_%s\"",
|
||||
DataClass[Games->Game.HiddenOrVisible],The_GetSuffix ());
|
||||
HidVis_DataClass[Games->Game.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Txt);
|
||||
HTM_DIV_End ();
|
||||
HTM_TD_End ();
|
||||
|
@ -723,10 +705,10 @@ static void Gam_PutParGameOrder (Gam_Order_t SelectedOrder)
|
|||
static void Gam_PutIconsToRemEditOneGame (struct Gam_Games *Games,
|
||||
const char *Anchor)
|
||||
{
|
||||
static Act_Action_t ActionHideUnhide[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static Act_Action_t ActionHideUnhide[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = ActUnhGam, // Hidden ==> action to unhide
|
||||
[Cns_VISIBLE] = ActHidGam, // Visible ==> action to hide
|
||||
[HidVis_HIDDEN ] = ActUnhGam, // Hidden ==> action to unhide
|
||||
[HidVis_VISIBLE] = ActHidGam, // Visible ==> action to hide
|
||||
};
|
||||
static const Act_Action_t ActionShowResults[Rol_NUM_ROLES] =
|
||||
{
|
||||
|
@ -968,8 +950,8 @@ void Gam_GetGameDataByCod (struct Gam_Game *Game)
|
|||
Game->CrsCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||
|
||||
/* Get whether the game is hidden (row[2]) */
|
||||
Game->HiddenOrVisible = (row[2][0] == 'Y') ? Cns_HIDDEN :
|
||||
Cns_VISIBLE;
|
||||
Game->HiddenOrVisible = (row[2][0] == 'Y') ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE;
|
||||
|
||||
/* Get author of the game (row[3]) */
|
||||
Game->UsrCod = Str_ConvertStrCodToLongCod (row[3]);
|
||||
|
|
|
@ -79,7 +79,7 @@ struct Gam_Game
|
|||
unsigned Visibility; // Visibility of results
|
||||
char Title[Gam_MAX_BYTES_TITLE + 1];
|
||||
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible; // Game is hidden or visible?
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible; // Game is hidden or visible?
|
||||
unsigned NumQsts; // Number of questions in the game
|
||||
unsigned NumMchs; // Number of matches in the game
|
||||
unsigned NumUnfinishedMchs; // Number of unfinished matches in the game
|
||||
|
|
33
swad_icon.c
33
swad_icon.c
|
@ -38,6 +38,7 @@
|
|||
#include "swad_figure.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_icon.h"
|
||||
#include "swad_layout.h"
|
||||
|
@ -70,6 +71,20 @@ const char *Ico_IconSetNames[Ico_NUM_ICON_SETS] =
|
|||
[Ico_ICON_SET_NUVOLA ] = "Nuvola",
|
||||
};
|
||||
|
||||
struct Ico_IconColor Ico_HiddenVisible[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[HidVis_HIDDEN ] =
|
||||
{
|
||||
.Icon = "eye-slash.svg",
|
||||
.Color = Ico_RED
|
||||
},
|
||||
[HidVis_VISIBLE] =
|
||||
{
|
||||
.Icon = "eye.svg",
|
||||
.Color = Ico_GREEN
|
||||
}
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************************** Private prototypes ****************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -296,25 +311,15 @@ void Ico_PutContextualIconToConfigure (Act_Action_t NextAction,
|
|||
"cog.svg",Ico_BLACK);
|
||||
}
|
||||
|
||||
void Ico_PutContextualIconToHideUnhide (const Act_Action_t NextAction[Cns_NUM_HIDDEN_VISIBLE],
|
||||
void Ico_PutContextualIconToHideUnhide (const Act_Action_t NextAction[HidVis_NUM_HIDDEN_VISIBLE],
|
||||
const char *Anchor,
|
||||
void (*FuncPars) (void *Args),void *Args,
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible)
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible)
|
||||
{
|
||||
static const char *Icon[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "eye-slash.svg", // hidden ==> icon to unhide
|
||||
[Cns_VISIBLE] = "eye.svg", // visible ==> icon to hide
|
||||
};
|
||||
static Ico_Color_t Color[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = Ico_RED, // hidden ==> red icon to unhide
|
||||
[Cns_VISIBLE] = Ico_GREEN, // visible ==> green icon to hide
|
||||
};
|
||||
|
||||
Lay_PutContextualLinkOnlyIcon (NextAction[HiddenOrVisible],Anchor,
|
||||
FuncPars,Args,
|
||||
Icon[HiddenOrVisible],Color[HiddenOrVisible]);
|
||||
Ico_HiddenVisible[HiddenOrVisible].Icon,
|
||||
Ico_HiddenVisible[HiddenOrVisible].Color);
|
||||
}
|
||||
|
||||
void Ico_PutContextualIconToExpand (const Act_Action_t NextAction,const char *Anchor,
|
||||
|
|
16
swad_icon.h
16
swad_icon.h
|
@ -23,6 +23,12 @@
|
|||
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_hidden_visible.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************************** Public constants ******************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -51,6 +57,12 @@ typedef enum
|
|||
Ico_YELLOW = 5,
|
||||
} Ico_Color_t;
|
||||
|
||||
struct Ico_IconColor
|
||||
{
|
||||
const char *Icon;
|
||||
Ico_Color_t Color;
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************************** Public prototypes *****************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -80,10 +92,10 @@ void Ico_PutContextualIconToView (Act_Action_t NextAction,const char *Anchor,
|
|||
void (*FuncPars) (void *Args),void *Args);
|
||||
void Ico_PutContextualIconToConfigure (Act_Action_t NextAction,
|
||||
void (*FuncPars) (void *Args),void *Args);
|
||||
void Ico_PutContextualIconToHideUnhide (const Act_Action_t NextAction[Cns_NUM_HIDDEN_VISIBLE],
|
||||
void Ico_PutContextualIconToHideUnhide (const Act_Action_t NextAction[HidVis_NUM_HIDDEN_VISIBLE],
|
||||
const char *Anchor,
|
||||
void (*FuncPars) (void *Args),void *Args,
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible);
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible);
|
||||
void Ico_PutContextualIconToExpand (const Act_Action_t NextAction,const char *Anchor,
|
||||
void (*FuncPars) (void *Args),void *Args);
|
||||
void Ico_PutContextualIconToContract (const Act_Action_t NextAction,const char *Anchor,
|
||||
|
|
|
@ -1284,7 +1284,7 @@ static void MchRes_CheckIfICanViewMatchResult (const struct Gam_Game *Game,
|
|||
{
|
||||
case Rol_STD:
|
||||
// Depends on visibility of game and result (eye icons)
|
||||
ICanView->Result = (Game->HiddenOrVisible == Cns_VISIBLE && // The game is visible
|
||||
ICanView->Result = (Game->HiddenOrVisible == HidVis_VISIBLE && // The game is visible
|
||||
Match->Status.ShowUsrResults && // The results of the match are visible to users
|
||||
Usr_ItsMe (UsrCod) == Usr_ME); // The result is mine
|
||||
// Whether I belong or not to groups of match is not checked here...
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "swad_figure.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_hierarchy_level.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_notice.h"
|
||||
|
@ -504,10 +505,10 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing,
|
|||
bool Highlight)
|
||||
{
|
||||
extern const char *Txt_See_full_notice;
|
||||
static Act_Action_t ActionHideUnhide[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static Act_Action_t ActionHideUnhide[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = ActUnhNot, // Hidden ==> action to unhide
|
||||
[Cns_VISIBLE] = ActHidNot, // Visible ==> action to hide
|
||||
[HidVis_HIDDEN ] = ActUnhNot, // Hidden ==> action to unhide
|
||||
[HidVis_VISIBLE] = ActHidNot, // Visible ==> action to hide
|
||||
};
|
||||
static const char *ContainerClass[Not_NUM_STATUS] =
|
||||
{
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "swad_figure.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_hierarchy_level.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_pagination.h"
|
||||
|
@ -74,7 +75,7 @@ struct Level
|
|||
{
|
||||
unsigned Number; // Numbers for each level from 1 to maximum level
|
||||
bool Expanded; // If each level from 1 to maximum level is expanded
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible; // If each level...
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible; // If each level...
|
||||
// ...from 1 to maximum level...
|
||||
// ...is hidden or visible
|
||||
};
|
||||
|
@ -127,7 +128,7 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
|||
long SelectedRscCod);
|
||||
static void Prg_PutIconToContractExpandItem (struct Prg_Item *Item,
|
||||
bool Expanded,bool Editing);
|
||||
static void Prg_WriteItemText (long ItmCod,Cns_HiddenOrVisible_t HiddenOrVisible);
|
||||
static void Prg_WriteItemText (long ItmCod,HidVis_HiddenOrVisible_t HiddenOrVisible);
|
||||
static void Prg_WriteRowToCreateItem (long ParentItmCod,unsigned FormLevel);
|
||||
static void Prg_SetTitleClass (char **TitleClass,unsigned Level);
|
||||
static void Prg_FreeTitleClass (char *TitleClass);
|
||||
|
@ -143,12 +144,12 @@ static void Prg_WriteNumItem (unsigned Level);
|
|||
static void Prg_WriteNumNewItem (unsigned Level);
|
||||
|
||||
static void Prg_SetExpandedLevel (unsigned Level,bool Expanded);
|
||||
static void Prg_SetHiddenLevel (unsigned Level,Cns_HiddenOrVisible_t HiddenOrVisible);
|
||||
static void Prg_SetHiddenLevel (unsigned Level,HidVis_HiddenOrVisible_t HiddenOrVisible);
|
||||
static bool Prg_GetExpandedLevel (unsigned Level);
|
||||
static Cns_HiddenOrVisible_t Prg_GetHiddenLevel (unsigned Level);
|
||||
static HidVis_HiddenOrVisible_t Prg_GetHiddenLevel (unsigned Level);
|
||||
|
||||
static bool Prg_CheckIfAllHigherLevelsAreExpanded (unsigned CurrentLevel);
|
||||
static Cns_HiddenOrVisible_t Prg_CheckIfAnyHigherLevelIsHidden (unsigned CurrentLevel);
|
||||
static HidVis_HiddenOrVisible_t Prg_CheckIfAnyHigherLevelIsHidden (unsigned CurrentLevel);
|
||||
|
||||
static void Prg_PutFormsToRemEditOneItem (Prg_ListingType_t ListingType,
|
||||
unsigned NumItem,
|
||||
|
@ -466,6 +467,7 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
|||
long SelectedItmCod,
|
||||
long SelectedRscCod)
|
||||
{
|
||||
extern const char *HidVis_PrgClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
static unsigned UniqueId = 0;
|
||||
static bool EditingProgram[Prg_NUM_LISTING_TYPES] =
|
||||
{
|
||||
|
@ -487,12 +489,7 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
|||
[false] = "", // Not expanded
|
||||
[true ] = " rowspan=\"2\"", // Expanded
|
||||
};
|
||||
static const char *PrgClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = " PRG_HIDDEN",
|
||||
[Cns_VISIBLE] = "",
|
||||
};
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible = Cns_HIDDEN; // Initialized to avoid warning
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible = HidVis_HIDDEN; // Initialized to avoid warning
|
||||
char *Id;
|
||||
unsigned ColSpan;
|
||||
unsigned NumCol;
|
||||
|
@ -504,15 +501,15 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
|||
Prg_SetHiddenLevel (Item->Hierarchy.Level,Item->Hierarchy.HiddenOrVisible);
|
||||
switch (Item->Hierarchy.HiddenOrVisible)
|
||||
{
|
||||
case Cns_HIDDEN: // this item is marked as hidden
|
||||
HiddenOrVisible = Cns_HIDDEN;
|
||||
case HidVis_HIDDEN: // this item is marked as hidden
|
||||
HiddenOrVisible = HidVis_HIDDEN;
|
||||
break;
|
||||
case Cns_VISIBLE: // this item is not marked as hidden
|
||||
case HidVis_VISIBLE: // this item is not marked as hidden
|
||||
HiddenOrVisible = Prg_CheckIfAnyHigherLevelIsHidden (Item->Hierarchy.Level);
|
||||
break;
|
||||
}
|
||||
|
||||
if (EditingProgram[ListingType] || HiddenOrVisible == Cns_VISIBLE)
|
||||
if (EditingProgram[ListingType] || HiddenOrVisible == HidVis_VISIBLE)
|
||||
{
|
||||
/***** Increase number in level *****/
|
||||
Prg_IncreaseNumberInLevel (Item->Hierarchy.Level);
|
||||
|
@ -557,7 +554,8 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
|||
HTM_TD_Begin ("class=\"PRG_NUM %s\"%s",
|
||||
The_GetColorRows (),RowSpan[Expanded]);
|
||||
HTM_DIV_Begin ("class=\"RT %s%s\"",
|
||||
TitleClass,PrgClass[HiddenOrVisible]);
|
||||
TitleClass,
|
||||
HidVis_PrgClass[HiddenOrVisible]);
|
||||
Prg_WriteNumItem (Item->Hierarchy.Level);
|
||||
HTM_DIV_End ();
|
||||
HTM_TD_End ();
|
||||
|
@ -579,7 +577,8 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
|||
if (HighlightItem)
|
||||
HTM_ARTICLE_Begin (Prg_ITEM_SECTION_ID);
|
||||
HTM_DIV_Begin ("class=\"LT %s%s\"",
|
||||
TitleClass,PrgClass[HiddenOrVisible]);
|
||||
TitleClass,
|
||||
HidVis_PrgClass[HiddenOrVisible]);
|
||||
HTM_Txt (Item->Title);
|
||||
HTM_DIV_End ();
|
||||
if (HighlightItem)
|
||||
|
@ -607,7 +606,8 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
|||
Id,
|
||||
Item->Open ? "DATE_GREEN" :
|
||||
"DATE_RED",
|
||||
The_GetSuffix (),PrgClass[HiddenOrVisible]);
|
||||
The_GetSuffix (),
|
||||
HidVis_PrgClass[HiddenOrVisible]);
|
||||
Dat_WriteLocalDateHMSFromUTC (Id,Item->TimeUTC[StartEndTime],
|
||||
Gbl.Prefs.DateFormat,Dat_SEPARATOR_COMMA,
|
||||
true,true,false,0x6);
|
||||
|
@ -688,13 +688,9 @@ static void Prg_PutIconToContractExpandItem (struct Prg_Item *Item,
|
|||
/**************************** Show item text *********************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Prg_WriteItemText (long ItmCod,Cns_HiddenOrVisible_t HiddenOrVisible)
|
||||
static void Prg_WriteItemText (long ItmCod,HidVis_HiddenOrVisible_t HiddenOrVisible)
|
||||
{
|
||||
static const char *PrgClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = " PRG_HIDDEN",
|
||||
[Cns_VISIBLE] = "",
|
||||
};
|
||||
extern const char *HidVis_PrgClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
||||
|
||||
/* Text */
|
||||
|
@ -703,7 +699,8 @@ static void Prg_WriteItemText (long ItmCod,Cns_HiddenOrVisible_t HiddenOrVisible
|
|||
Txt,Cns_MAX_BYTES_TEXT,Str_DONT_REMOVE_SPACES);
|
||||
ALn_InsertLinks (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links
|
||||
HTM_DIV_Begin ("class=\"PAR PRG_TXT_%s%s\"",
|
||||
The_GetSuffix (),PrgClass[HiddenOrVisible]);
|
||||
The_GetSuffix (),
|
||||
HidVis_PrgClass[HiddenOrVisible]);
|
||||
HTM_Txt (Txt);
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
@ -909,7 +906,7 @@ static void Prg_SetExpandedLevel (unsigned Level,bool Expanded)
|
|||
Prg_Gbl.Levels[Level].Expanded = Expanded;
|
||||
}
|
||||
|
||||
static void Prg_SetHiddenLevel (unsigned Level,Cns_HiddenOrVisible_t HiddenOrVisible)
|
||||
static void Prg_SetHiddenLevel (unsigned Level,HidVis_HiddenOrVisible_t HiddenOrVisible)
|
||||
{
|
||||
if (Prg_Gbl.Levels)
|
||||
Prg_Gbl.Levels[Level].HiddenOrVisible = HiddenOrVisible;
|
||||
|
@ -927,16 +924,16 @@ static bool Prg_GetExpandedLevel (unsigned Level)
|
|||
return false;
|
||||
}
|
||||
|
||||
static Cns_HiddenOrVisible_t Prg_GetHiddenLevel (unsigned Level)
|
||||
static HidVis_HiddenOrVisible_t Prg_GetHiddenLevel (unsigned Level)
|
||||
{
|
||||
/* Level 0 (root) is always visible */
|
||||
if (Level == 0)
|
||||
return Cns_VISIBLE;
|
||||
return HidVis_VISIBLE;
|
||||
|
||||
if (Prg_Gbl.Levels)
|
||||
return Prg_Gbl.Levels[Level].HiddenOrVisible;
|
||||
|
||||
return Cns_VISIBLE;
|
||||
return HidVis_VISIBLE;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -956,17 +953,17 @@ static bool Prg_CheckIfAllHigherLevelsAreExpanded (unsigned CurrentLevel)
|
|||
return true; // None is contracted. All are expanded
|
||||
}
|
||||
|
||||
static Cns_HiddenOrVisible_t Prg_CheckIfAnyHigherLevelIsHidden (unsigned CurrentLevel)
|
||||
static HidVis_HiddenOrVisible_t Prg_CheckIfAnyHigherLevelIsHidden (unsigned CurrentLevel)
|
||||
{
|
||||
unsigned Level;
|
||||
|
||||
for (Level = 1;
|
||||
Level < CurrentLevel;
|
||||
Level++)
|
||||
if (Prg_GetHiddenLevel (Level) == Cns_HIDDEN)
|
||||
return Cns_HIDDEN;
|
||||
if (Prg_GetHiddenLevel (Level) == HidVis_HIDDEN)
|
||||
return HidVis_HIDDEN;
|
||||
|
||||
return Cns_VISIBLE; // None is hidden. All are visible.
|
||||
return HidVis_VISIBLE; // None is hidden. All are visible.
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -979,10 +976,10 @@ static void Prg_PutFormsToRemEditOneItem (Prg_ListingType_t ListingType,
|
|||
bool HighlightItem)
|
||||
{
|
||||
extern const char *Txt_Movement_not_allowed;
|
||||
static Act_Action_t ActionHideUnhide[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static Act_Action_t ActionHideUnhide[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = ActUnhPrgItm, // Hidden ==> action to unhide
|
||||
[Cns_VISIBLE] = ActHidPrgItm, // Visible ==> action to hide
|
||||
[HidVis_HIDDEN ] = ActUnhPrgItm, // Hidden ==> action to unhide
|
||||
[HidVis_VISIBLE] = ActHidPrgItm, // Visible ==> action to hide
|
||||
};
|
||||
char StrItemIndex[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
|
||||
|
||||
|
@ -1191,8 +1188,8 @@ void Prg_GetListItems (void)
|
|||
Prg_Gbl.List.Items[NumItem].Level = Str_ConvertStrToUnsigned (row[2]);
|
||||
|
||||
/* Get whether the program item is hidden or not (row[3]) */
|
||||
Prg_Gbl.List.Items[NumItem].HiddenOrVisible = (row[3][0] == 'Y') ? Cns_HIDDEN :
|
||||
Cns_VISIBLE;
|
||||
Prg_Gbl.List.Items[NumItem].HiddenOrVisible = (row[3][0] == 'Y') ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1260,8 +1257,8 @@ static void Prg_GetItemDataFromRow (MYSQL_RES **mysql_res,
|
|||
Item->Hierarchy.Level = Str_ConvertStrToUnsigned (row[2]);
|
||||
|
||||
/* Get whether the program item is hidden or not (row[3]) */
|
||||
Item->Hierarchy.HiddenOrVisible = (row[3][0] == 'Y') ? Cns_HIDDEN :
|
||||
Cns_VISIBLE;
|
||||
Item->Hierarchy.HiddenOrVisible = (row[3][0] == 'Y') ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE;
|
||||
|
||||
/* Get author of the program item (row[4]) */
|
||||
Item->UsrCod = Str_ConvertStrCodToLongCod (row[4]);
|
||||
|
@ -1310,7 +1307,7 @@ void Prg_ResetItem (struct Prg_Item *Item)
|
|||
Item->Hierarchy.ItmCod = -1L;
|
||||
Item->Hierarchy.ItmInd = 0;
|
||||
Item->Hierarchy.Level = 0;
|
||||
Item->Hierarchy.HiddenOrVisible = Cns_VISIBLE;
|
||||
Item->Hierarchy.HiddenOrVisible = HidVis_VISIBLE;
|
||||
Item->UsrCod = -1L;
|
||||
Item->TimeUTC[Dat_STR_TIME] =
|
||||
Item->TimeUTC[Dat_END_TIME] = (time_t) 0;
|
||||
|
@ -1323,7 +1320,7 @@ void Prg_ResetResource (struct Prg_Item *Item)
|
|||
{
|
||||
Item->Resource.Hierarchy.RscCod = -1L;
|
||||
Item->Resource.Hierarchy.RscInd = 0;
|
||||
Item->Resource.Hierarchy.HiddenOrVisible = Cns_VISIBLE;
|
||||
Item->Resource.Hierarchy.HiddenOrVisible = HidVis_VISIBLE;
|
||||
Item->Resource.Link.Type = Rsc_NONE;
|
||||
Item->Resource.Link.Cod = -1L;
|
||||
Item->Resource.Title[0] = '\0';
|
||||
|
|
|
@ -42,7 +42,7 @@ struct Prg_ResourceHierarchy
|
|||
{
|
||||
long RscCod;
|
||||
unsigned RscInd; // 1, 2, 3...
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible;
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
||||
};
|
||||
|
||||
#define Prg_MAX_CHARS_PROGRAM_ITEM_TITLE (128 - 1) // 127
|
||||
|
@ -53,7 +53,7 @@ struct Prg_ItemHierarchy
|
|||
long ItmCod;
|
||||
unsigned ItmInd; // 1, 2, 3...
|
||||
unsigned Level;
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible;
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
||||
};
|
||||
|
||||
struct Prg_Item
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "swad_error.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_parameter.h"
|
||||
#include "swad_parameter_code.h"
|
||||
#include "swad_program.h"
|
||||
|
@ -351,8 +352,8 @@ static void PrgRsc_GetResourceDataFromRow (MYSQL_RES *mysql_res,
|
|||
Item->Resource.Hierarchy.RscInd = Str_ConvertStrToUnsigned (row[2]);
|
||||
|
||||
/***** Get whether the program item is hidden (row(3)) *****/
|
||||
Item->Resource.Hierarchy.HiddenOrVisible = (row[3][0] == 'Y') ? Cns_HIDDEN :
|
||||
Cns_VISIBLE;
|
||||
Item->Resource.Hierarchy.HiddenOrVisible = (row[3][0] == 'Y') ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE;
|
||||
|
||||
/***** Get link type and code (row[4], row[5]) *****/
|
||||
Item->Resource.Link.Type = Rsc_GetTypeFromString (row[4]);
|
||||
|
@ -508,10 +509,10 @@ static void PrgRsc_PutFormsToRemEditOneResource (struct Prg_Item *Item,
|
|||
unsigned NumRsc,
|
||||
unsigned NumResources)
|
||||
{
|
||||
static Act_Action_t ActionHideUnhide[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static Act_Action_t ActionHideUnhide[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = ActUnhPrgRsc, // Hidden ==> action to unhide
|
||||
[Cns_VISIBLE] = ActHidPrgRsc, // Visible ==> action to hide
|
||||
[HidVis_HIDDEN ] = ActUnhPrgRsc, // Hidden ==> action to unhide
|
||||
[HidVis_VISIBLE] = ActHidPrgRsc, // Visible ==> action to hide
|
||||
};
|
||||
extern const char *Txt_Movement_not_allowed;
|
||||
extern const char *Txt_Visible;
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "swad_figure.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_hierarchy_level.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_ID.h"
|
||||
|
@ -3155,10 +3156,10 @@ static Prj_Order_t Prj_GetParPrjOrder (void)
|
|||
static void Prj_PutIconsToRemEditOnePrj (struct Prj_Projects *Projects,
|
||||
const char *Anchor)
|
||||
{
|
||||
static Act_Action_t ActionHideUnhide[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static Act_Action_t ActionHideUnhide[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = ActUnhPrj, // Hidden ==> action to unhide
|
||||
[Cns_VISIBLE] = ActHidPrj, // Visible ==> action to hide
|
||||
[HidVis_HIDDEN ] = ActUnhPrj, // Hidden ==> action to unhide
|
||||
[HidVis_VISIBLE] = ActHidPrj, // Visible ==> action to hide
|
||||
};
|
||||
|
||||
if (Prj_CheckIfICanEditProject (&Projects->Prj))
|
||||
|
|
135
swad_survey.c
135
swad_survey.c
|
@ -43,6 +43,7 @@
|
|||
#include "swad_global.h"
|
||||
#include "swad_group.h"
|
||||
#include "swad_group_database.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_notification.h"
|
||||
#include "swad_notification_database.h"
|
||||
|
@ -402,31 +403,11 @@ static void Svy_ShowOneSurvey (struct Svy_Surveys *Surveys,
|
|||
extern const char *Txt_Users;
|
||||
extern const char *Txt_Answer_survey;
|
||||
extern const char *Txt_View_results;
|
||||
static const char *DateGreenClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DATE_GREEN_LIGHT",
|
||||
[Cns_VISIBLE] = "DATE_GREEN",
|
||||
};
|
||||
static const char *DateRedClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DATE_RED_LIGHT",
|
||||
[Cns_VISIBLE] = "DATE_RED",
|
||||
};
|
||||
static const char *TitleClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "ASG_TITLE_LIGHT",
|
||||
[Cns_VISIBLE] = "ASG_TITLE",
|
||||
};
|
||||
static const char *GroupClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "ASG_GRP_LIGHT",
|
||||
[Cns_VISIBLE] = "ASG_GRP",
|
||||
};
|
||||
static const char *DataClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DAT_LIGHT",
|
||||
[Cns_VISIBLE] = "DAT",
|
||||
};
|
||||
extern const char *HidVis_DateGreenClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_DateRedClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_TitleClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_GroupClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_DataClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
char *Anchor = NULL;
|
||||
static unsigned UniqueId = 0;
|
||||
char *Id;
|
||||
|
@ -471,14 +452,14 @@ static void Svy_ShowOneSurvey (struct Svy_Surveys *Surveys,
|
|||
if (ShowOnlyThisSvyComplete)
|
||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s\"",
|
||||
Id,
|
||||
Surveys->Svy.Status.Open ? DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
||||
DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
Surveys->Svy.Status.Open ? HidVis_DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
||||
HidVis_DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
else
|
||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s %s\"",
|
||||
Id,
|
||||
Surveys->Svy.Status.Open ? DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
||||
DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
Surveys->Svy.Status.Open ? HidVis_DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
||||
HidVis_DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
The_GetSuffix (),
|
||||
The_GetColorRows ());
|
||||
Dat_WriteLocalDateHMSFromUTC (Id,Surveys->Svy.TimeUTC[Dat_STR_TIME],
|
||||
|
@ -493,14 +474,14 @@ static void Svy_ShowOneSurvey (struct Svy_Surveys *Surveys,
|
|||
if (ShowOnlyThisSvyComplete)
|
||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s\"",
|
||||
Id,
|
||||
Surveys->Svy.Status.Open ? DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
||||
DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
Surveys->Svy.Status.Open ? HidVis_DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
||||
HidVis_DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
else
|
||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s %s\"",
|
||||
Id,
|
||||
Surveys->Svy.Status.Open ? DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
||||
DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
Surveys->Svy.Status.Open ? HidVis_DateGreenClass[Surveys->Svy.Status.HiddenOrVisible] :
|
||||
HidVis_DateRedClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
The_GetSuffix (),
|
||||
The_GetColorRows ());
|
||||
Dat_WriteLocalDateHMSFromUTC (Id,Surveys->Svy.TimeUTC[Dat_END_TIME],
|
||||
|
@ -523,7 +504,7 @@ static void Svy_ShowOneSurvey (struct Svy_Surveys *Surveys,
|
|||
Grp_PutParWhichGroups (&WhichGroups);
|
||||
Pag_PutParPagNum (Pag_SURVEYS,Surveys->CurrentPage);
|
||||
HTM_BUTTON_Submit_Begin (Txt_View_survey,"class=\"LT BT_LINK %s_%s\"",
|
||||
TitleClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
HidVis_TitleClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Surveys->Svy.Title);
|
||||
HTM_BUTTON_End ();
|
||||
|
@ -532,7 +513,7 @@ static void Svy_ShowOneSurvey (struct Svy_Surveys *Surveys,
|
|||
|
||||
/* Number of questions and number of distinct users who have already answered this survey */
|
||||
HTM_DIV_Begin ("class=\"%s_%s\"",
|
||||
GroupClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
HidVis_GroupClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_TxtColonNBSP (Txt_Number_of_questions);
|
||||
HTM_Unsigned (Surveys->Svy.NumQsts);
|
||||
|
@ -610,7 +591,7 @@ static void Svy_ShowOneSurvey (struct Svy_Surveys *Surveys,
|
|||
|
||||
/* Scope of the survey */
|
||||
HTM_DIV_Begin ("class=\"%s_%s\"",
|
||||
GroupClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
HidVis_GroupClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_TxtColonNBSP (Txt_Scope);
|
||||
switch (Surveys->Svy.Scope)
|
||||
|
@ -641,7 +622,7 @@ static void Svy_ShowOneSurvey (struct Svy_Surveys *Surveys,
|
|||
|
||||
/* Users' roles who can answer the survey */
|
||||
HTM_DIV_Begin ("class=\"%s_%s\"",
|
||||
GroupClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
HidVis_GroupClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_TxtColon (Txt_Users);
|
||||
HTM_BR ();
|
||||
|
@ -663,7 +644,7 @@ static void Svy_ShowOneSurvey (struct Svy_Surveys *Surveys,
|
|||
Txt,Cns_MAX_BYTES_TEXT,Str_DONT_REMOVE_SPACES);
|
||||
ALn_InsertLinks (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links
|
||||
HTM_DIV_Begin ("class=\"PAR %s_%s\"",
|
||||
DataClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
HidVis_DataClass[Surveys->Svy.Status.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Txt);
|
||||
HTM_DIV_End ();
|
||||
|
@ -746,25 +727,24 @@ static void Svy_WriteStatus (struct Svy_Survey *Svy)
|
|||
extern const char *Txt_SURVEY_You_dont_belong_to_the_scope_of_the_survey;
|
||||
extern const char *Txt_SURVEY_You_have_already_answered;
|
||||
extern const char *Txt_SURVEY_You_have_not_answered;
|
||||
static const char *Class[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
extern const char *HidVis_DateGreenClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
extern const char *HidVis_DateRedClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
static struct
|
||||
{
|
||||
[Cns_HIDDEN ] = "STATUS_RED_LIGHT",
|
||||
[Cns_VISIBLE] = "STATUS_GREEN",
|
||||
};
|
||||
static const char **TxtHiddenOrVisible[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
const char **Class;
|
||||
const char **Txt;
|
||||
} HiddenOrVisible[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = &Txt_Hidden_survey,
|
||||
[Cns_VISIBLE] = &Txt_Visible_survey,
|
||||
};
|
||||
static const char *StatusGreenClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DATE_GREEN_LIGHT",
|
||||
[Cns_VISIBLE] = "DATE_GREEN",
|
||||
};
|
||||
static const char *StatusRedClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "DATE_RED_LIGHT",
|
||||
[Cns_VISIBLE] = "DATE_RED",
|
||||
[HidVis_HIDDEN ] =
|
||||
{
|
||||
.Class = &HidVis_DateRedClass [HidVis_HIDDEN ],
|
||||
.Txt = &Txt_Hidden_survey
|
||||
},
|
||||
[HidVis_VISIBLE] =
|
||||
{
|
||||
.Class = &HidVis_DateGreenClass[HidVis_VISIBLE],
|
||||
.Txt = &Txt_Visible_survey
|
||||
}
|
||||
};
|
||||
|
||||
/***** Begin list with items of status *****/
|
||||
|
@ -772,22 +752,23 @@ static void Svy_WriteStatus (struct Svy_Survey *Svy)
|
|||
|
||||
/* Write whether survey is visible or hidden */
|
||||
HTM_LI_Begin ("class=\"%s_%s\"",
|
||||
Class[Svy->Status.HiddenOrVisible],The_GetSuffix ());
|
||||
HTM_Txt (*TxtHiddenOrVisible[Svy->Status.HiddenOrVisible]);
|
||||
*HiddenOrVisible[Svy->Status.HiddenOrVisible].Class,
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (*HiddenOrVisible[Svy->Status.HiddenOrVisible].Txt);
|
||||
HTM_LI_End ();
|
||||
|
||||
/* Write whether survey is open or closed */
|
||||
if (Svy->Status.Open)
|
||||
{
|
||||
HTM_LI_Begin ("class=\"%s_%s\"",
|
||||
StatusGreenClass[Svy->Status.HiddenOrVisible],
|
||||
HidVis_DateGreenClass[Svy->Status.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Txt_Open_survey);
|
||||
}
|
||||
else
|
||||
{
|
||||
HTM_LI_Begin ("class=\"%s_%s\"",
|
||||
StatusRedClass[Svy->Status.HiddenOrVisible],
|
||||
HidVis_DateRedClass[Svy->Status.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Txt_Closed_survey);
|
||||
}
|
||||
|
@ -797,14 +778,14 @@ static void Svy_WriteStatus (struct Svy_Survey *Svy)
|
|||
if (Svy->Status.IAmLoggedWithAValidRoleToAnswer)
|
||||
{
|
||||
HTM_LI_Begin ("class=\"%s_%s\"",
|
||||
StatusGreenClass[Svy->Status.HiddenOrVisible],
|
||||
HidVis_DateGreenClass[Svy->Status.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Txt_SURVEY_Type_of_user_allowed);
|
||||
}
|
||||
else
|
||||
{
|
||||
HTM_LI_Begin ("class=\"%s_%s\"",
|
||||
StatusRedClass[Svy->Status.HiddenOrVisible],
|
||||
HidVis_DateRedClass[Svy->Status.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Txt_SURVEY_Type_of_user_not_allowed);
|
||||
}
|
||||
|
@ -814,14 +795,14 @@ static void Svy_WriteStatus (struct Svy_Survey *Svy)
|
|||
if (Svy->Status.IBelongToScope)
|
||||
{
|
||||
HTM_LI_Begin ("class=\"%s_%s\"",
|
||||
StatusGreenClass[Svy->Status.HiddenOrVisible],
|
||||
HidVis_DateGreenClass[Svy->Status.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Txt_SURVEY_You_belong_to_the_scope_of_the_survey);
|
||||
}
|
||||
else
|
||||
{
|
||||
HTM_LI_Begin ("class=\"%s_%s\"",
|
||||
StatusRedClass[Svy->Status.HiddenOrVisible],
|
||||
HidVis_DateRedClass[Svy->Status.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Txt_SURVEY_You_dont_belong_to_the_scope_of_the_survey);
|
||||
}
|
||||
|
@ -831,14 +812,14 @@ static void Svy_WriteStatus (struct Svy_Survey *Svy)
|
|||
if (Svy->Status.IHaveAnswered)
|
||||
{
|
||||
HTM_LI_Begin ("class=\"%s_%s\"",
|
||||
StatusGreenClass[Svy->Status.HiddenOrVisible],
|
||||
HidVis_DateGreenClass[Svy->Status.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Txt_SURVEY_You_have_already_answered);
|
||||
}
|
||||
else
|
||||
{
|
||||
HTM_LI_Begin ("class=\"%s_%s\"",
|
||||
StatusRedClass[Svy->Status.HiddenOrVisible],
|
||||
HidVis_DateRedClass[Svy->Status.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Txt_SURVEY_You_have_not_answered);
|
||||
}
|
||||
|
@ -877,10 +858,10 @@ void Svy_PutParSvyOrder (Dat_StartEndTime_t SelectedOrder)
|
|||
static void Svy_PutFormsToRemEditOneSvy (struct Svy_Surveys *Surveys,
|
||||
const char *Anchor)
|
||||
{
|
||||
static Act_Action_t ActionHideUnhide[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static Act_Action_t ActionHideUnhide[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = ActUnhSvy, // Hidden ==> action to unhide
|
||||
[Cns_VISIBLE] = ActHidSvy, // Visible ==> action to hide
|
||||
[HidVis_HIDDEN ] = ActUnhSvy, // Hidden ==> action to unhide
|
||||
[HidVis_VISIBLE] = ActHidSvy, // Visible ==> action to hide
|
||||
};
|
||||
|
||||
if (Surveys->Svy.Status.ICanEdit)
|
||||
|
@ -1164,8 +1145,8 @@ void Svy_GetSurveyDataByCod (struct Svy_Survey *Svy)
|
|||
Svy->Cod = Str_ConvertStrCodToLongCod (row[2]);
|
||||
|
||||
/* Get whether the survey is hidden (row[3]) */
|
||||
Svy->Status.HiddenOrVisible = (row[3][0] == 'Y') ? Cns_HIDDEN :
|
||||
Cns_VISIBLE;
|
||||
Svy->Status.HiddenOrVisible = (row[3][0] == 'Y') ? HidVis_HIDDEN :
|
||||
HidVis_VISIBLE;
|
||||
|
||||
/* Get roles (row[4]) */
|
||||
if (sscanf (row[4],"%u",&Svy->Roles) != 1)
|
||||
|
@ -1224,7 +1205,7 @@ void Svy_GetSurveyDataByCod (struct Svy_Survey *Svy)
|
|||
|
||||
/* Can I answer survey? */
|
||||
Svy->Status.ICanAnswer = ( Svy->NumQsts != 0) &&
|
||||
Svy->Status.HiddenOrVisible == Cns_VISIBLE &&
|
||||
Svy->Status.HiddenOrVisible == HidVis_VISIBLE &&
|
||||
Svy->Status.Open &&
|
||||
Svy->Status.IAmLoggedWithAValidRoleToAnswer &&
|
||||
Svy->Status.IBelongToScope &&
|
||||
|
@ -1242,7 +1223,7 @@ void Svy_GetSurveyDataByCod (struct Svy_Survey *Svy)
|
|||
Svy->Scope == HieLvl_CTY ||
|
||||
Svy->Scope == HieLvl_SYS) &&
|
||||
(Svy->NumQsts != 0) &&
|
||||
Svy->Status.HiddenOrVisible == Cns_VISIBLE &&
|
||||
Svy->Status.HiddenOrVisible == HidVis_VISIBLE &&
|
||||
Svy->Status.Open &&
|
||||
Svy->Status.IAmLoggedWithAValidRoleToAnswer &&
|
||||
Svy->Status.IBelongToScope &&
|
||||
|
@ -1331,7 +1312,7 @@ void Svy_GetSurveyDataByCod (struct Svy_Survey *Svy)
|
|||
Svy->Title[0] = '\0';
|
||||
Svy->NumQsts = 0;
|
||||
Svy->NumUsrs = 0;
|
||||
Svy->Status.HiddenOrVisible = Cns_VISIBLE;
|
||||
Svy->Status.HiddenOrVisible = HidVis_VISIBLE;
|
||||
Svy->Status.Open = false;
|
||||
Svy->Status.IAmLoggedWithAValidRoleToAnswer = false;
|
||||
Svy->Status.IBelongToScope = false;
|
||||
|
@ -1677,7 +1658,7 @@ void Svy_ReqCreatOrEditSvy (void)
|
|||
Surveys.Svy.Title[0] = '\0';
|
||||
Surveys.Svy.NumQsts = 0;
|
||||
Surveys.Svy.NumUsrs = 0;
|
||||
Surveys.Svy.Status.HiddenOrVisible = Cns_VISIBLE;
|
||||
Surveys.Svy.Status.HiddenOrVisible = HidVis_VISIBLE;
|
||||
Surveys.Svy.Status.Open = true;
|
||||
Surveys.Svy.Status.IAmLoggedWithAValidRoleToAnswer = false;
|
||||
Surveys.Svy.Status.IBelongToScope = false;
|
||||
|
@ -2162,10 +2143,10 @@ static void Svy_GetAndWriteNamesOfGrpsAssociatedToSvy (struct Svy_Survey *Svy)
|
|||
extern const char *Txt_Groups;
|
||||
extern const char *Txt_and;
|
||||
extern const char *Txt_The_whole_course;
|
||||
static const char *GroupClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
static const char *GroupClass[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "ASG_GRP_LIGHT",
|
||||
[Cns_VISIBLE] = "ASG_GRP",
|
||||
[HidVis_HIDDEN ] = "ASG_GRP_LIGHT",
|
||||
[HidVis_VISIBLE] = "ASG_GRP",
|
||||
};
|
||||
MYSQL_RES *mysql_res;
|
||||
MYSQL_ROW row;
|
||||
|
|
|
@ -53,7 +53,7 @@ struct Svy_Survey
|
|||
unsigned NumUsrs; // Number of distinct users who have already answered the survey
|
||||
struct
|
||||
{
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible; // Survey is hidden or visible?
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible; // Survey is hidden or visible?
|
||||
bool Open; // Start date <= now <= end date
|
||||
bool IAmLoggedWithAValidRoleToAnswer; // I am logged with a valid role to answer this survey
|
||||
bool IBelongToScope; // I belong to the scope of this survey
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include "swad_error.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_parameter.h"
|
||||
#include "swad_test_visibility.h"
|
||||
|
@ -40,7 +41,7 @@
|
|||
/*****************************************************************************/
|
||||
|
||||
void TstVis_ShowVisibilityIcons (unsigned SelectedVisibility,
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible)
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible)
|
||||
{
|
||||
extern const char *Txt_TST_STR_VISIBILITY[TstVis_NUM_ITEMS_VISIBILITY];
|
||||
extern const char *Txt_TST_HIDDEN_VISIBLE[2];
|
||||
|
@ -52,7 +53,7 @@ void TstVis_ShowVisibilityIcons (unsigned SelectedVisibility,
|
|||
[TstVis_VISIBLE_EACH_QST_SCORE] = "tasks.svg",
|
||||
[TstVis_VISIBLE_TOTAL_SCORE ] = "check-circle-regular.svg",
|
||||
};
|
||||
static void (*Ico_PutIcon[Cns_NUM_HIDDEN_VISIBLE]) (const char *Icon,Ico_Color_t Color,const char *Title);
|
||||
static void (*Ico_PutIcon[HidVis_NUM_HIDDEN_VISIBLE]) (const char *Icon,Ico_Color_t Color,const char *Title);
|
||||
TstVis_Visibility_t Visibility;
|
||||
bool ItemVisible;
|
||||
char *Title;
|
||||
|
|
|
@ -51,7 +51,7 @@ typedef enum
|
|||
/*****************************************************************************/
|
||||
|
||||
void TstVis_ShowVisibilityIcons (unsigned SelectedVisibility,
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible);
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible);
|
||||
void TstVis_PutVisibilityCheckboxes (unsigned SelectedVisibility);
|
||||
unsigned TstVis_GetVisibilityFromForm (void);
|
||||
unsigned TstVis_GetVisibilityFromStr (const char *Str);
|
||||
|
|
|
@ -72,6 +72,7 @@
|
|||
#include "swad_exam_log.h"
|
||||
#include "swad_figure.h"
|
||||
#include "swad_forum.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_hierarchy.h"
|
||||
#include "swad_holiday.h"
|
||||
#include "swad_info.h"
|
||||
|
@ -1369,9 +1370,9 @@ const char *Txt_AGENDA_PRIVAT_PUBLIC_EVENTS[2] =
|
|||
#endif
|
||||
};
|
||||
|
||||
const char *Txt_AGENDA_HIDDEN_VISIBLE_EVENTS[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
const char *Txt_AGENDA_HIDDEN_VISIBLE_EVENTS[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
// Cns_HIDDEN
|
||||
// HidVis_HIDDEN
|
||||
#if L==1 // ca
|
||||
"Esdeveniments ocults"
|
||||
#elif L==2 // de
|
||||
|
@ -1394,7 +1395,7 @@ const char *Txt_AGENDA_HIDDEN_VISIBLE_EVENTS[Cns_NUM_HIDDEN_VISIBLE] =
|
|||
"Gizli etkinlikler"
|
||||
#endif
|
||||
,
|
||||
// Cns_VISIBLE
|
||||
// HidVis_VISIBLE
|
||||
#if L==1 // ca
|
||||
"Esdeveniments visibles"
|
||||
#elif L==2 // de
|
||||
|
|
11
swad_user.c
11
swad_user.c
|
@ -64,6 +64,7 @@
|
|||
#include "swad_global.h"
|
||||
#include "swad_group.h"
|
||||
#include "swad_help.h"
|
||||
#include "swad_hidden_visible.h"
|
||||
#include "swad_hierarchy.h"
|
||||
#include "swad_hierarchy_level.h"
|
||||
#include "swad_HTML.h"
|
||||
|
@ -6396,7 +6397,7 @@ void Usr_WriteAuthor (struct Usr_Data *UsrDat,
|
|||
/********************* Write the author of an assignment *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Usr_WriteAuthor1Line (long UsrCod,Cns_HiddenOrVisible_t HiddenOrVisible)
|
||||
void Usr_WriteAuthor1Line (long UsrCod,HidVis_HiddenOrVisible_t HiddenOrVisible)
|
||||
{
|
||||
static const char *ClassPhoto[PhoSha_NUM_SHAPES] =
|
||||
{
|
||||
|
@ -6405,11 +6406,7 @@ void Usr_WriteAuthor1Line (long UsrCod,Cns_HiddenOrVisible_t HiddenOrVisible)
|
|||
[PhoSha_SHAPE_OVAL ] = "PHOTOO15x20",
|
||||
[PhoSha_SHAPE_RECTANGLE] = "PHOTOR15x20",
|
||||
};
|
||||
static const char *MsgClass[Cns_NUM_HIDDEN_VISIBLE] =
|
||||
{
|
||||
[Cns_HIDDEN ] = "MSG_AUT_LIGHT",
|
||||
[Cns_VISIBLE] = "MSG_AUT",
|
||||
};
|
||||
extern const char *HidVis_MsgClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
bool ShowPhoto = false;
|
||||
char PhotoURL[Cns_MAX_BYTES_WWW + 1];
|
||||
struct Usr_Data UsrDat;
|
||||
|
@ -6431,7 +6428,7 @@ void Usr_WriteAuthor1Line (long UsrCod,Cns_HiddenOrVisible_t HiddenOrVisible)
|
|||
|
||||
/***** Write name *****/
|
||||
HTM_DIV_Begin ("class=\"AUTHOR_1_LINE %s_%s\"",
|
||||
MsgClass[HiddenOrVisible],The_GetSuffix ());
|
||||
HidVis_MsgClass[HiddenOrVisible],The_GetSuffix ());
|
||||
HTM_Txt (UsrDat.FullName);
|
||||
HTM_DIV_End ();
|
||||
|
||||
|
|
|
@ -435,7 +435,7 @@ unsigned Usr_GetTotalNumberOfUsers (void);
|
|||
|
||||
void Usr_WriteAuthor (struct Usr_Data *UsrDat,
|
||||
Cns_DisabledOrEnabled_t DisabledOrEnabled);
|
||||
void Usr_WriteAuthor1Line (long UsrCod,Cns_HiddenOrVisible_t HiddenOrVisible);
|
||||
void Usr_WriteAuthor1Line (long UsrCod,HidVis_HiddenOrVisible_t HiddenOrVisible);
|
||||
|
||||
void Usr_ShowTableCellWithUsrData (struct Usr_Data *UsrDat,unsigned NumRows);
|
||||
|
||||
|
|
|
@ -443,7 +443,7 @@ static unsigned long long ZIP_CloneDir (const char *Path,const char *PathClone,c
|
|||
char PathFileInTree[PATH_MAX + 1];
|
||||
struct stat FileStatus;
|
||||
Brw_FileType_t FileType;
|
||||
Cns_HiddenOrVisible_t HiddenOrVisible;
|
||||
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
||||
bool SeeDocsZone = Gbl.FileBrowser.Type == Brw_SHOW_DOC_INS ||
|
||||
Gbl.FileBrowser.Type == Brw_SHOW_DOC_CTR ||
|
||||
Gbl.FileBrowser.Type == Brw_SHOW_DOC_DEG ||
|
||||
|
@ -482,9 +482,9 @@ static unsigned long long ZIP_CloneDir (const char *Path,const char *PathClone,c
|
|||
HiddenOrVisible = (SeeDocsZone ||
|
||||
SeeMarks) ? Brw_CheckIfFileOrFolderIsSetAsHiddenInDB (FileType,
|
||||
PathFileInTree) :
|
||||
Cns_VISIBLE;
|
||||
HidVis_VISIBLE;
|
||||
|
||||
if (HiddenOrVisible == Cns_VISIBLE) // If file/folder is visible
|
||||
if (HiddenOrVisible == HidVis_VISIBLE) // If file/folder is visible
|
||||
switch (FileType)
|
||||
{
|
||||
case Brw_IS_FOLDER:
|
||||
|
|
Loading…
Reference in New Issue