Version 16.201

This commit is contained in:
Antonio Cañas Vargas 2017-05-02 11:39:17 +02:00
parent 52028010e6
commit d3c4adfd44
6 changed files with 58 additions and 3330 deletions

File diff suppressed because it is too large Load Diff

View File

@ -191,7 +191,8 @@ static void Asg_PutHeadForSeeing (void)
extern const char *Txt_Folder; extern const char *Txt_Folder;
Dat_StartEndTime_t Order; Dat_StartEndTime_t Order;
fprintf (Gbl.F.Out,"<tr>"); fprintf (Gbl.F.Out,"<tr>"
"<th class=\"CONTEXT_COL\"></th>"); // Column for contextual icons
for (Order = Dat_START_TIME; for (Order = Dat_START_TIME;
Order <= Dat_END_TIME; Order <= Dat_END_TIME;
Order++) Order++)
@ -347,10 +348,17 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView)
Asg_GetDataOfAssignmentByCod (&Asg); Asg_GetDataOfAssignmentByCod (&Asg);
/***** Write first row of data of this assignment *****/ /***** Write first row of data of this assignment *****/
/* Forms to remove/edit this assignment */
fprintf (Gbl.F.Out,"<tr>"
"<td rowspan=\"2\" class=\"CONTEXT_COL COLOR%u\">",
Gbl.RowEvenOdd);
if (!PrintView)
Asg_PutFormsToRemEditOneAsg (Asg.AsgCod,Asg.Hidden);
fprintf (Gbl.F.Out,"</td>");
/* Start date/time */ /* Start date/time */
UniqueId++; UniqueId++;
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<td id=\"asg_date_start_%u\" class=\"%s LEFT_TOP COLOR%u\">"
"<td id=\"asg_date_start_%u\" class=\"%s LEFT_TOP COLOR%u\">"
"<script type=\"text/javascript\">" "<script type=\"text/javascript\">"
"writeLocalDateHMSFromUTC('asg_date_start_%u'," "writeLocalDateHMSFromUTC('asg_date_start_%u',"
"%ld,'<br />','%s',true,true,true);" "%ld,'<br />','%s',true,true,true);"
@ -422,10 +430,6 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView)
/* Author of the assignment */ /* Author of the assignment */
Asg_WriteAsgAuthor (&Asg); Asg_WriteAsgAuthor (&Asg);
/* Forms to remove/edit this assignment */
if (!PrintView)
Asg_PutFormsToRemEditOneAsg (Asg.AsgCod,Asg.Hidden);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Text of the assignment */ /* Text of the assignment */
@ -538,8 +542,6 @@ void Asg_PutHiddenParamAsgOrder (void)
static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden) static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden)
{ {
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
Gbl.Asgs.AsgCodToEdit = AsgCod; // Used as parameter in contextual links Gbl.Asgs.AsgCodToEdit = AsgCod; // Used as parameter in contextual links
switch (Gbl.Usrs.Me.LoggedRole) switch (Gbl.Usrs.Me.LoggedRole)
@ -565,8 +567,6 @@ static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden)
default: default:
break; break;
} }
fprintf (Gbl.F.Out,"</div>");
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -232,7 +232,8 @@ static void Att_ShowAllAttEvents (void)
{ {
/***** Table head *****/ /***** Table head *****/
Lay_StartTableWideMargin (2); Lay_StartTableWideMargin (2);
fprintf (Gbl.F.Out,"<tr>"); fprintf (Gbl.F.Out,"<tr>"
"<th class=\"CONTEXT_COL\"></th>"); // Column for contextual icons
for (Order = Dat_START_TIME; for (Order = Dat_START_TIME;
Order <= Dat_END_TIME; Order <= Dat_END_TIME;
Order++) Order++)
@ -364,10 +365,25 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt
Att_GetDataOfAttEventByCodAndCheckCrs (Att); Att_GetDataOfAttEventByCodAndCheckCrs (Att);
Att_GetNumStdsTotalWhoAreInAttEvent (Att); Att_GetNumStdsTotalWhoAreInAttEvent (Att);
/***** Start date/time *****/ /***** Write first row of data of this attendance event *****/
UniqueId++; /* Forms to remove/edit this attendance event */
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td id=\"att_date_start_%u\" class=\"%s LEFT_BOTTOM", "<td rowspan=\"2\" class=\"CONTEXT_COL COLOR%u\">",
Gbl.RowEvenOdd);
switch (Gbl.Usrs.Me.LoggedRole)
{
case Rol_TEACHER:
case Rol_SYS_ADM:
Att_PutFormsToRemEditOneAttEvent (Att->AttCod,Att->Hidden);
break;
default:
break;
}
fprintf (Gbl.F.Out,"</td>");
/* Start date/time */
UniqueId++;
fprintf (Gbl.F.Out,"<td id=\"att_date_start_%u\" class=\"%s LEFT_TOP",
UniqueId, UniqueId,
Att->Hidden ? (Att->Open ? "DATE_GREEN_LIGHT" : Att->Hidden ? (Att->Open ? "DATE_GREEN_LIGHT" :
"DATE_RED_LIGHT") : "DATE_RED_LIGHT") :
@ -383,8 +399,8 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt
"</td>", "</td>",
UniqueId,Att->TimeUTC[Att_START_TIME],Txt_Today); UniqueId,Att->TimeUTC[Att_START_TIME],Txt_Today);
/***** End date/time *****/ /* End date/time */
fprintf (Gbl.F.Out,"<td id=\"att_date_end_%u\" class=\"%s LEFT_BOTTOM", fprintf (Gbl.F.Out,"<td id=\"att_date_end_%u\" class=\"%s LEFT_TOP",
UniqueId, UniqueId,
Att->Hidden ? (Att->Open ? "DATE_GREEN_LIGHT" : Att->Hidden ? (Att->Open ? "DATE_GREEN_LIGHT" :
"DATE_RED_LIGHT") : "DATE_RED_LIGHT") :
@ -400,7 +416,7 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt
"</td>", "</td>",
UniqueId,Att->TimeUTC[Att_END_TIME],Txt_Today); UniqueId,Att->TimeUTC[Att_END_TIME],Txt_Today);
/***** Attendance event title *****/ /* Attendance event title */
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP"); fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP");
if (!ShowOnlyThisAttEventComplete) if (!ShowOnlyThisAttEventComplete)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
@ -416,7 +432,7 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt
Act_FormEnd (); Act_FormEnd ();
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/***** Number of students in this event *****/ /* Number of students in this event */
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP", fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_TOP",
Att->Hidden ? "ASG_TITLE_LIGHT" : Att->Hidden ? "ASG_TITLE_LIGHT" :
"ASG_TITLE"); "ASG_TITLE");
@ -436,16 +452,6 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt
/* Author of the attendance event */ /* Author of the attendance event */
Att_WriteAttEventAuthor (Att); Att_WriteAttEventAuthor (Att);
/* Forms to remove/edit this attendance event */
switch (Gbl.Usrs.Me.LoggedRole)
{
case Rol_TEACHER:
case Rol_SYS_ADM:
Att_PutFormsToRemEditOneAttEvent (Att->AttCod,Att->Hidden);
break;
default:
break;
}
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Text of the attendance event */ /* Text of the attendance event */
@ -542,8 +548,6 @@ static void Att_PutFormToListStdsParams (void)
static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden) static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden)
{ {
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
Gbl.AttEvents.AttCodToEdit = AttCod; // Used as parameters in contextual links Gbl.AttEvents.AttCodToEdit = AttCod; // Used as parameters in contextual links
/***** Put form to remove attendance event *****/ /***** Put form to remove attendance event *****/
@ -557,8 +561,6 @@ static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden)
/***** Put form to edit attendance event *****/ /***** Put form to edit attendance event *****/
Lay_PutContextualIconToEdit (ActEdiOneAtt,Att_PutParams); Lay_PutContextualIconToEdit (ActEdiOneAtt,Att_PutParams);
fprintf (Gbl.F.Out,"</div>");
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -217,20 +217,20 @@
// TODO: Change numbers of notifications in program and database to match order in tabs // TODO: Change numbers of notifications in program and database to match order in tabs
// TODO: Icon to view en "Fuente de información" // TODO: Icon to view en "Fuente de información"
// TODO: Change layout of contextual icons in assignments, surveys and attendance
/*****************************************************************************/ /*****************************************************************************/
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.200.1 (2017-05-02)" #define Log_PLATFORM_VERSION "SWAD 16.201 (2017-05-02)"
#define CSS_FILE "swad16.195.8.css" #define CSS_FILE "swad16.201.css"
#define JS_FILE "swad16.181.js" #define JS_FILE "swad16.181.js"
// Number of lines (includes comments but not blank lines) has been got with the following command: // Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1 // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
/* /*
Version 16.200.1: May 02, 2017 Fixed problem printing view of students, teachers, etc. (? lines) Version 16.201: May 02, 2017 Change layout of contextual icons in assignments, surveys and attendance. (218344 lines)
Version 16.200.1: May 02, 2017 Fixed problem printing view of students, teachers and guests. (218331 lines)
Version 16.200: May 02, 2017 Print view of an assignment, suggested by Sandra Daniela Tazzioli Barroso. (218337 lines) Version 16.200: May 02, 2017 Print view of an assignment, suggested by Sandra Daniela Tazzioli Barroso. (218337 lines)
1 change necessary in database: 1 change necessary in database:
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1637','es','N','Imprimir actividad'); INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1637','es','N','Imprimir actividad');

View File

@ -1259,16 +1259,15 @@ void Lay_PutIconLink (const char *Icon,const char *Title,const char *Text,
void Lay_PutIconWithText (const char *Icon,const char *Alt,const char *Text) void Lay_PutIconWithText (const char *Icon,const char *Alt,const char *Text)
{ {
/***** Print icon and optional text *****/
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_OPT ICO_HIGHLIGHT\">" fprintf (Gbl.F.Out,"<div class=\"CONTEXT_OPT ICO_HIGHLIGHT\">"
"<img src=\"%s/%s\"" "<img src=\"%s/%s\" alt=\"%s\" title=\"%s\""
" alt=\"%s\" title=\"%s\""
" class=\"ICO20x20\" />", " class=\"ICO20x20\" />",
Gbl.Prefs.IconsURL,Icon, Gbl.Prefs.IconsURL,Icon,
Alt,Text ? Text : Alt); Alt,Text ? Text : Alt);
if (Text) if (Text)
if (Text[0]) if (Text[0])
fprintf (Gbl.F.Out,"&nbsp;%s", fprintf (Gbl.F.Out,"&nbsp;%s",Text);
Text);
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");
} }

