Version 15.153

This commit is contained in:
Antonio Cañas Vargas 2016-03-19 19:22:13 +01:00
parent be8f6e7b46
commit 2d2c2364c0
5 changed files with 138 additions and 97 deletions

View File

@ -1298,7 +1298,7 @@ a:hover /* Default ==> underlined */
display:inline-block;
box-sizing:border-box;
margin:5px 0;
padding:8px 12px 12px 12px;
padding:8px 12px 20px 12px;
background-color:white;
border-radius:4px;
box-shadow:1px 1px 2px #CCC;
@ -1336,7 +1336,7 @@ a:hover /* Default ==> underlined */
box-sizing:border-box;
width:100%;
margin:0 auto;
padding:0 12px 20px 12px;
padding:0 12px 12px 12px;
color:#808080;
font-size:20pt;
font-weight:bold;

View File

@ -63,15 +63,15 @@ extern struct Globals Gbl;
/*****************************************************************************/
static void Asg_ShowAllAssignments (void);
static void Asg_PutIconToCreateNewAsg (void);
static void Asg_PutButtonToCreateNewAsg (void);
static void Asg_PutParamsToCreateNewAsg (void);
static void Asg_PutFormToSelectWhichGroupsToShow (void);
static void Asg_ShowOneAssignment (long AsgCod);
static void Asg_WriteAsgAuthor (struct Assignment *Asg);
static void Asg_WriteAssignmentFolder (struct Assignment *Asg);
static void Asg_GetParamAsgOrderType (void);
static void Asg_PutFormToCreateNewAsg (void);
static void Asg_PutFormToCreateNewAsgParams (void);
static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden);
static void Asg_PutParams (void);
static void Asg_GetDataOfAssignment (struct Assignment *Asg,const char *Query);
@ -99,16 +99,8 @@ void Asg_SeeAssignments (void)
Grp_GetParamWhichGrps ();
Pag_GetParamPagNum (Pag_ASSIGNMENTS);
/***** Put link (form) to create a bew assignment *****/
switch (Gbl.Usrs.Me.LoggedRole)
{
case Rol_TEACHER:
case Rol_SYS_ADM:
Asg_PutFormToCreateNewAsg ();
break;
default:
break;
}
/***** Get list of assignments *****/
Asg_GetListAssignments ();
/***** Show all the assignments *****/
Asg_ShowAllAssignments ();
@ -126,13 +118,11 @@ static void Asg_ShowAllAssignments (void)
extern const char *Txt_Assignment;
extern const char *Txt_Upload_files_QUESTION;
extern const char *Txt_Folder;
extern const char *Txt_No_assignments;
tAsgsOrderType Order;
struct Pagination Pagination;
unsigned NumAsg;
/***** Get list of assignments *****/
Asg_GetListAssignments ();
/***** Compute variables related to pagination *****/
Pagination.NumItems = Gbl.Asgs.Num;
Pagination.CurrentPage = (int) Gbl.Pag.CurrentPage;
@ -143,62 +133,71 @@ static void Asg_ShowAllAssignments (void)
if (Pagination.MoreThanOnePage)
Pag_WriteLinksToPagesCentered (Pag_ASSIGNMENTS,0,&Pagination);
/***** Start table *****/
Lay_StartRoundFrameTable (NULL,2,Txt_Assignments);
/***** Start frame *****/
Lay_StartRoundFrame ("100%",Txt_Assignments,
(Gbl.Usrs.Me.LoggedRole == Rol_TEACHER ||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) ? Asg_PutIconToCreateNewAsg :
NULL);
/***** Select whether show only my groups or all groups *****/
if (Gbl.CurrentCrs.Grps.NumGrps)
{
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"5\">");
Asg_PutFormToSelectWhichGroupsToShow ();
fprintf (Gbl.F.Out,"</td>"
"</tr>");
}
/***** Table head *****/
fprintf (Gbl.F.Out,"<tr>");
for (Order = Asg_ORDER_BY_START_DATE;
Order <= Asg_ORDER_BY_END_DATE;
Order++)
if (Gbl.Asgs.Num)
{
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE\">");
Act_FormStart (ActSeeAsg);
Grp_PutParamWhichGrps ();
Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage);
Par_PutHiddenParamUnsigned ("Order",(unsigned) Order);
Act_LinkFormSubmit (Txt_ASG_ATT_OR_SVY_HELP_ORDER[Order],"TIT_TBL");
if (Order == Gbl.Asgs.SelectedOrderType)
fprintf (Gbl.F.Out,"<u>");
fprintf (Gbl.F.Out,"%s",Txt_ASG_ATT_OR_SVY_ORDER[Order]);
if (Order == Gbl.Asgs.SelectedOrderType)
fprintf (Gbl.F.Out,"</u>");
fprintf (Gbl.F.Out,"</a>");
Act_FormEnd ();
fprintf (Gbl.F.Out,"</th>");
/***** Table head *****/
fprintf (Gbl.F.Out,"<table class=\"FRAME_TABLE CELLS_PAD_2\">"
"<tr>");
for (Order = Asg_ORDER_BY_START_DATE;
Order <= Asg_ORDER_BY_END_DATE;
Order++)
{
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE\">");
Act_FormStart (ActSeeAsg);
Grp_PutParamWhichGrps ();
Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage);
Par_PutHiddenParamUnsigned ("Order",(unsigned) Order);
Act_LinkFormSubmit (Txt_ASG_ATT_OR_SVY_HELP_ORDER[Order],"TIT_TBL");
if (Order == Gbl.Asgs.SelectedOrderType)
fprintf (Gbl.F.Out,"<u>");
fprintf (Gbl.F.Out,"%s",Txt_ASG_ATT_OR_SVY_ORDER[Order]);
if (Order == Gbl.Asgs.SelectedOrderType)
fprintf (Gbl.F.Out,"</u>");
fprintf (Gbl.F.Out,"</a>");
Act_FormEnd ();
fprintf (Gbl.F.Out,"</th>");
}
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE\">"
"%s"
"</th>"
"<th class=\"CENTER_MIDDLE\">"
"%s"
"</th>"
"<th class=\"CENTER_MIDDLE\">"
"%s"
"</th>"
"</tr>",
Txt_Assignment,
Txt_Upload_files_QUESTION,
Txt_Folder);
/***** Write all the assignments *****/
for (NumAsg = Pagination.FirstItemVisible;
NumAsg <= Pagination.LastItemVisible;
NumAsg++)
Asg_ShowOneAssignment (Gbl.Asgs.LstAsgCods[NumAsg - 1]);
/***** Table end *****/
fprintf (Gbl.F.Out,"</table>");
}
fprintf (Gbl.F.Out,"<th class=\"LEFT_MIDDLE\">"
"%s"
"</th>"
"<th class=\"CENTER_MIDDLE\">"
"%s"
"</th>"
"<th class=\"CENTER_MIDDLE\">"
"%s"
"</th>"
"</tr>",
Txt_Assignment,
Txt_Upload_files_QUESTION,
Txt_Folder);
else // No assignments created
Lay_ShowAlert (Lay_INFO,Txt_No_assignments);
/***** Write all the assignments *****/
for (NumAsg = Pagination.FirstItemVisible;
NumAsg <= Pagination.LastItemVisible;
NumAsg++)
Asg_ShowOneAssignment (Gbl.Asgs.LstAsgCods[NumAsg-1]);
/***** Button to create a new assignment *****/
Asg_PutButtonToCreateNewAsg ();
/***** Table end *****/
Lay_EndRoundFrameTable ();
/***** End frame *****/
Lay_EndRoundFrame ();
/***** Write again links to pages *****/
if (Pagination.MoreThanOnePage)
@ -208,6 +207,46 @@ static void Asg_ShowAllAssignments (void)
Asg_FreeListAssignments ();
}
/*****************************************************************************/
/******************* Put icon to create a new assignment *********************/
/*****************************************************************************/
static void Asg_PutIconToCreateNewAsg (void)
{
extern const char *Txt_New_assignment;
/***** Put form to create a new assignment *****/
Lay_PutContextualLink (ActFrmNewAsg,Asg_PutParamsToCreateNewAsg,
"plus64x64.png",Txt_New_assignment,NULL);
}
/*****************************************************************************/
/******************* Put button to create a new assignment *******************/
/*****************************************************************************/
static void Asg_PutButtonToCreateNewAsg (void)
{
extern const char *Txt_New_assignment;
extern const char *Txt_Create_assignment;
Act_FormStart (ActFrmNewAsg);
Asg_PutParamsToCreateNewAsg ();
Lay_PutConfirmButton (Gbl.Asgs.Num ? Txt_New_assignment :
Txt_Create_assignment);
Act_FormEnd ();
}
/*****************************************************************************/
/***************** Put parameters to create a new assignment *****************/
/*****************************************************************************/
static void Asg_PutParamsToCreateNewAsg (void)
{
Asg_PutHiddenParamAsgOrderType ();
Grp_PutParamWhichGrps ();
Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage);
}
/*****************************************************************************/
/***************** Put form to select which groups to show *******************/
/*****************************************************************************/
@ -461,29 +500,6 @@ void Asg_PutHiddenParamAsgOrderType (void)
Par_PutHiddenParamUnsigned ("Order",(unsigned) Gbl.Asgs.SelectedOrderType);
}
/*****************************************************************************/
/************** Put a link (form) to create a new assignment *****************/
/*****************************************************************************/
static void Asg_PutFormToCreateNewAsg (void)
{
extern const char *Txt_New_assignment;
/***** Put form to create a new assignment *****/
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
Lay_PutContextualLink (ActFrmNewAsg,Asg_PutFormToCreateNewAsgParams,
"plus64x64.png",
Txt_New_assignment,Txt_New_assignment);
fprintf (Gbl.F.Out,"</div>");
}
static void Asg_PutFormToCreateNewAsgParams (void)
{
Asg_PutHiddenParamAsgOrderType ();
Grp_PutParamWhichGrps ();
Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage);
}
/*****************************************************************************/
/***************** Put a link (form) to edit one assignment ******************/
/*****************************************************************************/
@ -1125,8 +1141,12 @@ void Asg_RequestCreatOrEditAsg (void)
Lay_EndRoundFrameTableWithButton (Lay_CONFIRM_BUTTON,Txt_Save);
Act_FormEnd ();
/***** Show current assignments *****/
Asg_ShowAllAssignments ();
/***** Get list of assignments *****/
Asg_GetListAssignments ();
/***** Show current assignments, if any *****/
if (Gbl.Asgs.Num)
Asg_ShowAllAssignments ();
}
/*****************************************************************************/

