Version 22.86.1: Mar 29, 2023 Icon to remove resource clipboard only if there are resources.

This commit is contained in:
acanas 2023-03-29 16:34:06 +02:00
parent 3b33d6b45c
commit 2bf309cf1b
5 changed files with 26 additions and 5 deletions

View File

@ -629,10 +629,11 @@ TODO: Emilce Barrera Mesa: Podr
TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen.
*/
#define Log_PLATFORM_VERSION "SWAD 22.86 (2023-03-29)"
#define Log_PLATFORM_VERSION "SWAD 22.86.1 (2023-03-29)"
#define CSS_FILE "swad22.86.css"
#define JS_FILE "swad22.49.js"
/*
Version 22.86.1: Mar 29, 2023 Icon to remove resource clipboard only if there are resources. (338596 lines)
Version 22.86: Mar 29, 2023 New actions to see and remove the resource clipboard in rubrics. (338578 lines)
Version 22.85.1: Mar 29, 2023 Code refactoring in links to update sections. (338447 lines)
Version 22.85: Mar 29, 2023 New action to remove the resource clipboard in program. (338449 lines)

View File

@ -872,6 +872,7 @@ static void PrgRsc_PutIconsClipboard (__attribute__((unused)) void *Args)
{
/***** Put icon to remove resource clipboard in program *****/
if (Prg_CheckIfICanEditProgram ())
if (Rsc_DB_GetNumResourcesInClipboard ()) // Only if there are resources
Ico_PutContextualIconToRemove (ActRemRscCli_InPrg,NULL,
NULL,NULL);
}

View File

@ -54,6 +54,22 @@ void Rsc_DB_CopyToClipboard (Rsc_Type_t Type,long Cod)
Cod);
}
/*****************************************************************************/
/******************** Get number of resources in clipboard *******************/
/*****************************************************************************/
unsigned Rsc_DB_GetNumResourcesInClipboard (void)
{
return (unsigned)
DB_QueryCOUNT ("can not get resources",
"SELECT COUNT(*)"
" FROM rsc_clipboards"
" WHERE UsrCod=%ld"
" AND CrsCod=%ld",
Gbl.Usrs.Me.UsrDat.UsrCod,
Gbl.Hierarchy.Crs.CrsCod);
}
/*****************************************************************************/
/****************** Get all resources from resource clipboard ****************/
/*****************************************************************************/

View File

@ -34,6 +34,8 @@
/*****************************************************************************/
void Rsc_DB_CopyToClipboard (Rsc_Type_t Type,long Cod);
unsigned Rsc_DB_GetNumResourcesInClipboard (void);
unsigned Rsc_DB_GetClipboard (MYSQL_RES **mysql_res);
void Rsc_DB_RemoveClipboard (void);

View File

@ -175,6 +175,7 @@ static void RubRsc_PutIconsClipboard (__attribute__((unused)) void *Args)
{
/***** Put icon to remove resource clipboard in rubrics *****/
if (Rub_CheckIfICanEditRubrics ())
if (Rsc_DB_GetNumResourcesInClipboard ()) // Only if there are resources
Ico_PutContextualIconToRemove (ActRemRscCli_InRub,NULL,
NULL,NULL);
}