Version 15.40.5

This commit is contained in:
Antonio Cañas Vargas 2015-11-19 20:04:41 +01:00
parent 7bd0c16de3
commit 39dffca30b
5 changed files with 58 additions and 54 deletions

View File

@ -194,7 +194,7 @@ void Ctr_SeeCtrWithPendingDegs (void)
}
/*****************************************************************************/
/****************** Draw institution logo and name with link *****************/
/******************** Draw centre logo and name with link ********************/
/*****************************************************************************/
void Ctr_DrawCentreLogoAndNameWithLink (struct Centre *Ctr,Act_Action_t Action,
@ -210,7 +210,7 @@ void Ctr_DrawCentreLogoAndNameWithLink (struct Centre *Ctr,Act_Action_t Action,
sprintf (Gbl.Title,Txt_Go_to_X,Ctr->FullName);
Act_LinkFormSubmit (Gbl.Title,ClassLink);
/***** Draw institution logo *****/
/***** Draw centre logo *****/
Log_DrawLogo (Sco_SCOPE_CTR,Ctr->CtrCod,Ctr->ShortName,
16,ClassLogo,true);

View File

@ -111,11 +111,12 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.40.4 (2015/11/19)"
#define Log_PLATFORM_VERSION "SWAD 15.40.5 (2015/11/19)"
// 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.40.5: Nov 19, 2015 Code refactoring in degrees. (187274 lines)
Version 15.40.4: Nov 19, 2015 Code refactoring in centres. (187279 lines)
Version 15.40.3: Nov 19, 2015 Code refactoring in institutions. (187281 lines)
Version 15.40.2: Nov 19, 2015 Some links to countries, institutions, centres and degrees removed. (187281 lines)

View File

@ -150,7 +150,6 @@ void Deg_SeeDegWithPendingCrss (void)
extern const char *Txt_Degrees_with_pending_courses;
extern const char *Txt_Degree;
extern const char *Txt_Courses_ABBREVIATION;
extern const char *Txt_Go_to_X;
extern const char *Txt_There_are_no_degrees_with_requests_for_courses_to_be_confirmed;
char Query[1024];
MYSQL_RES *mysql_res;
@ -221,15 +220,8 @@ void Deg_SeeDegWithPendingCrss (void)
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"LEFT_MIDDLE %s\">",
BgColor);
Act_FormGoToStart (ActSeeCrs);
Deg_PutParamDegCod (Deg.DegCod);
sprintf (Gbl.Title,Txt_Go_to_X,Deg.FullName);
Act_LinkFormSubmit (Gbl.Title,"DAT_NOBR");
Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShortName,
16,"CENTER_MIDDLE",true);
fprintf (Gbl.F.Out,"&nbsp;%s</a>",
Deg.FullName);
Act_FormEnd ();
Deg_DrawDegreeLogoAndNameWithLink (&Deg,ActSeeCrs,
"DAT_NOBR","CENTER_MIDDLE");
fprintf (Gbl.F.Out,"</td>");
/* Number of pending courses (row[1]) */
@ -251,6 +243,34 @@ void Deg_SeeDegWithPendingCrss (void)
DB_FreeMySQLResult (&mysql_res);
}
/*****************************************************************************/
/******************** Draw degree logo and name with link ********************/
/*****************************************************************************/
void Deg_DrawDegreeLogoAndNameWithLink (struct Degree *Deg,Act_Action_t Action,
const char *ClassLink,const char *ClassLogo)
{
extern const char *Txt_Go_to_X;
/***** Start form *****/
Act_FormGoToStart (Action);
Deg_PutParamDegCod (Deg->DegCod);
/***** Link to action *****/
sprintf (Gbl.Title,Txt_Go_to_X,Deg->FullName);
Act_LinkFormSubmit (Gbl.Title,ClassLink);
/***** Draw degree logo *****/
Log_DrawLogo (Sco_SCOPE_DEG,Deg->DegCod,Deg->ShortName,
16,ClassLogo,true);
/***** End link *****/
fprintf (Gbl.F.Out,"&nbsp;%s</a>",Deg->FullName);
/***** End form *****/
Act_FormEnd ();
}
/*****************************************************************************/
/****************** Show information of the current degree *******************/
/*****************************************************************************/
@ -1222,7 +1242,6 @@ static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg)
{
extern const char *Txt_DEGREE_With_courses;
extern const char *Txt_DEGREE_Without_courses;
extern const char *Txt_Go_to_X;
extern const char *Txt_DEGREE_With_year_for_optional_courses;
extern const char *Txt_DEGREE_Without_year_for_optional_courses;
extern const char *Txt_DEGREE_STATUS[Deg_NUM_STATUS_TXT];
@ -1274,17 +1293,9 @@ static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg)
NumDeg);
/***** Degree logo and name *****/
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_MIDDLE %s\">",
TxtClassStrong,BgColor);
Act_FormGoToStart (ActSeeCrs);
Deg_PutParamDegCod (Deg->DegCod);
sprintf (Gbl.Title,Txt_Go_to_X,Deg->FullName);
Act_LinkFormSubmit (Gbl.Title,TxtClassStrong);
Log_DrawLogo (Sco_SCOPE_DEG,Deg->DegCod,Deg->ShortName,
16,"CENTER_MIDDLE",true);
fprintf (Gbl.F.Out,"&nbsp;%s</a>",
Deg->FullName);
Act_FormEnd ();
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE %s\">",BgColor);
Deg_DrawDegreeLogoAndNameWithLink (Deg,ActSeeCrs,
TxtClassStrong,"CENTER_MIDDLE");
fprintf (Gbl.F.Out,"</td>");
/***** Type of degree *****/
@ -3893,18 +3904,18 @@ void Deg_GetAndWriteDegreesAdminBy (long UsrCod,unsigned ColSpan)
MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned long NumRow,NumRows;
long DegCod;
struct Degree Deg;
/***** Get degrees admin by a user from database *****/
sprintf (Query,"(SELECT -1 AS DegCod,'' AS ShortName,''"
sprintf (Query,"(SELECT -1 AS DegCod,'' AS FullName"
" FROM admin"
" WHERE UsrCod='%ld' AND Scope='Sys')"
" UNION "
"(SELECT degrees.DegCod,degrees.ShortName AS ShortName,degrees.FullName"
"(SELECT DegCod,degrees.FullName"
" FROM admin,degrees"
" WHERE admin.UsrCod='%ld' AND admin.Scope='Deg'"
" AND admin.Cod=degrees.DegCod)"
" ORDER BY ShortName",
" ORDER BY FullName",
UsrCod,UsrCod);
if ((NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get degrees admin by a user"))) // If degrees found for this administrator
/***** Get the list of degrees *****/
@ -3930,19 +3941,16 @@ void Deg_GetAndWriteDegreesAdminBy (long UsrCod,unsigned ColSpan)
/* Get next degree */
row = mysql_fetch_row (mysql_res);
DegCod = Str_ConvertStrCodToLongCod (row[0]);
Deg.DegCod = Str_ConvertStrCodToLongCod (row[0]);
if (DegCod > 0)
if (Deg.DegCod > 0)
{
/* Get data of degree */
Deg_GetDataOfDegreeByCod (&Deg);
/* Write degree logo and degree short name */
Act_FormGoToStart (ActSeeDegInf);
Deg_PutParamDegCod (DegCod);
sprintf (Gbl.Title,Txt_Go_to_X,row[2]);
Act_LinkFormSubmit (Gbl.Title,"DAT_SMALL_NOBR");
Log_DrawLogo (Sco_SCOPE_DEG,DegCod,row[1],
16,"LEFT_TOP",true);
fprintf (Gbl.F.Out,"&nbsp;%s</a>",row[2]);
Act_FormEnd ();
Deg_DrawDegreeLogoAndNameWithLink (&Deg,ActSeeDegInf,
"DAT_SMALL_NOBR","LEFT_TOP");
}
else
fprintf (Gbl.F.Out,"<img src=\"%s/swad16x16.gif\""

View File

@ -98,6 +98,9 @@ struct DegreeType
void Deg_SeePending (void);
void Deg_SeeDegWithPendingCrss (void);
void Deg_DrawDegreeLogoAndNameWithLink (struct Degree *Deg,Act_Action_t Action,
const char *ClassLink,const char *ClassLogo);
void Deg_ShowConfiguration (void);
void Deg_PrintConfiguration (void);

View File

@ -3232,7 +3232,7 @@ static void Sta_ShowNumHitsPerCountry (unsigned long NumRows,
"<th class=\"CENTER_TOP\">"
"%s"
"</th>"
"<th class=\"LEFT_TOP\">"
"<th class=\"CENTER_TOP\">"
"%s"
"</th>"
"<th class=\"LEFT_TOP\">"
@ -3323,7 +3323,7 @@ static void Sta_ShowNumHitsPerInstitution (unsigned long NumRows,
"<th class=\"CENTER_TOP\">"
"%s"
"</th>"
"<th class=\"LEFT_TOP\">"
"<th class=\"CENTER_TOP\">"
"%s"
"</th>"
"<th class=\"LEFT_TOP\">"
@ -3513,7 +3513,7 @@ static void Sta_ShowNumHitsPerDegree (unsigned long NumRows,
"<th class=\"CENTER_TOP\">"
"%s"
"</th>"
"<th class=\"LEFT_TOP\">"
"<th class=\"CENTER_TOP\">"
"%s"
"</th>"
"<th class=\"LEFT_TOP\">"
@ -3560,7 +3560,6 @@ static void Sta_ShowNumHitsPerDegree (unsigned long NumRows,
static void Sta_WriteDegree (long DegCod)
{
extern const char *Txt_Go_to_X;
struct Degree Deg;
/***** Start cell *****/
@ -3577,15 +3576,8 @@ static void Sta_WriteDegree (long DegCod)
Deg.FullName);
/***** Form to go to degree *****/
Act_FormGoToStart (ActSeeDegInf);
Deg_PutParamDegCod (DegCod);
sprintf (Gbl.Title,Txt_Go_to_X,Deg.ShortName);
Act_LinkFormSubmit (Gbl.Title,"LOG");
Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShortName,
16,"CENTER_TOP",true);
fprintf (Gbl.F.Out,"&nbsp;%s&nbsp;</a>",
Deg.ShortName);
Act_FormEnd ();
Deg_DrawDegreeLogoAndNameWithLink (&Deg,ActSeeDegInf,
"LOG","CENTER_TOP");
}
else // Hit with no degree selected
/***** No degree selected *****/
@ -3621,13 +3613,13 @@ static void Sta_ShowNumHitsPerCourse (unsigned long NumRows,
"<th class=\"CENTER_TOP\">"
"%s"
"</th>"
"<th class=\"LEFT_TOP\">"
"<th class=\"CENTER_TOP\">"
"%s"
"</th>"
"<th class=\"CENTER_TOP\">"
"%s"
"</th>"
"<th class=\"LEFT_TOP\">"
"<th class=\"CENTER_TOP\">"
"%s"
"</th>"
"<th class=\"LEFT_TOP\">"