2021-03-07 21:21:04 +01:00
|
|
|
|
// swad_hierarchy_config.c: hierarchy (country, institution, center, degree, course) configuration
|
2019-12-29 20:11:57 +01:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
SWAD (Shared Workspace At a Distance),
|
|
|
|
|
is a web platform developed at the University of Granada (Spain),
|
|
|
|
|
and used to support university teaching.
|
|
|
|
|
|
|
|
|
|
This file is part of SWAD core.
|
2023-03-10 17:21:04 +01:00
|
|
|
|
Copyright (C) 1999-2023 Antonio Ca<EFBFBD>as Vargas
|
2019-12-29 20:11:57 +01:00
|
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Affero General Public License as
|
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********************************* Headers ***********************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2021-12-29 23:41:26 +01:00
|
|
|
|
#define _GNU_SOURCE // For asprintf
|
|
|
|
|
#include <stdio.h> // For asprintf
|
2022-04-25 18:27:24 +02:00
|
|
|
|
#include <stdlib.h> // For free
|
2021-12-29 23:41:26 +01:00
|
|
|
|
|
2022-11-06 18:11:10 +01:00
|
|
|
|
#include "swad_action_list.h"
|
2021-12-29 23:41:26 +01:00
|
|
|
|
#include "swad_error.h"
|
2020-05-02 10:53:40 +02:00
|
|
|
|
#include "swad_figure_cache.h"
|
2019-12-29 20:11:57 +01:00
|
|
|
|
#include "swad_form.h"
|
|
|
|
|
#include "swad_global.h"
|
|
|
|
|
#include "swad_HTML.h"
|
|
|
|
|
#include "swad_logo.h"
|
|
|
|
|
#include "swad_QR.h"
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************** External global variables from others modules ****************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
extern struct Globals Gbl;
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************ Show title in configuration ************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2023-09-22 14:47:56 +02:00
|
|
|
|
void HieCfg_Title (bool PutLink,Hie_Level_t Level)
|
2019-12-29 20:11:57 +01:00
|
|
|
|
{
|
2023-09-22 14:47:56 +02:00
|
|
|
|
Hie_Level_t LevelLogo = (Level == Hie_CRS) ? Hie_DEG :
|
2023-09-19 19:13:29 +02:00
|
|
|
|
Level;
|
|
|
|
|
|
2021-12-20 09:24:49 +01:00
|
|
|
|
/***** Begin container *****/
|
2021-12-27 12:58:20 +01:00
|
|
|
|
HTM_DIV_Begin ("class=\"FRAME_TITLE FRAME_TITLE_BIG FRAME_TITLE_%s\"",
|
2022-04-05 01:00:24 +02:00
|
|
|
|
The_GetSuffix ());
|
2021-12-20 09:24:49 +01:00
|
|
|
|
|
|
|
|
|
/* Begin link */
|
2021-07-08 15:00:17 +02:00
|
|
|
|
if (PutLink)
|
2021-12-20 09:24:49 +01:00
|
|
|
|
HTM_A_Begin ("href=\"%s\" target=\"_blank\" title=\"%s\""
|
2021-12-27 12:58:20 +01:00
|
|
|
|
" class=\"FRAME_TITLE_BIG FRAME_TITLE_%s\"",
|
2023-09-19 19:13:29 +02:00
|
|
|
|
Gbl.Hierarchy.Node[LevelLogo].WWW,
|
|
|
|
|
Gbl.Hierarchy.Node[LevelLogo].FullName,
|
|
|
|
|
The_GetSuffix ());
|
2021-12-20 09:24:49 +01:00
|
|
|
|
|
|
|
|
|
/* Logo and name */
|
2023-09-19 19:13:29 +02:00
|
|
|
|
Lgo_DrawLogo (LevelLogo,
|
2023-09-20 10:36:07 +02:00
|
|
|
|
Gbl.Hierarchy.Node[LevelLogo].HieCod,
|
2023-09-19 19:13:29 +02:00
|
|
|
|
Gbl.Hierarchy.Node[LevelLogo].ShrtName,
|
2023-09-19 10:28:52 +02:00
|
|
|
|
64,NULL);
|
2021-07-08 15:00:17 +02:00
|
|
|
|
HTM_BR ();
|
2023-09-19 19:13:29 +02:00
|
|
|
|
HTM_Txt (Gbl.Hierarchy.Node[Level].FullName);
|
2021-12-20 09:24:49 +01:00
|
|
|
|
|
|
|
|
|
/* End link */
|
2021-07-08 15:00:17 +02:00
|
|
|
|
if (PutLink)
|
|
|
|
|
HTM_A_End ();
|
2021-12-20 09:24:49 +01:00
|
|
|
|
|
|
|
|
|
/***** End container *****/
|
2019-12-29 20:11:57 +01:00
|
|
|
|
HTM_DIV_End ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********************** Show full name in configuration **********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2023-09-22 14:47:56 +02:00
|
|
|
|
void HieCfg_FullName (bool PutForm,Act_Action_t NextAction,Hie_Level_t Level,
|
2023-09-21 22:06:19 +02:00
|
|
|
|
const char *Label)
|
2019-12-29 20:11:57 +01:00
|
|
|
|
{
|
|
|
|
|
/***** Full name *****/
|
|
|
|
|
HTM_TR_Begin (NULL);
|
|
|
|
|
|
2021-07-08 15:00:17 +02:00
|
|
|
|
/* Label */
|
|
|
|
|
Frm_LabelColumn ("RT",PutForm ? "FullName" :
|
|
|
|
|
NULL,
|
|
|
|
|
Label);
|
|
|
|
|
|
|
|
|
|
/* Data */
|
2022-04-05 01:00:24 +02:00
|
|
|
|
HTM_TD_Begin ("class=\"LB DAT_STRONG_%s\"",The_GetSuffix ());
|
2021-07-08 15:00:17 +02:00
|
|
|
|
if (PutForm)
|
|
|
|
|
{
|
|
|
|
|
/* Form to change full name */
|
|
|
|
|
Frm_BeginForm (NextAction);
|
2023-09-22 14:47:56 +02:00
|
|
|
|
HTM_INPUT_TEXT ("FullName",Hie_MAX_CHARS_FULL_NAME,
|
2023-09-21 22:06:19 +02:00
|
|
|
|
Gbl.Hierarchy.Node[Level].FullName,
|
2021-07-08 15:00:17 +02:00
|
|
|
|
HTM_SUBMIT_ON_CHANGE,
|
2022-03-30 00:46:18 +02:00
|
|
|
|
"id=\"FullName\""
|
|
|
|
|
" class=\"INPUT_FULL_NAME INPUT_%s\""
|
2021-12-20 09:24:49 +01:00
|
|
|
|
" required=\"required\"",
|
2022-04-05 01:00:24 +02:00
|
|
|
|
The_GetSuffix ());
|
2021-07-08 15:00:17 +02:00
|
|
|
|
Frm_EndForm ();
|
|
|
|
|
}
|
|
|
|
|
else // I can not edit full name
|
2023-09-21 22:06:19 +02:00
|
|
|
|
HTM_Txt (Gbl.Hierarchy.Node[Level].FullName);
|
2021-07-08 15:00:17 +02:00
|
|
|
|
HTM_TD_End ();
|
2019-12-29 20:11:57 +01:00
|
|
|
|
|
|
|
|
|
HTM_TR_End ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********* Show institution short name in institution configuration **********/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2023-09-22 14:47:56 +02:00
|
|
|
|
void HieCfg_ShrtName (bool PutForm,Act_Action_t NextAction,Hie_Level_t Level)
|
2019-12-29 20:11:57 +01:00
|
|
|
|
{
|
|
|
|
|
extern const char *Txt_Short_name;
|
|
|
|
|
|
|
|
|
|
/***** Short name *****/
|
|
|
|
|
HTM_TR_Begin (NULL);
|
|
|
|
|
|
2021-07-08 15:00:17 +02:00
|
|
|
|
/* Label */
|
|
|
|
|
Frm_LabelColumn ("RT",PutForm ? "ShortName" :
|
|
|
|
|
NULL,
|
|
|
|
|
Txt_Short_name);
|
|
|
|
|
|
|
|
|
|
/* Data */
|
2022-04-05 01:00:24 +02:00
|
|
|
|
HTM_TD_Begin ("class=\"LB DAT_STRONG_%s\"",The_GetSuffix ());
|
2021-07-08 15:00:17 +02:00
|
|
|
|
if (PutForm)
|
|
|
|
|
{
|
|
|
|
|
/* Form to change short name */
|
|
|
|
|
Frm_BeginForm (NextAction);
|
2023-09-22 14:47:56 +02:00
|
|
|
|
HTM_INPUT_TEXT ("ShortName",Hie_MAX_CHARS_SHRT_NAME,
|
2023-09-21 22:06:19 +02:00
|
|
|
|
Gbl.Hierarchy.Node[Level].ShrtName,
|
2021-07-08 15:00:17 +02:00
|
|
|
|
HTM_SUBMIT_ON_CHANGE,
|
2022-03-30 00:46:18 +02:00
|
|
|
|
"id=\"ShortName\""
|
|
|
|
|
" class=\"INPUT_SHORT_NAME INPUT_%s\""
|
2021-12-20 09:24:49 +01:00
|
|
|
|
" required=\"required\"",
|
2022-04-05 01:00:24 +02:00
|
|
|
|
The_GetSuffix ());
|
2021-07-08 15:00:17 +02:00
|
|
|
|
Frm_EndForm ();
|
|
|
|
|
}
|
|
|
|
|
else // I can not edit short name
|
2023-09-21 22:06:19 +02:00
|
|
|
|
HTM_Txt (Gbl.Hierarchy.Node[Level].ShrtName);
|
2021-07-08 15:00:17 +02:00
|
|
|
|
HTM_TD_End ();
|
2019-12-29 20:11:57 +01:00
|
|
|
|
|
|
|
|
|
HTM_TR_End ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************* Show web in configuration *************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void HieCfg_WWW (bool PrintView,bool PutForm,Act_Action_t NextAction,
|
|
|
|
|
const char WWW[Cns_MAX_BYTES_WWW + 1])
|
|
|
|
|
{
|
|
|
|
|
extern const char *Txt_Web;
|
|
|
|
|
|
|
|
|
|
/***** Web *****/
|
|
|
|
|
HTM_TR_Begin (NULL);
|
|
|
|
|
|
2021-07-08 15:00:17 +02:00
|
|
|
|
/* Label */
|
|
|
|
|
Frm_LabelColumn ("RT",PutForm ? "WWW" :
|
|
|
|
|
NULL,
|
|
|
|
|
Txt_Web);
|
|
|
|
|
|
|
|
|
|
/* Data */
|
2022-04-05 01:00:24 +02:00
|
|
|
|
HTM_TD_Begin ("class=\"LB DAT_%s\"",The_GetSuffix ());
|
2021-07-08 15:00:17 +02:00
|
|
|
|
if (PutForm)
|
|
|
|
|
{
|
|
|
|
|
/* Form to change web */
|
|
|
|
|
Frm_BeginForm (NextAction);
|
|
|
|
|
HTM_INPUT_URL ("WWW",WWW,HTM_SUBMIT_ON_CHANGE,
|
2022-03-30 00:46:18 +02:00
|
|
|
|
"id=\"WWW\" class=\"INPUT_WWW_WIDE INPUT_%s\""
|
2021-12-20 09:24:49 +01:00
|
|
|
|
" required=\"required\"",
|
2022-04-05 01:00:24 +02:00
|
|
|
|
The_GetSuffix ());
|
2021-07-08 15:00:17 +02:00
|
|
|
|
Frm_EndForm ();
|
|
|
|
|
}
|
|
|
|
|
else // I can not change web
|
|
|
|
|
{
|
|
|
|
|
HTM_DIV_Begin ("class=\"EXTERNAL_WWW_LONG\"");
|
|
|
|
|
if (!PrintView)
|
2022-03-29 00:58:40 +02:00
|
|
|
|
HTM_A_Begin ("href=\"%s\" target=\"_blank\""
|
|
|
|
|
" class=\"DAT_%s\"",
|
2022-04-05 01:00:24 +02:00
|
|
|
|
WWW,The_GetSuffix ());
|
2021-07-08 15:00:17 +02:00
|
|
|
|
HTM_Txt (WWW);
|
|
|
|
|
if (!PrintView)
|
|
|
|
|
HTM_A_End ();
|
|
|
|
|
HTM_DIV_End ();
|
|
|
|
|
}
|
|
|
|
|
HTM_TD_End ();
|
2019-12-29 20:11:57 +01:00
|
|
|
|
|
|
|
|
|
HTM_TR_End ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********************** Show shortcut in configuration ***********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2023-03-10 17:21:04 +01:00
|
|
|
|
void HieCfg_Shortcut (bool PrintView,ParCod_Param_t ParCode,long HieCod)
|
2019-12-29 20:11:57 +01:00
|
|
|
|
{
|
2023-03-10 00:13:55 +01:00
|
|
|
|
extern const char *Par_CodeStr[];
|
2019-12-29 20:11:57 +01:00
|
|
|
|
extern const char *Txt_Shortcut;
|
|
|
|
|
|
|
|
|
|
/***** Short cut *****/
|
|
|
|
|
HTM_TR_Begin (NULL);
|
|
|
|
|
|
2021-07-08 15:00:17 +02:00
|
|
|
|
/* Label */
|
|
|
|
|
Frm_LabelColumn ("RT",NULL,Txt_Shortcut);
|
|
|
|
|
|
|
|
|
|
/* Data */
|
2022-04-05 01:00:24 +02:00
|
|
|
|
HTM_TD_Begin ("class=\"LB DAT_%s\"",The_GetSuffix ());
|
2021-07-08 15:00:17 +02:00
|
|
|
|
if (!PrintView)
|
|
|
|
|
{
|
2023-03-10 17:21:04 +01:00
|
|
|
|
if (ParCode == ParCod_None)
|
2023-03-10 00:13:55 +01:00
|
|
|
|
HTM_A_Begin ("href=\"%s/\" target=\"_blank\" class=\"DAT_%s\"",
|
2021-07-08 15:00:17 +02:00
|
|
|
|
Cfg_URL_SWAD_CGI,
|
2022-04-05 01:00:24 +02:00
|
|
|
|
The_GetSuffix ());
|
2021-07-08 15:00:17 +02:00
|
|
|
|
else
|
2023-03-10 00:13:55 +01:00
|
|
|
|
HTM_A_Begin ("href=\"%s/?%s=%ld\" target=\"_blank\""
|
|
|
|
|
" class=\"DAT_%s\"",
|
2021-12-15 00:47:29 +01:00
|
|
|
|
Cfg_URL_SWAD_CGI,
|
2023-03-10 00:13:55 +01:00
|
|
|
|
Par_CodeStr[ParCode],HieCod,
|
2022-04-05 01:00:24 +02:00
|
|
|
|
The_GetSuffix ());
|
2021-07-08 15:00:17 +02:00
|
|
|
|
}
|
2023-03-10 17:21:04 +01:00
|
|
|
|
if (ParCode == ParCod_None)
|
2021-07-08 15:00:17 +02:00
|
|
|
|
HTM_TxtF ("%s/",
|
2020-01-09 16:44:14 +01:00
|
|
|
|
Cfg_URL_SWAD_CGI);
|
2023-03-10 00:13:55 +01:00
|
|
|
|
else
|
|
|
|
|
HTM_TxtF ("%s/?%s=%ld",
|
|
|
|
|
Cfg_URL_SWAD_CGI,
|
|
|
|
|
Par_CodeStr[ParCode],HieCod);
|
2021-07-08 15:00:17 +02:00
|
|
|
|
if (!PrintView)
|
|
|
|
|
HTM_A_End ();
|
|
|
|
|
HTM_TD_End ();
|
2019-12-29 20:11:57 +01:00
|
|
|
|
|
|
|
|
|
HTM_TR_End ();
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-25 22:18:01 +01:00
|
|
|
|
/*****************************************************************************/
|
2021-03-07 21:21:04 +01:00
|
|
|
|
/************************** Show number of centers ***************************/
|
2020-01-25 22:18:01 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2020-01-26 14:10:27 +01:00
|
|
|
|
void HieCfg_NumCtrs (unsigned NumCtrs,bool PutForm)
|
2020-01-25 22:18:01 +01:00
|
|
|
|
{
|
2021-03-07 21:21:04 +01:00
|
|
|
|
extern const char *Txt_Centers;
|
|
|
|
|
extern const char *Txt_Centers_of_INSTITUTION_X;
|
2021-12-29 23:41:26 +01:00
|
|
|
|
char *Title;
|
2020-01-25 22:18:01 +01:00
|
|
|
|
|
2021-03-07 21:21:04 +01:00
|
|
|
|
/***** Number of centers *****/
|
2020-01-25 22:18:01 +01:00
|
|
|
|
HTM_TR_Begin (NULL);
|
|
|
|
|
|
2021-07-08 15:00:17 +02:00
|
|
|
|
/* Label */
|
|
|
|
|
Frm_LabelColumn ("RT",NULL,Txt_Centers);
|
|
|
|
|
|
|
|
|
|
/* Data */
|
2022-04-05 01:00:24 +02:00
|
|
|
|
HTM_TD_Begin ("class=\"LB DAT_%s\"",The_GetSuffix ());
|
2021-07-08 15:00:17 +02:00
|
|
|
|
if (PutForm)
|
|
|
|
|
{
|
|
|
|
|
Frm_BeginFormGoTo (ActSeeCtr);
|
2023-09-22 14:47:56 +02:00
|
|
|
|
ParCod_PutPar (ParCod_Ins,Gbl.Hierarchy.Node[Hie_INS].HieCod);
|
2021-12-29 23:41:26 +01:00
|
|
|
|
if (asprintf (&Title,Txt_Centers_of_INSTITUTION_X,
|
2023-09-22 14:47:56 +02:00
|
|
|
|
Gbl.Hierarchy.Node[Hie_INS].ShrtName) < 0)
|
2021-12-29 23:41:26 +01:00
|
|
|
|
Err_NotEnoughMemoryExit ();
|
2022-09-09 12:50:53 +02:00
|
|
|
|
HTM_BUTTON_Submit_Begin (Title,"class=\"LB BT_LINK\"");
|
2021-12-29 23:41:26 +01:00
|
|
|
|
free (Title);
|
2021-07-08 15:00:17 +02:00
|
|
|
|
}
|
|
|
|
|
HTM_Unsigned (NumCtrs);
|
|
|
|
|
if (PutForm)
|
|
|
|
|
{
|
|
|
|
|
HTM_BUTTON_End ();
|
|
|
|
|
Frm_EndForm ();
|
|
|
|
|
}
|
|
|
|
|
HTM_TD_End ();
|
2020-01-25 22:18:01 +01:00
|
|
|
|
|
|
|
|
|
HTM_TR_End ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2021-03-07 21:21:04 +01:00
|
|
|
|
/********************* Show number of centers with map ***********************/
|
2020-01-25 22:18:01 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void HieCfg_NumCtrsWithMap (unsigned NumCtrs,unsigned NumCtrsWithMap)
|
|
|
|
|
{
|
2021-03-07 21:21:04 +01:00
|
|
|
|
extern const char *Txt_Centers_with_map;
|
2020-01-25 22:18:01 +01:00
|
|
|
|
|
2021-03-07 21:21:04 +01:00
|
|
|
|
/***** Number of centers with map *****/
|
2020-01-25 22:18:01 +01:00
|
|
|
|
HTM_TR_Begin (NULL);
|
|
|
|
|
|
2021-07-08 15:00:17 +02:00
|
|
|
|
/* Label */
|
|
|
|
|
Frm_LabelColumn ("RT",NULL,Txt_Centers_with_map);
|
2020-01-25 22:18:01 +01:00
|
|
|
|
|
2021-07-08 15:00:17 +02:00
|
|
|
|
/* Data */
|
2022-04-05 01:00:24 +02:00
|
|
|
|
HTM_TD_Begin ("class=\"LB DAT_%s\"",The_GetSuffix ());
|
2021-07-08 15:00:17 +02:00
|
|
|
|
HTM_TxtF ("%u (%.1lf%%)",
|
|
|
|
|
NumCtrsWithMap,
|
|
|
|
|
NumCtrs ? (double) NumCtrsWithMap * 100.0 /
|
|
|
|
|
(double) NumCtrs :
|
|
|
|
|
0.0);
|
|
|
|
|
HTM_TD_End ();
|
2020-01-25 22:18:01 +01:00
|
|
|
|
|
|
|
|
|
HTM_TR_End ();
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-29 20:11:57 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************* Show QR in configuration **************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2023-03-10 17:21:04 +01:00
|
|
|
|
void HieCfg_QR (ParCod_Param_t ParCode,long HieCod)
|
2019-12-29 20:11:57 +01:00
|
|
|
|
{
|
|
|
|
|
extern const char *Txt_QR_code;
|
|
|
|
|
|
|
|
|
|
/***** QR *****/
|
|
|
|
|
HTM_TR_Begin (NULL);
|
|
|
|
|
|
2021-07-08 15:00:17 +02:00
|
|
|
|
/* Label */
|
|
|
|
|
Frm_LabelColumn ("RT",NULL,Txt_QR_code);
|
2019-12-29 20:11:57 +01:00
|
|
|
|
|
2021-07-08 15:00:17 +02:00
|
|
|
|
/* Data */
|
2022-04-05 01:00:24 +02:00
|
|
|
|
HTM_TD_Begin ("class=\"LB DAT_%s\"",The_GetSuffix ());
|
2023-03-10 00:13:55 +01:00
|
|
|
|
QR_LinkTo (250,ParCode,HieCod);
|
2021-07-08 15:00:17 +02:00
|
|
|
|
HTM_TD_End ();
|
2019-12-29 20:11:57 +01:00
|
|
|
|
|
|
|
|
|
HTM_TR_End ();
|
|
|
|
|
}
|
2020-05-02 10:53:40 +02:00
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************ Number of users in courses *************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2023-09-22 14:47:56 +02:00
|
|
|
|
void HieCfg_NumUsrsInCrss (Hie_Level_t Level,long Cod,Rol_Role_t Role)
|
2020-05-02 10:53:40 +02:00
|
|
|
|
{
|
|
|
|
|
extern const char *Txt_Users_in_courses;
|
|
|
|
|
extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
|
|
|
|
|
|
|
|
|
/***** Number of users in courses *****/
|
|
|
|
|
HTM_TR_Begin (NULL);
|
|
|
|
|
|
2021-07-08 15:00:17 +02:00
|
|
|
|
/* Label */
|
|
|
|
|
Frm_LabelColumn ("RT",NULL,
|
|
|
|
|
Role == Rol_UNK ? Txt_Users_in_courses :
|
|
|
|
|
Txt_ROLES_PLURAL_Abc[Role][Usr_SEX_UNKNOWN]);
|
|
|
|
|
|
|
|
|
|
/* Data */
|
2022-04-05 01:00:24 +02:00
|
|
|
|
HTM_TD_Begin ("class=\"LB DAT_%s\"",The_GetSuffix ());
|
2023-07-11 19:12:24 +02:00
|
|
|
|
HTM_Unsigned (Enr_GetCachedNumUsrsInCrss (Level,Cod,
|
2021-07-08 15:00:17 +02:00
|
|
|
|
Role == Rol_UNK ? (1 << Rol_STD) |
|
|
|
|
|
(1 << Rol_NET) |
|
|
|
|
|
(1 << Rol_TCH) : // Any user
|
|
|
|
|
(1 << Role)));
|
|
|
|
|
HTM_TD_End ();
|
2020-05-02 10:53:40 +02:00
|
|
|
|
|
|
|
|
|
HTM_TR_End ();
|
|
|
|
|
}
|