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: Change forms to change my webs / social networks to one unique form with a "Save changes" button
/*****************************************************************************/
/****************************** 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 JS_FILE "swad16.46.1.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 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.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)

View File

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

View File

@ -343,7 +343,7 @@ void Net_ShowFormMyWebsAndSocialNets (void)
Net_COL2_WIDTH);
Act_FormStart (ActChgMyNet);
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\""
" onchange=\"document.getElementById('%s').submit();\" />",
Cns_MAX_LENGTH_URL,URL,