View File

@ -223,7 +223,8 @@ static void Svy_ListAllSurveys (struct SurveyQuestion *SvyQst)
{ {
/***** Table head *****/ /***** Table head *****/
Lay_StartTableWideMargin (2); Lay_StartTableWideMargin (2);
fprintf (Gbl.F.Out,"<tr>"); fprintf (Gbl.F.Out,"<tr>"
"<th class=\"CONTEXT_COL\"></th>"); // Column for contextual icons
for (Order = Svy_ORDER_BY_START_DATE; for (Order = Svy_ORDER_BY_START_DATE;
Order <= Svy_ORDER_BY_END_DATE; Order <= Svy_ORDER_BY_END_DATE;
Order++) Order++)
@ -440,10 +441,18 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,
if (ShowOnlyThisSvyComplete) if (ShowOnlyThisSvyComplete)
Lay_StartTableWide (2); Lay_StartTableWide (2);
/***** Start date/time *****/ /***** Write first row of data of this assignment *****/
UniqueId++; /* Forms to remove/edit this assignment */
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td id=\"svy_date_start_%u\" class=\"%s LEFT_TOP", "<td rowspan=\"2\" class=\"CONTEXT_COL COLOR%u\">",
Gbl.RowEvenOdd);
if (Svy.Status.ICanEdit)
Svy_PutFormsToRemEditOneSvy (Svy.SvyCod,Svy.Status.Visible);
fprintf (Gbl.F.Out,"</td>");
/* Start date/time */
UniqueId++;
fprintf (Gbl.F.Out,"<td id=\"svy_date_start_%u\" class=\"%s LEFT_TOP",
UniqueId, UniqueId,
Svy.Status.Visible ? (Svy.Status.Open ? "DATE_GREEN" : Svy.Status.Visible ? (Svy.Status.Open ? "DATE_GREEN" :
"DATE_RED") : "DATE_RED") :
@ -459,7 +468,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,
"</td>", "</td>",
UniqueId,Svy.TimeUTC[Svy_START_TIME],Txt_Today); UniqueId,Svy.TimeUTC[Svy_START_TIME],Txt_Today);
/***** End date/time *****/ /* End date/time */
fprintf (Gbl.F.Out,"<td id=\"svy_date_end_%u\" class=\"%s LEFT_TOP", fprintf (Gbl.F.Out,"<td id=\"svy_date_end_%u\" class=\"%s LEFT_TOP",
UniqueId, UniqueId,
Svy.Status.Visible ? (Svy.Status.Open ? "DATE_GREEN" : Svy.Status.Visible ? (Svy.Status.Open ? "DATE_GREEN" :
@ -476,7 +485,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,
"</td>", "</td>",
UniqueId,Svy.TimeUTC[Svy_END_TIME],Txt_Today); UniqueId,Svy.TimeUTC[Svy_END_TIME],Txt_Today);
/***** Survey title *****/ /* Survey title */
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP"); fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP");
if (!ShowOnlyThisSvyComplete) if (!ShowOnlyThisSvyComplete)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
@ -505,7 +514,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,
Txt_No_of_users, Txt_No_of_users,
Svy.NumUsrs); Svy.NumUsrs);
/***** Status of the survey *****/ /* Status of the survey */
fprintf (Gbl.F.Out,"<td rowspan=\"2\" class=\"LEFT_TOP"); fprintf (Gbl.F.Out,"<td rowspan=\"2\" class=\"LEFT_TOP");
if (!ShowOnlyThisSvyComplete) if (!ShowOnlyThisSvyComplete)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
@ -559,10 +568,6 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,
/* Author of the survey */ /* Author of the survey */
Svy_WriteAuthor (&Svy); Svy_WriteAuthor (&Svy);
/* Forms to remove/edit this survey */
if (Svy.Status.ICanEdit)
Svy_PutFormsToRemEditOneSvy (Svy.SvyCod,Svy.Status.Visible);
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
"<td class=\"LEFT_TOP"); "<td class=\"LEFT_TOP");
if (!ShowOnlyThisSvyComplete) if (!ShowOnlyThisSvyComplete)
@ -783,8 +788,6 @@ static void Svy_PutFormsToRemEditOneSvy (long SvyCod,bool Visible)
{ {
extern const char *Txt_Reset; extern const char *Txt_Reset;
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
Gbl.Svys.SvyCodToEdit = SvyCod; // Used as parameters in contextual links Gbl.Svys.SvyCodToEdit = SvyCod; // Used as parameters in contextual links
/***** Put form to remove survey *****/ /***** Put form to remove survey *****/
@ -804,8 +807,6 @@ static void Svy_PutFormsToRemEditOneSvy (long SvyCod,bool Visible)
/***** Put form to edit survey *****/ /***** Put form to edit survey *****/
Lay_PutContextualIconToEdit (ActEdiOneSvy,Svy_PutParams); Lay_PutContextualIconToEdit (ActEdiOneSvy,Svy_PutParams);
fprintf (Gbl.F.Out,"</div>");
} }
/*****************************************************************************/ /*****************************************************************************/