View File

@ -127,21 +127,21 @@
// TODO: Icon to the left in list of forums is not correct when scope is system
// TODO: Move info about number of files to bottom of file browsers
// TODO: Show tagline at top, near logo
// TODO: Show big header h1 when no country specified
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.152 (2016-03-19)"
#define Log_PLATFORM_VERSION "SWAD 15.153 (2016-03-19)"
#define CSS_FILE "swad15.152.css"
#define JS_FILE "swad15.131.3.js"
// 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
/*
Version 15.152: Mar 19, 2016 Changes in layout of head. Not finished. (? lines)
Version 15.153: Mar 19, 2016 Icon to add new assignment integrated in frame.
Changes in layout of assignments. (195984 lines)
Version 15.152: Mar 19, 2016 Changes in layout of head. Not finished. (195949 lines)
Version 15.151.5: Mar 19, 2016 Icon to edit holidays integrated in frame. (195931 lines)
Version 15.151.4: Mar 19, 2016 Icon to edit plugins integrated in frame. (195933 lines)
Version 15.151.3: Mar 19, 2016 Icon to edit mail domains integrated in frame. (195934 lines)

View File

@ -313,7 +313,7 @@ void Sch_PutFormToSearch (const char *Icon,const char *IdInputText)
if (IdInputText)
fprintf (Gbl.F.Out," id=\"%s\"",IdInputText);
fprintf (Gbl.F.Out," type=\"text\" name=\"Search\""
" size=\"30\" maxlength=\"%u\" value=\"%s\"",
" size=\"20\" maxlength=\"%u\" value=\"%s\"",
Sch_MAX_LENGTH_STRING_TO_FIND,
Gbl.Search.Str);
if (!Gbl.Search.Str[0])

View File

@ -23366,7 +23366,7 @@ const char *Txt_No =
const char *Txt_No_announcements =
#if L==1
"No hay anuncis";
"No hi ha anuncis";
#elif L==2
"Keine Bekanntmachungen";
#elif L==3
@ -23406,6 +23406,27 @@ const char *Txt_No_announcements_of_exams_of_X = // Warning: it is very importan
"N&atilde;o chamadas para exame de <strong>%s</strong>.";
#endif
const char *Txt_No_assignments =
#if L==1
"No hi ha activitats";
#elif L==2
"Keine Aufgaben";
#elif L==3
"No assignments";
#elif L==4
"No hay actividades";
#elif L==5
"Il n'y a pas d'activit&eacute;s";
#elif L==6
"No hay actividades"; // Okoteve traducción
#elif L==7
"Non ci sono attivit&agrave;";
#elif L==8
"Brak zadania";
#elif L==9
"N&atilde;o h&aacute; atividades";
#endif
const char *Txt_no_course_of_origin = // Means: "message sent from any course"
#if L==1
"sin asignatura de origen"; // Necessita traduccio
@ -23534,7 +23555,7 @@ const char *Txt_No_enrollment_requests =
const char *Txt_No_events =
#if L==1
"No hay esdeveniments.";
"No hi ha esdeveniments.";
#elif L==2
"Keine Ereignisse.";
#elif L==3