mirror of https://github.com/acanas/swad-core.git
Version19.141.6
This commit is contained in:
parent
10031f2c02
commit
908086f4d0
|
@ -1597,6 +1597,21 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
width:100%;
|
||||
}
|
||||
|
||||
.PRG_HIGHLIGHTED_ITEM
|
||||
{
|
||||
animation:itemfadein 1s ease forwards;
|
||||
}
|
||||
@keyframes itemfadein
|
||||
{
|
||||
/* from {outline:thick solid #4d88a1;}
|
||||
to {outline:thick solid transparent;} */
|
||||
/*
|
||||
from {text-shadow:0px 1px #008000;}
|
||||
to {text-shadow:0px 1px transparent;} */
|
||||
from {opacity:0;}
|
||||
to {opacity:1;}
|
||||
}
|
||||
|
||||
/********************************** Notice ***********************************/
|
||||
.NOTICE_HIGHLIGHT
|
||||
{
|
|
@ -381,7 +381,7 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
// TabCrs ******************************************************************
|
||||
// Actions in menu:
|
||||
[ActSeeCrsInf ] = { 847, 0,TabCrs,ActSeeCrsInf ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Crs_ShowIntroduction ,"info" },
|
||||
[ActSeePrg ] = {1821, 1,TabCrs,ActSeePrg ,0x200,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_SeeCourseProgram ,"clipboard-list" },
|
||||
[ActSeePrg ] = {1821, 1,TabCrs,ActSeePrg ,0x200,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prg_ShowCourseProgram ,"clipboard-list" },
|
||||
[ActSeeTchGui ] = { 784, 2,TabCrs,ActSeeTchGui ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Inf_ShowInfo ,"book-open" },
|
||||
[ActSeeSyl ] = {1242, 3,TabCrs,ActSeeSyl ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Inf_ShowInfo ,"list-ol" },
|
||||
[ActSeeBib ] = { 32, 4,TabCrs,ActSeeBib ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Inf_ShowInfo ,"book" },
|
||||
|
|
|
@ -497,8 +497,8 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
|||
En OpenSWAD:
|
||||
ps2pdf source.ps destination.pdf
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 19.141.5 (2020-03-03)"
|
||||
#define CSS_FILE "swad19.136.css"
|
||||
#define Log_PLATFORM_VERSION "SWAD 19.141.6 (2020-03-04)"
|
||||
#define CSS_FILE "swad19.141.6.css"
|
||||
#define JS_FILE "swad19.91.1.js"
|
||||
/*
|
||||
*
|
||||
|
@ -524,6 +524,7 @@ Param
|
|||
// TODO: Miguel Damas: al principio de los exámenes tendría que poner cuánto resta cada pregunta
|
||||
// TODO: Si el alumno ha marcado "Permitir que los profesores...", entonces pedir confirmación al pulsar el botón azul, para evitar que se envíe por error antes de tiempo
|
||||
|
||||
Version 19.141.6: Mar 04, 2020 Changes in edition of course program. (282230 lines)
|
||||
Version 19.141.5: Mar 03, 2020 Fixed bug in edition of course program. (282224 lines)
|
||||
Version 19.141.4: Mar 03, 2020 Remove subtree in course program. (282214 lines)
|
||||
Version 19.141.3: Mar 03, 2020 Form to create new item inside course program. (282199 lines)
|
||||
|
|
137
swad_program.c
137
swad_program.c
|
@ -80,13 +80,16 @@ static unsigned *Prg_NumItem = NULL; // Numbers for each level from 1 to maximum
|
|||
/***************************** Private prototypes ****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Prg_ShowCourseProgramHighlightingItem (long HighlightItmCod);
|
||||
static void Prg_ShowAllItems (Prg_CreateOrChangeItem_t CreateOrChangeItem,
|
||||
long HighlightItmCod,
|
||||
long ParentItmCod,long ItmCodBeforeForm,unsigned FormLevel);
|
||||
static bool Prg_CheckIfICanCreateItems (void);
|
||||
static void Prg_PutIconsListItems (void);
|
||||
static void Prg_PutIconToCreateNewItem (void);
|
||||
static void Prg_PutButtonToCreateNewItem (void);
|
||||
static void Prg_ShowOneItem (unsigned NumItem,const struct ProgramItem *Item,bool PrintView);
|
||||
static void Prg_ShowOneItem (unsigned NumItem,const struct ProgramItem *Item,
|
||||
long HighlightItmCod,bool PrintView);
|
||||
static void Prg_ShowItemForm (Prg_CreateOrChangeItem_t CreateOrChangeItem,
|
||||
long ParamItmCod,unsigned FormLevel);
|
||||
|
||||
|
@ -131,26 +134,31 @@ static void Prg_ExchangeItems (int NumItemTop,int NumItemBottom);
|
|||
static void Prg_MoveItemAndChildrenLeft (unsigned NumItem);
|
||||
static void Prg_MoveItemAndChildrenRight (unsigned NumItem);
|
||||
|
||||
static bool Prg_CheckIfSimilarPrgItemExists (const char *Field,const char *Value,long ItmCod);
|
||||
static void Prg_ShowFormToCreatePrgItem (long ParentItmCod);
|
||||
static void Prg_ShowFormToChangePrgItem (long ItmCod);
|
||||
static void Prg_ShowFormToPrgItem (const struct ProgramItem *Item,
|
||||
const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME],
|
||||
const char *Txt);
|
||||
static void Prg_InsertPrgItem (struct ProgramItem *ParentItem,
|
||||
struct ProgramItem *Item,const char *Txt);
|
||||
static long Prg_InsertPrgItemIntoDB (struct ProgramItem *Item,const char *Txt);
|
||||
static void Prg_UpdatePrgItem (struct ProgramItem *Item,const char *Txt);
|
||||
static bool Prg_CheckIfSimilarItemExists (const char *Field,const char *Value,long ItmCod);
|
||||
static void Prg_ShowFormToCreateItem (long ParentItmCod);
|
||||
static void Prg_ShowFormToChangeItem (long ItmCod);
|
||||
static void Prg_ShowFormItem (const struct ProgramItem *Item,
|
||||
const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME],
|
||||
const char *Txt);
|
||||
static void Prg_InsertItem (const struct ProgramItem *ParentItem,
|
||||
struct ProgramItem *Item,const char *Txt);
|
||||
static long Prg_InsertItemIntoDB (struct ProgramItem *Item,const char *Txt);
|
||||
static void Prg_UpdateItem (struct ProgramItem *Item,const char *Txt);
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************ List all the program items *************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Prg_SeeCourseProgram (void)
|
||||
void Prg_ShowCourseProgram (void)
|
||||
{
|
||||
Prg_ShowCourseProgramHighlightingItem (-1L);
|
||||
}
|
||||
|
||||
static void Prg_ShowCourseProgramHighlightingItem (long HighlightItmCod)
|
||||
{
|
||||
/***** Show all the program items *****/
|
||||
Prg_ShowAllItems (Prg_DONT_PUT_FORM_ITEM,
|
||||
-1L,-1L,0);
|
||||
HighlightItmCod,-1L,-1L,0);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -158,6 +166,7 @@ void Prg_SeeCourseProgram (void)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void Prg_ShowAllItems (Prg_CreateOrChangeItem_t CreateOrChangeItem,
|
||||
long HighlightItmCod,
|
||||
long ParentItmCod,long ItmCodBeforeForm,unsigned FormLevel)
|
||||
{
|
||||
extern const char *Hlp_COURSE_Program;
|
||||
|
@ -191,6 +200,7 @@ static void Prg_ShowAllItems (Prg_CreateOrChangeItem_t CreateOrChangeItem,
|
|||
|
||||
/* Show item */
|
||||
Prg_ShowOneItem (NumItem,&Item,
|
||||
HighlightItmCod,
|
||||
false); // Not print view
|
||||
|
||||
/* Show form to create/change item */
|
||||
|
@ -288,7 +298,8 @@ static void Prg_PutButtonToCreateNewItem (void)
|
|||
|
||||
#define Prg_WIDTH_NUM_ITEM 20
|
||||
|
||||
static void Prg_ShowOneItem (unsigned NumItem,const struct ProgramItem *Item,bool PrintView)
|
||||
static void Prg_ShowOneItem (unsigned NumItem,const struct ProgramItem *Item,
|
||||
long HighlightItmCod,bool PrintView)
|
||||
{
|
||||
char *Anchor = NULL;
|
||||
static unsigned UniqueId = 0;
|
||||
|
@ -305,7 +316,10 @@ static void Prg_ShowOneItem (unsigned NumItem,const struct ProgramItem *Item,boo
|
|||
Frm_SetAnchorStr (Item->Hierarchy.ItmCod,&Anchor);
|
||||
|
||||
/***** Start row *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
if (Item->Hierarchy.ItmCod == HighlightItmCod)
|
||||
HTM_TR_Begin ("class=\"PRG_HIGHLIGHTED_ITEM\"");
|
||||
else
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
/***** Forms to remove/edit this program item *****/
|
||||
if (!PrintView)
|
||||
|
@ -342,6 +356,8 @@ static void Prg_ShowOneItem (unsigned NumItem,const struct ProgramItem *Item,boo
|
|||
else
|
||||
HTM_TD_Begin ("colspan=\"%u\" class=\"LT COLOR%u\"",
|
||||
ColSpan,Gbl.RowEvenOdd);
|
||||
if (Item->Hierarchy.ItmCod == HighlightItmCod)
|
||||
HTM_SECTION_Begin ("highlighted_item");
|
||||
HTM_ARTICLE_Begin (Anchor);
|
||||
|
||||
/* Title */
|
||||
|
@ -363,6 +379,8 @@ static void Prg_ShowOneItem (unsigned NumItem,const struct ProgramItem *Item,boo
|
|||
|
||||
/* End title and text */
|
||||
HTM_ARTICLE_End ();
|
||||
if (Item->Hierarchy.ItmCod == HighlightItmCod)
|
||||
HTM_SECTION_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
/***** Start/end date/time *****/
|
||||
|
@ -453,9 +471,9 @@ static void Prg_ShowItemForm (Prg_CreateOrChangeItem_t CreateOrChangeItem,
|
|||
ColSpan,Gbl.RowEvenOdd);
|
||||
HTM_ARTICLE_Begin ("item_form");
|
||||
if (CreateOrChangeItem == Prg_PUT_FORM_CREATE_ITEM)
|
||||
Prg_ShowFormToCreatePrgItem (ParamItmCod);
|
||||
Prg_ShowFormToCreateItem (ParamItmCod);
|
||||
else
|
||||
Prg_ShowFormToChangePrgItem (ParamItmCod);
|
||||
Prg_ShowFormToChangeItem (ParamItmCod);
|
||||
HTM_ARTICLE_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -599,9 +617,9 @@ static void Prg_PutFormsToRemEditOnePrgItem (unsigned NumItem,
|
|||
|
||||
/***** Put form to hide/show program item *****/
|
||||
if (Item->Hierarchy.Hidden)
|
||||
Ico_PutContextualIconToUnhide (ActShoPrgItm,Anchor,Prg_PutParams);
|
||||
Ico_PutContextualIconToUnhide (ActShoPrgItm,"highlighted_item",Prg_PutParams);
|
||||
else
|
||||
Ico_PutContextualIconToHide (ActHidPrgItm,Anchor,Prg_PutParams);
|
||||
Ico_PutContextualIconToHide (ActHidPrgItm,"highlighted_item",Prg_PutParams);
|
||||
|
||||
/***** Put form to edit program item *****/
|
||||
Ico_PutContextualIconToEdit (ActFrmChgPrgItm,"item_form",Prg_PutParams);
|
||||
|
@ -614,7 +632,7 @@ static void Prg_PutFormsToRemEditOnePrgItem (unsigned NumItem,
|
|||
/***** Put icon to move up the item *****/
|
||||
if (Prg_CheckIfMoveUpIsAllowed (NumItem))
|
||||
{
|
||||
Lay_PutContextualLinkOnlyIcon (ActUp_PrgItm,NULL,Prg_PutParams,
|
||||
Lay_PutContextualLinkOnlyIcon (ActUp_PrgItm,"highlighted_item",Prg_PutParams,
|
||||
"arrow-up.svg",
|
||||
Str_BuildStringStr (Txt_Move_up_X,
|
||||
StrItemIndex));
|
||||
|
@ -626,7 +644,7 @@ static void Prg_PutFormsToRemEditOnePrgItem (unsigned NumItem,
|
|||
/***** Put icon to move down the item *****/
|
||||
if (Prg_CheckIfMoveDownIsAllowed (NumItem))
|
||||
{
|
||||
Lay_PutContextualLinkOnlyIcon (ActDwnPrgItm,NULL,Prg_PutParams,
|
||||
Lay_PutContextualLinkOnlyIcon (ActDwnPrgItm,"highlighted_item",Prg_PutParams,
|
||||
"arrow-down.svg",
|
||||
Str_BuildStringStr (Txt_Move_down_X,
|
||||
StrItemIndex));
|
||||
|
@ -638,7 +656,7 @@ static void Prg_PutFormsToRemEditOnePrgItem (unsigned NumItem,
|
|||
/***** Icon to move left item (increase level) *****/
|
||||
if (Prg_CheckIfMoveLeftIsAllowed (NumItem))
|
||||
{
|
||||
Lay_PutContextualLinkOnlyIcon (ActLftPrgItm,Anchor,Prg_PutParams,
|
||||
Lay_PutContextualLinkOnlyIcon (ActLftPrgItm,"highlighted_item",Prg_PutParams,
|
||||
"arrow-left.svg",
|
||||
Str_BuildStringStr (Txt_Increase_level_of_X,
|
||||
StrItemIndex));
|
||||
|
@ -650,7 +668,7 @@ static void Prg_PutFormsToRemEditOnePrgItem (unsigned NumItem,
|
|||
/***** Icon to move right item (indent, decrease level) *****/
|
||||
if (Prg_CheckIfMoveRightIsAllowed (NumItem))
|
||||
{
|
||||
Lay_PutContextualLinkOnlyIcon (ActRgtPrgItm,Anchor,Prg_PutParams,
|
||||
Lay_PutContextualLinkOnlyIcon (ActRgtPrgItm,"highlighted_item",Prg_PutParams,
|
||||
"arrow-right.svg",
|
||||
Str_BuildStringStr (Txt_Decrease_level_of_X,
|
||||
StrItemIndex));
|
||||
|
@ -1071,7 +1089,7 @@ void Prg_ReqRemPrgItem (void)
|
|||
Item.Title);
|
||||
|
||||
/***** Show program items again *****/
|
||||
Prg_SeeCourseProgram ();
|
||||
Prg_ShowCourseProgramHighlightingItem (Item.Hierarchy.ItmCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1116,7 +1134,7 @@ void Prg_RemovePrgItem (void)
|
|||
Prg_FreeListItems ();
|
||||
|
||||
/***** Show program items again *****/
|
||||
Prg_SeeCourseProgram ();
|
||||
Prg_ShowCourseProgram ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1142,7 +1160,7 @@ void Prg_HidePrgItem (void)
|
|||
Item.Hierarchy.ItmCod,Gbl.Hierarchy.Crs.CrsCod);
|
||||
|
||||
/***** Show program items again *****/
|
||||
Prg_SeeCourseProgram ();
|
||||
Prg_ShowCourseProgramHighlightingItem (Item.Hierarchy.ItmCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1168,7 +1186,7 @@ void Prg_ShowPrgItem (void)
|
|||
Item.Hierarchy.ItmCod,Gbl.Hierarchy.Crs.CrsCod);
|
||||
|
||||
/***** Show program items again *****/
|
||||
Prg_SeeCourseProgram ();
|
||||
Prg_ShowCourseProgramHighlightingItem (Item.Hierarchy.ItmCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1200,7 +1218,7 @@ void Prg_MoveUpPrgItem (void)
|
|||
Prg_FreeListItems ();
|
||||
|
||||
/***** Show program items again *****/
|
||||
Prg_SeeCourseProgram ();
|
||||
Prg_ShowCourseProgramHighlightingItem (ItmCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1232,7 +1250,7 @@ void Prg_MoveDownPrgItem (void)
|
|||
Prg_FreeListItems ();
|
||||
|
||||
/***** Show program items again *****/
|
||||
Prg_SeeCourseProgram ();
|
||||
Prg_ShowCourseProgramHighlightingItem (ItmCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1260,7 +1278,7 @@ void Prg_MoveLeftPrgItem (void)
|
|||
Prg_FreeListItems ();
|
||||
|
||||
/***** Show program items again *****/
|
||||
Prg_SeeCourseProgram ();
|
||||
Prg_ShowCourseProgramHighlightingItem (ItmCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1288,7 +1306,7 @@ void Prg_MoveRightPrgItem (void)
|
|||
Prg_FreeListItems ();
|
||||
|
||||
/***** Show program items again *****/
|
||||
Prg_SeeCourseProgram ();
|
||||
Prg_ShowCourseProgramHighlightingItem (ItmCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1559,7 +1577,7 @@ BottomIndex.End: 49| 222|-->|-->-49| 222| | -49| 222|-->|--> 26| 2
|
|||
/*************** Check if the title of a program item exists *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static bool Prg_CheckIfSimilarPrgItemExists (const char *Field,const char *Value,long ItmCod)
|
||||
static bool Prg_CheckIfSimilarItemExists (const char *Field,const char *Value,long ItmCod)
|
||||
{
|
||||
/***** Get number of program items with a field value from database *****/
|
||||
return (DB_QueryCOUNT ("can not get similar program items",
|
||||
|
@ -1602,7 +1620,7 @@ void Prg_RequestCreatePrgItem (void)
|
|||
|
||||
/***** Show current program items, if any *****/
|
||||
Prg_ShowAllItems (Prg_PUT_FORM_CREATE_ITEM,
|
||||
ParentItmCod,ItmCodBeforeForm,FormLevel);
|
||||
-1L,ParentItmCod,ItmCodBeforeForm,FormLevel);
|
||||
}
|
||||
|
||||
void Prg_RequestChangePrgItem (void)
|
||||
|
@ -1629,14 +1647,14 @@ void Prg_RequestChangePrgItem (void)
|
|||
|
||||
/***** Show current program items, if any *****/
|
||||
Prg_ShowAllItems (Prg_PUT_FORM_CHANGE_ITEM,
|
||||
-1L,ItmCodBeforeForm,FormLevel);
|
||||
-1L,-1L,ItmCodBeforeForm,FormLevel);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Put a form to create a new program item *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Prg_ShowFormToCreatePrgItem (long ParentItmCod)
|
||||
static void Prg_ShowFormToCreateItem (long ParentItmCod)
|
||||
{
|
||||
extern const char *Hlp_COURSE_Program_new_item;
|
||||
extern const char *Txt_New_item;
|
||||
|
@ -1660,7 +1678,7 @@ static void Prg_ShowFormToCreatePrgItem (long ParentItmCod)
|
|||
Item.Open = true;
|
||||
|
||||
/***** Begin form *****/
|
||||
Frm_StartForm (ActNewPrgItm);
|
||||
Frm_StartFormAnchor (ActNewPrgItm,"highlighted_item");
|
||||
Prg_PutParamItmCod (ParentItem.Hierarchy.ItmCod);
|
||||
|
||||
/***** Begin box and table *****/
|
||||
|
@ -1668,7 +1686,7 @@ static void Prg_ShowFormToCreatePrgItem (long ParentItmCod)
|
|||
Hlp_COURSE_Program_new_item,Box_NOT_CLOSABLE,2);
|
||||
|
||||
/***** Show form *****/
|
||||
Prg_ShowFormToPrgItem (&Item,SetHMS,NULL);
|
||||
Prg_ShowFormItem (&Item,SetHMS,NULL);
|
||||
|
||||
/***** End table, send button and end box *****/
|
||||
Box_BoxTableWithButtonEnd (Btn_CREATE_BUTTON,Txt_Create_item);
|
||||
|
@ -1681,7 +1699,7 @@ static void Prg_ShowFormToCreatePrgItem (long ParentItmCod)
|
|||
/***************** Put a form to create a new program item *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Prg_ShowFormToChangePrgItem (long ItmCod)
|
||||
static void Prg_ShowFormToChangeItem (long ItmCod)
|
||||
{
|
||||
extern const char *Hlp_COURSE_Program_edit_item;
|
||||
extern const char *Txt_Edit_item;
|
||||
|
@ -1700,7 +1718,7 @@ static void Prg_ShowFormToChangePrgItem (long ItmCod)
|
|||
Prg_GetPrgItemTxtFromDB (Item.Hierarchy.ItmCod,Txt);
|
||||
|
||||
/***** Begin form *****/
|
||||
Frm_StartForm (ActChgPrgItm);
|
||||
Frm_StartFormAnchor (ActChgPrgItm,"highlighted_item");
|
||||
Prg_PutParamItmCod (Item.Hierarchy.ItmCod);
|
||||
|
||||
/***** Begin box and table *****/
|
||||
|
@ -1711,7 +1729,7 @@ static void Prg_ShowFormToChangePrgItem (long ItmCod)
|
|||
Hlp_COURSE_Program_edit_item,Box_NOT_CLOSABLE,2);
|
||||
|
||||
/***** Show form *****/
|
||||
Prg_ShowFormToPrgItem (&Item,SetHMS,Txt);
|
||||
Prg_ShowFormItem (&Item,SetHMS,Txt);
|
||||
|
||||
/***** End table, send button and end box *****/
|
||||
Box_BoxTableWithButtonEnd (Btn_CONFIRM_BUTTON,Txt_Save_changes);
|
||||
|
@ -1724,9 +1742,9 @@ static void Prg_ShowFormToChangePrgItem (long ItmCod)
|
|||
/***************** Put a form to create a new program item *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Prg_ShowFormToPrgItem (const struct ProgramItem *Item,
|
||||
const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME],
|
||||
const char *Txt)
|
||||
static void Prg_ShowFormItem (const struct ProgramItem *Item,
|
||||
const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME],
|
||||
const char *Txt)
|
||||
{
|
||||
extern const char *Txt_Title;
|
||||
extern const char *Txt_Description;
|
||||
|
@ -1812,7 +1830,7 @@ void Prg_RecFormNewPrgItem (void)
|
|||
if (NewItem.Title[0]) // If there's a program item title
|
||||
{
|
||||
/* If title of program item was in database... */
|
||||
if (Prg_CheckIfSimilarPrgItemExists ("Title",NewItem.Title,NewItem.Hierarchy.ItmCod))
|
||||
if (Prg_CheckIfSimilarItemExists ("Title",NewItem.Title,NewItem.Hierarchy.ItmCod))
|
||||
{
|
||||
NewItemIsCorrect = false;
|
||||
|
||||
|
@ -1830,7 +1848,7 @@ void Prg_RecFormNewPrgItem (void)
|
|||
if (NewItemIsCorrect)
|
||||
{
|
||||
/* Add new program item to database */
|
||||
Prg_InsertPrgItem (&ParentItem,&NewItem,Description);
|
||||
Prg_InsertItem (&ParentItem,&NewItem,Description);
|
||||
|
||||
/* Write success message */
|
||||
Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_item_X,
|
||||
|
@ -1839,10 +1857,10 @@ void Prg_RecFormNewPrgItem (void)
|
|||
else
|
||||
/***** Show form to create item *****/
|
||||
// TODO: The form should be filled with partial data, now is always empty
|
||||
Prg_ShowFormToCreatePrgItem (ParentItem.Hierarchy.ItmCod);
|
||||
Prg_ShowFormToCreateItem (ParentItem.Hierarchy.ItmCod);
|
||||
|
||||
/***** Show program items again *****/
|
||||
Prg_SeeCourseProgram ();
|
||||
Prg_ShowCourseProgramHighlightingItem (NewItem.Hierarchy.ItmCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1853,8 +1871,6 @@ void Prg_RecFormChgPrgItem (void)
|
|||
{
|
||||
extern const char *Txt_Already_existed_an_item_with_the_title_X;
|
||||
extern const char *Txt_You_must_specify_the_title_of_the_item;
|
||||
extern const char *Txt_Created_new_item_X;
|
||||
extern const char *Txt_The_item_has_been_modified;
|
||||
struct ProgramItem OldItem; // Current program item data in database
|
||||
struct ProgramItem NewItem; // Item data received from form
|
||||
bool NewItemIsCorrect = true;
|
||||
|
@ -1887,7 +1903,7 @@ void Prg_RecFormChgPrgItem (void)
|
|||
if (NewItem.Title[0]) // If there's a program item title
|
||||
{
|
||||
/* If title of program item was in database... */
|
||||
if (Prg_CheckIfSimilarPrgItemExists ("Title",NewItem.Title,NewItem.Hierarchy.ItmCod))
|
||||
if (Prg_CheckIfSimilarItemExists ("Title",NewItem.Title,NewItem.Hierarchy.ItmCod))
|
||||
{
|
||||
NewItemIsCorrect = false;
|
||||
|
||||
|
@ -1903,28 +1919,23 @@ void Prg_RecFormChgPrgItem (void)
|
|||
|
||||
/***** Update existing item *****/
|
||||
if (NewItemIsCorrect)
|
||||
{
|
||||
/* Update program item */
|
||||
Prg_UpdatePrgItem (&NewItem,Description);
|
||||
|
||||
/* Write success message */
|
||||
Ale_ShowAlert (Ale_SUCCESS,Txt_The_item_has_been_modified);
|
||||
}
|
||||
Prg_UpdateItem (&NewItem,Description);
|
||||
else
|
||||
/***** Show form to change item *****/
|
||||
// TODO: The form should be filled with partial data, now is always empty
|
||||
Prg_ShowFormToChangePrgItem (NewItem.Hierarchy.ItmCod);
|
||||
Prg_ShowFormToChangeItem (NewItem.Hierarchy.ItmCod);
|
||||
|
||||
/***** Show program items again *****/
|
||||
Prg_SeeCourseProgram ();
|
||||
Prg_ShowCourseProgramHighlightingItem (NewItem.Hierarchy.ItmCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*********** Insert a new program item as a child of a parent item ***********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Prg_InsertPrgItem (struct ProgramItem *ParentItem,
|
||||
struct ProgramItem *Item,const char *Txt)
|
||||
static void Prg_InsertItem (const struct ProgramItem *ParentItem,
|
||||
struct ProgramItem *Item,const char *Txt)
|
||||
{
|
||||
unsigned NumItemParent;
|
||||
unsigned NumItemLastChild;
|
||||
|
@ -1983,7 +1994,7 @@ static void Prg_InsertPrgItem (struct ProgramItem *ParentItem,
|
|||
}
|
||||
|
||||
/***** Insert new program item *****/
|
||||
Item->Hierarchy.ItmCod = Prg_InsertPrgItemIntoDB (Item,Txt);
|
||||
Item->Hierarchy.ItmCod = Prg_InsertItemIntoDB (Item,Txt);
|
||||
|
||||
/***** Unlock table *****/
|
||||
Gbl.DB.LockedTables = false; // Set to false before the following unlock...
|
||||
|
@ -1999,7 +2010,7 @@ static void Prg_InsertPrgItem (struct ProgramItem *ParentItem,
|
|||
/***************** Create a new program item into database *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static long Prg_InsertPrgItemIntoDB (struct ProgramItem *Item,const char *Txt)
|
||||
static long Prg_InsertItemIntoDB (struct ProgramItem *Item,const char *Txt)
|
||||
{
|
||||
return DB_QueryINSERTandReturnCode ("can not create new program item",
|
||||
"INSERT INTO prg_items"
|
||||
|
@ -2021,7 +2032,7 @@ static long Prg_InsertPrgItemIntoDB (struct ProgramItem *Item,const char *Txt)
|
|||
/******************** Update an existing program item ************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Prg_UpdatePrgItem (struct ProgramItem *Item,const char *Txt)
|
||||
static void Prg_UpdateItem (struct ProgramItem *Item,const char *Txt)
|
||||
{
|
||||
/***** Update the data of the program item *****/
|
||||
DB_QueryUPDATE ("can not update program item",
|
||||
|
|
|
@ -62,7 +62,7 @@ struct ProgramItem
|
|||
/***************************** Public prototypes *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Prg_SeeCourseProgram (void);
|
||||
void Prg_ShowCourseProgram (void);
|
||||
|
||||
void Prg_RequestCreatePrgItem (void);
|
||||
void Prg_RequestChangePrgItem (void);
|
||||
|
|
21
swad_text.c
21
swad_text.c
|
@ -46209,27 +46209,6 @@ const char *Txt_The_integrated_editor_is_not_yet_available =
|
|||
"O editor integrado ainda não está disponível.";
|
||||
#endif
|
||||
|
||||
const char *Txt_The_item_has_been_modified =
|
||||
#if L==1 // ca
|
||||
"El ítem ha estat modificat.";
|
||||
#elif L==2 // de
|
||||
"Das Artikel wurde geändert.";
|
||||
#elif L==3 // en
|
||||
"The item has been modified.";
|
||||
#elif L==4 // es
|
||||
"El ítem ha sido modificado.";
|
||||
#elif L==5 // fr
|
||||
"L'article a été modifié.";
|
||||
#elif L==6 // gn
|
||||
"El ítem ha sido modificado."; // Okoteve traducción
|
||||
#elif L==7 // it
|
||||
"Il articolo è stato modificato.";
|
||||
#elif L==8 // pl
|
||||
"Gra przedmiot zmodyfikowane.";
|
||||
#elif L==9 // pt
|
||||
"O item foi modificado.";
|
||||
#endif
|
||||
|
||||
const char *Txt_The_link_X_already_exists = // Warning: it is very important to include %s in the following sentences
|
||||
#if L==1 // ca
|
||||
"El enlace <strong>%s</strong> ya existe."; // Necessita traduccio
|
||||
|
|
Loading…
Reference in New Issue