mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-05 00:05:23 +02:00
Version 23.41: Oct 29, 2023 Code refactoring in view/edit/print.
This commit is contained in:
parent
e1135c77b7
commit
362c522791
|
@ -67,8 +67,7 @@ extern struct Globals Gbl;
|
|||
/*****************************************************************************/
|
||||
|
||||
static void Asg_PutHead (struct Asg_Assignments *Assignments,
|
||||
bool OnlyOneAssignment,
|
||||
bool PrintView);
|
||||
bool OnlyOneAssignment,Vie_ViewType_t ViewType);
|
||||
static bool Asg_CheckIfICanCreateAssignments (void);
|
||||
static void Asg_PutIconsListAssignments (void *Assignments);
|
||||
static void Asg_PutIconToCreateNewAsg (void *Assignments);
|
||||
|
@ -76,9 +75,10 @@ static void Asg_ParsWhichGroupsToShow (void *Assignments);
|
|||
static void Asg_PutIconsOneAsg (void *Assignments);
|
||||
static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments,
|
||||
bool OnlyOneAssignment,
|
||||
bool PrintView);
|
||||
Vie_ViewType_t ViewType);
|
||||
static void Asg_WriteAsgAuthor (struct Asg_Assignment *Asg);
|
||||
static void Asg_WriteAssignmentFolder (struct Asg_Assignment *Asg,bool PrintView);
|
||||
static void Asg_WriteAssignmentFolder (struct Asg_Assignment *Asg,
|
||||
Vie_ViewType_t ViewType);
|
||||
|
||||
static void Asg_PutIconsToRemEditOneAsg (struct Asg_Assignments *Assignments,
|
||||
const char *Anchor);
|
||||
|
@ -179,7 +179,7 @@ void Asg_ShowAllAssignments (struct Asg_Assignments *Assignments)
|
|||
/***** Table head *****/
|
||||
Asg_PutHead (Assignments,
|
||||
false, // Not only this assignment in table
|
||||
false); // Not print view
|
||||
Vie_VIEW); // Not print view
|
||||
|
||||
/***** Write all assignments *****/
|
||||
for (NumAsg = Pagination.FirstItemVisible, The_ResetRowColor ();
|
||||
|
@ -189,8 +189,8 @@ void Asg_ShowAllAssignments (struct Asg_Assignments *Assignments)
|
|||
Assignments->Asg.AsgCod = Assignments->LstAsgCods[NumAsg - 1];
|
||||
Asg_GetAssignmentDataByCod (&Assignments->Asg);
|
||||
Asg_ShowAssignmentRow (Assignments,
|
||||
false, // Not only this assignment in table
|
||||
false); // Not print view
|
||||
false, // Not only this assignment in table
|
||||
Vie_VIEW); // Not print view
|
||||
}
|
||||
|
||||
/***** End table *****/
|
||||
|
@ -215,8 +215,7 @@ void Asg_ShowAllAssignments (struct Asg_Assignments *Assignments)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void Asg_PutHead (struct Asg_Assignments *Assignments,
|
||||
bool OnlyOneAssignment,
|
||||
bool PrintView)
|
||||
bool OnlyOneAssignment,Vie_ViewType_t ViewType)
|
||||
{
|
||||
extern const char *Txt_START_END_TIME_HELP[Dat_NUM_START_END_TIME];
|
||||
extern const char *Txt_START_END_TIME[Dat_NUM_START_END_TIME];
|
||||
|
@ -237,7 +236,7 @@ static void Asg_PutHead (struct Asg_Assignments *Assignments,
|
|||
/* Begin head cell */
|
||||
HTM_TH_Begin (HTM_HEAD_LEFT);
|
||||
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
{
|
||||
/* Begin form */
|
||||
Frm_BeginForm (ActSeeAllAsg);
|
||||
|
@ -256,7 +255,7 @@ static void Asg_PutHead (struct Asg_Assignments *Assignments,
|
|||
/* Start / end text */
|
||||
HTM_Txt (Txt_START_END_TIME[Order]);
|
||||
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
{
|
||||
/* End link to select order */
|
||||
if (Order == Assignments->SelectedOrder)
|
||||
|
@ -388,7 +387,7 @@ void Asg_PrintOneAssignment (void)
|
|||
Asg_GetAssignmentDataByCod (&Assignments.Asg);
|
||||
|
||||
/***** Write header *****/
|
||||
Lay_WriteHeaderClassPhoto (true,false);
|
||||
Lay_WriteHeaderClassPhoto (Vie_PRINT,false);
|
||||
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWideMarginPadding (2);
|
||||
|
@ -396,12 +395,12 @@ void Asg_PrintOneAssignment (void)
|
|||
/***** Table head *****/
|
||||
Asg_PutHead (&Assignments,
|
||||
true, // Only this assignment in table
|
||||
true); // Print view
|
||||
Vie_PRINT); // Print view
|
||||
|
||||
/***** Write assignment *****/
|
||||
Asg_ShowAssignmentRow (&Assignments,
|
||||
true, // Only this assignment in table
|
||||
true); // Print view
|
||||
true, // Only this assignment in table
|
||||
Vie_PRINT); // Print view
|
||||
|
||||
/***** End table *****/
|
||||
HTM_TABLE_End ();
|
||||
|
@ -425,12 +424,12 @@ void Asg_ShowOneAssignmentInBox (struct Asg_Assignments *Assignments)
|
|||
/***** Table head *****/
|
||||
Asg_PutHead (Assignments,
|
||||
true, // Only this assignment in table
|
||||
false); // Not print view
|
||||
Vie_VIEW); // Not print view
|
||||
|
||||
/***** Write assignment *****/
|
||||
Asg_ShowAssignmentRow (Assignments,
|
||||
true, // Only this assignment in table
|
||||
false); // Not print view
|
||||
Vie_VIEW); // Not print view
|
||||
|
||||
/***** End table and end box *****/
|
||||
Box_BoxTableEnd ();
|
||||
|
@ -463,7 +462,7 @@ static void Asg_PutIconsOneAsg (void *Assignments)
|
|||
|
||||
static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments,
|
||||
bool OnlyOneAssignment,
|
||||
bool PrintView)
|
||||
Vie_ViewType_t ViewType)
|
||||
{
|
||||
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
||||
extern const char *HidVis_DateGreenClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
|
@ -500,19 +499,27 @@ static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments,
|
|||
{
|
||||
if (asprintf (&Id,"asg_date_%u_%u",(unsigned) StartEndTime,UniqueId) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
if (PrintView)
|
||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s\"",
|
||||
Id,
|
||||
Assignments->Asg.Open ? HidVis_DateGreenClass[Assignments->Asg.HiddenOrVisible] :
|
||||
HidVis_DateRedClass[Assignments->Asg.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
else
|
||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s %s\"",
|
||||
Id,
|
||||
Assignments->Asg.Open ? HidVis_DateGreenClass[Assignments->Asg.HiddenOrVisible] :
|
||||
HidVis_DateRedClass[Assignments->Asg.HiddenOrVisible],
|
||||
The_GetSuffix (),
|
||||
The_GetColorRows ());
|
||||
switch (ViewType)
|
||||
{
|
||||
case Vie_VIEW:
|
||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s %s\"",
|
||||
Id,
|
||||
Assignments->Asg.Open ? HidVis_DateGreenClass[Assignments->Asg.HiddenOrVisible] :
|
||||
HidVis_DateRedClass[Assignments->Asg.HiddenOrVisible],
|
||||
The_GetSuffix (),
|
||||
The_GetColorRows ());
|
||||
break;
|
||||
case Vie_PRINT:
|
||||
HTM_TD_Begin ("id=\"%s\" class=\"LT %s_%s\"",
|
||||
Id,
|
||||
Assignments->Asg.Open ? HidVis_DateGreenClass[Assignments->Asg.HiddenOrVisible] :
|
||||
HidVis_DateRedClass[Assignments->Asg.HiddenOrVisible],
|
||||
The_GetSuffix ());
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
break;
|
||||
}
|
||||
Dat_WriteLocalDateHMSFromUTC (Id,Assignments->Asg.TimeUTC[StartEndTime],
|
||||
Gbl.Prefs.DateFormat,Dat_SEPARATOR_BREAK,
|
||||
true,true,true,0x7);
|
||||
|
@ -521,10 +528,18 @@ static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments,
|
|||
}
|
||||
|
||||
/* Assignment title */
|
||||
if (PrintView)
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
else
|
||||
HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ());
|
||||
switch (ViewType)
|
||||
{
|
||||
case Vie_VIEW:
|
||||
HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ());
|
||||
break;
|
||||
case Vie_PRINT:
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
break;
|
||||
}
|
||||
|
||||
HTM_ARTICLE_Begin (Anchor);
|
||||
Frm_BeginForm (ActSeeOneAsg);
|
||||
|
@ -541,14 +556,23 @@ static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments,
|
|||
HTM_TD_End ();
|
||||
|
||||
/* Assignment folder */
|
||||
if (PrintView)
|
||||
HTM_TD_Begin ("class=\"LT DAT_%s\"",
|
||||
The_GetSuffix ());
|
||||
else
|
||||
HTM_TD_Begin ("class=\"LT DAT_%s %s\"",
|
||||
The_GetSuffix (),The_GetColorRows ());
|
||||
switch (ViewType)
|
||||
{
|
||||
case Vie_VIEW:
|
||||
HTM_TD_Begin ("class=\"LT DAT_%s %s\"",
|
||||
The_GetSuffix (),The_GetColorRows ());
|
||||
break;
|
||||
case Vie_PRINT:
|
||||
HTM_TD_Begin ("class=\"LT DAT_%s\"",
|
||||
The_GetSuffix ());
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
break;
|
||||
}
|
||||
|
||||
if (Assignments->Asg.SendWork == Asg_SEND_WORK)
|
||||
Asg_WriteAssignmentFolder (&Assignments->Asg,PrintView);
|
||||
Asg_WriteAssignmentFolder (&Assignments->Asg,ViewType);
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
@ -557,10 +581,18 @@ static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments,
|
|||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Author of the assignment */
|
||||
if (PrintView)
|
||||
HTM_TD_Begin ("colspan=\"2\" class=\"LT\"");
|
||||
else
|
||||
HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"",The_GetColorRows ());
|
||||
switch (ViewType)
|
||||
{
|
||||
case Vie_VIEW:
|
||||
HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"",The_GetColorRows ());
|
||||
break;
|
||||
case Vie_PRINT:
|
||||
HTM_TD_Begin ("colspan=\"2\" class=\"LT\"");
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
break;
|
||||
}
|
||||
Asg_WriteAsgAuthor (&Assignments->Asg);
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -569,10 +601,18 @@ static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments,
|
|||
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
|
||||
Txt,Cns_MAX_BYTES_TEXT,Str_DONT_REMOVE_SPACES);
|
||||
ALn_InsertLinks (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links
|
||||
if (PrintView)
|
||||
HTM_TD_Begin ("colspan=\"2\" class=\"LT\"");
|
||||
else
|
||||
HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"",The_GetColorRows ());
|
||||
switch (ViewType)
|
||||
{
|
||||
case Vie_VIEW:
|
||||
HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"",The_GetColorRows ());
|
||||
break;
|
||||
case Vie_PRINT:
|
||||
HTM_TD_Begin ("colspan=\"2\" class=\"LT\"");
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
break;
|
||||
}
|
||||
if (Gbl.Crs.Grps.NumGrps)
|
||||
Asg_GetAndWriteNamesOfGrpsAssociatedToAsg (&Assignments->Asg);
|
||||
|
||||
|
@ -606,17 +646,18 @@ static void Asg_WriteAsgAuthor (struct Asg_Assignment *Asg)
|
|||
/********************* Write the folder of an assignment *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Asg_WriteAssignmentFolder (struct Asg_Assignment *Asg,bool PrintView)
|
||||
static void Asg_WriteAssignmentFolder (struct Asg_Assignment *Asg,
|
||||
Vie_ViewType_t ViewType)
|
||||
{
|
||||
extern const char *Txt_Folder;
|
||||
Act_Action_t NextAction;
|
||||
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
|
||||
Asg->Open && // It's open (inside dates)
|
||||
Asg->IBelongToCrsOrGrps; // I belong to course or groups
|
||||
|
||||
/***** Folder icon *****/
|
||||
if (!PrintView && // Not print view
|
||||
ICanSendFiles) // I can send files to this assignment folder
|
||||
if (ViewType == Vie_VIEW && // Not print view
|
||||
ICanSendFiles) // I can send files to this assignment folder
|
||||
{
|
||||
/* Form to create a new file or folder */
|
||||
Gbl.FileBrowser.FullTree = true; // By default, show all files
|
||||
|
|
|
@ -78,7 +78,7 @@ static unsigned Cal_GetParFirstDayOfWeek (void);
|
|||
static void Cal_DrawCalendar (Act_Action_t ActionSeeCalendar,
|
||||
Act_Action_t ActionChangeCalendar1stDay,
|
||||
void (*FunctionToDrawContextualIcons) (void *Args),void *Args,
|
||||
bool PrintView);
|
||||
Vie_ViewType_t ViewType);
|
||||
static void Cal_PutIconsCalendar (__attribute__((unused)) void *Args);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -235,36 +235,42 @@ void Cal_ShowCalendar (void)
|
|||
{
|
||||
Cal_DrawCalendar (ActSeeCal,ActChgCal1stDay,
|
||||
Cal_PutIconsCalendar,NULL,
|
||||
false);
|
||||
Vie_VIEW);
|
||||
}
|
||||
|
||||
void Cal_PrintCalendar (void)
|
||||
{
|
||||
Cal_DrawCalendar (ActUnk,ActUnk,
|
||||
NULL,NULL,
|
||||
true);
|
||||
Vie_PRINT);
|
||||
}
|
||||
|
||||
static void Cal_DrawCalendar (Act_Action_t ActionSeeCalendar,
|
||||
Act_Action_t ActionChangeCalendar1stDay,
|
||||
void (*FunctionToDrawContextualIcons) (void *Args),void *Args,
|
||||
bool PrintView)
|
||||
Vie_ViewType_t ViewType)
|
||||
{
|
||||
extern const char *Hlp_START_Calendar;
|
||||
extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
|
||||
char ParsStr[Frm_MAX_BYTES_PARAMS_STR + 1];
|
||||
static const char *Print[Vie_NUM_VIEW_TYPES] =
|
||||
{
|
||||
[Vie_VIEW ] = "false",
|
||||
[Vie_PRINT] = "true",
|
||||
};
|
||||
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
FunctionToDrawContextualIcons,Args,
|
||||
PrintView ? NULL :
|
||||
Hlp_START_Calendar,Box_NOT_CLOSABLE);
|
||||
ViewType == Vie_VIEW ? Hlp_START_Calendar :
|
||||
NULL,
|
||||
Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Write header *****/
|
||||
Lay_WriteHeaderClassPhoto (PrintView,false);
|
||||
Lay_WriteHeaderClassPhoto (ViewType,false);
|
||||
|
||||
/***** Preference selector to change first day of week *****/
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
{
|
||||
Set_BeginSettingsHead ();
|
||||
Cal_ShowFormToSelFirstDayOfWeek (ActionChangeCalendar1stDay,
|
||||
|
@ -284,8 +290,7 @@ static void Cal_DrawCalendar (Act_Action_t ActionSeeCalendar,
|
|||
Gbl.Prefs.FirstDayOfWeek,
|
||||
(long) Dat_GetStartExecutionTimeUTC (),
|
||||
Gbl.Hierarchy.Node[Hie_CTR].Specific.PlcCod,
|
||||
PrintView ? "true" :
|
||||
"false",
|
||||
Print[ViewType],
|
||||
The_GetSuffix (),
|
||||
Cfg_URL_SWAD_CGI,Lan_STR_LANG_ID[Gbl.Prefs.Language]);
|
||||
Frm_SetParsForm (ParsStr,ActionSeeCalendar,true);
|
||||
|
|
|
@ -75,23 +75,23 @@ extern struct Globals Gbl;
|
|||
/***************************** Private prototypes ****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_Configuration (bool PrintView);
|
||||
static void CtrCfg_Configuration (Vie_ViewType_t ViewType);
|
||||
static void CtrCfg_PutIconsCtrConfig (__attribute__((unused)) void *Args);
|
||||
static void CtrCfg_PutIconToChangePhoto (void);
|
||||
static void CtrCfg_Map (const struct Map_Coordinates *Coord);
|
||||
static void CtrCfg_Latitude (double Latitude);
|
||||
static void CtrCfg_Longitude (double Longitude);
|
||||
static void CtrCfg_Altitude (double Altitude);
|
||||
static void CtrCfg_Photo (bool PrintView,bool PutForm,bool PutLink,
|
||||
static void CtrCfg_Photo (Vie_ViewType_t ViewType,bool PutForm,bool PutLink,
|
||||
const char PathPhoto[PATH_MAX + 1]);
|
||||
static void CtrCfg_GetPhotoAttr (long CtrCod,char **PhotoAttribution);
|
||||
static void CtrCfg_FreePhotoAttr (char **PhotoAttribution);
|
||||
static void CtrCfg_Institution (bool PrintView,bool PutForm);
|
||||
static void CtrCfg_Institution (Vie_ViewType_t ViewType,bool PutForm);
|
||||
static void CtrCfg_FullName (bool PutForm);
|
||||
static void CtrCfg_ShrtName (bool PutForm);
|
||||
static void CtrCfg_Place (bool PutForm);
|
||||
static void CtrCfg_WWW (bool PrintView,bool PutForm);
|
||||
static void CtrCfg_Shortcut (bool PrintView);
|
||||
static void CtrCfg_WWW (Vie_ViewType_t ViewType,bool PutForm);
|
||||
static void CtrCfg_Shortcut (Vie_ViewType_t ViewType);
|
||||
static void CtrCfg_QR (void);
|
||||
static void CtrCfg_NumUsrs (void);
|
||||
static void CtrCfg_NumDegs (void);
|
||||
|
@ -103,7 +103,7 @@ static void CtrCfg_NumCrss (void);
|
|||
|
||||
void CtrCfg_ShowConfiguration (void)
|
||||
{
|
||||
CtrCfg_Configuration (false);
|
||||
CtrCfg_Configuration (Vie_VIEW);
|
||||
|
||||
/***** Show help to enrol me *****/
|
||||
Hlp_ShowHelpWhatWouldYouLikeToDo ();
|
||||
|
@ -115,14 +115,14 @@ void CtrCfg_ShowConfiguration (void)
|
|||
|
||||
void CtrCfg_PrintConfiguration (void)
|
||||
{
|
||||
CtrCfg_Configuration (true);
|
||||
CtrCfg_Configuration (Vie_PRINT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************* Information of the current center ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_Configuration (bool PrintView)
|
||||
static void CtrCfg_Configuration (Vie_ViewType_t ViewType)
|
||||
{
|
||||
extern const char *Hlp_CENTER_Information;
|
||||
struct Map_Coordinates Coord;
|
||||
|
@ -145,108 +145,111 @@ static void CtrCfg_Configuration (bool PrintView)
|
|||
Ctr_GetCoordByCod (Gbl.Hierarchy.Node[Hie_CTR].HieCod,&Coord);
|
||||
|
||||
/***** Initializations *****/
|
||||
PutLink = !PrintView && Gbl.Hierarchy.Node[Hie_CTR].WWW[0];
|
||||
PutFormIns = !PrintView && Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM;
|
||||
PutFormName = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM;
|
||||
PutLink = ViewType == Vie_VIEW && Gbl.Hierarchy.Node[Hie_CTR].WWW[0];
|
||||
PutFormIns = ViewType == Vie_VIEW && Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM;
|
||||
PutFormName = ViewType == Vie_VIEW && Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM;
|
||||
PutFormPlc =
|
||||
PutFormCoor =
|
||||
PutFormWWW =
|
||||
PutFormPhoto = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM;
|
||||
PutFormPhoto = ViewType == Vie_VIEW && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM;
|
||||
|
||||
/***** Begin box *****/
|
||||
if (PrintView)
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
NULL,NULL,
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
else
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
CtrCfg_PutIconsCtrConfig,NULL,
|
||||
Hlp_CENTER_Information,Box_NOT_CLOSABLE);
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
ViewType == Vie_VIEW ? CtrCfg_PutIconsCtrConfig :
|
||||
NULL,NULL,
|
||||
ViewType == Vie_VIEW ? Hlp_CENTER_Information :
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Title *****/
|
||||
HieCfg_Title (PutLink,Hie_CTR);
|
||||
/***** Title *****/
|
||||
HieCfg_Title (PutLink,Hie_CTR);
|
||||
|
||||
/**************************** Left part ***********************************/
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_LEFT HIE_CFG_WIDTH\"");
|
||||
/**************************** Left part ***********************************/
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_LEFT HIE_CFG_WIDTH\"");
|
||||
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWidePadding (2);
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWidePadding (2);
|
||||
|
||||
/***** Institution *****/
|
||||
CtrCfg_Institution (PrintView,PutFormIns);
|
||||
/***** Institution *****/
|
||||
CtrCfg_Institution (ViewType,PutFormIns);
|
||||
|
||||
/***** Center name *****/
|
||||
CtrCfg_FullName (PutFormName);
|
||||
CtrCfg_ShrtName (PutFormName);
|
||||
/***** Center name *****/
|
||||
CtrCfg_FullName (PutFormName);
|
||||
CtrCfg_ShrtName (PutFormName);
|
||||
|
||||
/***** Place *****/
|
||||
CtrCfg_Place (PutFormPlc);
|
||||
/***** Place *****/
|
||||
CtrCfg_Place (PutFormPlc);
|
||||
|
||||
/***** Coordinates *****/
|
||||
if (PutFormCoor)
|
||||
{
|
||||
CtrCfg_Latitude (Coord.Latitude );
|
||||
CtrCfg_Longitude (Coord.Longitude);
|
||||
CtrCfg_Altitude (Coord.Altitude );
|
||||
}
|
||||
/***** Coordinates *****/
|
||||
if (PutFormCoor)
|
||||
{
|
||||
CtrCfg_Latitude (Coord.Latitude );
|
||||
CtrCfg_Longitude (Coord.Longitude);
|
||||
CtrCfg_Altitude (Coord.Altitude );
|
||||
}
|
||||
|
||||
/***** Center WWW *****/
|
||||
CtrCfg_WWW (PrintView,PutFormWWW);
|
||||
/***** Center WWW *****/
|
||||
CtrCfg_WWW (ViewType,PutFormWWW);
|
||||
|
||||
/***** Shortcut to the center *****/
|
||||
CtrCfg_Shortcut (PrintView);
|
||||
/***** Shortcut to the center *****/
|
||||
CtrCfg_Shortcut (ViewType);
|
||||
|
||||
if (PrintView)
|
||||
/***** QR code with link to the center *****/
|
||||
CtrCfg_QR ();
|
||||
else
|
||||
{
|
||||
/***** Number of users who claim to belong to this center,
|
||||
number of degrees,
|
||||
number of courses *****/
|
||||
CtrCfg_NumUsrs ();
|
||||
CtrCfg_NumDegs ();
|
||||
CtrCfg_NumCrss ();
|
||||
switch (ViewType)
|
||||
{
|
||||
case Vie_VIEW:
|
||||
/***** Number of users who claim to belong to this center,
|
||||
number of degrees,
|
||||
number of courses *****/
|
||||
CtrCfg_NumUsrs ();
|
||||
CtrCfg_NumDegs ();
|
||||
CtrCfg_NumCrss ();
|
||||
|
||||
/***** Number of users in courses of this center *****/
|
||||
HieCfg_NumUsrsInCrss (Hie_CTR,Gbl.Hierarchy.Node[Hie_CTR].HieCod,Rol_TCH);
|
||||
HieCfg_NumUsrsInCrss (Hie_CTR,Gbl.Hierarchy.Node[Hie_CTR].HieCod,Rol_NET);
|
||||
HieCfg_NumUsrsInCrss (Hie_CTR,Gbl.Hierarchy.Node[Hie_CTR].HieCod,Rol_STD);
|
||||
HieCfg_NumUsrsInCrss (Hie_CTR,Gbl.Hierarchy.Node[Hie_CTR].HieCod,Rol_UNK);
|
||||
}
|
||||
/***** Number of users in courses of this center *****/
|
||||
HieCfg_NumUsrsInCrss (Hie_CTR,Gbl.Hierarchy.Node[Hie_CTR].HieCod,Rol_TCH);
|
||||
HieCfg_NumUsrsInCrss (Hie_CTR,Gbl.Hierarchy.Node[Hie_CTR].HieCod,Rol_NET);
|
||||
HieCfg_NumUsrsInCrss (Hie_CTR,Gbl.Hierarchy.Node[Hie_CTR].HieCod,Rol_STD);
|
||||
HieCfg_NumUsrsInCrss (Hie_CTR,Gbl.Hierarchy.Node[Hie_CTR].HieCod,Rol_UNK);
|
||||
break;
|
||||
case Vie_PRINT:
|
||||
/***** QR code with link to the center *****/
|
||||
CtrCfg_QR ();
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
break;
|
||||
}
|
||||
|
||||
/***** End table *****/
|
||||
HTM_TABLE_End ();
|
||||
|
||||
/***** End of left part *****/
|
||||
HTM_DIV_End ();
|
||||
|
||||
/**************************** Right part **********************************/
|
||||
/***** Check map *****/
|
||||
MapIsAvailable = Map_CheckIfCoordAreAvailable (&Coord);
|
||||
|
||||
/***** Check photo *****/
|
||||
snprintf (PathPhoto,sizeof (PathPhoto),"%s/%02u/%u/%u.jpg",
|
||||
Cfg_PATH_CTR_PUBLIC,
|
||||
(unsigned) (Gbl.Hierarchy.Node[Hie_CTR].HieCod % 100),
|
||||
(unsigned) Gbl.Hierarchy.Node[Hie_CTR].HieCod,
|
||||
(unsigned) Gbl.Hierarchy.Node[Hie_CTR].HieCod);
|
||||
PhotoExists = Fil_CheckIfPathExists (PathPhoto);
|
||||
|
||||
if (MapIsAvailable || PhotoExists)
|
||||
{
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_RIGHT HIE_CFG_WIDTH\"");
|
||||
|
||||
/***** Center map *****/
|
||||
if (MapIsAvailable)
|
||||
CtrCfg_Map (&Coord);
|
||||
|
||||
/***** Center photo *****/
|
||||
if (PhotoExists)
|
||||
CtrCfg_Photo (PrintView,PutFormPhoto,PutLink,PathPhoto);
|
||||
/***** End table *****/
|
||||
HTM_TABLE_End ();
|
||||
|
||||
/***** End of left part *****/
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
||||
/**************************** Right part **********************************/
|
||||
/***** Check map *****/
|
||||
MapIsAvailable = Map_CheckIfCoordAreAvailable (&Coord);
|
||||
|
||||
/***** Check photo *****/
|
||||
snprintf (PathPhoto,sizeof (PathPhoto),"%s/%02u/%u/%u.jpg",
|
||||
Cfg_PATH_CTR_PUBLIC,
|
||||
(unsigned) (Gbl.Hierarchy.Node[Hie_CTR].HieCod % 100),
|
||||
(unsigned) Gbl.Hierarchy.Node[Hie_CTR].HieCod,
|
||||
(unsigned) Gbl.Hierarchy.Node[Hie_CTR].HieCod);
|
||||
PhotoExists = Fil_CheckIfPathExists (PathPhoto);
|
||||
|
||||
if (MapIsAvailable || PhotoExists)
|
||||
{
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_RIGHT HIE_CFG_WIDTH\"");
|
||||
|
||||
/***** Center map *****/
|
||||
if (MapIsAvailable)
|
||||
CtrCfg_Map (&Coord);
|
||||
|
||||
/***** Center photo *****/
|
||||
if (PhotoExists)
|
||||
CtrCfg_Photo (ViewType,PutFormPhoto,PutLink,PathPhoto);
|
||||
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
||||
/***** End box *****/
|
||||
Box_BoxEnd ();
|
||||
|
@ -418,7 +421,7 @@ static void CtrCfg_Altitude (double Altitude)
|
|||
/***************************** Draw center photo *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_Photo (bool PrintView,bool PutForm,bool PutLink,
|
||||
static void CtrCfg_Photo (Vie_ViewType_t ViewType,bool PutForm,bool PutLink,
|
||||
const char PathPhoto[PATH_MAX + 1])
|
||||
{
|
||||
char *PhotoAttribution = NULL;
|
||||
|
@ -448,8 +451,8 @@ static void CtrCfg_Photo (bool PrintView,bool PutForm,bool PutLink,
|
|||
(unsigned) Gbl.Hierarchy.Node[Hie_CTR].HieCod) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
HTM_IMG (URL,Icon,Gbl.Hierarchy.Node[Hie_CTR].FullName,
|
||||
"class=\"%s\"",PrintView ? "CENTER_PHOTO_PRINT CENTER_PHOTO_WIDTH" :
|
||||
"CENTER_PHOTO_SHOW CENTER_PHOTO_WIDTH");
|
||||
"class=\"%s\"",ViewType == Vie_VIEW ? "CENTER_PHOTO_SHOW CENTER_PHOTO_WIDTH" :
|
||||
"CENTER_PHOTO_PRINT CENTER_PHOTO_WIDTH");
|
||||
free (Icon);
|
||||
free (URL);
|
||||
if (PutLink)
|
||||
|
@ -531,7 +534,7 @@ static void CtrCfg_FreePhotoAttr (char **PhotoAttribution)
|
|||
/***************** Show institution in center configuration ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_Institution (bool PrintView,bool PutForm)
|
||||
static void CtrCfg_Institution (Vie_ViewType_t ViewType,bool PutForm)
|
||||
{
|
||||
extern const char *Par_CodeStr[];
|
||||
extern const char *Txt_Institution;
|
||||
|
@ -578,7 +581,7 @@ static void CtrCfg_Institution (bool PrintView,bool PutForm)
|
|||
}
|
||||
else // I can not move center to another institution
|
||||
{
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
{
|
||||
Frm_BeginFormGoTo (ActSeeInsInf);
|
||||
ParCod_PutPar (ParCod_Ins,Gbl.Hierarchy.Node[Hie_INS].HieCod);
|
||||
|
@ -594,7 +597,7 @@ static void CtrCfg_Institution (bool PrintView,bool PutForm)
|
|||
HTM_NBSP ();
|
||||
HTM_Txt (Gbl.Hierarchy.Node[Hie_INS].FullName);
|
||||
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
{
|
||||
HTM_BUTTON_End ();
|
||||
Frm_EndForm ();
|
||||
|
@ -698,18 +701,18 @@ static void CtrCfg_Place (bool PutForm)
|
|||
/***************** Show center WWW in center configuration *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_WWW (bool PrintView,bool PutForm)
|
||||
static void CtrCfg_WWW (Vie_ViewType_t ViewType,bool PutForm)
|
||||
{
|
||||
HieCfg_WWW (PrintView,PutForm,ActChgCtrWWWCfg,Gbl.Hierarchy.Node[Hie_CTR].WWW);
|
||||
HieCfg_WWW (ViewType,PutForm,ActChgCtrWWWCfg,Gbl.Hierarchy.Node[Hie_CTR].WWW);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*************** Show center shortcut in center configuration ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_Shortcut (bool PrintView)
|
||||
static void CtrCfg_Shortcut (Vie_ViewType_t ViewType)
|
||||
{
|
||||
HieCfg_Shortcut (PrintView,ParCod_Ctr,Gbl.Hierarchy.Node[Hie_CTR].HieCod);
|
||||
HieCfg_Shortcut (ViewType,ParCod_Ctr,Gbl.Hierarchy.Node[Hie_CTR].HieCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -633,10 +633,11 @@ Me sale este error, no s
|
|||
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
|
||||
*/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 23.40 (2023-10-28)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 23.41 (2023-10-29)"
|
||||
#define CSS_FILE "swad23.35.1.css"
|
||||
#define JS_FILE "swad22.49.js"
|
||||
/*
|
||||
Version 23.41: Oct 29, 2023 Code refactoring in view/edit/print. (335359 lines)
|
||||
Version 23.40: Oct 28, 2023 Code refactoring in view/edit. (335273 lines)
|
||||
Version 23.39: Oct 27, 2023 Code refactoring in contracted/expanded and rubrics. (335209 lines)
|
||||
Version 23.38.3: Oct 27, 2023 When clicking on edition of a program item, expand it if contracted. (335155 lines)
|
||||
|
|
|
@ -58,14 +58,14 @@ extern struct Globals Gbl;
|
|||
/***************************** Private prototypes ****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtyCfg_Configuration (bool PrintView);
|
||||
static void CtyCfg_Configuration (Vie_ViewType_t ViewType);
|
||||
static void CtyCfg_PutIconToPrint (__attribute__((unused)) void *Args);
|
||||
static void CtyCfg_Title (bool PutLink);
|
||||
static void CtyCfg_Map (void);
|
||||
static void CtyCfg_MapImage (bool PrintView,bool PutLink);
|
||||
static void CtyCfg_Platform (bool PrintView);
|
||||
static void CtyCfg_MapImage (Vie_ViewType_t ViewType,bool PutLink);
|
||||
static void CtyCfg_Platform (Vie_ViewType_t ViewType);
|
||||
static void CtyCfg_Name (bool PutLink);
|
||||
static void CtyCfg_Shortcut (bool PrintView);
|
||||
static void CtyCfg_Shortcut (Vie_ViewType_t ViewType);
|
||||
static void CtyCfg_QR (void);
|
||||
static void CtyCfg_NumUsrs (void);
|
||||
static void CtyCfg_NumInss (void);
|
||||
|
@ -81,7 +81,7 @@ static void CtyCfg_FreeMapAttr (char **MapAttribution);
|
|||
|
||||
void CtyCfg_ShowConfiguration (void)
|
||||
{
|
||||
CtyCfg_Configuration (false);
|
||||
CtyCfg_Configuration (Vie_VIEW);
|
||||
|
||||
/***** Show help to enrol me *****/
|
||||
Hlp_ShowHelpWhatWouldYouLikeToDo ();
|
||||
|
@ -93,14 +93,14 @@ void CtyCfg_ShowConfiguration (void)
|
|||
|
||||
void CtyCfg_PrintConfiguration (void)
|
||||
{
|
||||
CtyCfg_Configuration (true);
|
||||
CtyCfg_Configuration (Vie_PRINT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Information of the current country *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtyCfg_Configuration (bool PrintView)
|
||||
static void CtyCfg_Configuration (Vie_ViewType_t ViewType)
|
||||
{
|
||||
extern const char *Hlp_COUNTRY_Information;
|
||||
bool PutLink;
|
||||
|
@ -113,92 +113,95 @@ static void CtyCfg_Configuration (bool PrintView)
|
|||
return;
|
||||
|
||||
/***** Initializations *****/
|
||||
PutLink = !PrintView && Gbl.Hierarchy.Node[Hie_CTY].WWW[0];
|
||||
PutLink = ViewType == Vie_VIEW && Gbl.Hierarchy.Node[Hie_CTY].WWW[0];
|
||||
|
||||
/***** Begin box *****/
|
||||
if (PrintView)
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
NULL,NULL,
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
else
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
CtyCfg_PutIconToPrint,NULL,
|
||||
Hlp_COUNTRY_Information,Box_NOT_CLOSABLE);
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
ViewType == Vie_VIEW ? CtyCfg_PutIconToPrint :
|
||||
NULL,NULL,
|
||||
ViewType == Vie_VIEW ? Hlp_COUNTRY_Information :
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Title *****/
|
||||
CtyCfg_Title (PutLink);
|
||||
/***** Title *****/
|
||||
CtyCfg_Title (PutLink);
|
||||
|
||||
/**************************** Left part ***********************************/
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_LEFT HIE_CFG_WIDTH\"");
|
||||
/**************************** Left part ***********************************/
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_LEFT HIE_CFG_WIDTH\"");
|
||||
|
||||
/* Begin table */
|
||||
HTM_TABLE_BeginWidePadding (2);
|
||||
/* Begin table */
|
||||
HTM_TABLE_BeginWidePadding (2);
|
||||
|
||||
/* Platform */
|
||||
CtyCfg_Platform (PrintView);
|
||||
/* Platform */
|
||||
CtyCfg_Platform (ViewType);
|
||||
|
||||
/* Country name (an link to WWW if exists) */
|
||||
CtyCfg_Name (PutLink);
|
||||
/* Country name (an link to WWW if exists) */
|
||||
CtyCfg_Name (PutLink);
|
||||
|
||||
/* Shortcut to the country */
|
||||
CtyCfg_Shortcut (PrintView);
|
||||
/* Shortcut to the country */
|
||||
CtyCfg_Shortcut (ViewType);
|
||||
|
||||
NumCtrsWithMap = Ctr_GetCachedNumCtrsWithMapInCty (Gbl.Hierarchy.Node[Hie_CTY].HieCod);
|
||||
if (PrintView)
|
||||
/* QR code with link to the country */
|
||||
CtyCfg_QR ();
|
||||
else
|
||||
{
|
||||
NumCtrs = Hie_GetCachedNumNodesInHieLvl (Hie_CTR, // Number of centers...
|
||||
Hie_CTY, // ...in country
|
||||
Gbl.Hierarchy.Node[Hie_CTY].HieCod);
|
||||
NumCtrsWithMap = Ctr_GetCachedNumCtrsWithMapInCty (Gbl.Hierarchy.Node[Hie_CTY].HieCod);
|
||||
switch (ViewType)
|
||||
{
|
||||
case Vie_VIEW:
|
||||
NumCtrs = Hie_GetCachedNumNodesInHieLvl (Hie_CTR, // Number of centers...
|
||||
Hie_CTY, // ...in country
|
||||
Gbl.Hierarchy.Node[Hie_CTY].HieCod);
|
||||
|
||||
/* Number of users who claim to belong to this country,
|
||||
number of institutions,
|
||||
number of centers,
|
||||
number of degrees,
|
||||
number of courses */
|
||||
CtyCfg_NumUsrs ();
|
||||
CtyCfg_NumInss ();
|
||||
HieCfg_NumCtrs (NumCtrs,
|
||||
false); // Don't put form
|
||||
HieCfg_NumCtrsWithMap (NumCtrs,NumCtrsWithMap);
|
||||
CtyCfg_NumDegs ();
|
||||
CtyCfg_NumCrss ();
|
||||
/* Number of users who claim to belong to this country,
|
||||
number of institutions,
|
||||
number of centers,
|
||||
number of degrees,
|
||||
number of courses */
|
||||
CtyCfg_NumUsrs ();
|
||||
CtyCfg_NumInss ();
|
||||
HieCfg_NumCtrs (NumCtrs,
|
||||
false); // Don't put form
|
||||
HieCfg_NumCtrsWithMap (NumCtrs,NumCtrsWithMap);
|
||||
CtyCfg_NumDegs ();
|
||||
CtyCfg_NumCrss ();
|
||||
|
||||
/* Number of users in courses of this country */
|
||||
HieCfg_NumUsrsInCrss (Hie_CTY,Gbl.Hierarchy.Node[Hie_CTY].HieCod,Rol_TCH);
|
||||
HieCfg_NumUsrsInCrss (Hie_CTY,Gbl.Hierarchy.Node[Hie_CTY].HieCod,Rol_NET);
|
||||
HieCfg_NumUsrsInCrss (Hie_CTY,Gbl.Hierarchy.Node[Hie_CTY].HieCod,Rol_STD);
|
||||
HieCfg_NumUsrsInCrss (Hie_CTY,Gbl.Hierarchy.Node[Hie_CTY].HieCod,Rol_UNK);
|
||||
}
|
||||
/* Number of users in courses of this country */
|
||||
HieCfg_NumUsrsInCrss (Hie_CTY,Gbl.Hierarchy.Node[Hie_CTY].HieCod,Rol_TCH);
|
||||
HieCfg_NumUsrsInCrss (Hie_CTY,Gbl.Hierarchy.Node[Hie_CTY].HieCod,Rol_NET);
|
||||
HieCfg_NumUsrsInCrss (Hie_CTY,Gbl.Hierarchy.Node[Hie_CTY].HieCod,Rol_STD);
|
||||
HieCfg_NumUsrsInCrss (Hie_CTY,Gbl.Hierarchy.Node[Hie_CTY].HieCod,Rol_UNK);
|
||||
break;
|
||||
case Vie_PRINT:
|
||||
/* QR code with link to the country */
|
||||
CtyCfg_QR ();
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
break;
|
||||
}
|
||||
|
||||
/* End table */
|
||||
HTM_TABLE_End ();
|
||||
/* End table */
|
||||
HTM_TABLE_End ();
|
||||
|
||||
/* End of left part */
|
||||
HTM_DIV_End ();
|
||||
|
||||
/**************************** Right part **********************************/
|
||||
/* Check country map */
|
||||
MapImageExists = Cty_CheckIfCountryPhotoExists (&Gbl.Hierarchy.Node[Hie_CTY]);
|
||||
|
||||
if (NumCtrsWithMap || MapImageExists)
|
||||
{
|
||||
/* Begin container */
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_RIGHT HIE_CFG_WIDTH\"");
|
||||
|
||||
/* Country map */
|
||||
if (NumCtrsWithMap)
|
||||
CtyCfg_Map ();
|
||||
|
||||
/* Country map image */
|
||||
if (MapImageExists)
|
||||
CtyCfg_MapImage (PrintView,PutLink);
|
||||
|
||||
/* End container */
|
||||
/* End of left part */
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
||||
/**************************** Right part **********************************/
|
||||
/* Check country map */
|
||||
MapImageExists = Cty_CheckIfCountryPhotoExists (&Gbl.Hierarchy.Node[Hie_CTY]);
|
||||
|
||||
if (NumCtrsWithMap || MapImageExists)
|
||||
{
|
||||
/* Begin container */
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_RIGHT HIE_CFG_WIDTH\"");
|
||||
|
||||
/* Country map */
|
||||
if (NumCtrsWithMap)
|
||||
CtyCfg_Map ();
|
||||
|
||||
/* Country map image */
|
||||
if (MapImageExists)
|
||||
CtyCfg_MapImage (ViewType,PutLink);
|
||||
|
||||
/* End container */
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
||||
/***** End box *****/
|
||||
Box_BoxEnd ();
|
||||
|
@ -319,7 +322,7 @@ static void CtyCfg_Map (void)
|
|||
/************* Show country map image in country configuration ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtyCfg_MapImage (bool PrintView,bool PutLink)
|
||||
static void CtyCfg_MapImage (Vie_ViewType_t ViewType,bool PutLink)
|
||||
{
|
||||
char *MapAttribution = NULL;
|
||||
|
||||
|
@ -332,18 +335,19 @@ static void CtyCfg_MapImage (bool PrintView,bool PutLink)
|
|||
HTM_A_Begin ("href=\"%s\" target=\"_blank\"",
|
||||
Gbl.Hierarchy.Node[Hie_CTY].WWW);
|
||||
Cty_DrawCountryMap (&Gbl.Hierarchy.Node[Hie_CTY],
|
||||
PrintView ? "COUNTRY_MAP_PRINT" :
|
||||
"COUNTRY_MAP_SHOW");
|
||||
ViewType == Vie_VIEW ? "COUNTRY_MAP_SHOW" :
|
||||
"COUNTRY_MAP_PRINT");
|
||||
if (PutLink)
|
||||
HTM_A_End ();
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** Map attribution *****/
|
||||
if (!PrintView && Cty_CheckIfICanEditCountries ())
|
||||
if (ViewType == Vie_VIEW && Cty_CheckIfICanEditCountries ())
|
||||
{
|
||||
HTM_DIV_Begin ("class=\"CM\"");
|
||||
Frm_BeginForm (ActChgCtyMapAtt);
|
||||
HTM_TEXTAREA_Begin ("id=\"AttributionArea\" name=\"Attribution\" rows=\"3\""
|
||||
HTM_TEXTAREA_Begin ("id=\"AttributionArea\" name=\"Attribution\""
|
||||
" rows=\"3\""
|
||||
" onchange=\"this.form.submit();return false;\"");
|
||||
if (MapAttribution)
|
||||
HTM_Txt (MapAttribution);
|
||||
|
@ -366,7 +370,7 @@ static void CtyCfg_MapImage (bool PrintView,bool PutLink)
|
|||
/****************** Show platform in country configuration *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtyCfg_Platform (bool PrintView)
|
||||
static void CtyCfg_Platform (Vie_ViewType_t ViewType)
|
||||
{
|
||||
extern const char *Txt_System;
|
||||
|
||||
|
@ -378,7 +382,7 @@ static void CtyCfg_Platform (bool PrintView)
|
|||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LT DAT_%s\"",The_GetSuffix ());
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
{
|
||||
Frm_BeginFormGoTo (ActSeeSysInf);
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (Cfg_PLATFORM_SHORT_NAME),
|
||||
|
@ -388,7 +392,7 @@ static void CtyCfg_Platform (bool PrintView)
|
|||
Ico_PutIcon ("swad64x64.png",Ico_UNCHANGED,Cfg_PLATFORM_FULL_NAME,"ICO20x20");
|
||||
HTM_NBSP ();
|
||||
HTM_Txt (Cfg_PLATFORM_SHORT_NAME);
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
{
|
||||
HTM_BUTTON_End ();
|
||||
Frm_EndForm ();
|
||||
|
@ -430,9 +434,9 @@ static void CtyCfg_Name (bool PutLink)
|
|||
/************** Show country shortcut in country configuration ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtyCfg_Shortcut (bool PrintView)
|
||||
static void CtyCfg_Shortcut (Vie_ViewType_t ViewType)
|
||||
{
|
||||
HieCfg_Shortcut (PrintView,ParCod_Cty,Gbl.Hierarchy.Node[Hie_CTY].HieCod);
|
||||
HieCfg_Shortcut (ViewType,ParCod_Cty,Gbl.Hierarchy.Node[Hie_CTY].HieCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -132,7 +132,7 @@ void Crs_ShowIntroduction (void)
|
|||
{
|
||||
/***** Course configuration *****/
|
||||
HTM_DIV_Begin ("class=\"CM\"");
|
||||
CrsCfg_Configuration (false);
|
||||
CrsCfg_Configuration (Vie_VIEW);
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** Course introduction *****/
|
||||
|
|
|
@ -60,13 +60,13 @@ extern struct Globals Gbl;
|
|||
/*****************************************************************************/
|
||||
|
||||
static void CrsCfg_PutIconToPrint (__attribute__((unused)) void *Args);
|
||||
static void CrsCfg_Degree (bool PrintView,bool PutForm);
|
||||
static void CrsCfg_Degree (Vie_ViewType_t ViewType,bool PutForm);
|
||||
static void CrsCfg_FullName (bool PutForm);
|
||||
static void CrsCfg_ShrtName (bool PutForm);
|
||||
static void CrsCfg_Year (bool PutForm);
|
||||
static void CrsCfg_InstitutionalCode (bool PutForm);
|
||||
static void CrsCfg_InternalCode (void);
|
||||
static void CrsCfg_Shortcut (bool PrintView);
|
||||
static void CrsCfg_Shortcut (Vie_ViewType_t ViewType);
|
||||
static void CrsCfg_QR (void);
|
||||
static void CrsCfg_Indicators (void);
|
||||
|
||||
|
@ -74,7 +74,7 @@ static void CrsCfg_Indicators (void);
|
|||
/***************** Configuration of the current course ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void CrsCfg_Configuration (bool PrintView)
|
||||
void CrsCfg_Configuration (Vie_ViewType_t ViewType)
|
||||
{
|
||||
extern const char *Hlp_COURSE_Information;
|
||||
bool PutLink;
|
||||
|
@ -88,83 +88,86 @@ void CrsCfg_Configuration (bool PrintView)
|
|||
return;
|
||||
|
||||
/***** Initializations *****/
|
||||
PutLink = !PrintView && Gbl.Hierarchy.Node[Hie_DEG].WWW[0];
|
||||
PutFormDeg = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM;
|
||||
PutFormName = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM;
|
||||
PutLink = ViewType == Vie_VIEW && Gbl.Hierarchy.Node[Hie_DEG].WWW[0];
|
||||
PutFormDeg = ViewType == Vie_VIEW && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM;
|
||||
PutFormName = ViewType == Vie_VIEW && Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM;
|
||||
PutFormYear =
|
||||
PutFormInsCod = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_TCH;
|
||||
PutFormInsCod = ViewType == Vie_VIEW && Gbl.Usrs.Me.Role.Logged >= Rol_TCH;
|
||||
|
||||
/***** Contextual menu *****/
|
||||
if (!PrintView)
|
||||
if (Gbl.Usrs.Me.Role.Logged == Rol_GST ||
|
||||
Gbl.Usrs.Me.Role.Logged == Rol_USR)
|
||||
{
|
||||
Mnu_ContextMenuBegin ();
|
||||
Enr_PutLinkToRequestSignUp (); // Request enrolment in the current course
|
||||
Mnu_ContextMenuEnd ();
|
||||
}
|
||||
if (ViewType == Vie_VIEW &&
|
||||
(Gbl.Usrs.Me.Role.Logged == Rol_GST ||
|
||||
Gbl.Usrs.Me.Role.Logged == Rol_USR))
|
||||
{
|
||||
Mnu_ContextMenuBegin ();
|
||||
Enr_PutLinkToRequestSignUp (); // Request enrolment in the current course
|
||||
Mnu_ContextMenuEnd ();
|
||||
}
|
||||
|
||||
/***** Begin box *****/
|
||||
if (PrintView)
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
NULL,NULL,
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
else
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
CrsCfg_PutIconToPrint,NULL,
|
||||
Hlp_COURSE_Information,Box_NOT_CLOSABLE);
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
ViewType == Vie_VIEW ? CrsCfg_PutIconToPrint :
|
||||
NULL,NULL,
|
||||
ViewType == Vie_VIEW ? Hlp_COURSE_Information :
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Title *****/
|
||||
HieCfg_Title (PutLink,Hie_CRS);
|
||||
/***** Title *****/
|
||||
HieCfg_Title (PutLink,Hie_CRS);
|
||||
|
||||
/**************************** Left part ***********************************/
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_LEFT HIE_CFG_WIDTH\"");
|
||||
/**************************** Left part ***********************************/
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_LEFT HIE_CFG_WIDTH\"");
|
||||
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWidePadding (2);
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWidePadding (2);
|
||||
|
||||
/***** Degree *****/
|
||||
CrsCfg_Degree (PrintView,PutFormDeg);
|
||||
/***** Degree *****/
|
||||
CrsCfg_Degree (ViewType,PutFormDeg);
|
||||
|
||||
/***** Course name *****/
|
||||
CrsCfg_FullName (PutFormName);
|
||||
CrsCfg_ShrtName (PutFormName);
|
||||
/***** Course name *****/
|
||||
CrsCfg_FullName (PutFormName);
|
||||
CrsCfg_ShrtName (PutFormName);
|
||||
|
||||
/***** Course year *****/
|
||||
CrsCfg_Year (PutFormYear);
|
||||
/***** Course year *****/
|
||||
CrsCfg_Year (PutFormYear);
|
||||
|
||||
if (!PrintView)
|
||||
{
|
||||
/***** Institutional code of the course *****/
|
||||
CrsCfg_InstitutionalCode (PutFormInsCod);
|
||||
if (ViewType == Vie_VIEW)
|
||||
{
|
||||
/***** Institutional code of the course *****/
|
||||
CrsCfg_InstitutionalCode (PutFormInsCod);
|
||||
|
||||
/***** Internal code of the course *****/
|
||||
CrsCfg_InternalCode ();
|
||||
}
|
||||
/***** Internal code of the course *****/
|
||||
CrsCfg_InternalCode ();
|
||||
}
|
||||
|
||||
/***** Shortcut to the couse *****/
|
||||
CrsCfg_Shortcut (PrintView);
|
||||
/***** Shortcut to the couse *****/
|
||||
CrsCfg_Shortcut (ViewType);
|
||||
|
||||
if (PrintView)
|
||||
/***** QR code with link to the course *****/
|
||||
CrsCfg_QR ();
|
||||
else
|
||||
{
|
||||
/***** Number of users *****/
|
||||
HieCfg_NumUsrsInCrss (Hie_CRS,Gbl.Hierarchy.Node[Hie_CRS].HieCod,Rol_TCH);
|
||||
HieCfg_NumUsrsInCrss (Hie_CRS,Gbl.Hierarchy.Node[Hie_CRS].HieCod,Rol_NET);
|
||||
HieCfg_NumUsrsInCrss (Hie_CRS,Gbl.Hierarchy.Node[Hie_CRS].HieCod,Rol_STD);
|
||||
HieCfg_NumUsrsInCrss (Hie_CRS,Gbl.Hierarchy.Node[Hie_CRS].HieCod,Rol_UNK);
|
||||
switch (ViewType)
|
||||
{
|
||||
case Vie_VIEW:
|
||||
/***** Number of users *****/
|
||||
HieCfg_NumUsrsInCrss (Hie_CRS,Gbl.Hierarchy.Node[Hie_CRS].HieCod,Rol_TCH);
|
||||
HieCfg_NumUsrsInCrss (Hie_CRS,Gbl.Hierarchy.Node[Hie_CRS].HieCod,Rol_NET);
|
||||
HieCfg_NumUsrsInCrss (Hie_CRS,Gbl.Hierarchy.Node[Hie_CRS].HieCod,Rol_STD);
|
||||
HieCfg_NumUsrsInCrss (Hie_CRS,Gbl.Hierarchy.Node[Hie_CRS].HieCod,Rol_UNK);
|
||||
|
||||
/***** Indicators *****/
|
||||
CrsCfg_Indicators ();
|
||||
}
|
||||
/***** Indicators *****/
|
||||
CrsCfg_Indicators ();
|
||||
break;
|
||||
case Vie_PRINT:
|
||||
/***** QR code with link to the course *****/
|
||||
CrsCfg_QR ();
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
break;
|
||||
}
|
||||
|
||||
/***** End table *****/
|
||||
HTM_TABLE_End ();
|
||||
/***** End table *****/
|
||||
HTM_TABLE_End ();
|
||||
|
||||
/***** End of left part *****/
|
||||
HTM_DIV_End ();
|
||||
/***** End of left part *****/
|
||||
HTM_DIV_End ();
|
||||
|
||||
/***** End box *****/
|
||||
Box_BoxEnd ();
|
||||
|
@ -186,14 +189,14 @@ static void CrsCfg_PutIconToPrint (__attribute__((unused)) void *Args)
|
|||
|
||||
void CrsCfg_PrintConfiguration (void)
|
||||
{
|
||||
CrsCfg_Configuration (true);
|
||||
CrsCfg_Configuration (Vie_PRINT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Show degree in course configuration ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CrsCfg_Degree (bool PrintView,bool PutForm)
|
||||
static void CrsCfg_Degree (Vie_ViewType_t ViewType,bool PutForm)
|
||||
{
|
||||
extern const char *Par_CodeStr[];
|
||||
extern const char *Txt_Degree;
|
||||
|
@ -240,7 +243,7 @@ static void CrsCfg_Degree (bool PrintView,bool PutForm)
|
|||
}
|
||||
else // I can not move course to another degree
|
||||
{
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
{
|
||||
Frm_BeginFormGoTo (ActSeeDegInf);
|
||||
ParCod_PutPar (ParCod_Deg,Gbl.Hierarchy.Node[Hie_DEG].HieCod);
|
||||
|
@ -254,7 +257,7 @@ static void CrsCfg_Degree (bool PrintView,bool PutForm)
|
|||
20,"LM");
|
||||
HTM_NBSP ();
|
||||
HTM_Txt (Gbl.Hierarchy.Node[Hie_DEG].FullName);
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
{
|
||||
HTM_BUTTON_End ();
|
||||
Frm_EndForm ();
|
||||
|
@ -393,9 +396,9 @@ static void CrsCfg_InternalCode (void)
|
|||
/*************** Show course shortcut in course configuration ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CrsCfg_Shortcut (bool PrintView)
|
||||
static void CrsCfg_Shortcut (Vie_ViewType_t ViewType)
|
||||
{
|
||||
HieCfg_Shortcut (PrintView,ParCod_Crs,Gbl.Hierarchy.Node[Hie_CRS].HieCod);
|
||||
HieCfg_Shortcut (ViewType,ParCod_Crs,Gbl.Hierarchy.Node[Hie_CRS].HieCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
/***************************** Public prototypes *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void CrsCfg_Configuration (bool PrintView);
|
||||
void CrsCfg_Configuration (Vie_ViewType_t ViewType);
|
||||
void CrsCfg_PrintConfiguration (void);
|
||||
|
||||
void CrsCfg_ChangeCrsDeg (void);
|
||||
|
|
|
@ -57,13 +57,13 @@ extern struct Globals Gbl;
|
|||
/**************************** Private prototypes *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void DegCfg_Configuration (bool PrintView);
|
||||
static void DegCfg_Configuration (Vie_ViewType_t ViewType);
|
||||
static void DegCfg_PutIconsToPrintAndUpload (__attribute__((unused)) void *Args);
|
||||
static void DegCfg_Center (bool PrintView,bool PutForm);
|
||||
static void DegCfg_Center (Vie_ViewType_t ViewType,bool PutForm);
|
||||
static void DegCfg_FullName (bool PutForm);
|
||||
static void DegCfg_ShrtName (bool PutForm);
|
||||
static void DegCfg_WWW (bool PrintView,bool PutForm);
|
||||
static void DegCfg_Shortcut (bool PrintView);
|
||||
static void DegCfg_WWW (Vie_ViewType_t ViewType,bool PutForm);
|
||||
static void DegCfg_Shortcut (Vie_ViewType_t ViewType);
|
||||
static void DegCfg_QR (void);
|
||||
static void DegCfg_NumCrss (void);
|
||||
|
||||
|
@ -73,7 +73,7 @@ static void DegCfg_NumCrss (void);
|
|||
|
||||
void DegCfg_ShowConfiguration (void)
|
||||
{
|
||||
DegCfg_Configuration (false);
|
||||
DegCfg_Configuration (Vie_VIEW);
|
||||
|
||||
/***** Show help to enrol me *****/
|
||||
Hlp_ShowHelpWhatWouldYouLikeToDo ();
|
||||
|
@ -85,14 +85,14 @@ void DegCfg_ShowConfiguration (void)
|
|||
|
||||
void DegCfg_PrintConfiguration (void)
|
||||
{
|
||||
DegCfg_Configuration (true);
|
||||
DegCfg_Configuration (Vie_PRINT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************* Information of the current degree ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void DegCfg_Configuration (bool PrintView)
|
||||
static void DegCfg_Configuration (Vie_ViewType_t ViewType)
|
||||
{
|
||||
extern const char *Hlp_DEGREE_Information;
|
||||
bool PutLink;
|
||||
|
@ -105,23 +105,20 @@ static void DegCfg_Configuration (bool PrintView)
|
|||
return;
|
||||
|
||||
/***** Initializations *****/
|
||||
PutLink = !PrintView && Gbl.Hierarchy.Node[Hie_DEG].WWW[0];
|
||||
PutFormCtr = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM;
|
||||
PutFormName = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM;
|
||||
PutFormWWW = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM;
|
||||
PutLink = ViewType == Vie_VIEW && Gbl.Hierarchy.Node[Hie_DEG].WWW[0];
|
||||
PutFormCtr = ViewType == Vie_VIEW && Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM;
|
||||
PutFormName = ViewType == Vie_VIEW && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM;
|
||||
PutFormWWW = ViewType == Vie_VIEW && Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM;
|
||||
|
||||
/***** Begin box *****/
|
||||
if (PrintView)
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
NULL,NULL,
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
else
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
DegCfg_PutIconsToPrintAndUpload,NULL,
|
||||
Hlp_DEGREE_Information,Box_NOT_CLOSABLE);
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
ViewType == Vie_VIEW ? DegCfg_PutIconsToPrintAndUpload :
|
||||
NULL,NULL,
|
||||
ViewType == Vie_VIEW ? Hlp_DEGREE_Information :
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Title *****/
|
||||
HieCfg_Title (PutLink,Hie_DEG);
|
||||
/***** Title *****/
|
||||
HieCfg_Title (PutLink,Hie_DEG);
|
||||
|
||||
/**************************** Left part ***********************************/
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_LEFT HIE_CFG_WIDTH\"");
|
||||
|
@ -130,31 +127,36 @@ static void DegCfg_Configuration (bool PrintView)
|
|||
HTM_TABLE_BeginWidePadding (2);
|
||||
|
||||
/***** Center *****/
|
||||
DegCfg_Center (PrintView,PutFormCtr);
|
||||
DegCfg_Center (ViewType,PutFormCtr);
|
||||
|
||||
/***** Degree name *****/
|
||||
DegCfg_FullName (PutFormName);
|
||||
DegCfg_ShrtName (PutFormName);
|
||||
|
||||
/***** Degree WWW *****/
|
||||
DegCfg_WWW (PrintView,PutFormWWW);
|
||||
DegCfg_WWW (ViewType,PutFormWWW);
|
||||
|
||||
/***** Shortcut to the degree *****/
|
||||
DegCfg_Shortcut (PrintView);
|
||||
DegCfg_Shortcut (ViewType);
|
||||
|
||||
if (PrintView)
|
||||
/***** QR code with link to the degree *****/
|
||||
DegCfg_QR ();
|
||||
else
|
||||
switch (ViewType)
|
||||
{
|
||||
/***** Number of courses *****/
|
||||
DegCfg_NumCrss ();
|
||||
case Vie_VIEW:
|
||||
/***** Number of courses *****/
|
||||
DegCfg_NumCrss ();
|
||||
|
||||
/***** Number of users *****/
|
||||
HieCfg_NumUsrsInCrss (Hie_DEG,Gbl.Hierarchy.Node[Hie_DEG].HieCod,Rol_TCH);
|
||||
HieCfg_NumUsrsInCrss (Hie_DEG,Gbl.Hierarchy.Node[Hie_DEG].HieCod,Rol_NET);
|
||||
HieCfg_NumUsrsInCrss (Hie_DEG,Gbl.Hierarchy.Node[Hie_DEG].HieCod,Rol_STD);
|
||||
HieCfg_NumUsrsInCrss (Hie_DEG,Gbl.Hierarchy.Node[Hie_DEG].HieCod,Rol_UNK);
|
||||
/***** Number of users *****/
|
||||
HieCfg_NumUsrsInCrss (Hie_DEG,Gbl.Hierarchy.Node[Hie_DEG].HieCod,Rol_TCH);
|
||||
HieCfg_NumUsrsInCrss (Hie_DEG,Gbl.Hierarchy.Node[Hie_DEG].HieCod,Rol_NET);
|
||||
HieCfg_NumUsrsInCrss (Hie_DEG,Gbl.Hierarchy.Node[Hie_DEG].HieCod,Rol_STD);
|
||||
HieCfg_NumUsrsInCrss (Hie_DEG,Gbl.Hierarchy.Node[Hie_DEG].HieCod,Rol_UNK);
|
||||
break;
|
||||
case Vie_PRINT:
|
||||
/***** QR code with link to the degree *****/
|
||||
DegCfg_QR ();
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
}
|
||||
|
||||
/***** End table *****/
|
||||
|
@ -188,7 +190,7 @@ static void DegCfg_PutIconsToPrintAndUpload (__attribute__((unused)) void *Args)
|
|||
/******************** Show center in degree configuration ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void DegCfg_Center (bool PrintView,bool PutForm)
|
||||
static void DegCfg_Center (Vie_ViewType_t ViewType,bool PutForm)
|
||||
{
|
||||
extern const char *Par_CodeStr[];
|
||||
extern const char *Txt_Center;
|
||||
|
@ -235,7 +237,7 @@ static void DegCfg_Center (bool PrintView,bool PutForm)
|
|||
}
|
||||
else // I can not move degree to another center
|
||||
{
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
{
|
||||
Frm_BeginFormGoTo (ActSeeCtrInf);
|
||||
ParCod_PutPar (ParCod_Ctr,Gbl.Hierarchy.Node[Hie_CTR].HieCod);
|
||||
|
@ -249,7 +251,7 @@ static void DegCfg_Center (bool PrintView,bool PutForm)
|
|||
20,"LM");
|
||||
HTM_NBSP ();
|
||||
HTM_Txt (Gbl.Hierarchy.Node[Hie_CTR].FullName);
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
{
|
||||
HTM_BUTTON_End ();
|
||||
Frm_EndForm ();
|
||||
|
@ -282,18 +284,18 @@ static void DegCfg_ShrtName (bool PutForm)
|
|||
/***************** Show degree WWW in degree configuration *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void DegCfg_WWW (bool PrintView,bool PutForm)
|
||||
static void DegCfg_WWW (Vie_ViewType_t ViewType,bool PutForm)
|
||||
{
|
||||
HieCfg_WWW (PrintView,PutForm,ActChgDegWWWCfg,Gbl.Hierarchy.Node[Hie_DEG].WWW);
|
||||
HieCfg_WWW (ViewType,PutForm,ActChgDegWWWCfg,Gbl.Hierarchy.Node[Hie_DEG].WWW);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*************** Show degree shortcut in degree configuration ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void DegCfg_Shortcut (bool PrintView)
|
||||
static void DegCfg_Shortcut (Vie_ViewType_t ViewType)
|
||||
{
|
||||
HieCfg_Shortcut (PrintView,ParCod_Deg,Gbl.Hierarchy.Node[Hie_DEG].HieCod);
|
||||
HieCfg_Shortcut (ViewType,ParCod_Deg,Gbl.Hierarchy.Node[Hie_DEG].HieCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -581,7 +581,7 @@ static void ExaPrn_ShowExamPrintToFillIt (struct Exa_Exams *Exams,
|
|||
|
||||
/***** Heading *****/
|
||||
/* Institution, degree and course */
|
||||
Lay_WriteHeaderClassPhoto (false,false);
|
||||
Lay_WriteHeaderClassPhoto (Vie_VIEW,false);
|
||||
|
||||
/***** Show user and time *****/
|
||||
HTM_TABLE_BeginWideMarginPadding (10);
|
||||
|
|
|
@ -1348,7 +1348,7 @@ static void ExaRes_ShowExamResult (const struct Exa_Exam *Exam,
|
|||
Hlp_ASSESSMENT_Exams_results,Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Header *****/
|
||||
Lay_WriteHeaderClassPhoto (false,false);
|
||||
Lay_WriteHeaderClassPhoto (Vie_VIEW,false);
|
||||
|
||||
/***** Check user data *****/
|
||||
/* Get data of the user who answered the exam print */
|
||||
|
|
|
@ -147,7 +147,7 @@ void HieCfg_Name (bool PutForm,Hie_Level_t Level,Nam_ShrtOrFullName_t ShrtOrFull
|
|||
/************************* Show web in configuration *************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void HieCfg_WWW (bool PrintView,bool PutForm,Act_Action_t NextAction,
|
||||
void HieCfg_WWW (Vie_ViewType_t ViewType,bool PutForm,Act_Action_t NextAction,
|
||||
const char WWW[Cns_MAX_BYTES_WWW + 1])
|
||||
{
|
||||
extern const char *Txt_Web;
|
||||
|
@ -175,12 +175,12 @@ void HieCfg_WWW (bool PrintView,bool PutForm,Act_Action_t NextAction,
|
|||
else // I can not change web
|
||||
{
|
||||
HTM_DIV_Begin ("class=\"EXTERNAL_WWW_FULL\"");
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\""
|
||||
" class=\"DAT_%s\"",
|
||||
WWW,The_GetSuffix ());
|
||||
HTM_Txt (WWW);
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
HTM_A_End ();
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ void HieCfg_WWW (bool PrintView,bool PutForm,Act_Action_t NextAction,
|
|||
/********************** Show shortcut in configuration ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void HieCfg_Shortcut (bool PrintView,ParCod_Param_t ParCode,long HieCod)
|
||||
void HieCfg_Shortcut (Vie_ViewType_t ViewType,ParCod_Param_t ParCode,long HieCod)
|
||||
{
|
||||
extern const char *Par_CodeStr[];
|
||||
extern const char *Txt_Shortcut;
|
||||
|
@ -206,7 +206,7 @@ void HieCfg_Shortcut (bool PrintView,ParCod_Param_t ParCode,long HieCod)
|
|||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LB DAT_%s\"",The_GetSuffix ());
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
{
|
||||
if (ParCode == ParCod_None)
|
||||
HTM_A_Begin ("href=\"%s/\" target=\"_blank\" class=\"DAT_%s\"",
|
||||
|
@ -226,7 +226,7 @@ void HieCfg_Shortcut (bool PrintView,ParCod_Param_t ParCode,long HieCod)
|
|||
HTM_TxtF ("%s/?%s=%ld",
|
||||
Cfg_URL_SWAD_CGI,
|
||||
Par_CodeStr[ParCode],HieCod);
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
HTM_A_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
|
|
|
@ -35,9 +35,9 @@
|
|||
|
||||
void HieCfg_Title (bool PutLink,Hie_Level_t LogoScope);
|
||||
void HieCfg_Name (bool PutForm,Hie_Level_t Level,Nam_ShrtOrFullName_t ShrtOrFull);
|
||||
void HieCfg_WWW (bool PrintView,bool PutForm,Act_Action_t NextAction,
|
||||
void HieCfg_WWW (Vie_ViewType_t ViewType,bool PutForm,Act_Action_t NextAction,
|
||||
const char WWW[Cns_MAX_BYTES_WWW + 1]);
|
||||
void HieCfg_Shortcut (bool PrintView,ParCod_Param_t ParCode,long HieCod);
|
||||
void HieCfg_Shortcut (Vie_ViewType_t ViewType,ParCod_Param_t ParCode,long HieCod);
|
||||
void HieCfg_NumCtrs (unsigned NumCtrs,bool PutForm);
|
||||
void HieCfg_NumCtrsWithMap (unsigned NumCtrs,unsigned NumCtrsWithMap);
|
||||
void HieCfg_QR (ParCod_Param_t ParCode,long HieCod);
|
||||
|
|
|
@ -1441,7 +1441,7 @@ static bool Inf_CheckAndShowPlainTxt (void)
|
|||
|
||||
if (Gbl.Crs.Info.Type == Inf_INTRODUCTION ||
|
||||
Gbl.Crs.Info.Type == Inf_TEACHING_GUIDE)
|
||||
Lay_WriteHeaderClassPhoto (false,false);
|
||||
Lay_WriteHeaderClassPhoto (Vie_VIEW,false);
|
||||
|
||||
HTM_DIV_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ());
|
||||
|
||||
|
@ -1531,7 +1531,7 @@ static bool Inf_CheckAndShowRichTxt (void)
|
|||
|
||||
if (Gbl.Crs.Info.Type == Inf_INTRODUCTION ||
|
||||
Gbl.Crs.Info.Type == Inf_TEACHING_GUIDE)
|
||||
Lay_WriteHeaderClassPhoto (false,false);
|
||||
Lay_WriteHeaderClassPhoto (Vie_VIEW,false);
|
||||
|
||||
HTM_DIV_Begin ("id=\"crs_info\" class=\"LM CRS_INFO_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
@ -1664,7 +1664,7 @@ void Inf_EditPlainTxtInfo (void)
|
|||
|
||||
if (Gbl.Crs.Info.Type == Inf_INTRODUCTION ||
|
||||
Gbl.Crs.Info.Type == Inf_TEACHING_GUIDE)
|
||||
Lay_WriteHeaderClassPhoto (false,false);
|
||||
Lay_WriteHeaderClassPhoto (Vie_VIEW,false);
|
||||
|
||||
/***** Get info text from database *****/
|
||||
Inf_GetInfoTxtFromDB (Gbl.Hierarchy.Node[Hie_CRS].HieCod,Gbl.Crs.Info.Type,
|
||||
|
@ -1732,7 +1732,7 @@ void Inf_EditRichTxtInfo (void)
|
|||
|
||||
if (Gbl.Crs.Info.Type == Inf_INTRODUCTION ||
|
||||
Gbl.Crs.Info.Type == Inf_TEACHING_GUIDE)
|
||||
Lay_WriteHeaderClassPhoto (false,false);
|
||||
Lay_WriteHeaderClassPhoto (Vie_VIEW,false);
|
||||
|
||||
/***** Get info text from database *****/
|
||||
Inf_GetInfoTxtFromDB (Gbl.Hierarchy.Node[Hie_CRS].HieCod,Gbl.Crs.Info.Type,
|
||||
|
|
|
@ -62,14 +62,14 @@ extern struct Globals Gbl;
|
|||
/***************************** Private prototypes ****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void InsCfg_Configuration (bool PrintView);
|
||||
static void InsCfg_Configuration (Vie_ViewType_t ViewType);
|
||||
static void InsCfg_PutIconsToPrintAndUpload (__attribute__((unused)) void *Args);
|
||||
static void InsCfg_Map (void);
|
||||
static void InsCfg_Country (bool PrintView,bool PutForm);
|
||||
static void InsCfg_Country (Vie_ViewType_t ViewType,bool PutForm);
|
||||
static void InsCfg_FullName (bool PutForm);
|
||||
static void InsCfg_ShrtName (bool PutForm);
|
||||
static void InsCfg_WWW (bool PrintView,bool PutForm);
|
||||
static void InsCfg_Shortcut (bool PrintView);
|
||||
static void InsCfg_WWW (Vie_ViewType_t ViewType,bool PutForm);
|
||||
static void InsCfg_Shortcut (Vie_ViewType_t ViewType);
|
||||
static void InsCfg_QR (void);
|
||||
static void InsCfg_NumUsrs (void);
|
||||
static void InsCfg_NumDegs (void);
|
||||
|
@ -82,7 +82,7 @@ static void InsCfg_NumDpts (void);
|
|||
|
||||
void InsCfg_ShowConfiguration (void)
|
||||
{
|
||||
InsCfg_Configuration (false);
|
||||
InsCfg_Configuration (Vie_VIEW);
|
||||
|
||||
/***** Show help to enrol me *****/
|
||||
Hlp_ShowHelpWhatWouldYouLikeToDo ();
|
||||
|
@ -94,14 +94,14 @@ void InsCfg_ShowConfiguration (void)
|
|||
|
||||
void InsCfg_PrintConfiguration (void)
|
||||
{
|
||||
InsCfg_Configuration (true);
|
||||
InsCfg_Configuration (Vie_PRINT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Information of the current institution ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void InsCfg_Configuration (bool PrintView)
|
||||
static void InsCfg_Configuration (Vie_ViewType_t ViewType)
|
||||
{
|
||||
extern const char *Hlp_INSTITUTION_Information;
|
||||
bool PutLink;
|
||||
|
@ -116,90 +116,93 @@ static void InsCfg_Configuration (bool PrintView)
|
|||
return;
|
||||
|
||||
/***** Initializations *****/
|
||||
PutLink = !PrintView && Gbl.Hierarchy.Node[Hie_INS].WWW[0];
|
||||
PutLink = ViewType == Vie_VIEW && Gbl.Hierarchy.Node[Hie_INS].WWW[0];
|
||||
PutFormCty =
|
||||
PutFormName = !PrintView && Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM;
|
||||
PutFormWWW = !PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM;
|
||||
PutFormName = ViewType == Vie_VIEW && Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM;
|
||||
PutFormWWW = ViewType == Vie_VIEW && Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM;
|
||||
|
||||
/***** Begin box *****/
|
||||
if (PrintView)
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
NULL,NULL,
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
else
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
InsCfg_PutIconsToPrintAndUpload,NULL,
|
||||
Hlp_INSTITUTION_Information,Box_NOT_CLOSABLE);
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
ViewType == Vie_VIEW ? InsCfg_PutIconsToPrintAndUpload :
|
||||
NULL,NULL,
|
||||
ViewType == Vie_VIEW ? Hlp_INSTITUTION_Information :
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Title *****/
|
||||
HieCfg_Title (PutLink,Hie_INS);
|
||||
|
||||
/***** Title *****/
|
||||
HieCfg_Title (PutLink,Hie_INS);
|
||||
/**************************** Left part ***********************************/
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_LEFT HIE_CFG_WIDTH\"");
|
||||
|
||||
/**************************** Left part ***********************************/
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_LEFT HIE_CFG_WIDTH\"");
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWidePadding (2);
|
||||
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWidePadding (2);
|
||||
/***** Country *****/
|
||||
InsCfg_Country (ViewType,PutFormCty);
|
||||
|
||||
/***** Country *****/
|
||||
InsCfg_Country (PrintView,PutFormCty);
|
||||
/***** Institution name *****/
|
||||
InsCfg_FullName (PutFormName);
|
||||
InsCfg_ShrtName (PutFormName);
|
||||
|
||||
/***** Institution name *****/
|
||||
InsCfg_FullName (PutFormName);
|
||||
InsCfg_ShrtName (PutFormName);
|
||||
/***** Institution WWW *****/
|
||||
InsCfg_WWW (ViewType,PutFormWWW);
|
||||
|
||||
/***** Institution WWW *****/
|
||||
InsCfg_WWW (PrintView,PutFormWWW);
|
||||
/***** Shortcut to the institution *****/
|
||||
InsCfg_Shortcut (ViewType);
|
||||
|
||||
/***** Shortcut to the institution *****/
|
||||
InsCfg_Shortcut (PrintView);
|
||||
NumCtrsWithMap = Ctr_GetCachedNumCtrsWithMapInIns (Gbl.Hierarchy.Node[Hie_INS].HieCod);
|
||||
|
||||
NumCtrsWithMap = Ctr_GetCachedNumCtrsWithMapInIns (Gbl.Hierarchy.Node[Hie_INS].HieCod);
|
||||
if (PrintView)
|
||||
/***** QR code with link to the institution *****/
|
||||
InsCfg_QR ();
|
||||
else
|
||||
{
|
||||
NumCtrs = Hie_GetCachedNumNodesInHieLvl (Hie_CTR, // Number of centers...
|
||||
Hie_INS, // ...in institution
|
||||
Gbl.Hierarchy.Node[Hie_INS].HieCod);
|
||||
switch (ViewType)
|
||||
{
|
||||
case Vie_VIEW:
|
||||
NumCtrs = Hie_GetCachedNumNodesInHieLvl (Hie_CTR, // Number of centers...
|
||||
Hie_INS, // ...in institution
|
||||
Gbl.Hierarchy.Node[Hie_INS].HieCod);
|
||||
|
||||
/***** Number of users who claim to belong to this institution,
|
||||
number of centers,
|
||||
number of degrees,
|
||||
number of courses,
|
||||
number of departments *****/
|
||||
InsCfg_NumUsrs ();
|
||||
HieCfg_NumCtrs (NumCtrs,
|
||||
true); // Put form
|
||||
HieCfg_NumCtrsWithMap (NumCtrs,NumCtrsWithMap);
|
||||
InsCfg_NumDegs ();
|
||||
InsCfg_NumCrss ();
|
||||
InsCfg_NumDpts ();
|
||||
/***** Number of users who claim to belong to this institution,
|
||||
number of centers,
|
||||
number of degrees,
|
||||
number of courses,
|
||||
number of departments *****/
|
||||
InsCfg_NumUsrs ();
|
||||
HieCfg_NumCtrs (NumCtrs,
|
||||
true); // Put form
|
||||
HieCfg_NumCtrsWithMap (NumCtrs,NumCtrsWithMap);
|
||||
InsCfg_NumDegs ();
|
||||
InsCfg_NumCrss ();
|
||||
InsCfg_NumDpts ();
|
||||
|
||||
/***** Number of users in courses of this institution *****/
|
||||
HieCfg_NumUsrsInCrss (Hie_INS,Gbl.Hierarchy.Node[Hie_INS].HieCod,Rol_TCH);
|
||||
HieCfg_NumUsrsInCrss (Hie_INS,Gbl.Hierarchy.Node[Hie_INS].HieCod,Rol_NET);
|
||||
HieCfg_NumUsrsInCrss (Hie_INS,Gbl.Hierarchy.Node[Hie_INS].HieCod,Rol_STD);
|
||||
HieCfg_NumUsrsInCrss (Hie_INS,Gbl.Hierarchy.Node[Hie_INS].HieCod,Rol_UNK);
|
||||
}
|
||||
/***** Number of users in courses of this institution *****/
|
||||
HieCfg_NumUsrsInCrss (Hie_INS,Gbl.Hierarchy.Node[Hie_INS].HieCod,Rol_TCH);
|
||||
HieCfg_NumUsrsInCrss (Hie_INS,Gbl.Hierarchy.Node[Hie_INS].HieCod,Rol_NET);
|
||||
HieCfg_NumUsrsInCrss (Hie_INS,Gbl.Hierarchy.Node[Hie_INS].HieCod,Rol_STD);
|
||||
HieCfg_NumUsrsInCrss (Hie_INS,Gbl.Hierarchy.Node[Hie_INS].HieCod,Rol_UNK);
|
||||
break;
|
||||
case Vie_PRINT:
|
||||
/***** QR code with link to the institution *****/
|
||||
InsCfg_QR ();
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
break;
|
||||
}
|
||||
|
||||
/***** End table *****/
|
||||
HTM_TABLE_End ();
|
||||
|
||||
/***** End of left part *****/
|
||||
HTM_DIV_End ();
|
||||
|
||||
/**************************** Right part **********************************/
|
||||
if (NumCtrsWithMap)
|
||||
{
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_RIGHT HIE_CFG_WIDTH\"");
|
||||
|
||||
/***** Institution map *****/
|
||||
InsCfg_Map ();
|
||||
/***** End table *****/
|
||||
HTM_TABLE_End ();
|
||||
|
||||
/***** End of left part *****/
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
||||
/**************************** Right part **********************************/
|
||||
if (NumCtrsWithMap)
|
||||
{
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_RIGHT HIE_CFG_WIDTH\"");
|
||||
|
||||
/***** Institution map *****/
|
||||
InsCfg_Map ();
|
||||
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
||||
/***** End box *****/
|
||||
Box_BoxEnd ();
|
||||
|
@ -294,7 +297,7 @@ static void InsCfg_Map (void)
|
|||
/***************** Show country in institution configuration *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void InsCfg_Country (bool PrintView,bool PutForm)
|
||||
static void InsCfg_Country (Vie_ViewType_t ViewType,bool PutForm)
|
||||
{
|
||||
extern const char *Par_CodeStr[];
|
||||
extern const char *Txt_Country;
|
||||
|
@ -338,7 +341,7 @@ static void InsCfg_Country (bool PrintView,bool PutForm)
|
|||
}
|
||||
else // I can not move institution to another country
|
||||
{
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
{
|
||||
Frm_BeginFormGoTo (ActSeeCtyInf);
|
||||
ParCod_PutPar (ParCod_Cty,Gbl.Hierarchy.Node[Hie_CTY].HieCod);
|
||||
|
@ -349,7 +352,7 @@ static void InsCfg_Country (bool PrintView,bool PutForm)
|
|||
Cty_DrawCountryMap (&Gbl.Hierarchy.Node[Hie_CTY],"COUNTRY_MAP_TINY");
|
||||
HTM_NBSP ();
|
||||
HTM_Txt (Gbl.Hierarchy.Node[Hie_CTY].FullName);
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
{
|
||||
HTM_BUTTON_End ();
|
||||
Frm_EndForm ();
|
||||
|
@ -384,18 +387,18 @@ static void InsCfg_ShrtName (bool PutForm)
|
|||
/************ Show institution WWW in institution configuration **************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void InsCfg_WWW (bool PrintView,bool PutForm)
|
||||
static void InsCfg_WWW (Vie_ViewType_t ViewType,bool PutForm)
|
||||
{
|
||||
HieCfg_WWW (PrintView,PutForm,ActChgInsWWWCfg,Gbl.Hierarchy.Node[Hie_INS].WWW);
|
||||
HieCfg_WWW (ViewType,PutForm,ActChgInsWWWCfg,Gbl.Hierarchy.Node[Hie_INS].WWW);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********** Show institution shortcut in institution configuration ***********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void InsCfg_Shortcut (bool PrintView)
|
||||
static void InsCfg_Shortcut (Vie_ViewType_t ViewType)
|
||||
{
|
||||
HieCfg_Shortcut (PrintView,ParCod_Ins,Gbl.Hierarchy.Node[Hie_INS].HieCod);
|
||||
HieCfg_Shortcut (ViewType,ParCod_Ins,Gbl.Hierarchy.Node[Hie_INS].HieCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -1462,7 +1462,7 @@ static void Lay_WriteFootFromHTMLFile (void)
|
|||
/****** Write header and footer of the class photo or academic calendar ******/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto)
|
||||
void Lay_WriteHeaderClassPhoto (Vie_ViewType_t ViewType,bool DrawingClassPhoto)
|
||||
{
|
||||
struct Hie_Node Hie[Hie_NUM_LEVELS];
|
||||
|
||||
|
@ -1492,13 +1492,13 @@ void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto)
|
|||
HTM_TD_Begin ("class=\"LT\" style=\"width:60px;\"");
|
||||
if (Hie[Hie_INS].HieCod > 0)
|
||||
{
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\"",Hie[Hie_INS].WWW);
|
||||
Lgo_DrawLogo (Hie_INS,
|
||||
Hie[Hie_INS].HieCod,
|
||||
Hie[Hie_INS].ShrtName,
|
||||
40,NULL);
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
HTM_A_End ();
|
||||
}
|
||||
HTM_TD_End ();
|
||||
|
@ -1508,24 +1508,24 @@ void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto)
|
|||
The_GetSuffix ());
|
||||
if (Hie[Hie_INS].HieCod > 0)
|
||||
{
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\""
|
||||
" class=\"CLASSPHOTO_TITLE CLASSPHOTO_%s\"",
|
||||
Hie[Hie_INS].WWW,The_GetSuffix ());
|
||||
HTM_Txt (Hie[Hie_INS].FullName);
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
HTM_A_End ();
|
||||
}
|
||||
if (Hie[Hie_DEG].HieCod > 0)
|
||||
{
|
||||
if (Hie[Hie_INS].HieCod > 0)
|
||||
HTM_Txt (" - ");
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\""
|
||||
" class=\"CLASSPHOTO_TITLE CLASSPHOTO_%s\"",
|
||||
Hie[Hie_DEG].WWW,The_GetSuffix ());
|
||||
HTM_Txt (Hie[Hie_DEG].FullName);
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
HTM_A_End ();
|
||||
}
|
||||
HTM_BR ();
|
||||
|
@ -1544,7 +1544,7 @@ void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto)
|
|||
HTM_TD_Begin ("class=\"RT\" style=\"width:60px;\"");
|
||||
if (Hie[Hie_DEG].HieCod > 0)
|
||||
{
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\""
|
||||
" class=\"CLASSPHOTO_TITLE CLASSPHOTO_%s\"",
|
||||
Hie[Hie_DEG].WWW,The_GetSuffix ());
|
||||
|
@ -1552,7 +1552,7 @@ void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto)
|
|||
Hie[Hie_DEG].HieCod,
|
||||
Hie[Hie_DEG].ShrtName,
|
||||
40,NULL);
|
||||
if (!PrintView)
|
||||
if (ViewType == Vie_VIEW)
|
||||
HTM_A_End ();
|
||||
}
|
||||
HTM_TD_End ();
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "swad_action.h"
|
||||
#include "swad_icon.h"
|
||||
#include "swad_view_edit.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************************** Public constants *****************************/
|
||||
|
@ -67,7 +68,7 @@ void Lay_WriteAboutZone (void);
|
|||
void Lay_RefreshNotifsAndConnected (void);
|
||||
void Lay_RefreshLastClicks (void);
|
||||
|
||||
void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto);
|
||||
void Lay_WriteHeaderClassPhoto (Vie_ViewType_t ViewType,bool DrawingClassPhoto);
|
||||
|
||||
void Lay_AdvertisementMobile (void);
|
||||
|
||||
|
|
|
@ -1097,7 +1097,7 @@ void MchRes_ShowOneMchResult (void)
|
|||
Box_BoxBegin (NULL,Match.Title,
|
||||
NULL,NULL,
|
||||
Hlp_ASSESSMENT_Games_results,Box_NOT_CLOSABLE);
|
||||
Lay_WriteHeaderClassPhoto (false,false);
|
||||
Lay_WriteHeaderClassPhoto (Vie_VIEW,false);
|
||||
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWideMarginPadding (10);
|
||||
|
|
|
@ -130,7 +130,7 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
|||
long SelectedRscCod);
|
||||
static void Prg_PutIconToContractOrExpandItem (struct Prg_Item *Item,
|
||||
ConExp_ContractedOrExpanded_t ContractedOrExpanded,
|
||||
VieEdi_ViewOrEdit_t ViewingOrEditing);
|
||||
Vie_ViewType_t ViewType);
|
||||
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);
|
||||
|
@ -473,20 +473,20 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
|||
{
|
||||
extern const char *HidVis_PrgClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||
static unsigned UniqueId = 0;
|
||||
static VieEdi_ViewOrEdit_t ViewingOrEditingProgram[Prg_NUM_LISTING_TYPES] =
|
||||
static Vie_ViewType_t ViewingOrEditingProgram[Prg_NUM_LISTING_TYPES] =
|
||||
{
|
||||
[Prg_PRINT ] = VieEdi_VIEW,
|
||||
[Prg_VIEW ] = VieEdi_VIEW,
|
||||
[Prg_EDIT_ITEMS ] = VieEdi_EDIT,
|
||||
[Prg_FORM_NEW_END_ITEM ] = VieEdi_EDIT,
|
||||
[Prg_FORM_NEW_CHILD_ITEM ] = VieEdi_EDIT,
|
||||
[Prg_FORM_EDIT_ITEM ] = VieEdi_EDIT,
|
||||
[Prg_END_EDIT_ITEM ] = VieEdi_EDIT,
|
||||
[Prg_RECEIVE_ITEM ] = VieEdi_EDIT,
|
||||
[Prg_EDIT_RESOURCES ] = VieEdi_EDIT,
|
||||
[Prg_EDIT_RESOURCE_LINK ] = VieEdi_EDIT,
|
||||
[Prg_CHANGE_RESOURCE_LINK] = VieEdi_EDIT,
|
||||
[Prg_END_EDIT_RES ] = VieEdi_EDIT,
|
||||
[Prg_PRINT ] = Vie_VIEW,
|
||||
[Prg_VIEW ] = Vie_VIEW,
|
||||
[Prg_EDIT_ITEMS ] = Vie_EDIT,
|
||||
[Prg_FORM_NEW_END_ITEM ] = Vie_EDIT,
|
||||
[Prg_FORM_NEW_CHILD_ITEM ] = Vie_EDIT,
|
||||
[Prg_FORM_EDIT_ITEM ] = Vie_EDIT,
|
||||
[Prg_END_EDIT_ITEM ] = Vie_EDIT,
|
||||
[Prg_RECEIVE_ITEM ] = Vie_EDIT,
|
||||
[Prg_EDIT_RESOURCES ] = Vie_EDIT,
|
||||
[Prg_EDIT_RESOURCE_LINK ] = Vie_EDIT,
|
||||
[Prg_CHANGE_RESOURCE_LINK] = Vie_EDIT,
|
||||
[Prg_END_EDIT_RES ] = Vie_EDIT,
|
||||
};
|
||||
static const char *RowSpan[ConExp_NUM_CONTRACTED_EXPANDED] =
|
||||
{
|
||||
|
@ -513,7 +513,7 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
|||
break;
|
||||
}
|
||||
|
||||
if (ViewingOrEditingProgram[ListingType] == VieEdi_EDIT ||
|
||||
if (ViewingOrEditingProgram[ListingType] == Vie_EDIT ||
|
||||
HiddenOrVisible == HidVis_VISIBLE)
|
||||
{
|
||||
/***** Increase number in level *****/
|
||||
|
@ -548,7 +548,7 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
|||
HTM_TD_End ();
|
||||
|
||||
/* Forms to remove/edit this program item */
|
||||
if (ViewingOrEditingProgram[ListingType] == VieEdi_EDIT)
|
||||
if (ViewingOrEditingProgram[ListingType] == Vie_EDIT)
|
||||
{
|
||||
HTM_TD_Begin ("class=\"PRG_COL1 LT %s\"%s",
|
||||
The_GetColorRows (),RowSpan[ContractedOrExpanded]);
|
||||
|
@ -670,14 +670,14 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
|||
|
||||
static void Prg_PutIconToContractOrExpandItem (struct Prg_Item *Item,
|
||||
ConExp_ContractedOrExpanded_t ContractedOrExpanded,
|
||||
VieEdi_ViewOrEdit_t ViewingOrEditing)
|
||||
Vie_ViewType_t ViewType)
|
||||
{
|
||||
static const Act_Action_t NextAction[ConExp_NUM_CONTRACTED_EXPANDED][2] =
|
||||
static const Act_Action_t NextAction[ConExp_NUM_CONTRACTED_EXPANDED][Vie_NUM_VIEW_TYPES] =
|
||||
{
|
||||
[ConExp_CONTRACTED][VieEdi_VIEW] = ActExpSeePrgItm, // Contracted, Not editing ==> action to expand
|
||||
[ConExp_CONTRACTED][VieEdi_EDIT] = ActExpEdiPrgItm, // Contracted, Editing ==> action to expand
|
||||
[ConExp_EXPANDED ][VieEdi_VIEW] = ActConSeePrgItm, // Expanded , Not editing ==> action to contract
|
||||
[ConExp_EXPANDED ][VieEdi_EDIT] = ActConEdiPrgItm, // Expanded , Editing ==> action to contract
|
||||
[ConExp_CONTRACTED][Vie_VIEW] = ActExpSeePrgItm, // Contracted, Not editing ==> action to expand
|
||||
[ConExp_CONTRACTED][Vie_EDIT] = ActExpEdiPrgItm, // Contracted, Editing ==> action to expand
|
||||
[ConExp_EXPANDED ][Vie_VIEW] = ActConSeePrgItm, // Expanded , Not editing ==> action to contract
|
||||
[ConExp_EXPANDED ][Vie_EDIT] = ActConEdiPrgItm, // Expanded , Editing ==> action to contract
|
||||
};
|
||||
static void (*PutContextualIcon[ConExp_NUM_CONTRACTED_EXPANDED]) (const Act_Action_t NextAction,const char *Anchor,
|
||||
void (*FuncPars) (void *Args),void *Args) =
|
||||
|
@ -687,7 +687,7 @@ static void Prg_PutIconToContractOrExpandItem (struct Prg_Item *Item,
|
|||
};
|
||||
|
||||
/***** Icon to hide/unhide program item *****/
|
||||
PutContextualIcon[ContractedOrExpanded] (NextAction[ContractedOrExpanded][ViewingOrEditing],
|
||||
PutContextualIcon[ContractedOrExpanded] (NextAction[ContractedOrExpanded][ViewType],
|
||||
Prg_HIGHLIGHTED_SECTION_ID,
|
||||
Prg_PutParItmCod,&Item->Hierarchy.ItmCod);
|
||||
}
|
||||
|
|
|
@ -81,10 +81,10 @@ static void PrgRsc_WriteRowViewResource (unsigned NumRsc,
|
|||
const struct Prg_Item *Item);
|
||||
static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources,
|
||||
struct Prg_Item *Item,
|
||||
VieEdi_ViewOrEdit_t ViewOrEditLink);
|
||||
Vie_ViewType_t LinkViewType);
|
||||
static void PrgRsc_WriteRowNewResource (unsigned NumResources,
|
||||
struct Prg_Item *Item,
|
||||
VieEdi_ViewOrEdit_t ViewOrEditLink);
|
||||
Vie_ViewType_t LinkViewType);
|
||||
static void PrgRsc_PutFormsToRemEditOneResource (struct Prg_Item *Item,
|
||||
unsigned NumRsc,
|
||||
unsigned NumResources);
|
||||
|
@ -155,42 +155,42 @@ void PrgRsc_ListItemResources (Prg_ListingType_t ListingType,
|
|||
MYSQL_RES *mysql_res;
|
||||
unsigned NumRsc;
|
||||
unsigned NumResources;
|
||||
VieEdi_ViewOrEdit_t ViewingOrEditingResourcesOfThisItem;
|
||||
Vie_ViewType_t ViewingOrEditingResourcesOfThisItem;
|
||||
char *Title;
|
||||
static VieEdi_ViewOrEdit_t ViewingOrEditing[Prg_NUM_LISTING_TYPES] =
|
||||
static Vie_ViewType_t ViewingOrEditing[Prg_NUM_LISTING_TYPES] =
|
||||
{
|
||||
[Prg_PRINT ] = VieEdi_VIEW,
|
||||
[Prg_VIEW ] = VieEdi_VIEW,
|
||||
[Prg_EDIT_ITEMS ] = VieEdi_EDIT,
|
||||
[Prg_FORM_NEW_END_ITEM ] = VieEdi_EDIT,
|
||||
[Prg_FORM_NEW_CHILD_ITEM ] = VieEdi_EDIT,
|
||||
[Prg_FORM_EDIT_ITEM ] = VieEdi_EDIT,
|
||||
[Prg_END_EDIT_ITEM ] = VieEdi_EDIT,
|
||||
[Prg_RECEIVE_ITEM ] = VieEdi_EDIT,
|
||||
[Prg_EDIT_RESOURCES ] = VieEdi_EDIT,
|
||||
[Prg_EDIT_RESOURCE_LINK ] = VieEdi_EDIT,
|
||||
[Prg_CHANGE_RESOURCE_LINK] = VieEdi_EDIT,
|
||||
[Prg_END_EDIT_RES ] = VieEdi_EDIT,
|
||||
[Prg_PRINT ] = Vie_VIEW,
|
||||
[Prg_VIEW ] = Vie_VIEW,
|
||||
[Prg_EDIT_ITEMS ] = Vie_EDIT,
|
||||
[Prg_FORM_NEW_END_ITEM ] = Vie_EDIT,
|
||||
[Prg_FORM_NEW_CHILD_ITEM ] = Vie_EDIT,
|
||||
[Prg_FORM_EDIT_ITEM ] = Vie_EDIT,
|
||||
[Prg_END_EDIT_ITEM ] = Vie_EDIT,
|
||||
[Prg_RECEIVE_ITEM ] = Vie_EDIT,
|
||||
[Prg_EDIT_RESOURCES ] = Vie_EDIT,
|
||||
[Prg_EDIT_RESOURCE_LINK ] = Vie_EDIT,
|
||||
[Prg_CHANGE_RESOURCE_LINK] = Vie_EDIT,
|
||||
[Prg_END_EDIT_RES ] = Vie_EDIT,
|
||||
};
|
||||
static VieEdi_ViewOrEdit_t ViewingOrEditingResources[Prg_NUM_LISTING_TYPES] =
|
||||
static Vie_ViewType_t ViewingOrEditingResources[Prg_NUM_LISTING_TYPES] =
|
||||
{
|
||||
[Prg_PRINT ] = VieEdi_VIEW,
|
||||
[Prg_VIEW ] = VieEdi_VIEW,
|
||||
[Prg_EDIT_ITEMS ] = VieEdi_VIEW,
|
||||
[Prg_FORM_NEW_END_ITEM ] = VieEdi_VIEW,
|
||||
[Prg_FORM_NEW_CHILD_ITEM ] = VieEdi_VIEW,
|
||||
[Prg_FORM_EDIT_ITEM ] = VieEdi_VIEW,
|
||||
[Prg_END_EDIT_ITEM ] = VieEdi_VIEW,
|
||||
[Prg_RECEIVE_ITEM ] = VieEdi_VIEW,
|
||||
[Prg_EDIT_RESOURCES ] = VieEdi_EDIT,
|
||||
[Prg_EDIT_RESOURCE_LINK ] = VieEdi_EDIT,
|
||||
[Prg_CHANGE_RESOURCE_LINK] = VieEdi_EDIT,
|
||||
[Prg_END_EDIT_RES ] = VieEdi_VIEW,
|
||||
[Prg_PRINT ] = Vie_VIEW,
|
||||
[Prg_VIEW ] = Vie_VIEW,
|
||||
[Prg_EDIT_ITEMS ] = Vie_VIEW,
|
||||
[Prg_FORM_NEW_END_ITEM ] = Vie_VIEW,
|
||||
[Prg_FORM_NEW_CHILD_ITEM ] = Vie_VIEW,
|
||||
[Prg_FORM_EDIT_ITEM ] = Vie_VIEW,
|
||||
[Prg_END_EDIT_ITEM ] = Vie_VIEW,
|
||||
[Prg_RECEIVE_ITEM ] = Vie_VIEW,
|
||||
[Prg_EDIT_RESOURCES ] = Vie_EDIT,
|
||||
[Prg_EDIT_RESOURCE_LINK ] = Vie_EDIT,
|
||||
[Prg_CHANGE_RESOURCE_LINK] = Vie_EDIT,
|
||||
[Prg_END_EDIT_RES ] = Vie_VIEW,
|
||||
};
|
||||
static void (*PrgRsc_PutIconsResources[VieEdi_NUM_VIEW_EDIT]) (void *ItmCod) =
|
||||
static void (*PrgRsc_PutIconsResources[Vie_NUM_VIEW_TYPES]) (void *ItmCod) =
|
||||
{
|
||||
PrgRsc_PutIconsViewResources,
|
||||
PrgRsc_PutIconsEditResources,
|
||||
[Vie_VIEW] = PrgRsc_PutIconsViewResources,
|
||||
[Vie_EDIT] = PrgRsc_PutIconsEditResources,
|
||||
};
|
||||
|
||||
/***** Trivial check *****/
|
||||
|
@ -199,9 +199,9 @@ void PrgRsc_ListItemResources (Prg_ListingType_t ListingType,
|
|||
|
||||
/***** Get list of item resources from database *****/
|
||||
NumResources = Prg_DB_GetListResources (&mysql_res,Item->Hierarchy.ItmCod,
|
||||
ViewingOrEditingResources[ListingType] == VieEdi_EDIT);
|
||||
ViewingOrEditingResources[ListingType] == Vie_EDIT);
|
||||
|
||||
if (NumResources || ViewingOrEditing[ListingType] == VieEdi_EDIT)
|
||||
if (NumResources || ViewingOrEditing[ListingType] == Vie_EDIT)
|
||||
{
|
||||
if (Item->Hierarchy.ItmCod == SelectedItmCod)
|
||||
{
|
||||
|
@ -219,18 +219,18 @@ void PrgRsc_ListItemResources (Prg_ListingType_t ListingType,
|
|||
}
|
||||
|
||||
/***** Begin box *****/
|
||||
ViewingOrEditingResourcesOfThisItem = ViewingOrEditingResources[ListingType] == VieEdi_EDIT &&
|
||||
(Item->Hierarchy.ItmCod == SelectedItmCod) ? VieEdi_EDIT :
|
||||
VieEdi_VIEW;
|
||||
ViewingOrEditingResourcesOfThisItem = ViewingOrEditingResources[ListingType] == Vie_EDIT &&
|
||||
(Item->Hierarchy.ItmCod == SelectedItmCod) ? Vie_EDIT :
|
||||
Vie_VIEW;
|
||||
|
||||
switch (ViewingOrEditing[ListingType])
|
||||
{
|
||||
case VieEdi_VIEW:
|
||||
case Vie_VIEW:
|
||||
Box_BoxBegin ("100%",NULL,
|
||||
NULL,NULL,
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
break;
|
||||
case VieEdi_EDIT:
|
||||
case Vie_EDIT:
|
||||
if (asprintf (&Title,Txt_Resources_of_X,Item->Title) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
Box_BoxBegin ("100%",Title,
|
||||
|
@ -239,6 +239,9 @@ void PrgRsc_ListItemResources (Prg_ListingType_t ListingType,
|
|||
Hlp_COURSE_Program,Box_NOT_CLOSABLE);
|
||||
free (Title);
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
break;
|
||||
}
|
||||
|
||||
/***** Table *****/
|
||||
|
@ -256,25 +259,29 @@ void PrgRsc_ListItemResources (Prg_ListingType_t ListingType,
|
|||
/* Show item */
|
||||
switch (ViewingOrEditingResourcesOfThisItem)
|
||||
{
|
||||
case VieEdi_VIEW:
|
||||
case Vie_VIEW:
|
||||
PrgRsc_WriteRowViewResource (NumRsc,Item);
|
||||
break;
|
||||
case VieEdi_EDIT:
|
||||
case Vie_EDIT:
|
||||
PrgRsc_WriteRowEditResource (NumRsc,NumResources,Item,
|
||||
(ListingType == Prg_EDIT_RESOURCE_LINK &&
|
||||
Item->Resource.Hierarchy.RscCod == SelectedRscCod) ? VieEdi_EDIT :
|
||||
VieEdi_VIEW);
|
||||
Item->Resource.Hierarchy.RscCod == SelectedRscCod) ? Vie_EDIT :
|
||||
Vie_VIEW);
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/***** Form to create a new resource *****/
|
||||
if (ViewingOrEditingResourcesOfThisItem == VieEdi_EDIT)
|
||||
if (ViewingOrEditingResourcesOfThisItem == Vie_EDIT)
|
||||
{
|
||||
Prg_ResetResource (Item);
|
||||
PrgRsc_WriteRowNewResource (NumResources,Item,
|
||||
(ListingType == Prg_EDIT_RESOURCE_LINK &&
|
||||
Item->Resource.Hierarchy.RscCod == SelectedRscCod) ? VieEdi_EDIT :
|
||||
VieEdi_VIEW);
|
||||
Item->Resource.Hierarchy.RscCod == SelectedRscCod) ? Vie_EDIT :
|
||||
Vie_VIEW);
|
||||
}
|
||||
|
||||
/***** End table *****/
|
||||
|
@ -413,7 +420,7 @@ static void PrgRsc_WriteRowViewResource (unsigned NumRsc,
|
|||
|
||||
static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources,
|
||||
struct Prg_Item *Item,
|
||||
VieEdi_ViewOrEdit_t ViewOrEditLink)
|
||||
Vie_ViewType_t LinkViewType)
|
||||
{
|
||||
/***** Begin row *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
@ -445,19 +452,22 @@ static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources,
|
|||
HTM_BR ();
|
||||
|
||||
/* Edit link showing clipboard / Show current link */
|
||||
switch (ViewOrEditLink)
|
||||
switch (LinkViewType)
|
||||
{
|
||||
case VieEdi_VIEW:
|
||||
case Vie_VIEW:
|
||||
/* Show current link */
|
||||
Rsc_WriteLinkName (&Item->Resource.Link,Frm_PUT_FORM_TO_GO);
|
||||
break;
|
||||
case VieEdi_EDIT:
|
||||
case Vie_EDIT:
|
||||
/* Show clipboard to change resource link */
|
||||
Frm_BeginFormAnchor (ActChgLnkPrgRsc,PrgRsc_RESOURCE_SECTION_ID);
|
||||
ParCod_PutPar (ParCod_Rsc,Item->Resource.Hierarchy.RscCod);
|
||||
Rsc_ShowClipboardToChangeLink (&Item->Resource.Link);
|
||||
Frm_EndForm ();
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
break;
|
||||
}
|
||||
|
||||
HTM_TD_End ();
|
||||
|
@ -472,7 +482,7 @@ static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources,
|
|||
|
||||
static void PrgRsc_WriteRowNewResource (unsigned NumResources,
|
||||
struct Prg_Item *Item,
|
||||
VieEdi_ViewOrEdit_t ViewOrEditLink)
|
||||
Vie_ViewType_t LinkViewType)
|
||||
{
|
||||
extern const char *Txt_New_resource;
|
||||
|
||||
|
@ -505,7 +515,7 @@ static void PrgRsc_WriteRowNewResource (unsigned NumResources,
|
|||
Frm_EndForm ();
|
||||
|
||||
/* Edit link showing clipboard? */
|
||||
if (ViewOrEditLink == VieEdi_EDIT)
|
||||
if (LinkViewType == Vie_EDIT)
|
||||
{
|
||||
HTM_BR ();
|
||||
|
||||
|
|
|
@ -1413,7 +1413,7 @@ void Prj_PrintOneProject (void)
|
|||
Prj_GetProjectDataByCod (&Projects.Prj);
|
||||
|
||||
/***** Write header *****/
|
||||
Lay_WriteHeaderClassPhoto (true,false);
|
||||
Lay_WriteHeaderClassPhoto (Vie_PRINT,false);
|
||||
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWideMarginPadding (2);
|
||||
|
|
|
@ -136,7 +136,7 @@ void Syl_ResetSyllabus (struct Syl_Syllabus *Syllabus)
|
|||
{
|
||||
Syllabus->PathDir[0] = '\0';
|
||||
Syllabus->NumItem = 0;
|
||||
Syllabus->ViewingOrEditing = VieEdi_VIEW;
|
||||
Syllabus->ViewType = Vie_VIEW;
|
||||
Syllabus->WhichSyllabus = Syl_DEFAULT_WHICH_SYLLABUS;
|
||||
}
|
||||
|
||||
|
@ -244,14 +244,14 @@ bool Syl_CheckAndEditSyllabus (struct Syl_Syllabus *Syllabus)
|
|||
case ActLftIteSylLec: case ActLftIteSylPra:
|
||||
case ActInsIteSylLec: case ActInsIteSylPra:
|
||||
case ActModIteSylLec: case ActModIteSylPra:
|
||||
Syllabus->ViewingOrEditing = VieEdi_EDIT;
|
||||
Syllabus->ViewType = Vie_EDIT;
|
||||
break;
|
||||
default:
|
||||
Syllabus->ViewingOrEditing = VieEdi_VIEW;
|
||||
Syllabus->ViewType = Vie_VIEW;
|
||||
break;
|
||||
}
|
||||
|
||||
if (Syllabus->ViewingOrEditing == VieEdi_EDIT ||
|
||||
if (Syllabus->ViewType == Vie_EDIT ||
|
||||
Syl_LstItemsSyllabus.NumItems)
|
||||
{
|
||||
/***** Write the current syllabus *****/
|
||||
|
@ -523,15 +523,15 @@ static void Syl_ShowSyllabus (struct Syl_Syllabus *Syllabus)
|
|||
extern const char *Txt_Done;
|
||||
unsigned NumItem;
|
||||
int Col;
|
||||
static const char **HelpLink[VieEdi_NUM_VIEW_EDIT] =
|
||||
static const char **HelpLink[Vie_NUM_VIEW_TYPES] =
|
||||
{
|
||||
[VieEdi_VIEW] = &Hlp_COURSE_Syllabus,
|
||||
[VieEdi_EDIT] = &Hlp_COURSE_Syllabus_edit,
|
||||
[Vie_VIEW] = &Hlp_COURSE_Syllabus,
|
||||
[Vie_EDIT] = &Hlp_COURSE_Syllabus_edit,
|
||||
};
|
||||
static int NumButtons[VieEdi_NUM_VIEW_EDIT] =
|
||||
static int NumButtons[Vie_NUM_VIEW_TYPES] =
|
||||
{
|
||||
[VieEdi_VIEW] = 0,
|
||||
[VieEdi_EDIT] = 5,
|
||||
[Vie_VIEW] = 0,
|
||||
[Vie_EDIT] = 5,
|
||||
};
|
||||
bool ShowRowInsertNewItem = (Gbl.Action.Act == ActInsIteSylLec || Gbl.Action.Act == ActInsIteSylPra ||
|
||||
Gbl.Action.Act == ActModIteSylLec || Gbl.Action.Act == ActModIteSylPra ||
|
||||
|
@ -539,7 +539,7 @@ static void Syl_ShowSyllabus (struct Syl_Syllabus *Syllabus)
|
|||
Gbl.Action.Act == ActLftIteSylLec || Gbl.Action.Act == ActLftIteSylPra);
|
||||
bool ICanEdit = Gbl.Usrs.Me.Role.Logged == Rol_TCH ||
|
||||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM;
|
||||
bool PutIconToEdit = Syllabus->ViewingOrEditing == VieEdi_VIEW && ICanEdit;
|
||||
bool PutIconToEdit = Syllabus->ViewType == Vie_VIEW && ICanEdit;
|
||||
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,Txt_INFO_TITLE[Gbl.Crs.Info.Type],
|
||||
|
@ -547,7 +547,7 @@ static void Syl_ShowSyllabus (struct Syl_Syllabus *Syllabus)
|
|||
NULL,
|
||||
PutIconToEdit ? &Gbl.Crs.Info.Type :
|
||||
NULL,
|
||||
*HelpLink[Syllabus->ViewingOrEditing],Box_NOT_CLOSABLE);
|
||||
*HelpLink[Syllabus->ViewType],Box_NOT_CLOSABLE);
|
||||
|
||||
/****** Form to select syllabus *****/
|
||||
Syl_PutFormWhichSyllabus (Syllabus->WhichSyllabus);
|
||||
|
@ -558,7 +558,7 @@ static void Syl_ShowSyllabus (struct Syl_Syllabus *Syllabus)
|
|||
/***** Set width of columns of the table *****/
|
||||
HTM_Txt ("<colgroup>");
|
||||
for (Col = 0;
|
||||
Col < NumButtons[Syllabus->ViewingOrEditing];
|
||||
Col < NumButtons[Syllabus->ViewType];
|
||||
Col++)
|
||||
HTM_Txt ("<col width=\"12\" />");
|
||||
for (Col = 1;
|
||||
|
@ -584,7 +584,7 @@ static void Syl_ShowSyllabus (struct Syl_Syllabus *Syllabus)
|
|||
Syl_LstItemsSyllabus.Lst[NumItem].Level,NULL,
|
||||
"",true);
|
||||
}
|
||||
else if (Syllabus->ViewingOrEditing == VieEdi_EDIT)
|
||||
else if (Syllabus->ViewType == Vie_EDIT)
|
||||
/***** If the syllabus is empty ==>
|
||||
show form to add a iten to the end *****/
|
||||
Syl_ShowRowSyllabus (Syllabus,0,
|
||||
|
@ -594,7 +594,7 @@ static void Syl_ShowSyllabus (struct Syl_Syllabus *Syllabus)
|
|||
HTM_TABLE_End ();
|
||||
|
||||
/***** Button to view *****/
|
||||
if (Syllabus->ViewingOrEditing == VieEdi_EDIT)
|
||||
if (Syllabus->ViewType == Vie_EDIT)
|
||||
{
|
||||
Frm_BeginForm (Inf_ActionsSeeInfo[Gbl.Crs.Info.Type]);
|
||||
Btn_PutConfirmButton (Txt_Done);
|
||||
|
@ -629,9 +629,9 @@ static void Syl_ShowRowSyllabus (struct Syl_Syllabus *Syllabus,unsigned NumItem,
|
|||
/***** Begin the row *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
switch (Syllabus->ViewingOrEditing)
|
||||
switch (Syllabus->ViewType)
|
||||
{
|
||||
case VieEdi_VIEW:
|
||||
case Vie_VIEW:
|
||||
/***** Indent depending on the level *****/
|
||||
if (Level > 1)
|
||||
{
|
||||
|
@ -658,7 +658,7 @@ static void Syl_ShowRowSyllabus (struct Syl_Syllabus *Syllabus,unsigned NumItem,
|
|||
HTM_Txt (Text);
|
||||
HTM_TD_End ();
|
||||
break;
|
||||
case VieEdi_EDIT:
|
||||
case Vie_EDIT:
|
||||
if (NewItem)
|
||||
{
|
||||
HTM_TD_Begin ("colspan=\"5\" class=\"%s\"",
|
||||
|
@ -737,6 +737,9 @@ static void Syl_ShowRowSyllabus (struct Syl_Syllabus *Syllabus,unsigned NumItem,
|
|||
|
||||
Syl_PutFormItemSyllabus (Syllabus,NewItem,NumItem,Level,CodItem,Text);
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
break;
|
||||
}
|
||||
|
||||
/***** End of the row *****/
|
||||
|
@ -935,7 +938,7 @@ void Syl_RemoveItemSyllabus (void)
|
|||
/***** Load syllabus from XML file to memory *****/
|
||||
Syl_LoadListItemsSyllabusIntoMemory (&Syllabus,Gbl.Hierarchy.Node[Hie_CRS].HieCod);
|
||||
|
||||
Syllabus.ViewingOrEditing = VieEdi_EDIT;
|
||||
Syllabus.ViewType = Vie_EDIT;
|
||||
|
||||
/***** Get item number *****/
|
||||
Syllabus.NumItem = Syl_GetParItemNumber ();
|
||||
|
@ -1012,7 +1015,7 @@ static void Syl_ChangePlaceItemSyllabus (Syl_ChangePosItem_t UpOrDownPos)
|
|||
/***** Load syllabus from XML file to memory *****/
|
||||
Syl_LoadListItemsSyllabusIntoMemory (&Syllabus,Gbl.Hierarchy.Node[Hie_CRS].HieCod);
|
||||
|
||||
Syllabus.ViewingOrEditing = VieEdi_EDIT;
|
||||
Syllabus.ViewType = Vie_EDIT;
|
||||
|
||||
/***** Get item number *****/
|
||||
Syllabus.NumItem = Syl_GetParItemNumber ();
|
||||
|
@ -1198,7 +1201,7 @@ static void Syl_ChangeLevelItemSyllabus (Syl_ChangeLevelItem_t IncreaseOrDecreas
|
|||
/***** Load syllabus from XML file to memory *****/
|
||||
Syl_LoadListItemsSyllabusIntoMemory (&Syllabus,Gbl.Hierarchy.Node[Hie_CRS].HieCod);
|
||||
|
||||
Syllabus.ViewingOrEditing = VieEdi_EDIT;
|
||||
Syllabus.ViewType = Vie_EDIT;
|
||||
|
||||
/***** Get item number *****/
|
||||
Syllabus.NumItem = Syl_GetParItemNumber ();
|
||||
|
@ -1261,7 +1264,7 @@ void Syl_InsertItemSyllabus (void)
|
|||
/***** Load syllabus from XML file to memory *****/
|
||||
Syl_LoadListItemsSyllabusIntoMemory (&Syllabus,Gbl.Hierarchy.Node[Hie_CRS].HieCod);
|
||||
|
||||
Syllabus.ViewingOrEditing = VieEdi_EDIT;
|
||||
Syllabus.ViewType = Vie_EDIT;
|
||||
|
||||
/***** Get item number *****/
|
||||
Syllabus.NumItem = Syl_GetParItemNumber ();
|
||||
|
@ -1330,7 +1333,7 @@ void Syl_ModifyItemSyllabus (void)
|
|||
/***** Load syllabus from XML file to memory *****/
|
||||
Syl_LoadListItemsSyllabusIntoMemory (&Syllabus,Gbl.Hierarchy.Node[Hie_CRS].HieCod);
|
||||
|
||||
Syllabus.ViewingOrEditing = VieEdi_EDIT;
|
||||
Syllabus.ViewType = Vie_EDIT;
|
||||
|
||||
/***** Get item number *****/
|
||||
Syllabus.NumItem = Syl_GetParItemNumber ();
|
||||
|
|
|
@ -77,7 +77,7 @@ struct Syl_Syllabus
|
|||
char PathDir[PATH_MAX + 1];
|
||||
unsigned NumItem; // Item being edited
|
||||
unsigned ParNumItem; // Used as parameter in forms
|
||||
VieEdi_ViewOrEdit_t ViewingOrEditing;
|
||||
Vie_ViewType_t ViewType;
|
||||
Syl_WhichSyllabus_t WhichSyllabus;
|
||||
};
|
||||
|
||||
|
|
|
@ -59,11 +59,11 @@ extern struct Globals Gbl;
|
|||
/***************************** Private prototypes ****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void SysCfg_Configuration (bool PrintView);
|
||||
static void SysCfg_Configuration (Vie_ViewType_t ViewType);
|
||||
static void SysCfg_PutIconToPrint (__attribute__((unused)) void *Args);
|
||||
static void SysCfg_Map (void);
|
||||
static void SysCfg_Platform (void);
|
||||
static void SysCfg_Shortcut (bool PrintView);
|
||||
static void SysCfg_Shortcut (Vie_ViewType_t ViewType);
|
||||
static void SysCfg_QR (void);
|
||||
static void SysCfg_NumCtys (void);
|
||||
static void SysCfg_NumInss (void);
|
||||
|
@ -76,7 +76,7 @@ static void SysCfg_NumCrss (void);
|
|||
|
||||
void SysCfg_ShowConfiguration (void)
|
||||
{
|
||||
SysCfg_Configuration (false);
|
||||
SysCfg_Configuration (Vie_VIEW);
|
||||
|
||||
/***** Show help to enrol me *****/
|
||||
Hlp_ShowHelpWhatWouldYouLikeToDo ();
|
||||
|
@ -88,90 +88,93 @@ void SysCfg_ShowConfiguration (void)
|
|||
|
||||
void SysCfg_PrintConfiguration (void)
|
||||
{
|
||||
SysCfg_Configuration (true);
|
||||
SysCfg_Configuration (Vie_PRINT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Information of the current country *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void SysCfg_Configuration (bool PrintView)
|
||||
static void SysCfg_Configuration (Vie_ViewType_t ViewType)
|
||||
{
|
||||
extern const char *Hlp_SYSTEM_Information;
|
||||
unsigned NumCtrs;
|
||||
unsigned NumCtrsWithMap;
|
||||
|
||||
/***** Begin box *****/
|
||||
if (PrintView)
|
||||
Box_BoxBegin (NULL,Cfg_PLATFORM_SHORT_NAME,
|
||||
NULL,NULL,
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
else
|
||||
Box_BoxBegin (NULL,Cfg_PLATFORM_SHORT_NAME,
|
||||
SysCfg_PutIconToPrint,NULL,
|
||||
Hlp_SYSTEM_Information,Box_NOT_CLOSABLE);
|
||||
Box_BoxBegin (NULL,Cfg_PLATFORM_SHORT_NAME,
|
||||
ViewType == Vie_VIEW ? SysCfg_PutIconToPrint :
|
||||
NULL,NULL,
|
||||
ViewType == Vie_VIEW ? Hlp_SYSTEM_Information :
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
|
||||
/**************************** Left part ***********************************/
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_LEFT HIE_CFG_WIDTH\"");
|
||||
/**************************** Left part ***********************************/
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_LEFT HIE_CFG_WIDTH\"");
|
||||
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWidePadding (2);
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWidePadding (2);
|
||||
|
||||
/***** Platform *****/
|
||||
SysCfg_Platform ();
|
||||
/***** Platform *****/
|
||||
SysCfg_Platform ();
|
||||
|
||||
/***** Shortcut to the country *****/
|
||||
SysCfg_Shortcut (PrintView);
|
||||
/***** Shortcut to the country *****/
|
||||
SysCfg_Shortcut (ViewType);
|
||||
|
||||
/***** Get number of centers with map *****/
|
||||
NumCtrsWithMap = Ctr_GetCachedNumCtrsWithMapInSys ();
|
||||
/***** Get number of centers with map *****/
|
||||
NumCtrsWithMap = Ctr_GetCachedNumCtrsWithMapInSys ();
|
||||
|
||||
if (PrintView)
|
||||
/***** QR code with link to the country *****/
|
||||
SysCfg_QR ();
|
||||
else
|
||||
{
|
||||
/***** Get number of centers *****/
|
||||
NumCtrs = Hie_GetCachedNumNodesInHieLvl (Hie_CTR, // Number of centers...
|
||||
Hie_SYS, // ...in system
|
||||
Gbl.Hierarchy.Node[Hie_SYS].HieCod);
|
||||
switch (ViewType)
|
||||
{
|
||||
case Vie_VIEW:
|
||||
/***** Get number of centers *****/
|
||||
NumCtrs = Hie_GetCachedNumNodesInHieLvl (Hie_CTR, // Number of centers...
|
||||
Hie_SYS, // ...in system
|
||||
Gbl.Hierarchy.Node[Hie_SYS].HieCod);
|
||||
|
||||
/***** Number of countries,
|
||||
number of institutions,
|
||||
number of centers,
|
||||
number of degrees,
|
||||
number of courses *****/
|
||||
SysCfg_NumCtys ();
|
||||
SysCfg_NumInss ();
|
||||
HieCfg_NumCtrs (NumCtrs,
|
||||
false); // Don't put form
|
||||
HieCfg_NumCtrsWithMap (NumCtrs,NumCtrsWithMap);
|
||||
SysCfg_NumDegs ();
|
||||
SysCfg_NumCrss ();
|
||||
/***** Number of countries,
|
||||
number of institutions,
|
||||
number of centers,
|
||||
number of degrees,
|
||||
number of courses *****/
|
||||
SysCfg_NumCtys ();
|
||||
SysCfg_NumInss ();
|
||||
HieCfg_NumCtrs (NumCtrs,
|
||||
false); // Don't put form
|
||||
HieCfg_NumCtrsWithMap (NumCtrs,NumCtrsWithMap);
|
||||
SysCfg_NumDegs ();
|
||||
SysCfg_NumCrss ();
|
||||
|
||||
/***** Number of users in courses of this country *****/
|
||||
HieCfg_NumUsrsInCrss (Hie_SYS,-1L,Rol_TCH);
|
||||
HieCfg_NumUsrsInCrss (Hie_SYS,-1L,Rol_NET);
|
||||
HieCfg_NumUsrsInCrss (Hie_SYS,-1L,Rol_STD);
|
||||
HieCfg_NumUsrsInCrss (Hie_SYS,-1L,Rol_UNK);
|
||||
}
|
||||
/***** Number of users in courses of this country *****/
|
||||
HieCfg_NumUsrsInCrss (Hie_SYS,-1L,Rol_TCH);
|
||||
HieCfg_NumUsrsInCrss (Hie_SYS,-1L,Rol_NET);
|
||||
HieCfg_NumUsrsInCrss (Hie_SYS,-1L,Rol_STD);
|
||||
HieCfg_NumUsrsInCrss (Hie_SYS,-1L,Rol_UNK);
|
||||
break;
|
||||
case Vie_PRINT:
|
||||
/***** QR code with link to the country *****/
|
||||
SysCfg_QR ();
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
break;
|
||||
}
|
||||
|
||||
/***** End table *****/
|
||||
HTM_TABLE_End ();
|
||||
|
||||
/***** End of left part *****/
|
||||
HTM_DIV_End ();
|
||||
|
||||
/**************************** Right part **********************************/
|
||||
if (NumCtrsWithMap)
|
||||
{
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_RIGHT HIE_CFG_WIDTH\"");
|
||||
|
||||
/***** Country map *****/
|
||||
SysCfg_Map ();
|
||||
/***** End table *****/
|
||||
HTM_TABLE_End ();
|
||||
|
||||
/***** End of left part *****/
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
||||
/**************************** Right part **********************************/
|
||||
if (NumCtrsWithMap)
|
||||
{
|
||||
HTM_DIV_Begin ("class=\"HIE_CFG_RIGHT HIE_CFG_WIDTH\"");
|
||||
|
||||
/***** Country map *****/
|
||||
SysCfg_Map ();
|
||||
|
||||
HTM_DIV_End ();
|
||||
}
|
||||
|
||||
/***** End box *****/
|
||||
Box_BoxEnd ();
|
||||
|
@ -285,9 +288,9 @@ static void SysCfg_Platform (void)
|
|||
/************** Show platform shortcut in system configuration ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void SysCfg_Shortcut (bool PrintView)
|
||||
static void SysCfg_Shortcut (Vie_ViewType_t ViewType)
|
||||
{
|
||||
HieCfg_Shortcut (PrintView,ParCod_None,-1L);
|
||||
HieCfg_Shortcut (ViewType,ParCod_None,-1L);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -347,7 +347,7 @@ void Tst_AssessTest (void)
|
|||
Box_BoxBegin (NULL,Txt_Result,
|
||||
NULL,NULL,
|
||||
Hlp_ASSESSMENT_Tests,Box_NOT_CLOSABLE);
|
||||
Lay_WriteHeaderClassPhoto (false,false);
|
||||
Lay_WriteHeaderClassPhoto (Vie_VIEW,false);
|
||||
|
||||
/***** Header *****/
|
||||
if (Gbl.Usrs.Me.IBelongToCurrent[Hie_CRS])
|
||||
|
|
|
@ -218,7 +218,7 @@ void TstPrn_ShowTestPrintToFillIt (struct TstPrn_Print *Print,
|
|||
Box_BoxBegin (NULL,Txt_Test,
|
||||
NULL,NULL,
|
||||
Hlp_ASSESSMENT_Tests,Box_NOT_CLOSABLE);
|
||||
Lay_WriteHeaderClassPhoto (false,false);
|
||||
Lay_WriteHeaderClassPhoto (Vie_VIEW,false);
|
||||
|
||||
if (Print->NumQsts.All)
|
||||
{
|
||||
|
@ -2236,7 +2236,7 @@ void TstPrn_ShowOnePrint (void)
|
|||
Box_BoxBegin (NULL,Txt_Result,
|
||||
NULL,NULL,
|
||||
Hlp_ASSESSMENT_Tests_results,Box_NOT_CLOSABLE);
|
||||
Lay_WriteHeaderClassPhoto (false,false);
|
||||
Lay_WriteHeaderClassPhoto (Vie_VIEW,false);
|
||||
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWideMarginPadding (10);
|
||||
|
|
|
@ -323,8 +323,9 @@ void Tmt_ShowClassTimeTable (void)
|
|||
[Tmt_TUTORING_TIMETABLE] = ActUnk,
|
||||
};
|
||||
struct Tmt_Timetable Timetable;
|
||||
bool PrintView = (Gbl.Action.Act == ActPrnCrsTT ||
|
||||
Gbl.Action.Act == ActPrnMyTT);
|
||||
Vie_ViewType_t ViewType = (Gbl.Action.Act == ActPrnCrsTT ||
|
||||
Gbl.Action.Act == ActPrnMyTT) ? Vie_PRINT :
|
||||
Vie_VIEW;
|
||||
Grp_WhichGroups_t WhichGroups;
|
||||
|
||||
/***** Initializations *****/
|
||||
|
@ -345,13 +346,13 @@ void Tmt_ShowClassTimeTable (void)
|
|||
}
|
||||
|
||||
Timetable.ContextualIcons.PutIconEditCrsTT = (Timetable.Type == Tmt_COURSE_TIMETABLE &&
|
||||
!PrintView &&
|
||||
ViewType == Vie_VIEW &&
|
||||
Gbl.Usrs.Me.Role.Logged >= Rol_TCH);
|
||||
Timetable.ContextualIcons.PutIconEditOfficeHours = (Timetable.Type == Tmt_MY_TIMETABLE &&
|
||||
!PrintView &&
|
||||
ViewType == Vie_VIEW &&
|
||||
(Gbl.Usrs.Me.Role.Available & (1 << Rol_TCH |
|
||||
1 << Rol_NET)));
|
||||
Timetable.ContextualIcons.PutIconPrint = !PrintView;
|
||||
Timetable.ContextualIcons.PutIconPrint = (ViewType == Vie_VIEW);
|
||||
|
||||
/***** Get whether to show only my groups or all groups *****/
|
||||
Grp_GetParWhichGroups ();
|
||||
|
@ -370,28 +371,34 @@ void Tmt_ShowClassTimeTable (void)
|
|||
|
||||
/***** Begin time table drawing *****/
|
||||
if (Timetable.Type == Tmt_COURSE_TIMETABLE)
|
||||
Lay_WriteHeaderClassPhoto (PrintView,false);
|
||||
Lay_WriteHeaderClassPhoto (ViewType,false);
|
||||
|
||||
if (PrintView)
|
||||
/***** Show whether only my groups or all groups are selected *****/
|
||||
Tmt_ShowTimeTableGrpsSelected ();
|
||||
else
|
||||
switch (ViewType)
|
||||
{
|
||||
/***** Setting selector *****/
|
||||
Set_BeginSettingsHead ();
|
||||
case Vie_VIEW:
|
||||
/***** Setting selector *****/
|
||||
Set_BeginSettingsHead ();
|
||||
|
||||
/* Select whether show only my groups or all groups */
|
||||
if ( Timetable.Type == Tmt_MY_TIMETABLE ||
|
||||
(Timetable.Type == Tmt_COURSE_TIMETABLE &&
|
||||
Gbl.Crs.Grps.NumGrps))
|
||||
Tmt_PutFormToSelectWhichGroupsToShow (&Timetable);
|
||||
/* Select whether show only my groups or all groups */
|
||||
if ( Timetable.Type == Tmt_MY_TIMETABLE ||
|
||||
(Timetable.Type == Tmt_COURSE_TIMETABLE &&
|
||||
Gbl.Crs.Grps.NumGrps))
|
||||
Tmt_PutFormToSelectWhichGroupsToShow (&Timetable);
|
||||
|
||||
/* Show form to change first day of week */
|
||||
WhichGroups = Grp_GetParWhichGroups ();
|
||||
Cal_ShowFormToSelFirstDayOfWeek (ActChgTT1stDay[Timetable.Type],
|
||||
Grp_PutParWhichGroups,&WhichGroups);
|
||||
/* Show form to change first day of week */
|
||||
WhichGroups = Grp_GetParWhichGroups ();
|
||||
Cal_ShowFormToSelFirstDayOfWeek (ActChgTT1stDay[Timetable.Type],
|
||||
Grp_PutParWhichGroups,&WhichGroups);
|
||||
|
||||
Set_EndSettingsHead ();
|
||||
Set_EndSettingsHead ();
|
||||
break;
|
||||
case Vie_PRINT:
|
||||
/***** Show whether only my groups or all groups are selected *****/
|
||||
Tmt_ShowTimeTableGrpsSelected ();
|
||||
break;
|
||||
default:
|
||||
Err_WrongTypeExit ();
|
||||
break;
|
||||
}
|
||||
|
||||
/***** Show the time table *****/
|
||||
|
|
12
swad_user.c
12
swad_user.c
|
@ -5082,7 +5082,7 @@ void Usr_SeeGuests (void)
|
|||
|
||||
/***** Draw a class photo with guests *****/
|
||||
if (Gbl.Usrs.Me.ListType == Set_USR_LIST_AS_CLASS_PHOTO)
|
||||
Lay_WriteHeaderClassPhoto (false,true);
|
||||
Lay_WriteHeaderClassPhoto (Vie_VIEW,true);
|
||||
|
||||
/* Set options allowed */
|
||||
PutForm = Usr_SetOptionsListUsrsAllowed (Rol_GST,ICanChooseOption);
|
||||
|
@ -5232,7 +5232,7 @@ void Usr_SeeStudents (void)
|
|||
|
||||
/***** Draw a class photo with students of the course *****/
|
||||
if (Gbl.Usrs.Me.ListType == Set_USR_LIST_AS_CLASS_PHOTO)
|
||||
Lay_WriteHeaderClassPhoto (false,true);
|
||||
Lay_WriteHeaderClassPhoto (Vie_VIEW,true);
|
||||
|
||||
/* Set options allowed */
|
||||
PutForm = Usr_SetOptionsListUsrsAllowed (Rol_STD,ICanChooseOption);
|
||||
|
@ -5398,7 +5398,7 @@ void Usr_SeeTeachers (void)
|
|||
|
||||
/***** Draw a class photo with teachers of the course *****/
|
||||
if (Gbl.Usrs.Me.ListType == Set_USR_LIST_AS_CLASS_PHOTO)
|
||||
Lay_WriteHeaderClassPhoto (false,true);
|
||||
Lay_WriteHeaderClassPhoto (Vie_VIEW,true);
|
||||
|
||||
/* Set options allowed */
|
||||
PutForm = Usr_SetOptionsListUsrsAllowed (Rol_TCH,ICanChooseOption);
|
||||
|
@ -5928,7 +5928,7 @@ void Usr_SeeGstClassPhotoPrn (void)
|
|||
if (Gbl.Usrs.LstUsrs[Rol_GST].NumUsrs)
|
||||
{
|
||||
/***** Draw the guests' class photo *****/
|
||||
Lay_WriteHeaderClassPhoto (true,true);
|
||||
Lay_WriteHeaderClassPhoto (Vie_PRINT,true);
|
||||
HTM_TABLE_BeginWide ();
|
||||
Usr_DrawClassPhoto (Usr_CLASS_PHOTO_PRN,
|
||||
Rol_GST,&Gbl.Usrs.Selected,false);
|
||||
|
@ -5966,7 +5966,7 @@ void Usr_SeeStdClassPhotoPrn (void)
|
|||
if (Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs)
|
||||
{
|
||||
/***** Draw the students' class photo *****/
|
||||
Lay_WriteHeaderClassPhoto (true,true);
|
||||
Lay_WriteHeaderClassPhoto (Vie_PRINT,true);
|
||||
HTM_TABLE_BeginWide ();
|
||||
Usr_DrawClassPhoto (Usr_CLASS_PHOTO_PRN,
|
||||
Rol_STD,&Gbl.Usrs.Selected,false);
|
||||
|
@ -6028,7 +6028,7 @@ void Usr_SeeTchClassPhotoPrn (void)
|
|||
if (NumUsrs)
|
||||
{
|
||||
/***** Draw the teachers' class photo *****/
|
||||
Lay_WriteHeaderClassPhoto (true,true);
|
||||
Lay_WriteHeaderClassPhoto (Vie_PRINT,true);
|
||||
HTM_TABLE_BeginWide ();
|
||||
|
||||
/* List teachers and non-editing teachers */
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// swad_view_edit.h: types and constants related to view/edit
|
||||
// swad_view.h: types and constants related to view/edit/print
|
||||
|
||||
#ifndef _SWAD_VIE_EDI
|
||||
#define _SWAD_VIE_EDI
|
||||
#ifndef _SWAD_VIEW
|
||||
#define _SWAD_VIEW
|
||||
/*
|
||||
SWAD (Shared Workspace At a Distance in Spanish),
|
||||
is a web platform developed at the University of Granada (Spain),
|
||||
|
@ -28,7 +28,7 @@
|
|||
/***************************** Public constants ******************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define VieEdi_NUM_VIEW_EDIT 2
|
||||
#define Vie_NUM_VIEW_TYPES 3
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************************* Public types ********************************/
|
||||
|
@ -36,8 +36,9 @@
|
|||
|
||||
typedef enum
|
||||
{
|
||||
VieEdi_VIEW = 0,
|
||||
VieEdi_EDIT = 1,
|
||||
} VieEdi_ViewOrEdit_t;
|
||||
Vie_VIEW = 0,
|
||||
Vie_EDIT = 1,
|
||||
Vie_PRINT = 2,
|
||||
} Vie_ViewType_t;
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user