Version18.116.6

This commit is contained in:
Antonio Cañas Vargas 2019-04-20 22:06:18 +02:00
parent 483045a682
commit 5fbb40778d
4 changed files with 31 additions and 73 deletions

View File

@ -79,7 +79,8 @@ static void Asg_WriteAsgAuthor (struct Assignment *Asg);
static void Asg_WriteAssignmentFolder (struct Assignment *Asg,bool PrintView); static void Asg_WriteAssignmentFolder (struct Assignment *Asg,bool PrintView);
static void Asg_GetParamAsgOrder (void); static void Asg_GetParamAsgOrder (void);
static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden); static void Asg_PutFormsToRemEditOneAsg (const struct Assignment *Asg,
const char *Anchor);
static void Asg_PutParams (void); static void Asg_PutParams (void);
static void Asg_GetDataOfAssignment (struct Assignment *Asg, static void Asg_GetDataOfAssignment (struct Assignment *Asg,
MYSQL_RES **mysql_res, MYSQL_RES **mysql_res,
@ -340,6 +341,7 @@ void Asg_PrintOneAssignment (void)
static void Asg_ShowOneAssignment (long AsgCod,bool PrintView) static void Asg_ShowOneAssignment (long AsgCod,bool PrintView)
{ {
extern const char *Txt_Today; extern const char *Txt_Today;
char *Anchor = NULL;
static unsigned UniqueId = 0; static unsigned UniqueId = 0;
struct Assignment Asg; struct Assignment Asg;
char Txt[Cns_MAX_BYTES_TEXT + 1]; char Txt[Cns_MAX_BYTES_TEXT + 1];
@ -348,6 +350,9 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView)
Asg.AsgCod = AsgCod; Asg.AsgCod = AsgCod;
Asg_GetDataOfAssignmentByCod (&Asg); Asg_GetDataOfAssignmentByCod (&Asg);
/***** Set anchor string *****/
Frm_SetAnchorStr (Asg.AsgCod,&Anchor);
/***** Write first row of data of this assignment *****/ /***** Write first row of data of this assignment *****/
/* Forms to remove/edit this assignment */ /* Forms to remove/edit this assignment */
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
@ -357,7 +362,7 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView)
else else
{ {
fprintf (Gbl.F.Out," COLOR%u\">",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," COLOR%u\">",Gbl.RowEvenOdd);
Asg_PutFormsToRemEditOneAsg (Asg.AsgCod,Asg.Hidden); Asg_PutFormsToRemEditOneAsg (&Asg,Anchor);
} }
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
@ -400,14 +405,15 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView)
(unsigned) Gbl.Prefs.DateFormat,Txt_Today); (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
/* Assignment title */ /* Assignment title */
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP"); fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP",
Asg.Hidden ? "ASG_TITLE_LIGHT" :
"ASG_TITLE");
if (!PrintView) if (!PrintView)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"\">" fprintf (Gbl.F.Out,"\">");
"<div class=\"%s\">%s</div>", Lay_StartArticle (Anchor);
Asg.Hidden ? "ASG_TITLE_LIGHT" : fprintf (Gbl.F.Out,"%s",Asg.Title);
"ASG_TITLE", Lay_EndArticle ();
Asg.Title);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Assignment folder */ /* Assignment folder */
@ -452,6 +458,9 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView)
"DAT", "DAT",
Txt); Txt);
/***** Free anchor string *****/
Frm_FreeAnchorStr (Anchor);
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
/***** Mark possible notification as seen *****/ /***** Mark possible notification as seen *****/
@ -533,9 +542,10 @@ void Asg_PutHiddenParamAsgOrder (void)
/***************** Put a link (form) to edit one assignment ******************/ /***************** Put a link (form) to edit one assignment ******************/
/*****************************************************************************/ /*****************************************************************************/
static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden) static void Asg_PutFormsToRemEditOneAsg (const struct Assignment *Asg,
const char *Anchor)
{ {
Gbl.Asgs.AsgCodToEdit = AsgCod; // Used as parameter in contextual links Gbl.Asgs.AsgCodToEdit = Asg->AsgCod; // Used as parameter in contextual links
switch (Gbl.Usrs.Me.Role.Logged) switch (Gbl.Usrs.Me.Role.Logged)
{ {
@ -545,10 +555,10 @@ static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden)
Ico_PutContextualIconToRemove (ActReqRemAsg,Asg_PutParams); Ico_PutContextualIconToRemove (ActReqRemAsg,Asg_PutParams);
/***** Put form to hide/show assignment *****/ /***** Put form to hide/show assignment *****/
if (Hidden) if (Asg->Hidden)
Ico_PutContextualIconToUnhide (ActShoAsg,NULL,Asg_PutParams); Ico_PutContextualIconToUnhide (ActShoAsg,Anchor,Asg_PutParams);
else else
Ico_PutContextualIconToHide (ActHidAsg,NULL,Asg_PutParams); Ico_PutContextualIconToHide (ActHidAsg,Anchor,Asg_PutParams);
/***** Put form to edit assignment *****/ /***** Put form to edit assignment *****/
Ico_PutContextualIconToEdit (ActEdiOneAsg,Asg_PutParams); Ico_PutContextualIconToEdit (ActEdiOneAsg,Asg_PutParams);
@ -995,7 +1005,6 @@ void Asg_RemoveAssignment (void)
void Asg_HideAssignment (void) void Asg_HideAssignment (void)
{ {
extern const char *Txt_Assignment_X_is_now_hidden;
struct Assignment Asg; struct Assignment Asg;
/***** Get assignment code *****/ /***** Get assignment code *****/
@ -1011,10 +1020,6 @@ void Asg_HideAssignment (void)
" WHERE AsgCod=%ld AND CrsCod=%ld", " WHERE AsgCod=%ld AND CrsCod=%ld",
Asg.AsgCod,Gbl.Hierarchy.Crs.CrsCod); Asg.AsgCod,Gbl.Hierarchy.Crs.CrsCod);
/***** Write message to show the change made *****/
Ale_ShowAlert (Ale_SUCCESS,Txt_Assignment_X_is_now_hidden,
Asg.Title);
/***** Show assignments again *****/ /***** Show assignments again *****/
Asg_SeeAssignments (); Asg_SeeAssignments ();
} }
@ -1025,7 +1030,6 @@ void Asg_HideAssignment (void)
void Asg_ShowAssignment (void) void Asg_ShowAssignment (void)
{ {
extern const char *Txt_Assignment_X_is_now_visible;
struct Assignment Asg; struct Assignment Asg;
/***** Get assignment code *****/ /***** Get assignment code *****/
@ -1041,10 +1045,6 @@ void Asg_ShowAssignment (void)
" WHERE AsgCod=%ld AND CrsCod=%ld", " WHERE AsgCod=%ld AND CrsCod=%ld",
Asg.AsgCod,Gbl.Hierarchy.Crs.CrsCod); Asg.AsgCod,Gbl.Hierarchy.Crs.CrsCod);
/***** Write message to show the change made *****/
Ale_ShowAlert (Ale_SUCCESS,Txt_Assignment_X_is_now_visible,
Asg.Title);
/***** Show assignments again *****/ /***** Show assignments again *****/
Asg_SeeAssignments (); Asg_SeeAssignments ();
} }

