Version 16.65

This commit is contained in:
Antonio Cañas Vargas 2016-11-20 18:43:38 +01:00
parent c38153e71e
commit 2e38644b92
3 changed files with 29 additions and 35 deletions

View File

@ -166,17 +166,20 @@
// TODO: Default type of degree should be "Other" or empty by default // TODO: Default type of degree should be "Other" or empty by default
// TODO: Change forms to change my webs / social networks to one unique form with a "Save changes" button
/*****************************************************************************/ /*****************************************************************************/
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.64.34 (2016-11-20)" #define Log_PLATFORM_VERSION "SWAD 16.65 (2016-11-20)"
#define CSS_FILE "swad16.60.1.css" #define CSS_FILE "swad16.60.1.css"
#define JS_FILE "swad16.46.1.js" #define JS_FILE "swad16.46.1.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.65: Nov 20, 2016 Changes in selector of my courses. (207369 lines)
Version 16.64.34: Nov 20, 2016 Input fields for URLs are changed from text to url. (207376 lines) Version 16.64.34: Nov 20, 2016 Input fields for URLs are changed from text to url. (207376 lines)
Version 16.64.33: Nov 20, 2016 Input fields for email are changed from text to email. (207375 lines) Version 16.64.33: Nov 20, 2016 Input fields for email are changed from text to email. (207375 lines)
Version 16.64.32: Nov 20, 2016 Input fields for phone numbers are changed from text to tel. (207374 lines) Version 16.64.32: Nov 20, 2016 Input fields for phone numbers are changed from text to tel. (207374 lines)

View File

@ -1087,7 +1087,6 @@ void Crs_WriteSelectorMyCourses (void)
{ {
extern const char *Txt_Course; extern const char *Txt_Course;
unsigned NumMyCrs; unsigned NumMyCrs;
bool IBelongToCurrentCrs = false;
long CrsCod; long CrsCod;
long DegCod; long DegCod;
long LastDegCod; long LastDegCod;
@ -1100,7 +1099,7 @@ void Crs_WriteSelectorMyCourses (void)
/***** Start form *****/ /***** Start form *****/
Act_FormGoToStart (Gbl.Usrs.Me.MyCrss.Num ? ActSeeCrsInf : Act_FormGoToStart (Gbl.Usrs.Me.MyCrss.Num ? ActSeeCrsInf :
ActSysReqSch); ActSysReqSch);
/***** Start of selector of courses *****/ /***** Start of selector of courses *****/
fprintf (Gbl.F.Out,"<select name=\"crs\"" fprintf (Gbl.F.Out,"<select name=\"crs\""
@ -1109,12 +1108,12 @@ void Crs_WriteSelectorMyCourses (void)
Gbl.Form.Id); Gbl.Form.Id);
/***** Write an option when no course selected *****/ /***** Write an option when no course selected *****/
if (Gbl.CurrentCrs.Crs.CrsCod <= 0) if (Gbl.CurrentCrs.Crs.CrsCod <= 0) // No course selected
fprintf (Gbl.F.Out,"<option value=\"-1\" disabled=\"disabled\"" fprintf (Gbl.F.Out,"<option value=\"-1\""
" selected=\"selected\">" " disabled=\"disabled\" selected=\"selected\">"
"%s" "%s"
"</option>", "</option>",
Txt_Course); Txt_Course);
if (Gbl.Usrs.Me.MyCrss.Num) if (Gbl.Usrs.Me.MyCrss.Num)
{ {
@ -1130,41 +1129,33 @@ void Crs_WriteSelectorMyCourses (void)
if (DegCod != LastDegCod) if (DegCod != LastDegCod)
{ {
fprintf (Gbl.F.Out,"<option value=\"-1\" disabled=\"disabled\">" if (LastDegCod > 0)
"--- %s ---" fprintf (Gbl.F.Out,"</optgroup>");
"</option>", fprintf (Gbl.F.Out,"<optgroup label=\"%s\">",DegShortName);
DegShortName);
LastDegCod = DegCod; LastDegCod = DegCod;
} }
fprintf (Gbl.F.Out,"<option value=\"%ld\"", fprintf (Gbl.F.Out,"<option value=\"%ld\"",
Gbl.Usrs.Me.MyCrss.Crss[NumMyCrs].CrsCod); Gbl.Usrs.Me.MyCrss.Crss[NumMyCrs].CrsCod);
if (Gbl.CurrentCrs.Crs.CrsCod > 0 && if (CrsCod == Gbl.CurrentCrs.Crs.CrsCod) // Course selected
CrsCod == Gbl.CurrentCrs.Crs.CrsCod)
{
fprintf (Gbl.F.Out," selected=\"selected\""); fprintf (Gbl.F.Out," selected=\"selected\"");
IBelongToCurrentCrs = true;
}
fprintf (Gbl.F.Out,">%s</option>",CrsShortName); fprintf (Gbl.F.Out,">%s</option>",CrsShortName);
} }
if (LastDegCod > 0)
fprintf (Gbl.F.Out,"</optgroup>");
} }
if (Gbl.CurrentCrs.Crs.CrsCod > 0) /***** Write an option with the current course
{ when I don't belong to it *****/
if (!IBelongToCurrentCrs) if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected
{ !Gbl.Usrs.Me.IBelongToCurrentCrs) // I do not belong to it
/***** Blank option to separate *****/ fprintf (Gbl.F.Out,"<option value=\"%ld\""
if (Gbl.Usrs.Me.MyCrss.Num) " disabled=\"disabled\" selected=\"selected\">"
fprintf (Gbl.F.Out,"<option value=\"-1\" disabled=\"disabled\">" "%s"
"------------" "</option>",
"</option>"); Gbl.CurrentCrs.Crs.CrsCod,
Gbl.CurrentCrs.Crs.ShrtName);
/***** Write an option with the current course *****/
fprintf (Gbl.F.Out,"<option value=\"%ld\" selected=\"selected\">%s</option>",
Gbl.CurrentCrs.Crs.CrsCod,
Gbl.CurrentCrs.Crs.ShrtName);
}
}
/***** End form *****/ /***** End form *****/
fprintf (Gbl.F.Out,"</select>"); fprintf (Gbl.F.Out,"</select>");

View File

@ -343,7 +343,7 @@ void Net_ShowFormMyWebsAndSocialNets (void)
Net_COL2_WIDTH); Net_COL2_WIDTH);
Act_FormStart (ActChgMyNet); Act_FormStart (ActChgMyNet);
Par_PutHiddenParamUnsigned ("Web",(unsigned) NumURL); Par_PutHiddenParamUnsigned ("Web",(unsigned) NumURL);
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"URL\"" fprintf (Gbl.F.Out,"<input type=\"url\" name=\"URL\""
" style=\"width:500px;\" maxlength=\"%u\" value=\"%s\"" " style=\"width:500px;\" maxlength=\"%u\" value=\"%s\""
" onchange=\"document.getElementById('%s').submit();\" />", " onchange=\"document.getElementById('%s').submit();\" />",
Cns_MAX_LENGTH_URL,URL, Cns_MAX_LENGTH_URL,URL,