mirror of https://github.com/acanas/swad-core.git
Version 22.4.2: Sep 16, 2022 Changes in edition of program items.
This commit is contained in:
parent
4c2893aff4
commit
c8297efb77
|
@ -1679,7 +1679,7 @@ a:hover img.CENTER_PHOTO_SHOW
|
||||||
.PRG_COL1
|
.PRG_COL1
|
||||||
{
|
{
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
width:86px;
|
width:108px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.PRG_TITLE_DESCRIPTION_WIDTH
|
.PRG_TITLE_DESCRIPTION_WIDTH
|
||||||
|
@ -1778,8 +1778,8 @@ a:hover img.CENTER_PHOTO_SHOW
|
||||||
.PRG_RSC_PURPLE,
|
.PRG_RSC_PURPLE,
|
||||||
.PRG_RSC_BLUE,
|
.PRG_RSC_BLUE,
|
||||||
.PRG_RSC_YELLOW,
|
.PRG_RSC_YELLOW,
|
||||||
.PRG_RSC_PINK {color:#202020; font-size:14pt; font-weight:bold;}
|
.PRG_RSC_PINK {color:#202020; font-size:12pt;}
|
||||||
.PRG_RSC_DARK {color:#e0e0e0; font-size:14pt; font-weight:bold;}
|
.PRG_RSC_DARK {color:#e0e0e0; font-size:12pt;}
|
||||||
|
|
||||||
/************************* Program resource clipboard ************************/
|
/************************* Program resource clipboard ************************/
|
||||||
.PRG_CLIPBOARD
|
.PRG_CLIPBOARD
|
||||||
|
|
|
@ -7969,12 +7969,19 @@ void Brw_ShowFileMetadata (void)
|
||||||
FileNameToShow);
|
FileNameToShow);
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
|
/*
|
||||||
PutIconToGetLink = (Gbl.FileBrowser.Type == Brw_SHOW_DOC_CRS || // Only document zone
|
PutIconToGetLink = (Gbl.FileBrowser.Type == Brw_SHOW_DOC_CRS || // Only document zone
|
||||||
Gbl.FileBrowser.Type == Brw_ADMI_DOC_CRS) &&
|
Gbl.FileBrowser.Type == Brw_ADMI_DOC_CRS) &&
|
||||||
(FileMetadata.FilFolLnk.Type == Brw_IS_FILE || // Only files or links
|
(FileMetadata.FilFolLnk.Type == Brw_IS_FILE || // Only files or links
|
||||||
FileMetadata.FilFolLnk.Type == Brw_IS_LINK) &&
|
FileMetadata.FilFolLnk.Type == Brw_IS_LINK) &&
|
||||||
(Gbl.Usrs.Me.Role.Logged == Rol_TCH || // Only if I am teacher or superuser
|
(Gbl.Usrs.Me.Role.Logged == Rol_TCH || // Only if I am teacher or superuser
|
||||||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM);
|
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM);
|
||||||
|
*/
|
||||||
|
PutIconToGetLink = (Gbl.FileBrowser.Type == Brw_SHOW_DOC_CRS || // Only document zone
|
||||||
|
Gbl.FileBrowser.Type == Brw_ADMI_DOC_CRS) &&
|
||||||
|
(FileMetadata.FilFolLnk.Type == Brw_IS_FILE || // Only files or links
|
||||||
|
FileMetadata.FilFolLnk.Type == Brw_IS_LINK) &&
|
||||||
|
(Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); // Only if I am superuser // TODO: Include teachers
|
||||||
if (PutIconToGetLink)
|
if (PutIconToGetLink)
|
||||||
Box_BoxShadowBegin (NULL,NULL,
|
Box_BoxShadowBegin (NULL,NULL,
|
||||||
Brw_PutIconToGetLinkToFile,&FileMetadata,
|
Brw_PutIconToGetLinkToFile,&FileMetadata,
|
||||||
|
|
|
@ -606,10 +606,11 @@ 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.4.1 (2022-09-15)"
|
#define Log_PLATFORM_VERSION "SWAD 22.4.2 (2022-09-16)"
|
||||||
#define CSS_FILE "swad22.3.css"
|
#define CSS_FILE "swad22.3.css"
|
||||||
#define JS_FILE "swad21.100.js"
|
#define JS_FILE "swad21.100.js"
|
||||||
/*
|
/*
|
||||||
|
Version 22.4.2: Sep 16, 2022 Changes in edition of program items. (329982 lines)
|
||||||
Version 22.4.1: Sep 15, 2022 Changes in edition of program items. (329955 lines)
|
Version 22.4.1: Sep 15, 2022 Changes in edition of program items. (329955 lines)
|
||||||
Copy the following icon to icon public directory:
|
Copy the following icon to icon public directory:
|
||||||
sudo cp icon/link.svg /var/www/html/swad/icon/
|
sudo cp icon/link.svg /var/www/html/swad/icon/
|
||||||
|
|
|
@ -70,6 +70,12 @@ typedef enum
|
||||||
PrgRsc_FORUM_THREAD,
|
PrgRsc_FORUM_THREAD,
|
||||||
} PrgRsc_Type_t;
|
} PrgRsc_Type_t;
|
||||||
|
|
||||||
|
struct Prg_Link
|
||||||
|
{
|
||||||
|
PrgRsc_Type_t Type;
|
||||||
|
long Cod;
|
||||||
|
};
|
||||||
|
|
||||||
#define Prg_MAX_CHARS_PROGRAM_ITEM_TITLE (128 - 1) // 127
|
#define Prg_MAX_CHARS_PROGRAM_ITEM_TITLE (128 - 1) // 127
|
||||||
#define Prg_MAX_BYTES_PROGRAM_ITEM_TITLE ((Prg_MAX_CHARS_PROGRAM_ITEM_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
#define Prg_MAX_BYTES_PROGRAM_ITEM_TITLE ((Prg_MAX_CHARS_PROGRAM_ITEM_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
||||||
|
|
||||||
|
@ -92,8 +98,7 @@ struct Prg_Item
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
struct Prg_ResourceHierarchy Hierarchy;
|
struct Prg_ResourceHierarchy Hierarchy;
|
||||||
PrgRsc_Type_t Type;
|
struct Prg_Link Link;
|
||||||
long Cod;
|
|
||||||
char Title[PrgRsc_MAX_BYTES_PROGRAM_RESOURCE_TITLE + 1];
|
char Title[PrgRsc_MAX_BYTES_PROGRAM_RESOURCE_TITLE + 1];
|
||||||
} Resource;
|
} Resource;
|
||||||
};
|
};
|
||||||
|
|
|
@ -112,10 +112,9 @@ static bool PrgRsc_ExchangeResources (const struct Prg_ResourceHierarchy *Rsc1,
|
||||||
const struct Prg_ResourceHierarchy *Rsc2);
|
const struct Prg_ResourceHierarchy *Rsc2);
|
||||||
|
|
||||||
static void PrgRsc_ShowClipboard (struct Prg_Item *Item);
|
static void PrgRsc_ShowClipboard (struct Prg_Item *Item);
|
||||||
static void PrgRsc_WriteRowClipboard (unsigned NumLink,
|
static void PrgRsc_WriteRowClipboard (bool SubmitOnClick,const struct Prg_Link *Link);
|
||||||
const struct PrgRsc_Link *Link);
|
static void PrgRsc_WriteLinkName (const struct Prg_Link *Link);
|
||||||
static void PrgRsc_WriteLinkName (const struct PrgRsc_Link *Link);
|
static void PrgRsc_GetDataOfLinkFromClipboard (struct Prg_Link *Link,
|
||||||
static void PrgRsc_GetDataOfLinkFromClipboard (struct PrgRsc_Link *Link,
|
|
||||||
MYSQL_RES **mysql_res);
|
MYSQL_RES **mysql_res);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -408,8 +407,8 @@ static void PrgRsc_GetDataOfResource (struct Prg_Item *Item,
|
||||||
Item->Resource.Hierarchy.Hidden = (row[3][0] == 'Y');
|
Item->Resource.Hierarchy.Hidden = (row[3][0] == 'Y');
|
||||||
|
|
||||||
/* Get link type and code (row[4], row[5]) */
|
/* Get link type and code (row[4], row[5]) */
|
||||||
Item->Resource.Type = PrgRsc_GetTypeFromString (row[4]);
|
Item->Resource.Link.Type = PrgRsc_GetTypeFromString (row[4]);
|
||||||
Item->Resource.Cod = Str_ConvertStrCodToLongCod (row[5]);
|
Item->Resource.Link.Cod = Str_ConvertStrCodToLongCod (row[5]);
|
||||||
|
|
||||||
/* Get the title of the item resource (row[6]) */
|
/* Get the title of the item resource (row[6]) */
|
||||||
Str_Copy (Item->Resource.Title,row[6],sizeof (Item->Resource.Title) - 1);
|
Str_Copy (Item->Resource.Title,row[6],sizeof (Item->Resource.Title) - 1);
|
||||||
|
@ -422,6 +421,8 @@ static void PrgRsc_GetDataOfResource (struct Prg_Item *Item,
|
||||||
static void PrgRsc_WriteRowViewResource (unsigned NumRsc,
|
static void PrgRsc_WriteRowViewResource (unsigned NumRsc,
|
||||||
const struct Prg_Item *Item)
|
const struct Prg_Item *Item)
|
||||||
{
|
{
|
||||||
|
extern const char *Prg_ResourceTypesDB[PrgRsc_NUM_TYPES];
|
||||||
|
|
||||||
/***** Begin row *****/
|
/***** Begin row *****/
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
|
@ -435,6 +436,10 @@ static void PrgRsc_WriteRowViewResource (unsigned NumRsc,
|
||||||
HTM_TD_Begin ("class=\"PRG_MAIN PRG_RSC_%s %s\"",
|
HTM_TD_Begin ("class=\"PRG_MAIN PRG_RSC_%s %s\"",
|
||||||
The_GetSuffix (),The_GetColorRows1 (1));
|
The_GetSuffix (),The_GetColorRows1 (1));
|
||||||
HTM_Txt (Item->Resource.Title);
|
HTM_Txt (Item->Resource.Title);
|
||||||
|
HTM_BR ();
|
||||||
|
Ico_PutIconOn (Prg_ResourceTypesLogos[Item->Resource.Link.Type],Ico_BLACK,
|
||||||
|
Prg_ResourceTypesDB[Item->Resource.Link.Type]);
|
||||||
|
PrgRsc_WriteLinkName (&Item->Resource.Link);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** End row *****/
|
/***** End row *****/
|
||||||
|
@ -451,10 +456,6 @@ static void PrgRsc_WriteRowEditResource (Prg_ListingType_t ListingType,
|
||||||
long SelectedRscCod)
|
long SelectedRscCod)
|
||||||
{
|
{
|
||||||
extern const char *Prg_ResourceTypesDB[PrgRsc_NUM_TYPES];
|
extern const char *Prg_ResourceTypesDB[PrgRsc_NUM_TYPES];
|
||||||
struct PrgRsc_Link Link;
|
|
||||||
|
|
||||||
Link.Type = Item->Resource.Type;
|
|
||||||
Link.Cod = Item->Resource.Cod;
|
|
||||||
|
|
||||||
/***** Begin row *****/
|
/***** Begin row *****/
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
@ -470,8 +471,10 @@ static void PrgRsc_WriteRowEditResource (Prg_ListingType_t ListingType,
|
||||||
HTM_Unsigned (NumRsc + 1);
|
HTM_Unsigned (NumRsc + 1);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Title *****/
|
/***** Title and link/clipboard *****/
|
||||||
HTM_TD_Begin ("class=\"PRG_MAIN LT %s\"",The_GetColorRows1 (1));
|
HTM_TD_Begin ("class=\"PRG_MAIN LT %s\"",The_GetColorRows1 (1));
|
||||||
|
|
||||||
|
/* Title */
|
||||||
Frm_BeginFormAnchor (ActRenPrgRsc,PrgRsc_RESOURCE_SECTION_ID);
|
Frm_BeginFormAnchor (ActRenPrgRsc,PrgRsc_RESOURCE_SECTION_ID);
|
||||||
Prg_PutParamRscCod (&Item->Resource.Hierarchy.RscCod);
|
Prg_PutParamRscCod (&Item->Resource.Hierarchy.RscCod);
|
||||||
HTM_INPUT_TEXT ("Title",PrgRsc_MAX_CHARS_PROGRAM_RESOURCE_TITLE,Item->Resource.Title,
|
HTM_INPUT_TEXT ("Title",PrgRsc_MAX_CHARS_PROGRAM_RESOURCE_TITLE,Item->Resource.Title,
|
||||||
|
@ -479,27 +482,20 @@ static void PrgRsc_WriteRowEditResource (Prg_ListingType_t ListingType,
|
||||||
"class=\"INPUT_FULL_NAME INPUT_%s\"",
|
"class=\"INPUT_FULL_NAME INPUT_%s\"",
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
HTM_TD_End ();
|
|
||||||
|
|
||||||
/***** Icon to edit link *****/
|
HTM_BR ();
|
||||||
HTM_TD_Begin ("class=\"PRG_MAIN RT %s\"",The_GetColorRows1 (1));
|
|
||||||
Ico_PutContextualIconToEdit (ActSeeCliPrgRsc,PrgRsc_RESOURCE_SECTION_ID,
|
|
||||||
Prg_PutParamRscCod,&Item->Resource.Hierarchy.RscCod);
|
|
||||||
HTM_TD_End ();
|
|
||||||
|
|
||||||
/***** Link *****/
|
/* Link / clipboard */
|
||||||
HTM_TD_Begin ("class=\"PRG_MAIN LT %s\"",The_GetColorRows1 (1));
|
|
||||||
|
|
||||||
/* Show clipboard to change resource link */
|
|
||||||
if (ListingType == Prg_SHOW_CLIPBOARD &&
|
if (ListingType == Prg_SHOW_CLIPBOARD &&
|
||||||
Item->Resource.Hierarchy.RscCod == SelectedRscCod)
|
Item->Resource.Hierarchy.RscCod == SelectedRscCod)
|
||||||
|
/* Show clipboard to change resource link */
|
||||||
PrgRsc_ShowClipboard (Item);
|
PrgRsc_ShowClipboard (Item);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/***** Link *****/
|
/* Link */
|
||||||
Ico_PutIconOn (Prg_ResourceTypesLogos[Link.Type],Ico_BLACK,
|
Ico_PutIconOn (Prg_ResourceTypesLogos[Item->Resource.Link.Type],Ico_BLACK,
|
||||||
Prg_ResourceTypesDB[Link.Type]);
|
Prg_ResourceTypesDB[Item->Resource.Link.Type]);
|
||||||
PrgRsc_WriteLinkName (&Link);
|
PrgRsc_WriteLinkName (&Item->Resource.Link);
|
||||||
}
|
}
|
||||||
|
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
@ -524,6 +520,7 @@ static void PrgRsc_WriteRowNewResource (Prg_ListingType_t ListingType,
|
||||||
|
|
||||||
/***** Forms to remove/edit this item resource *****/
|
/***** Forms to remove/edit this item resource *****/
|
||||||
HTM_TD_Begin ("class=\"PRG_COL1 LT %s\"",The_GetColorRows1 (1));
|
HTM_TD_Begin ("class=\"PRG_COL1 LT %s\"",The_GetColorRows1 (1));
|
||||||
|
PrgRsc_PutFormsToRemEditOneResource (Item,NumResources,NumResources);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Resource number *****/
|
/***** Resource number *****/
|
||||||
|
@ -532,8 +529,10 @@ static void PrgRsc_WriteRowNewResource (Prg_ListingType_t ListingType,
|
||||||
HTM_Unsigned (NumResources + 1);
|
HTM_Unsigned (NumResources + 1);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Title *****/
|
/***** Title and link/clipboard *****/
|
||||||
HTM_TD_Begin ("class=\"PRG_MAIN LT %s\"",The_GetColorRows1 (1));
|
HTM_TD_Begin ("class=\"PRG_MAIN LT %s\"",The_GetColorRows1 (1));
|
||||||
|
|
||||||
|
/* Title */
|
||||||
Frm_BeginFormAnchor (ActNewPrgRsc,PrgRsc_RESOURCE_SECTION_ID);
|
Frm_BeginFormAnchor (ActNewPrgRsc,PrgRsc_RESOURCE_SECTION_ID);
|
||||||
Prg_PutParamItmCod (&Item->Hierarchy.ItmCod);
|
Prg_PutParamItmCod (&Item->Hierarchy.ItmCod);
|
||||||
HTM_INPUT_TEXT ("Title",PrgRsc_MAX_CHARS_PROGRAM_RESOURCE_TITLE,"",
|
HTM_INPUT_TEXT ("Title",PrgRsc_MAX_CHARS_PROGRAM_RESOURCE_TITLE,"",
|
||||||
|
@ -543,25 +542,17 @@ static void PrgRsc_WriteRowNewResource (Prg_ListingType_t ListingType,
|
||||||
"Nuevo recurso", // TODO: Need translation!!!!!!!!!!!!!!!!!!!
|
"Nuevo recurso", // TODO: Need translation!!!!!!!!!!!!!!!!!!!
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
HTM_TD_End ();
|
|
||||||
|
|
||||||
/***** Icon to edit link *****/
|
|
||||||
HTM_TD_Begin ("class=\"PRG_MAIN RT %s\"",The_GetColorRows1 (1));
|
|
||||||
Ico_PutContextualIconToEdit (ActSeeCliPrgRsc,PrgRsc_RESOURCE_SECTION_ID,
|
|
||||||
Prg_PutParamItmCod,&Item->Hierarchy.ItmCod);
|
|
||||||
HTM_TD_End ();
|
|
||||||
|
|
||||||
/***** Link *****/
|
/* Link / clipboard */
|
||||||
HTM_TD_Begin ("class=\"PRG_MAIN LT %s\"",The_GetColorRows1 (1));
|
|
||||||
|
|
||||||
/* Show clipboard to change resource link */
|
|
||||||
if (ListingType == Prg_SHOW_CLIPBOARD &&
|
if (ListingType == Prg_SHOW_CLIPBOARD &&
|
||||||
SelectedRscCod <= 0) // No resource selected
|
Item->Resource.Hierarchy.RscCod == SelectedRscCod)
|
||||||
|
{
|
||||||
|
HTM_BR ();
|
||||||
|
|
||||||
|
/* Show clipboard to change resource link */
|
||||||
PrgRsc_ShowClipboard (Item);
|
PrgRsc_ShowClipboard (Item);
|
||||||
else
|
}
|
||||||
/***** Link *****/
|
|
||||||
Ico_PutIconOn (Prg_ResourceTypesLogos[PrgRsc_NONE],Ico_BLACK,
|
|
||||||
Prg_ResourceTypesDB[PrgRsc_NONE]);
|
|
||||||
|
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
@ -583,35 +574,50 @@ static void PrgRsc_PutFormsToRemEditOneResource (struct Prg_Item *Item,
|
||||||
[true ] = ActUnhPrgRsc, // Hidden ==> action to unhide
|
[true ] = ActUnhPrgRsc, // Hidden ==> action to unhide
|
||||||
};
|
};
|
||||||
extern const char *Txt_Movement_not_allowed;
|
extern const char *Txt_Movement_not_allowed;
|
||||||
|
extern const char *Txt_Visible;
|
||||||
|
|
||||||
switch (Gbl.Usrs.Me.Role.Logged)
|
switch (Gbl.Usrs.Me.Role.Logged)
|
||||||
{
|
{
|
||||||
case Rol_TCH:
|
case Rol_TCH:
|
||||||
case Rol_SYS_ADM:
|
case Rol_SYS_ADM:
|
||||||
/***** Icon to remove item resource *****/
|
/***** Icon to remove item resource *****/
|
||||||
Ico_PutContextualIconToRemove (ActReqRemPrgRsc,PrgRsc_RESOURCE_SECTION_ID,
|
if (NumRsc < NumResources)
|
||||||
Prg_PutParamRscCod,&Item->Resource.Hierarchy.RscCod);
|
Ico_PutContextualIconToRemove (ActReqRemPrgRsc,PrgRsc_RESOURCE_SECTION_ID,
|
||||||
|
Prg_PutParamRscCod,&Item->Resource.Hierarchy.RscCod);
|
||||||
|
else
|
||||||
|
Ico_PutIconRemovalNotAllowed ();
|
||||||
|
|
||||||
/***** Icon to hide/unhide item resource *****/
|
/***** Icon to hide/unhide item resource *****/
|
||||||
Ico_PutContextualIconToHideUnhide (ActionHideUnhide,PrgRsc_RESOURCE_SECTION_ID,
|
if (NumRsc < NumResources)
|
||||||
Prg_PutParamRscCod,&Item->Resource.Hierarchy.RscCod,
|
Ico_PutContextualIconToHideUnhide (ActionHideUnhide,PrgRsc_RESOURCE_SECTION_ID,
|
||||||
Item->Resource.Hierarchy.Hidden);
|
Prg_PutParamRscCod,&Item->Resource.Hierarchy.RscCod,
|
||||||
|
Item->Resource.Hierarchy.Hidden);
|
||||||
|
else
|
||||||
|
Ico_PutIconOff ("eye.svg",Ico_GREEN,Txt_Visible);
|
||||||
|
|
||||||
/***** Icon to move up the item *****/
|
/***** Icon to move up the item resource *****/
|
||||||
if (NumRsc > 0)
|
if (NumRsc > 0 && NumRsc < NumResources)
|
||||||
Lay_PutContextualLinkOnlyIcon (ActUp_PrgRsc,PrgRsc_RESOURCE_SECTION_ID,
|
Lay_PutContextualLinkOnlyIcon (ActUp_PrgRsc,PrgRsc_RESOURCE_SECTION_ID,
|
||||||
Prg_PutParamRscCod,&Item->Resource.Hierarchy.RscCod,
|
Prg_PutParamRscCod,&Item->Resource.Hierarchy.RscCod,
|
||||||
"arrow-up.svg",Ico_BLACK);
|
"arrow-up.svg",Ico_BLACK);
|
||||||
else
|
else
|
||||||
Ico_PutIconOff ("arrow-up.svg",Ico_BLACK,Txt_Movement_not_allowed);
|
Ico_PutIconOff ("arrow-up.svg",Ico_BLACK,Txt_Movement_not_allowed);
|
||||||
|
|
||||||
/***** Put icon to move down the item *****/
|
/***** Put icon to move down the item resource *****/
|
||||||
if (NumRsc < NumResources - 1)
|
if (NumRsc < NumResources - 1)
|
||||||
Lay_PutContextualLinkOnlyIcon (ActDwnPrgRsc,PrgRsc_RESOURCE_SECTION_ID,
|
Lay_PutContextualLinkOnlyIcon (ActDwnPrgRsc,PrgRsc_RESOURCE_SECTION_ID,
|
||||||
Prg_PutParamRscCod,&Item->Resource.Hierarchy.RscCod,
|
Prg_PutParamRscCod,&Item->Resource.Hierarchy.RscCod,
|
||||||
"arrow-down.svg",Ico_BLACK);
|
"arrow-down.svg",Ico_BLACK);
|
||||||
else
|
else
|
||||||
Ico_PutIconOff ("arrow-down.svg",Ico_BLACK,Txt_Movement_not_allowed);
|
Ico_PutIconOff ("arrow-down.svg",Ico_BLACK,Txt_Movement_not_allowed);
|
||||||
|
|
||||||
|
/***** Put icon to edit the item resource *****/
|
||||||
|
if (NumRsc < NumResources)
|
||||||
|
Ico_PutContextualIconToEdit (ActSeeCliPrgRsc,PrgRsc_RESOURCE_SECTION_ID,
|
||||||
|
Prg_PutParamRscCod,&Item->Resource.Hierarchy.RscCod);
|
||||||
|
else
|
||||||
|
Ico_PutContextualIconToEdit (ActSeeCliPrgRsc,PrgRsc_RESOURCE_SECTION_ID,
|
||||||
|
Prg_PutParamItmCod,&Item->Hierarchy.ItmCod);
|
||||||
break;
|
break;
|
||||||
case Rol_STD:
|
case Rol_STD:
|
||||||
case Rol_NET:
|
case Rol_NET:
|
||||||
|
@ -917,7 +923,12 @@ static void PrgRsc_ShowClipboard (struct Prg_Item *Item)
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
unsigned NumLink;
|
unsigned NumLink;
|
||||||
unsigned NumLinks;
|
unsigned NumLinks;
|
||||||
struct PrgRsc_Link Link;
|
struct Prg_Link Link;
|
||||||
|
static const struct Prg_Link EmptyLink =
|
||||||
|
{
|
||||||
|
.Type = PrgRsc_NONE,
|
||||||
|
.Cod = -1L,
|
||||||
|
};
|
||||||
|
|
||||||
/***** Begin form *****/
|
/***** Begin form *****/
|
||||||
Frm_BeginFormAnchor (ActChgLnkPrgRsc,PrgRsc_RESOURCE_SECTION_ID);
|
Frm_BeginFormAnchor (ActChgLnkPrgRsc,PrgRsc_RESOURCE_SECTION_ID);
|
||||||
|
@ -926,24 +937,21 @@ static void PrgRsc_ShowClipboard (struct Prg_Item *Item)
|
||||||
/***** Begin list *****/
|
/***** Begin list *****/
|
||||||
HTM_UL_Begin ("class=\"PRG_CLIPBOARD\"");
|
HTM_UL_Begin ("class=\"PRG_CLIPBOARD\"");
|
||||||
|
|
||||||
/***** Current link *****/
|
/***** Current link (empty or not) *****/
|
||||||
Link.Type = Item->Resource.Type;
|
PrgRsc_WriteRowClipboard (false,&Item->Resource.Link);
|
||||||
Link.Cod = Item->Resource.Cod;
|
|
||||||
PrgRsc_WriteRowClipboard (0,&Link);
|
|
||||||
|
|
||||||
/***** Get list of item resources from database *****/
|
/***** Row with empty link to remove the current link *****/
|
||||||
|
if (Item->Resource.Link.Type != PrgRsc_NONE)
|
||||||
|
PrgRsc_WriteRowClipboard (true,&EmptyLink);
|
||||||
|
|
||||||
|
/***** Get links in clipboard from database and write them *****/
|
||||||
NumLinks = Prg_DB_GetClipboard (&mysql_res);
|
NumLinks = Prg_DB_GetClipboard (&mysql_res);
|
||||||
|
|
||||||
/***** Write all item resources *****/
|
|
||||||
for (NumLink = 1;
|
for (NumLink = 1;
|
||||||
NumLink <= NumLinks;
|
NumLink <= NumLinks;
|
||||||
NumLink++)
|
NumLink++)
|
||||||
{
|
{
|
||||||
/* Get data of this link */
|
|
||||||
PrgRsc_GetDataOfLinkFromClipboard (&Link,&mysql_res);
|
PrgRsc_GetDataOfLinkFromClipboard (&Link,&mysql_res);
|
||||||
|
PrgRsc_WriteRowClipboard (true,&Link);
|
||||||
/* Show link */
|
|
||||||
PrgRsc_WriteRowClipboard (NumLink,&Link);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
|
@ -960,21 +968,19 @@ static void PrgRsc_ShowClipboard (struct Prg_Item *Item)
|
||||||
/************************ Show one link from clipboard ***********************/
|
/************************ Show one link from clipboard ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void PrgRsc_WriteRowClipboard (unsigned NumLink,
|
static void PrgRsc_WriteRowClipboard (bool SubmitOnClick,const struct Prg_Link *Link)
|
||||||
const struct PrgRsc_Link *Link)
|
|
||||||
{
|
{
|
||||||
extern const char *Prg_ResourceTypesDB[PrgRsc_NUM_TYPES];
|
extern const char *Prg_ResourceTypesDB[PrgRsc_NUM_TYPES];
|
||||||
|
|
||||||
HTM_LI_Begin ("class=\"DAT_%s\"",The_GetSuffix ());
|
HTM_LI_Begin ("class=\"DAT_%s\"",The_GetSuffix ());
|
||||||
HTM_LABEL_Begin (NULL);
|
HTM_LABEL_Begin (NULL);
|
||||||
if (NumLink)
|
|
||||||
HTM_INPUT_RADIO ("Link",true,
|
/***** Radio selector *****/
|
||||||
"value=\"%s_%ld\"",
|
HTM_INPUT_RADIO ("Link",SubmitOnClick,
|
||||||
Prg_ResourceTypesDB[Link->Type],Link->Cod);
|
"value=\"%s_%ld\"%s",
|
||||||
else
|
Prg_ResourceTypesDB[Link->Type],Link->Cod,
|
||||||
HTM_INPUT_RADIO ("Link",false,
|
SubmitOnClick ? "" :
|
||||||
"value=\"%s_%ld\" checked=\"checked\"",
|
" checked=\"checked\"");
|
||||||
Prg_ResourceTypesDB[Link->Type],Link->Cod);
|
|
||||||
|
|
||||||
/***** Type *****/
|
/***** Type *****/
|
||||||
Ico_PutIconOn (Prg_ResourceTypesLogos[Link->Type],Ico_BLACK,
|
Ico_PutIconOn (Prg_ResourceTypesLogos[Link->Type],Ico_BLACK,
|
||||||
|
@ -991,7 +997,7 @@ static void PrgRsc_WriteRowClipboard (unsigned NumLink,
|
||||||
/************* Write link name (filename, assignment title...) ***************/
|
/************* Write link name (filename, assignment title...) ***************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void PrgRsc_WriteLinkName (const struct PrgRsc_Link *Link)
|
static void PrgRsc_WriteLinkName (const struct Prg_Link *Link)
|
||||||
{
|
{
|
||||||
char FileName[NAME_MAX + 1];
|
char FileName[NAME_MAX + 1];
|
||||||
|
|
||||||
|
@ -1072,7 +1078,7 @@ void PrgRsc_ChangeLink (void)
|
||||||
/********************** Get resource data from clipboard *********************/
|
/********************** Get resource data from clipboard *********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void PrgRsc_GetDataOfLinkFromClipboard (struct PrgRsc_Link *Link,
|
static void PrgRsc_GetDataOfLinkFromClipboard (struct Prg_Link *Link,
|
||||||
MYSQL_RES **mysql_res)
|
MYSQL_RES **mysql_res)
|
||||||
{
|
{
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
|
|
|
@ -23,20 +23,6 @@
|
||||||
You should have received a copy of the GNU Affero General Public License
|
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/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
/*****************************************************************************/
|
|
||||||
/********************************* Headers ***********************************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/************************** Public types and constants ***********************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
struct PrgRsc_Link
|
|
||||||
{
|
|
||||||
PrgRsc_Type_t Type;
|
|
||||||
long Cod;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************************** Public prototypes *****************************/
|
/***************************** Public prototypes *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
23
swad_text.c
23
swad_text.c
|
@ -58403,6 +58403,29 @@ const char *Txt_View_homework =
|
||||||
"View homework"; // Çeviri lazim!
|
"View homework"; // Çeviri lazim!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const char *Txt_Visible =
|
||||||
|
#if L==1 // ca
|
||||||
|
"Visible";
|
||||||
|
#elif L==2 // de
|
||||||
|
"Sichtbare";
|
||||||
|
#elif L==3 // en
|
||||||
|
"Visible";
|
||||||
|
#elif L==4 // es
|
||||||
|
"Visible";
|
||||||
|
#elif L==5 // fr
|
||||||
|
"Visible";
|
||||||
|
#elif L==6 // gn
|
||||||
|
"Visible"; // Okoteve traducción
|
||||||
|
#elif L==7 // it
|
||||||
|
"Visibile";
|
||||||
|
#elif L==8 // pl
|
||||||
|
"Widoczny";
|
||||||
|
#elif L==9 // pt
|
||||||
|
"Visível";
|
||||||
|
#elif L==10 // tr
|
||||||
|
"Visible"; // Çeviri lazim!
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *Txt_Visible_by_BR_the_student =
|
const char *Txt_Visible_by_BR_the_student =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"¿Visible por<br />el estudiante?"; // Necessita traducció
|
"¿Visible por<br />el estudiante?"; // Necessita traducció
|
||||||
|
|
Loading…
Reference in New Issue