View File

@ -448,10 +448,11 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf ps2pdf source.ps destination.pdf
*/ */
#define Log_PLATFORM_VERSION "SWAD 18.116.5 (2019-04-20)" #define Log_PLATFORM_VERSION "SWAD 18.116.6 (2019-04-20)"
#define CSS_FILE "swad18.112.1.css" #define CSS_FILE "swad18.112.1.css"
#define JS_FILE "swad18.116.5.js" #define JS_FILE "swad18.116.5.js"
/* /*
Version 18.116.6: Apr 20, 2019 Changed the behaviour of hiding/showing an assignment. (242974 lines)
Version 18.116.5: Apr 20, 2019 Changed the behaviour of hiding/showing an attendance event. Version 18.116.5: Apr 20, 2019 Changed the behaviour of hiding/showing an attendance event.
Code refactoring related to anchors. (243014 lines) Code refactoring related to anchors. (243014 lines)
Version 18.116.4: Apr 20, 2019 Changed the behaviour of hiding/showing an agenda event. (243130 lines) Version 18.116.4: Apr 20, 2019 Changed the behaviour of hiding/showing an agenda event. (243130 lines)

View File

@ -991,9 +991,7 @@ static void Prj_ShowOneProject (unsigned NumIndex,struct Project *Prj,
Prj->Hidden == Prj_HIDDEN ? "DATE_BLUE_LIGHT" : Prj->Hidden == Prj_HIDDEN ? "DATE_BLUE_LIGHT" :
"DATE_BLUE", "DATE_BLUE",
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
Lay_StartArticle (Anchor);
fprintf (Gbl.F.Out,"%u",NumIndex); fprintf (Gbl.F.Out,"%u",NumIndex);
Lay_EndArticle ();
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
break; break;
default: default:
@ -1051,10 +1049,13 @@ static void Prj_ShowOneProject (unsigned NumIndex,struct Project *Prj,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today); (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
/* Project title */ /* Project title */
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP"); fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP",
Prj->Hidden == Prj_HIDDEN ? "ASG_TITLE_LIGHT" :
"ASG_TITLE");
if (ProjectView == Prj_LIST_PROJECTS) if (ProjectView == Prj_LIST_PROJECTS)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"\">"); fprintf (Gbl.F.Out,"\">");
Lay_StartArticle (Anchor);
if (ICanViewProjectFiles) if (ICanViewProjectFiles)
{ {
Frm_StartForm (ActAdmDocPrj); Frm_StartForm (ActAdmDocPrj);
@ -1067,10 +1068,8 @@ static void Prj_ShowOneProject (unsigned NumIndex,struct Project *Prj,
Frm_EndForm (); Frm_EndForm ();
} }
else else
fprintf (Gbl.F.Out,"<div class=\"%s\">%s</div>", fprintf (Gbl.F.Out,"%s",Prj->Title);
Prj->Hidden == Prj_HIDDEN ? "ASG_TITLE_LIGHT" : Lay_EndArticle ();
"ASG_TITLE",
Prj->Title);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Department */ /* Department */

View File

@ -2072,48 +2072,6 @@ const char *Txt_Assignment =
"Atividade"; "Atividade";
#endif #endif
const char *Txt_Assignment_X_is_now_hidden = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"La activitat <strong>%s</strong> ara est&agrave; oculta.";
#elif L==2 // de
"Die Aufgabe <strong>%s</strong> ist jetzt ausgeblendet.";
#elif L==3 // en
"Assignment <strong>%s</strong> is now hidden.";
#elif L==4 // es
"La actividad <strong>%s</strong> ahora est&aacute; oculta.";
#elif L==5 // fr
"L'activit&eacute; <strong>%s</strong> est maintenant cach&eacute;e.";
#elif L==6 // gn
"La actividad <strong>%s</strong> ahora est&aacute; oculta."; // Okoteve traducción
#elif L==7 // it
"L'attivit&agrave; <strong>%s</strong> &egrave; ora nascosta.";
#elif L==8 // pl
"Zadanie <strong>%s</strong> jest ukryte.";
#elif L==9 // pt
"A atividade <strong>%s</strong> &eacute; agora oculta.";
#endif
const char *Txt_Assignment_X_is_now_visible = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"La activitat <strong>%s</strong> ara est&agrave; visible.";
#elif L==2 // de
"Die Aufgabe <strong>%s</strong> ist jetzt sichtbar.";
#elif L==3 // en
"Assignment <strong>%s</strong> is now visible.";
#elif L==4 // es
"La actividad <strong>%s</strong> ahora est&aacute; visible.";
#elif L==5 // fr
"L'activit&eacute; <strong>%s</strong> est maintenant visible.";
#elif L==6 // gn
"La actividad <strong>%s</strong> ahora est&aacute; visible."; // Okoteve traducción
#elif L==7 // it
"L'attivit&agrave; <strong>%s</strong> &egrave; ora visibile.";
#elif L==8 // pl
"Zadanie <strong>%s</strong> jest teraz widoczny.";
#elif L==9 // pt
"A atividade <strong>%s</strong> &eacute; agora vis&iacute;vel.";
#endif
const char *Txt_Assignment_X_removed = // Warning: it is very important to include %s in the following sentences const char *Txt_Assignment_X_removed = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca #if L==1 // ca
"Activitat <strong>%s</strong> eliminada."; "Activitat <strong>%s</strong> eliminada.";