mirror of https://github.com/acanas/swad-core.git
Version 16.23
This commit is contained in:
parent
cb301ae486
commit
72258bc338
|
@ -362,6 +362,7 @@ Degree:
|
|||
241. ActDegSch Search for courses, teachers, documents...
|
||||
|
||||
242. ActPrnDegInf Print information on the current degree
|
||||
NEW. ActChgDegCtrCfg Request change of the centre of a degree in degree configuration
|
||||
243. ActReqDegLog Show form to send the logo of the current degree
|
||||
244. ActRecDegLog Receive and store the logo of the current degree
|
||||
245. ActRemDegLog Remove the logo of the current degree
|
||||
|
@ -1646,7 +1647,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
/* ActRenDegSho */{ 546,-1,TabCtr,ActSeeDeg ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,Deg_RenameDegreeShort ,Deg_ContEditAfterChgDeg ,NULL},
|
||||
/* ActRenDegFul */{ 547,-1,TabCtr,ActSeeDeg ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,Deg_RenameDegreeFull ,Deg_ContEditAfterChgDeg ,NULL},
|
||||
/* ActChgDegTyp */{ 544,-1,TabCtr,ActSeeDeg ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,DT_ChangeDegreeType ,NULL},
|
||||
/* ActChgDegCtr */{1049,-1,TabCtr,ActSeeDeg ,0x1C0,0x1C0,0x1C0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_ChangeDegreeCtr ,NULL},
|
||||
/* ActChgDegCtr */{1049,-1,TabCtr,ActSeeDeg ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_ChangeDegreeCtr ,NULL},
|
||||
/* ActChgDegWWW */{ 554,-1,TabCtr,ActSeeDeg ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_ChangeDegWWW ,NULL},
|
||||
/* ActChgDegSta */{1207,-1,TabCtr,ActSeeDeg ,0x1C0,0x1C0,0x1C0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_ChangeDegStatus ,NULL},
|
||||
|
||||
|
@ -1715,6 +1716,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
/* ActDegSch */{1184,-1,TabDeg,ActDegReqSch ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,Sch_GetParamsSearch ,Sch_DegSearch ,NULL},
|
||||
|
||||
/* ActPrnDegInf */{1150,-1,TabDeg,ActSeeDegInf ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_NEW_WINDOW ,NULL ,Deg_PrintConfiguration ,NULL},
|
||||
/* ActChgDegCtrCfg */{1588,-1,TabDeg,ActSeeDegInf ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,Deg_ChangeDegreeCtrInConfig ,Deg_ContEditAfterChgDegInConfig,NULL},
|
||||
/* ActReqDegLog */{1246,-1,TabDeg,ActSeeDegInf ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_RequestLogo ,NULL},
|
||||
/* ActRecDegLog */{ 553,-1,TabDeg,ActSeeDegInf ,0x100,0x100,0x100,Act_CONTENT_DATA,Act_MAIN_WINDOW,Deg_ReceiveLogo ,Deg_ShowConfiguration ,NULL},
|
||||
/* ActRemDegLog */{1343,-1,TabDeg,ActSeeDegInf ,0x100,0x100,0x100,Act_CONTENT_DATA,Act_MAIN_WINDOW,Deg_RemoveLogo ,Deg_ShowConfiguration ,NULL},
|
||||
|
@ -4441,6 +4443,7 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq
|
|||
ActAutUsrNew, // #1585
|
||||
ActReqMyUsgRep, // #1586
|
||||
ActChgCrsDegCfg, // #1587
|
||||
ActChgDegCtrCfg, // #1588
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
125
swad_action.h
125
swad_action.h
|
@ -55,9 +55,9 @@ typedef enum
|
|||
|
||||
typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
|
||||
|
||||
#define Act_NUM_ACTIONS (1+9+51+15+90+70+67+247+186+155+172+36+30+86)
|
||||
#define Act_NUM_ACTIONS (1+9+51+15+90+70+68+247+186+155+172+36+30+86)
|
||||
|
||||
#define Act_MAX_ACTION_COD 1587
|
||||
#define Act_MAX_ACTION_COD 1588
|
||||
|
||||
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 20
|
||||
|
||||
|
@ -362,69 +362,70 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica
|
|||
// Secondary actions
|
||||
#define ActDegSch (ActDowShaCtr+ 6)
|
||||
#define ActPrnDegInf (ActDowShaCtr+ 7)
|
||||
#define ActReqDegLog (ActDowShaCtr+ 8)
|
||||
#define ActRecDegLog (ActDowShaCtr+ 9)
|
||||
#define ActRemDegLog (ActDowShaCtr+ 10)
|
||||
#define ActChgDegCtrCfg (ActDowShaCtr+ 8)
|
||||
#define ActReqDegLog (ActDowShaCtr+ 9)
|
||||
#define ActRecDegLog (ActDowShaCtr+ 10)
|
||||
#define ActRemDegLog (ActDowShaCtr+ 11)
|
||||
|
||||
#define ActEdiCrs (ActDowShaCtr+ 11)
|
||||
#define ActReqCrs (ActDowShaCtr+ 12)
|
||||
#define ActNewCrs (ActDowShaCtr+ 13)
|
||||
#define ActRemCrs (ActDowShaCtr+ 14)
|
||||
#define ActChgInsCrsCod (ActDowShaCtr+ 15)
|
||||
#define ActChgCrsDeg (ActDowShaCtr+ 16)
|
||||
#define ActChgCrsYea (ActDowShaCtr+ 17)
|
||||
#define ActRenCrsSho (ActDowShaCtr+ 18)
|
||||
#define ActRenCrsFul (ActDowShaCtr+ 19)
|
||||
#define ActChgCrsSta (ActDowShaCtr+ 20)
|
||||
#define ActEdiCrs (ActDowShaCtr+ 12)
|
||||
#define ActReqCrs (ActDowShaCtr+ 13)
|
||||
#define ActNewCrs (ActDowShaCtr+ 14)
|
||||
#define ActRemCrs (ActDowShaCtr+ 15)
|
||||
#define ActChgInsCrsCod (ActDowShaCtr+ 16)
|
||||
#define ActChgCrsDeg (ActDowShaCtr+ 17)
|
||||
#define ActChgCrsYea (ActDowShaCtr+ 18)
|
||||
#define ActRenCrsSho (ActDowShaCtr+ 19)
|
||||
#define ActRenCrsFul (ActDowShaCtr+ 20)
|
||||
#define ActChgCrsSta (ActDowShaCtr+ 21)
|
||||
|
||||
#define ActChgToSeeDocDeg (ActDowShaCtr+ 21)
|
||||
#define ActSeeDocDeg (ActDowShaCtr+ 22)
|
||||
#define ActExpSeeDocDeg (ActDowShaCtr+ 23)
|
||||
#define ActConSeeDocDeg (ActDowShaCtr+ 24)
|
||||
#define ActZIPSeeDocDeg (ActDowShaCtr+ 25)
|
||||
#define ActReqDatSeeDocDeg (ActDowShaCtr+ 26)
|
||||
#define ActDowSeeDocDeg (ActDowShaCtr+ 27)
|
||||
#define ActChgToAdmDocDeg (ActDowShaCtr+ 28)
|
||||
#define ActAdmDocDeg (ActDowShaCtr+ 29)
|
||||
#define ActReqRemFilDocDeg (ActDowShaCtr+ 30)
|
||||
#define ActRemFilDocDeg (ActDowShaCtr+ 31)
|
||||
#define ActRemFolDocDeg (ActDowShaCtr+ 32)
|
||||
#define ActCopDocDeg (ActDowShaCtr+ 33)
|
||||
#define ActPasDocDeg (ActDowShaCtr+ 34)
|
||||
#define ActRemTreDocDeg (ActDowShaCtr+ 35)
|
||||
#define ActFrmCreDocDeg (ActDowShaCtr+ 36)
|
||||
#define ActCreFolDocDeg (ActDowShaCtr+ 37)
|
||||
#define ActCreLnkDocDeg (ActDowShaCtr+ 38)
|
||||
#define ActRenFolDocDeg (ActDowShaCtr+ 39)
|
||||
#define ActRcvFilDocDegDZ (ActDowShaCtr+ 40)
|
||||
#define ActRcvFilDocDegCla (ActDowShaCtr+ 41)
|
||||
#define ActExpAdmDocDeg (ActDowShaCtr+ 42)
|
||||
#define ActConAdmDocDeg (ActDowShaCtr+ 43)
|
||||
#define ActZIPAdmDocDeg (ActDowShaCtr+ 44)
|
||||
#define ActShoDocDeg (ActDowShaCtr+ 45)
|
||||
#define ActHidDocDeg (ActDowShaCtr+ 46)
|
||||
#define ActReqDatAdmDocDeg (ActDowShaCtr+ 47)
|
||||
#define ActChgDatAdmDocDeg (ActDowShaCtr+ 48)
|
||||
#define ActDowAdmDocDeg (ActDowShaCtr+ 49)
|
||||
#define ActChgToSeeDocDeg (ActDowShaCtr+ 22)
|
||||
#define ActSeeDocDeg (ActDowShaCtr+ 23)
|
||||
#define ActExpSeeDocDeg (ActDowShaCtr+ 24)
|
||||
#define ActConSeeDocDeg (ActDowShaCtr+ 25)
|
||||
#define ActZIPSeeDocDeg (ActDowShaCtr+ 26)
|
||||
#define ActReqDatSeeDocDeg (ActDowShaCtr+ 27)
|
||||
#define ActDowSeeDocDeg (ActDowShaCtr+ 28)
|
||||
#define ActChgToAdmDocDeg (ActDowShaCtr+ 29)
|
||||
#define ActAdmDocDeg (ActDowShaCtr+ 30)
|
||||
#define ActReqRemFilDocDeg (ActDowShaCtr+ 31)
|
||||
#define ActRemFilDocDeg (ActDowShaCtr+ 32)
|
||||
#define ActRemFolDocDeg (ActDowShaCtr+ 33)
|
||||
#define ActCopDocDeg (ActDowShaCtr+ 34)
|
||||
#define ActPasDocDeg (ActDowShaCtr+ 35)
|
||||
#define ActRemTreDocDeg (ActDowShaCtr+ 36)
|
||||
#define ActFrmCreDocDeg (ActDowShaCtr+ 37)
|
||||
#define ActCreFolDocDeg (ActDowShaCtr+ 38)
|
||||
#define ActCreLnkDocDeg (ActDowShaCtr+ 39)
|
||||
#define ActRenFolDocDeg (ActDowShaCtr+ 40)
|
||||
#define ActRcvFilDocDegDZ (ActDowShaCtr+ 41)
|
||||
#define ActRcvFilDocDegCla (ActDowShaCtr+ 42)
|
||||
#define ActExpAdmDocDeg (ActDowShaCtr+ 43)
|
||||
#define ActConAdmDocDeg (ActDowShaCtr+ 44)
|
||||
#define ActZIPAdmDocDeg (ActDowShaCtr+ 45)
|
||||
#define ActShoDocDeg (ActDowShaCtr+ 46)
|
||||
#define ActHidDocDeg (ActDowShaCtr+ 47)
|
||||
#define ActReqDatAdmDocDeg (ActDowShaCtr+ 48)
|
||||
#define ActChgDatAdmDocDeg (ActDowShaCtr+ 49)
|
||||
#define ActDowAdmDocDeg (ActDowShaCtr+ 50)
|
||||
|
||||
#define ActReqRemFilShaDeg (ActDowShaCtr+ 50)
|
||||
#define ActRemFilShaDeg (ActDowShaCtr+ 51)
|
||||
#define ActRemFolShaDeg (ActDowShaCtr+ 52)
|
||||
#define ActCopShaDeg (ActDowShaCtr+ 53)
|
||||
#define ActPasShaDeg (ActDowShaCtr+ 54)
|
||||
#define ActRemTreShaDeg (ActDowShaCtr+ 55)
|
||||
#define ActFrmCreShaDeg (ActDowShaCtr+ 56)
|
||||
#define ActCreFolShaDeg (ActDowShaCtr+ 57)
|
||||
#define ActCreLnkShaDeg (ActDowShaCtr+ 58)
|
||||
#define ActRenFolShaDeg (ActDowShaCtr+ 59)
|
||||
#define ActRcvFilShaDegDZ (ActDowShaCtr+ 60)
|
||||
#define ActRcvFilShaDegCla (ActDowShaCtr+ 61)
|
||||
#define ActExpShaDeg (ActDowShaCtr+ 62)
|
||||
#define ActConShaDeg (ActDowShaCtr+ 63)
|
||||
#define ActZIPShaDeg (ActDowShaCtr+ 64)
|
||||
#define ActReqDatShaDeg (ActDowShaCtr+ 65)
|
||||
#define ActChgDatShaDeg (ActDowShaCtr+ 66)
|
||||
#define ActDowShaDeg (ActDowShaCtr+ 67)
|
||||
#define ActReqRemFilShaDeg (ActDowShaCtr+ 51)
|
||||
#define ActRemFilShaDeg (ActDowShaCtr+ 52)
|
||||
#define ActRemFolShaDeg (ActDowShaCtr+ 53)
|
||||
#define ActCopShaDeg (ActDowShaCtr+ 54)
|
||||
#define ActPasShaDeg (ActDowShaCtr+ 55)
|
||||
#define ActRemTreShaDeg (ActDowShaCtr+ 56)
|
||||
#define ActFrmCreShaDeg (ActDowShaCtr+ 57)
|
||||
#define ActCreFolShaDeg (ActDowShaCtr+ 58)
|
||||
#define ActCreLnkShaDeg (ActDowShaCtr+ 59)
|
||||
#define ActRenFolShaDeg (ActDowShaCtr+ 60)
|
||||
#define ActRcvFilShaDegDZ (ActDowShaCtr+ 61)
|
||||
#define ActRcvFilShaDegCla (ActDowShaCtr+ 62)
|
||||
#define ActExpShaDeg (ActDowShaCtr+ 63)
|
||||
#define ActConShaDeg (ActDowShaCtr+ 64)
|
||||
#define ActZIPShaDeg (ActDowShaCtr+ 65)
|
||||
#define ActReqDatShaDeg (ActDowShaCtr+ 66)
|
||||
#define ActChgDatShaDeg (ActDowShaCtr+ 67)
|
||||
#define ActDowShaDeg (ActDowShaCtr+ 68)
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************************** Course tab *********************************/
|
||||
|
|
|
@ -148,17 +148,18 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.22.2 (2016-10-19)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.23 (2016-10-19)"
|
||||
#define CSS_FILE "swad15.229.css"
|
||||
#define JS_FILE "swad15.238.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.23: Oct 19, 2016 New form in degree configuration to move degree to another centre. (205434 lines)
|
||||
Version 16.22.2: Oct 19, 2016 Code refactoring in course configuration.
|
||||
Fixed bug in selector of courses in breadcrumb. (205350 lines)
|
||||
Version 16.22.1: Oct 19, 2016 Fixed bug in course configuration. (205373 lines)
|
||||
Version 16.22: Oct 19, 2016 New form in course configuration to change course degree.
|
||||
Version 16.22: Oct 19, 2016 New form in course configuration to move course to another degree.
|
||||
Code refactorization related with courses and degrees. (205369 lines)
|
||||
1 change necessary in database:
|
||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1587','es','N','Mover asignatura a otra titulac.');
|
||||
|
|
|
@ -205,7 +205,7 @@ static void Crs_Configuration (bool PrintView)
|
|||
/***** Start table *****/
|
||||
fprintf (Gbl.F.Out,"<table class=\"FRAME_TABLE CELLS_PAD_2\">");
|
||||
|
||||
/***** Course degree *****/
|
||||
/***** Degree *****/
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
"<td class=\"%s RIGHT_MIDDLE\">"
|
||||
"%s:"
|
||||
|
@ -214,14 +214,13 @@ static void Crs_Configuration (bool PrintView)
|
|||
The_ClassForm[Gbl.Prefs.Theme],
|
||||
Txt_Degree);
|
||||
|
||||
if (PrintView)
|
||||
Gbl.Usrs.Me.MyAdminDegs.Num = 0;
|
||||
else
|
||||
/* Get list of degrees administrated by me */
|
||||
/* Get list of degrees administrated by me */
|
||||
if (!PrintView)
|
||||
Deg_GetListDegsAdminByMe ();
|
||||
|
||||
/* Put form to select degree */
|
||||
if (Gbl.Usrs.Me.MyAdminDegs.Num)
|
||||
if (!PrintView &&
|
||||
Gbl.Usrs.Me.MyAdminDegs.Num)
|
||||
{
|
||||
Act_FormStart (ActChgCrsDegCfg);
|
||||
fprintf (Gbl.F.Out,"<select name=\"OthDegCod\""
|
||||
|
@ -243,7 +242,7 @@ static void Crs_Configuration (bool PrintView)
|
|||
/* Free list of degrees administrated by me */
|
||||
Deg_FreeListMyAdminDegs ();
|
||||
}
|
||||
else // I can not change degree
|
||||
else // I can not move course to another degree
|
||||
fprintf (Gbl.F.Out,"%s",Gbl.CurrentDeg.Deg.FullName);
|
||||
|
||||
fprintf (Gbl.F.Out,"</td>"
|
||||
|
@ -756,21 +755,6 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
Lay_EndRoundFrame ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/** Show message of success after changing a course in course configuration **/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Crs_ContEditAfterChgCrsInConfig (void)
|
||||
{
|
||||
/***** Write error/success message *****/
|
||||
Lay_ShowAlert (Gbl.Error ? Lay_WARNING :
|
||||
Lay_SUCCESS,
|
||||
Gbl.Message);
|
||||
|
||||
/***** Show the form again *****/
|
||||
Crs_ShowIntroduction ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*********************** Get total number of courses *************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -2441,11 +2425,12 @@ void Crs_ChangeCrsDegreeInConfig (void)
|
|||
struct Degree NewDeg;
|
||||
char Query[128];
|
||||
|
||||
/***** Get new degree from form *****/
|
||||
/* Get new degree code */
|
||||
/***** Get parameters from form *****/
|
||||
/* Get parameter with degree code */
|
||||
if ((NewDeg.DegCod = Deg_GetParamOtherDegCod ()) == -1L)
|
||||
Lay_ShowErrorAndExit ("Code of degree is missing.");
|
||||
/* Get data of new degree */
|
||||
|
||||
/***** Get data of new degree *****/
|
||||
Deg_GetDataOfDegreeByCod (&NewDeg);
|
||||
|
||||
/***** If I have permission to change course to this new degree... *****/
|
||||
|
@ -2472,14 +2457,16 @@ void Crs_ChangeCrsDegreeInConfig (void)
|
|||
sprintf (Query,"UPDATE courses SET DegCod='%ld' WHERE CrsCod='%ld'",
|
||||
NewDeg.DegCod,Gbl.CurrentCrs.Crs.CrsCod);
|
||||
DB_QueryUPDATE (Query,"can not move course to another degree");
|
||||
Gbl.CurrentCrs.Crs.DegCod = NewDeg.DegCod;
|
||||
Gbl.CurrentCrs.Crs.DegCod =
|
||||
Gbl.CurrentDeg.Deg.DegCod = NewDeg.DegCod;
|
||||
|
||||
/***** Initialize again current course, degree, centre... *****/
|
||||
Deg_InitCurrentCourse ();
|
||||
|
||||
/***** Create message to show the change made *****/
|
||||
sprintf (Gbl.Message,Txt_The_course_X_has_been_moved_to_the_degree_Y,
|
||||
Gbl.CurrentCrs.Crs.FullName,NewDeg.FullName);
|
||||
Gbl.CurrentCrs.Crs.FullName,
|
||||
Gbl.CurrentDeg.Deg.FullName);
|
||||
}
|
||||
}
|
||||
else // I have no permission to change course to this new degree
|
||||
|
@ -2490,6 +2477,21 @@ void Crs_ChangeCrsDegreeInConfig (void)
|
|||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/** Show message of success after changing a course in course configuration **/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Crs_ContEditAfterChgCrsInConfig (void)
|
||||
{
|
||||
/***** Write error/success message *****/
|
||||
Lay_ShowAlert (Gbl.Error ? Lay_WARNING :
|
||||
Lay_SUCCESS,
|
||||
Gbl.Message);
|
||||
|
||||
/***** Show the form again *****/
|
||||
Crs_ShowIntroduction ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****** Change the degree of a course (move course to another degree) ********/
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -287,15 +287,17 @@ void Deg_PrintConfiguration (void)
|
|||
static void Deg_Configuration (bool PrintView)
|
||||
{
|
||||
extern const char *The_ClassForm[The_NUM_THEMES];
|
||||
extern const char *Txt_Courses;
|
||||
extern const char *Txt_Courses_of_DEGREE_X;
|
||||
extern const char *Txt_Centre;
|
||||
extern const char *Txt_Degree;
|
||||
extern const char *Txt_Short_name;
|
||||
extern const char *Txt_Web;
|
||||
extern const char *Txt_Shortcut;
|
||||
extern const char *Txt_STR_LANG_ID[1+Txt_NUM_LANGUAGES];
|
||||
extern const char *Txt_Courses;
|
||||
extern const char *Txt_Courses_of_DEGREE_X;
|
||||
extern const char *Txt_QR_code;
|
||||
extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
||||
unsigned NumCtr;
|
||||
bool PutLink = !PrintView && Gbl.CurrentDeg.Deg.WWW[0];
|
||||
|
||||
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
||||
|
@ -322,6 +324,47 @@ static void Deg_Configuration (bool PrintView)
|
|||
/***** Start table *****/
|
||||
fprintf (Gbl.F.Out,"<table class=\"FRAME_TABLE CELLS_PAD_2\">");
|
||||
|
||||
/***** Centre *****/
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
"<td class=\"%s RIGHT_MIDDLE\">"
|
||||
"%s:"
|
||||
"</td>"
|
||||
"<td class=\"DAT LEFT_MIDDLE\">",
|
||||
The_ClassForm[Gbl.Prefs.Theme],
|
||||
Txt_Centre);
|
||||
|
||||
if (!PrintView &&
|
||||
Gbl.Usrs.Me.LoggedRole >= Rol_INS_ADM) // Only institution admins and system admin can move a degree to another centre
|
||||
{
|
||||
/* Get list of centres of the current institution */
|
||||
Ctr_GetListCentres (Gbl.CurrentIns.Ins.InsCod);
|
||||
|
||||
/* Put form to select centre */
|
||||
Act_FormStart (ActChgDegCtrCfg);
|
||||
fprintf (Gbl.F.Out,"<select name=\"OthCtrCod\""
|
||||
" class=\"INPUT_CENTRE\""
|
||||
" onchange=\"document.getElementById('%s').submit();\">",
|
||||
Gbl.Form.Id);
|
||||
for (NumCtr = 0;
|
||||
NumCtr < Gbl.Ctrs.Num;
|
||||
NumCtr++)
|
||||
fprintf (Gbl.F.Out,"<option value=\"%ld\"%s>%s</option>",
|
||||
Gbl.Ctrs.Lst[NumCtr].CtrCod,
|
||||
Gbl.Ctrs.Lst[NumCtr].CtrCod == Gbl.CurrentCtr.Ctr.CtrCod ? " selected=\"selected\"" :
|
||||
"",
|
||||
Gbl.Ctrs.Lst[NumCtr].ShortName);
|
||||
fprintf (Gbl.F.Out,"</select>");
|
||||
Act_FormEnd ();
|
||||
|
||||
/* Free list of centres */
|
||||
Ctr_FreeListCentres ();
|
||||
}
|
||||
else // I can not edit centre
|
||||
fprintf (Gbl.F.Out,"%s",Gbl.CurrentCtr.Ctr.FullName);
|
||||
|
||||
fprintf (Gbl.F.Out,"</td>"
|
||||
"</tr>");
|
||||
|
||||
/***** Degree full name *****/
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
"<td class=\"%s RIGHT_MIDDLE\">"
|
||||
|
@ -2538,12 +2581,60 @@ static bool Deg_CheckIfDegreeNameExists (long CtrCod,const char *FieldName,const
|
|||
/************************ Change the centre of a degree **********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Deg_ChangeDegreeCtrInConfig (void)
|
||||
{
|
||||
extern const char *Txt_The_degree_X_has_been_moved_to_the_centre_Y;
|
||||
struct Centre NewCtr;
|
||||
char Query[128];
|
||||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get parameter with centre code */
|
||||
NewCtr.CtrCod = Ctr_GetParamOtherCtrCod ();
|
||||
|
||||
/***** Get data of new centre *****/
|
||||
Ctr_GetDataOfCentreByCod (&NewCtr);
|
||||
|
||||
/***** Update centre in table of degrees *****/
|
||||
sprintf (Query,"UPDATE degrees SET CtrCod='%ld' WHERE DegCod='%ld'",
|
||||
NewCtr.CtrCod,Gbl.CurrentDeg.Deg.DegCod);
|
||||
DB_QueryUPDATE (Query,"can not update the centre of a degree");
|
||||
Gbl.CurrentDeg.Deg.CtrCod =
|
||||
Gbl.CurrentCtr.Ctr.CtrCod = NewCtr.CtrCod;
|
||||
|
||||
/***** Initialize again current course, degree, centre... *****/
|
||||
Deg_InitCurrentCourse ();
|
||||
|
||||
/***** Create message to show the change made *****/
|
||||
sprintf (Gbl.Message,Txt_The_degree_X_has_been_moved_to_the_centre_Y,
|
||||
Gbl.CurrentDeg.Deg.FullName,
|
||||
Gbl.CurrentCtr.Ctr.FullName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/** Show message of success after changing a course in course configuration **/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Deg_ContEditAfterChgDegInConfig (void)
|
||||
{
|
||||
/***** Write error/success message *****/
|
||||
Lay_ShowAlert (Gbl.Error ? Lay_WARNING :
|
||||
Lay_SUCCESS,
|
||||
Gbl.Message);
|
||||
|
||||
/***** Show the form again *****/
|
||||
Deg_ShowConfiguration ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************ Change the centre of a degree **********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Deg_ChangeDegreeCtr (void)
|
||||
{
|
||||
extern const char *Txt_The_degree_X_has_been_moved_to_the_centre_Y;
|
||||
struct Degree *Deg;
|
||||
struct Centre NewCtr;
|
||||
char Query[512];
|
||||
char Query[128];
|
||||
|
||||
Deg = &Gbl.Degs.EditingDeg;
|
||||
|
||||
|
|
|
@ -128,6 +128,8 @@ long Deg_GetInsCodOfDegreeByCod (long DegCod);
|
|||
void Deg_RemoveDegreeCompletely (long DegCod);
|
||||
void Deg_RenameDegreeShort (void);
|
||||
void Deg_RenameDegreeFull (void);
|
||||
void Deg_ChangeDegreeCtrInConfig (void);
|
||||
void Deg_ContEditAfterChgDegInConfig (void);
|
||||
void Deg_ChangeDegreeCtr (void);
|
||||
void Deg_ChangeDegWWW (void);
|
||||
void Deg_ChangeDegStatus (void);
|
||||
|
|
Loading…
Reference in New Issue