mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-13 04:04:35 +02:00
Version 22.20: Sep 22, 2022 Hidden items are not shown in program.
This commit is contained in:
parent
891122d268
commit
1dba1d82d9
|
@ -1 +1 @@
|
||||||
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="check-circle" class="svg-inline--fa fa-check-circle fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#246600" d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path></svg>
|
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="check-circle" class="svg-inline--fa fa-check-circle fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path></svg>
|
Before Width: | Height: | Size: 596 B After Width: | Height: | Size: 600 B |
|
@ -606,12 +606,14 @@ TODO: Fix bug: error al enviar un mensaje a dos recipientes, error on duplicate
|
||||||
|
|
||||||
TODO: Attach pdf files in multimedia.
|
TODO: Attach pdf files in multimedia.
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 22.19 (2022-09-21)"
|
#define Log_PLATFORM_VERSION "SWAD 22.20 (2022-09-22)"
|
||||||
#define CSS_FILE "swad22.18.css"
|
#define CSS_FILE "swad22.18.css"
|
||||||
#define JS_FILE "swad21.100.js"
|
#define JS_FILE "swad21.100.js"
|
||||||
/*
|
/*
|
||||||
TODO: Los items ocultos no deben salir en modo ver. En modo edición deben salir en otro color.
|
Version 22.20: Sep 22, 2022 Hidden items are not shown in program. (331838 lines)
|
||||||
TODO: Enlace Ok en los TFG sale de otro color.
|
Copy the following icon to icon public directory:
|
||||||
|
sudo cp icon/check-circle.svg /var/www/html/swad/icon/
|
||||||
|
|
||||||
Version 22.19: Sep 22, 2022 Fixed bugs in program. (331843 lines)
|
Version 22.19: Sep 22, 2022 Fixed bugs in program. (331843 lines)
|
||||||
Version 22.18: Sep 22, 2022 Expand/contract program items. (331877 lines)
|
Version 22.18: Sep 22, 2022 Expand/contract program items. (331877 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
|
|
|
@ -124,9 +124,9 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
||||||
long SelectedRscCod);
|
long SelectedRscCod);
|
||||||
static void Prg_PutIconToContractExpandItem (struct Prg_Item *Item,
|
static void Prg_PutIconToContractExpandItem (struct Prg_Item *Item,
|
||||||
bool Expanded,bool Editing);
|
bool Expanded,bool Editing);
|
||||||
static void Prg_WriteItemText (long ItmCod,bool LightStyle);
|
static void Prg_WriteItemText (long ItmCod,bool IsHidden);
|
||||||
static void Prg_WriteRowToCreateItem (long ParentItmCod,unsigned FormLevel);
|
static void Prg_WriteRowToCreateItem (long ParentItmCod,unsigned FormLevel);
|
||||||
static void Prg_SetTitleClass (char **TitleClass,unsigned Level,bool LightStyle);
|
static void Prg_SetTitleClass (char **TitleClass,unsigned Level);
|
||||||
static void Prg_FreeTitleClass (char *TitleClass);
|
static void Prg_FreeTitleClass (char *TitleClass);
|
||||||
|
|
||||||
static void Prg_SetMaxItemLevel (unsigned Level);
|
static void Prg_SetMaxItemLevel (unsigned Level);
|
||||||
|
@ -499,7 +499,7 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
||||||
[Prg_CHANGE_RESOURCE_LINK] = true,
|
[Prg_CHANGE_RESOURCE_LINK] = true,
|
||||||
[Prg_END_EDIT_RES ] = true,
|
[Prg_END_EDIT_RES ] = true,
|
||||||
};
|
};
|
||||||
bool LightStyle;
|
bool IsHidden;
|
||||||
char *Id;
|
char *Id;
|
||||||
unsigned ColSpan;
|
unsigned ColSpan;
|
||||||
unsigned NumCol;
|
unsigned NumCol;
|
||||||
|
@ -510,12 +510,14 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
||||||
/***** Check if this item should be shown as hidden *****/
|
/***** Check if this item should be shown as hidden *****/
|
||||||
Prg_SetHiddenLevel (Item->Hierarchy.Level,Item->Hierarchy.Hidden);
|
Prg_SetHiddenLevel (Item->Hierarchy.Level,Item->Hierarchy.Hidden);
|
||||||
if (Item->Hierarchy.Hidden) // this item is marked as hidden
|
if (Item->Hierarchy.Hidden) // this item is marked as hidden
|
||||||
LightStyle = true;
|
IsHidden = true;
|
||||||
else // this item is not marked as hidden
|
else // this item is not marked as hidden
|
||||||
LightStyle = Prg_CheckIfAnyHigherLevelIsHidden (Item->Hierarchy.Level);
|
IsHidden = Prg_CheckIfAnyHigherLevelIsHidden (Item->Hierarchy.Level);
|
||||||
|
|
||||||
|
if (Editing[ListingType] || !IsHidden)
|
||||||
|
{
|
||||||
/***** Title CSS class *****/
|
/***** Title CSS class *****/
|
||||||
Prg_SetTitleClass (&TitleClass,Item->Hierarchy.Level,LightStyle);
|
Prg_SetTitleClass (&TitleClass,Item->Hierarchy.Level);
|
||||||
|
|
||||||
/***** Increase number in level *****/
|
/***** Increase number in level *****/
|
||||||
Prg_IncreaseNumberInLevel (Item->Hierarchy.Level);
|
Prg_IncreaseNumberInLevel (Item->Hierarchy.Level);
|
||||||
|
@ -554,9 +556,13 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Item number *****/
|
/***** Item number *****/
|
||||||
HTM_TD_Begin ("rowspan=\"2\" class=\"PRG_NUM %s RT %s\"",
|
HTM_TD_Begin ("rowspan=\"2\" class=\"PRG_NUM %s\"",The_GetColorRows ());
|
||||||
TitleClass,The_GetColorRows ());
|
HTM_DIV_Begin ("class=\"RT %s%s\"",
|
||||||
|
TitleClass,
|
||||||
|
IsHidden ? " PRG_HIDDEN" :
|
||||||
|
"");
|
||||||
Prg_WriteNumItem (Item->Hierarchy.Level);
|
Prg_WriteNumItem (Item->Hierarchy.Level);
|
||||||
|
HTM_DIV_End ();
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Title *****/
|
/***** Title *****/
|
||||||
|
@ -564,22 +570,26 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
||||||
switch (ListingType)
|
switch (ListingType)
|
||||||
{
|
{
|
||||||
case Prg_PRINT:
|
case Prg_PRINT:
|
||||||
HTM_TD_Begin ("colspan=\"%u\" class=\"PRG_MAIN %s\"",
|
HTM_TD_Begin ("colspan=\"%u\" class=\"PRG_MAIN\"",ColSpan);
|
||||||
ColSpan,TitleClass);
|
|
||||||
HTM_Txt (Item->Title);
|
|
||||||
HTM_TD_End ();
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
HTM_TD_Begin ("colspan=\"%u\" class=\"PRG_MAIN %s %s\"",
|
HTM_TD_Begin ("colspan=\"%u\" class=\"PRG_MAIN %s\"",ColSpan,
|
||||||
ColSpan,TitleClass,The_GetColorRows ());
|
The_GetColorRows ());
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (HighlightItem)
|
if (HighlightItem)
|
||||||
HTM_ARTICLE_Begin (Prg_ITEM_SECTION_ID);
|
HTM_ARTICLE_Begin (Prg_ITEM_SECTION_ID);
|
||||||
|
HTM_DIV_Begin ("class=\"LT %s%s\"",
|
||||||
|
TitleClass,
|
||||||
|
IsHidden ? " PRG_HIDDEN" :
|
||||||
|
"");
|
||||||
HTM_Txt (Item->Title);
|
HTM_Txt (Item->Title);
|
||||||
|
HTM_DIV_End ();
|
||||||
if (HighlightItem)
|
if (HighlightItem)
|
||||||
HTM_ARTICLE_End ();
|
HTM_ARTICLE_End ();
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** Start/end date/time *****/
|
/***** Start/end date/time *****/
|
||||||
UniqueId++;
|
UniqueId++;
|
||||||
|
@ -593,28 +603,23 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
||||||
switch (ListingType)
|
switch (ListingType)
|
||||||
{
|
{
|
||||||
case Prg_PRINT:
|
case Prg_PRINT:
|
||||||
HTM_TD_Begin ("id=\"%s\" class=\"PRG_DATE LT %s_%s\"",
|
HTM_TD_Begin ("class=\"PRG_DATE LT\"");
|
||||||
Id,
|
|
||||||
LightStyle ? (Item->Open ? "DATE_GREEN_LIGHT" :
|
|
||||||
"DATE_RED_LIGHT") :
|
|
||||||
(Item->Open ? "DATE_GREEN" :
|
|
||||||
"DATE_RED"),
|
|
||||||
The_GetSuffix ());
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
HTM_TD_Begin ("id=\"%s\" class=\"PRG_DATE LT %s_%s %s\"",
|
HTM_TD_Begin ("class=\"PRG_DATE LT %s\"",The_GetColorRows ());
|
||||||
Id,
|
|
||||||
LightStyle ? (Item->Open ? "DATE_GREEN_LIGHT" :
|
|
||||||
"DATE_RED_LIGHT") :
|
|
||||||
(Item->Open ? "DATE_GREEN" :
|
|
||||||
"DATE_RED"),
|
|
||||||
The_GetSuffix (),
|
|
||||||
The_GetColorRows ());
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
HTM_DIV_Begin ("id=\"%s\" class=\"%s_%s%s\"",
|
||||||
|
Id,
|
||||||
|
Item->Open ? "DATE_GREEN" :
|
||||||
|
"DATE_RED",
|
||||||
|
The_GetSuffix (),
|
||||||
|
IsHidden ? " PRG_HIDDEN" :
|
||||||
|
"");
|
||||||
Dat_WriteLocalDateHMSFromUTC (Id,Item->TimeUTC[StartEndTime],
|
Dat_WriteLocalDateHMSFromUTC (Id,Item->TimeUTC[StartEndTime],
|
||||||
Gbl.Prefs.DateFormat,Dat_SEPARATOR_BREAK,
|
Gbl.Prefs.DateFormat,Dat_SEPARATOR_BREAK,
|
||||||
true,true,true,0x7);
|
true,true,true,0x7);
|
||||||
|
HTM_DIV_End ();
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
free (Id);
|
free (Id);
|
||||||
}
|
}
|
||||||
|
@ -644,7 +649,7 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
||||||
Prg_ShowFormToChangeItem (Item->Hierarchy.ItmCod);
|
Prg_ShowFormToChangeItem (Item->Hierarchy.ItmCod);
|
||||||
else
|
else
|
||||||
/* Text */
|
/* Text */
|
||||||
Prg_WriteItemText (Item->Hierarchy.ItmCod,LightStyle);
|
Prg_WriteItemText (Item->Hierarchy.ItmCod,IsHidden);
|
||||||
|
|
||||||
/* List of resources */
|
/* List of resources */
|
||||||
PrgRsc_ListItemResources (ListingType,Item,SelectedItmCod,SelectedRscCod);
|
PrgRsc_ListItemResources (ListingType,Item,SelectedItmCod,SelectedRscCod);
|
||||||
|
@ -658,6 +663,7 @@ static void Prg_WriteRowItem (Prg_ListingType_t ListingType,
|
||||||
/***** Free title CSS class *****/
|
/***** Free title CSS class *****/
|
||||||
Prg_FreeTitleClass (TitleClass);
|
Prg_FreeTitleClass (TitleClass);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************ Put icon to expand an item *************************/
|
/************************ Put icon to expand an item *************************/
|
||||||
|
@ -689,7 +695,7 @@ static void Prg_PutIconToContractExpandItem (struct Prg_Item *Item,
|
||||||
/**************************** Show item text *********************************/
|
/**************************** Show item text *********************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Prg_WriteItemText (long ItmCod,bool LightStyle)
|
static void Prg_WriteItemText (long ItmCod,bool IsHidden)
|
||||||
{
|
{
|
||||||
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
||||||
|
|
||||||
|
@ -700,7 +706,7 @@ static void Prg_WriteItemText (long ItmCod,bool LightStyle)
|
||||||
ALn_InsertLinks (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links
|
ALn_InsertLinks (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links
|
||||||
HTM_DIV_Begin ("class=\"PAR PRG_TXT_%s%s\"",
|
HTM_DIV_Begin ("class=\"PAR PRG_TXT_%s%s\"",
|
||||||
The_GetSuffix (),
|
The_GetSuffix (),
|
||||||
LightStyle ? " PRG_HIDDEN" :
|
IsHidden ? " PRG_HIDDEN" :
|
||||||
"");
|
"");
|
||||||
HTM_Txt (Txt);
|
HTM_Txt (Txt);
|
||||||
HTM_DIV_End ();
|
HTM_DIV_End ();
|
||||||
|
@ -717,7 +723,7 @@ static void Prg_WriteRowToCreateItem (long ParentItmCod,unsigned FormLevel)
|
||||||
unsigned NumCol;
|
unsigned NumCol;
|
||||||
|
|
||||||
/***** Title CSS class *****/
|
/***** Title CSS class *****/
|
||||||
Prg_SetTitleClass (&TitleClass,FormLevel,false);
|
Prg_SetTitleClass (&TitleClass,FormLevel);
|
||||||
|
|
||||||
/***** Begin row *****/
|
/***** Begin row *****/
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
@ -766,14 +772,12 @@ static void Prg_WriteRowToCreateItem (long ParentItmCod,unsigned FormLevel)
|
||||||
/**************** Set / free title class depending on level ******************/
|
/**************** Set / free title class depending on level ******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Prg_SetTitleClass (char **TitleClass,unsigned Level,bool LightStyle)
|
static void Prg_SetTitleClass (char **TitleClass,unsigned Level)
|
||||||
{
|
{
|
||||||
if (asprintf (TitleClass,"PRG_TIT_%u_%s%s",
|
if (asprintf (TitleClass,"PRG_TIT_%u_%s",
|
||||||
Level < 5 ? Level :
|
Level < 5 ? Level :
|
||||||
5,
|
5,
|
||||||
The_GetSuffix (),
|
The_GetSuffix ()) < 0)
|
||||||
LightStyle ? " PRG_HIDDEN" :
|
|
||||||
"") < 0)
|
|
||||||
Err_NotEnoughMemoryExit ();
|
Err_NotEnoughMemoryExit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -185,7 +185,6 @@ void PrgRsc_ListItemResources (Prg_ListingType_t ListingType,
|
||||||
unsigned NumRsc;
|
unsigned NumRsc;
|
||||||
unsigned NumResources;
|
unsigned NumResources;
|
||||||
bool EditingResourcesOfThisItem;
|
bool EditingResourcesOfThisItem;
|
||||||
bool EditLink;
|
|
||||||
char *Title;
|
char *Title;
|
||||||
static bool Editing[Prg_NUM_LISTING_TYPES] =
|
static bool Editing[Prg_NUM_LISTING_TYPES] =
|
||||||
{
|
{
|
||||||
|
@ -228,14 +227,12 @@ void PrgRsc_ListItemResources (Prg_ListingType_t ListingType,
|
||||||
|
|
||||||
if (NumResources || Editing[ListingType])
|
if (NumResources || Editing[ListingType])
|
||||||
{
|
{
|
||||||
/***** Begin section *****/
|
|
||||||
// if (FeaturedList[ListingType])
|
|
||||||
if (Item->Hierarchy.ItmCod == SelectedItmCod)
|
if (Item->Hierarchy.ItmCod == SelectedItmCod)
|
||||||
|
{
|
||||||
|
/***** Begin section *****/
|
||||||
HTM_SECTION_Begin (PrgRsc_RESOURCE_SECTION_ID);
|
HTM_SECTION_Begin (PrgRsc_RESOURCE_SECTION_ID);
|
||||||
|
|
||||||
/***** Show possible alerts *****/
|
/***** Show possible alerts *****/
|
||||||
if (Item->Hierarchy.ItmCod == SelectedItmCod)
|
|
||||||
{
|
|
||||||
if (Gbl.Action.Act == ActReqRemPrgRsc)
|
if (Gbl.Action.Act == ActReqRemPrgRsc)
|
||||||
/* Alert with button to remove resource */
|
/* Alert with button to remove resource */
|
||||||
Ale_ShowLastAlertAndButton (ActRemPrgRsc,PrgRsc_RESOURCE_SECTION_ID,NULL,
|
Ale_ShowLastAlertAndButton (ActRemPrgRsc,PrgRsc_RESOURCE_SECTION_ID,NULL,
|
||||||
|
@ -274,22 +271,18 @@ void PrgRsc_ListItemResources (Prg_ListingType_t ListingType,
|
||||||
|
|
||||||
/* Show item */
|
/* Show item */
|
||||||
if (EditingResourcesOfThisItem)
|
if (EditingResourcesOfThisItem)
|
||||||
{
|
PrgRsc_WriteRowEditResource (NumRsc,NumResources,Item,
|
||||||
EditLink = (Item->Resource.Hierarchy.RscCod == SelectedRscCod);
|
(ListingType == Prg_EDIT_RESOURCE_LINK &&
|
||||||
PrgRsc_WriteRowEditResource (NumRsc,NumResources,Item,EditLink);
|
Item->Resource.Hierarchy.RscCod == SelectedRscCod)); // Edit this link?
|
||||||
}
|
|
||||||
else
|
else
|
||||||
PrgRsc_WriteRowViewResource (NumRsc,Item);
|
PrgRsc_WriteRowViewResource (NumRsc,Item);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Form to create a new resource *****/
|
/***** Form to create a new resource *****/
|
||||||
if (EditingResourcesOfThisItem)
|
if (EditingResourcesOfThisItem)
|
||||||
{
|
PrgRsc_WriteRowNewResource (NumResources,Item,
|
||||||
Item->Resource.Hierarchy.RscCod = -1L;
|
(ListingType == Prg_EDIT_RESOURCE_LINK &&
|
||||||
EditLink = (ListingType == Prg_EDIT_RESOURCE_LINK &&
|
SelectedRscCod <= 0)); // Edit this link?
|
||||||
Item->Resource.Hierarchy.RscCod == SelectedRscCod);
|
|
||||||
PrgRsc_WriteRowNewResource (NumResources,Item,EditLink);
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** End table *****/
|
/***** End table *****/
|
||||||
HTM_TBODY_End ();
|
HTM_TBODY_End ();
|
||||||
|
@ -299,7 +292,6 @@ void PrgRsc_ListItemResources (Prg_ListingType_t ListingType,
|
||||||
Box_BoxEnd ();
|
Box_BoxEnd ();
|
||||||
|
|
||||||
/***** End section *****/
|
/***** End section *****/
|
||||||
// if (FeaturedList[ListingType])
|
|
||||||
if (Item->Hierarchy.ItmCod == SelectedItmCod)
|
if (Item->Hierarchy.ItmCod == SelectedItmCod)
|
||||||
HTM_SECTION_End ();
|
HTM_SECTION_End ();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user