Version 16.33

This commit is contained in:
Antonio Cañas Vargas 2016-10-22 19:49:33 +02:00
parent bb9c4f85f9
commit 9cf16f2e9a
5 changed files with 163 additions and 102 deletions

View File

@ -184,6 +184,7 @@ Institution:
85. ActChgInsCtyCfg Change country of institution in institution configuration
NEW. ActRenInsShoCfg Change short name of institution in institution configuration
NEW. ActRenInsFulCfg Change full name of institution in institution configuration
NEW. ActChgInsWWWCfg Change web of institution in institution configuration
86. ActReqInsLog Show form to send the logo of the current institution
87. ActRecInsLog Receive and store the logo of the current institution
88. ActRemInsLog Remove the logo of the current institution
@ -1530,6 +1531,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActChgInsCtyCfg */{1590,-1,TabUnk,ActSeeInsInf ,0x100,0x100,0x100,Act_CONT_NORM,Act_THIS_WINDOW,Ins_ChangeInsCtyInConfig ,Ins_ContEditAfterChgInsInConfig,NULL},
/* ActRenInsShoCfg */{1592,-1,TabUnk,ActSeeInsInf ,0x100,0x100,0x100,Act_CONT_NORM,Act_THIS_WINDOW,Ins_RenameInsShortInConfig ,Ins_ContEditAfterChgInsInConfig,NULL},
/* ActRenInsFulCfg */{1591,-1,TabUnk,ActSeeInsInf ,0x100,0x100,0x100,Act_CONT_NORM,Act_THIS_WINDOW,Ins_RenameInsFullInConfig ,Ins_ContEditAfterChgInsInConfig,NULL},
/* ActChgInsWWWCfg */{1593,-1,TabUnk,ActSeeInsInf ,0x100,0x100,0x100,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ins_ChangeInsWWWInConfig ,NULL},
/* ActReqInsLog */{1245,-1,TabUnk,ActSeeInsInf ,0x100,0x100,0x100,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ins_RequestLogo ,NULL},
/* ActRecInsLog */{ 699,-1,TabUnk,ActSeeInsInf ,0x100,0x100,0x100,Act_CONT_DATA,Act_THIS_WINDOW,Ins_ReceiveLogo ,Ins_ShowConfiguration ,NULL},
/* ActRemInsLog */{1341,-1,TabUnk,ActSeeInsInf ,0x100,0x100,0x100,Act_CONT_DATA,Act_THIS_WINDOW,Ins_RemoveLogo ,Ins_ShowConfiguration ,NULL},
@ -4446,6 +4448,7 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq
ActChgInsCtyCfg, // #1590
ActRenInsFulCfg, // #1591
ActRenInsShoCfg, // #1592
ActChgInsWWWCfg, // #1593
};
/*****************************************************************************/

View File

@ -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+14+92+70+67+247+186+155+172+36+30+86)
#define Act_NUM_ACTIONS (1+9+51+14+93+70+67+247+186+155+172+36+30+86)
#define Act_MAX_ACTION_COD 1592
#define Act_MAX_ACTION_COD 1593
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 20
@ -184,91 +184,92 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica
#define ActChgInsCtyCfg (ActChgInsSta+ 11)
#define ActRenInsShoCfg (ActChgInsSta+ 12)
#define ActRenInsFulCfg (ActChgInsSta+ 13)
#define ActReqInsLog (ActChgInsSta+ 14)
#define ActRecInsLog (ActChgInsSta+ 15)
#define ActRemInsLog (ActChgInsSta+ 16)
#define ActChgInsWWWCfg (ActChgInsSta+ 14)
#define ActReqInsLog (ActChgInsSta+ 15)
#define ActRecInsLog (ActChgInsSta+ 16)
#define ActRemInsLog (ActChgInsSta+ 17)
#define ActEdiCtr (ActChgInsSta+ 17)
#define ActReqCtr (ActChgInsSta+ 18)
#define ActNewCtr (ActChgInsSta+ 19)
#define ActRemCtr (ActChgInsSta+ 20)
#define ActChgCtrPlc (ActChgInsSta+ 21)
#define ActRenCtrSho (ActChgInsSta+ 22)
#define ActRenCtrFul (ActChgInsSta+ 23)
#define ActChgCtrWWW (ActChgInsSta+ 24)
#define ActChgCtrSta (ActChgInsSta+ 25)
#define ActEdiCtr (ActChgInsSta+ 18)
#define ActReqCtr (ActChgInsSta+ 19)
#define ActNewCtr (ActChgInsSta+ 20)
#define ActRemCtr (ActChgInsSta+ 21)
#define ActChgCtrPlc (ActChgInsSta+ 22)
#define ActRenCtrSho (ActChgInsSta+ 23)
#define ActRenCtrFul (ActChgInsSta+ 24)
#define ActChgCtrWWW (ActChgInsSta+ 25)
#define ActChgCtrSta (ActChgInsSta+ 26)
#define ActEdiDpt (ActChgInsSta+ 26)
#define ActNewDpt (ActChgInsSta+ 27)
#define ActRemDpt (ActChgInsSta+ 28)
#define ActChgDptIns (ActChgInsSta+ 29)
#define ActRenDptSho (ActChgInsSta+ 30)
#define ActRenDptFul (ActChgInsSta+ 31)
#define ActChgDptWWW (ActChgInsSta+ 32)
#define ActEdiDpt (ActChgInsSta+ 27)
#define ActNewDpt (ActChgInsSta+ 28)
#define ActRemDpt (ActChgInsSta+ 29)
#define ActChgDptIns (ActChgInsSta+ 30)
#define ActRenDptSho (ActChgInsSta+ 31)
#define ActRenDptFul (ActChgInsSta+ 32)
#define ActChgDptWWW (ActChgInsSta+ 33)
#define ActEdiPlc (ActChgInsSta+ 33)
#define ActNewPlc (ActChgInsSta+ 34)
#define ActRemPlc (ActChgInsSta+ 35)
#define ActRenPlcSho (ActChgInsSta+ 36)
#define ActRenPlcFul (ActChgInsSta+ 37)
#define ActEdiPlc (ActChgInsSta+ 34)
#define ActNewPlc (ActChgInsSta+ 35)
#define ActRemPlc (ActChgInsSta+ 36)
#define ActRenPlcSho (ActChgInsSta+ 37)
#define ActRenPlcFul (ActChgInsSta+ 38)
#define ActEdiHld (ActChgInsSta+ 38)
#define ActNewHld (ActChgInsSta+ 39)
#define ActRemHld (ActChgInsSta+ 40)
#define ActChgHldPlc (ActChgInsSta+ 41)
#define ActChgHldTyp (ActChgInsSta+ 42)
#define ActChgHldStrDat (ActChgInsSta+ 43)
#define ActChgHldEndDat (ActChgInsSta+ 44)
#define ActRenHld (ActChgInsSta+ 45)
#define ActEdiHld (ActChgInsSta+ 39)
#define ActNewHld (ActChgInsSta+ 40)
#define ActRemHld (ActChgInsSta+ 41)
#define ActChgHldPlc (ActChgInsSta+ 42)
#define ActChgHldTyp (ActChgInsSta+ 43)
#define ActChgHldStrDat (ActChgInsSta+ 44)
#define ActChgHldEndDat (ActChgInsSta+ 45)
#define ActRenHld (ActChgInsSta+ 46)
#define ActChgToSeeDocIns (ActChgInsSta+ 46)
#define ActSeeDocIns (ActChgInsSta+ 47)
#define ActExpSeeDocIns (ActChgInsSta+ 48)
#define ActConSeeDocIns (ActChgInsSta+ 49)
#define ActZIPSeeDocIns (ActChgInsSta+ 50)
#define ActReqDatSeeDocIns (ActChgInsSta+ 51)
#define ActDowSeeDocIns (ActChgInsSta+ 52)
#define ActChgToAdmDocIns (ActChgInsSta+ 53)
#define ActAdmDocIns (ActChgInsSta+ 54)
#define ActReqRemFilDocIns (ActChgInsSta+ 55)
#define ActRemFilDocIns (ActChgInsSta+ 56)
#define ActRemFolDocIns (ActChgInsSta+ 57)
#define ActCopDocIns (ActChgInsSta+ 58)
#define ActPasDocIns (ActChgInsSta+ 59)
#define ActRemTreDocIns (ActChgInsSta+ 60)
#define ActFrmCreDocIns (ActChgInsSta+ 61)
#define ActCreFolDocIns (ActChgInsSta+ 62)
#define ActCreLnkDocIns (ActChgInsSta+ 63)
#define ActRenFolDocIns (ActChgInsSta+ 64)
#define ActRcvFilDocInsDZ (ActChgInsSta+ 65)
#define ActRcvFilDocInsCla (ActChgInsSta+ 66)
#define ActExpAdmDocIns (ActChgInsSta+ 67)
#define ActConAdmDocIns (ActChgInsSta+ 68)
#define ActZIPAdmDocIns (ActChgInsSta+ 69)
#define ActShoDocIns (ActChgInsSta+ 70)
#define ActHidDocIns (ActChgInsSta+ 71)
#define ActReqDatAdmDocIns (ActChgInsSta+ 72)
#define ActChgDatAdmDocIns (ActChgInsSta+ 73)
#define ActDowAdmDocIns (ActChgInsSta+ 74)
#define ActChgToSeeDocIns (ActChgInsSta+ 47)
#define ActSeeDocIns (ActChgInsSta+ 48)
#define ActExpSeeDocIns (ActChgInsSta+ 49)
#define ActConSeeDocIns (ActChgInsSta+ 50)
#define ActZIPSeeDocIns (ActChgInsSta+ 51)
#define ActReqDatSeeDocIns (ActChgInsSta+ 52)
#define ActDowSeeDocIns (ActChgInsSta+ 53)
#define ActChgToAdmDocIns (ActChgInsSta+ 54)
#define ActAdmDocIns (ActChgInsSta+ 55)
#define ActReqRemFilDocIns (ActChgInsSta+ 56)
#define ActRemFilDocIns (ActChgInsSta+ 57)
#define ActRemFolDocIns (ActChgInsSta+ 58)
#define ActCopDocIns (ActChgInsSta+ 59)
#define ActPasDocIns (ActChgInsSta+ 60)
#define ActRemTreDocIns (ActChgInsSta+ 61)
#define ActFrmCreDocIns (ActChgInsSta+ 62)
#define ActCreFolDocIns (ActChgInsSta+ 63)
#define ActCreLnkDocIns (ActChgInsSta+ 64)
#define ActRenFolDocIns (ActChgInsSta+ 65)
#define ActRcvFilDocInsDZ (ActChgInsSta+ 66)
#define ActRcvFilDocInsCla (ActChgInsSta+ 67)
#define ActExpAdmDocIns (ActChgInsSta+ 68)
#define ActConAdmDocIns (ActChgInsSta+ 69)
#define ActZIPAdmDocIns (ActChgInsSta+ 70)
#define ActShoDocIns (ActChgInsSta+ 71)
#define ActHidDocIns (ActChgInsSta+ 72)
#define ActReqDatAdmDocIns (ActChgInsSta+ 73)
#define ActChgDatAdmDocIns (ActChgInsSta+ 74)
#define ActDowAdmDocIns (ActChgInsSta+ 75)
#define ActReqRemFilShaIns (ActChgInsSta+ 75)
#define ActRemFilShaIns (ActChgInsSta+ 76)
#define ActRemFolShaIns (ActChgInsSta+ 77)
#define ActCopShaIns (ActChgInsSta+ 78)
#define ActPasShaIns (ActChgInsSta+ 79)
#define ActRemTreShaIns (ActChgInsSta+ 80)
#define ActFrmCreShaIns (ActChgInsSta+ 81)
#define ActCreFolShaIns (ActChgInsSta+ 82)
#define ActCreLnkShaIns (ActChgInsSta+ 83)
#define ActRenFolShaIns (ActChgInsSta+ 84)
#define ActRcvFilShaInsDZ (ActChgInsSta+ 85)
#define ActRcvFilShaInsCla (ActChgInsSta+ 86)
#define ActExpShaIns (ActChgInsSta+ 87)
#define ActConShaIns (ActChgInsSta+ 88)
#define ActZIPShaIns (ActChgInsSta+ 89)
#define ActReqDatShaIns (ActChgInsSta+ 90)
#define ActChgDatShaIns (ActChgInsSta+ 91)
#define ActDowShaIns (ActChgInsSta+ 92)
#define ActReqRemFilShaIns (ActChgInsSta+ 76)
#define ActRemFilShaIns (ActChgInsSta+ 77)
#define ActRemFolShaIns (ActChgInsSta+ 78)
#define ActCopShaIns (ActChgInsSta+ 79)
#define ActPasShaIns (ActChgInsSta+ 80)
#define ActRemTreShaIns (ActChgInsSta+ 81)
#define ActFrmCreShaIns (ActChgInsSta+ 82)
#define ActCreFolShaIns (ActChgInsSta+ 83)
#define ActCreLnkShaIns (ActChgInsSta+ 84)
#define ActRenFolShaIns (ActChgInsSta+ 85)
#define ActRcvFilShaInsDZ (ActChgInsSta+ 86)
#define ActRcvFilShaInsCla (ActChgInsSta+ 87)
#define ActExpShaIns (ActChgInsSta+ 88)
#define ActConShaIns (ActChgInsSta+ 89)
#define ActZIPShaIns (ActChgInsSta+ 90)
#define ActReqDatShaIns (ActChgInsSta+ 91)
#define ActChgDatShaIns (ActChgInsSta+ 92)
#define ActDowShaIns (ActChgInsSta+ 93)
/*****************************************************************************/
/********************************* Centre tab ********************************/

View File

@ -150,13 +150,18 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.32.3 (2016-10-22)"
#define Log_PLATFORM_VERSION "SWAD 16.33 (2016-10-22)"
#define CSS_FILE "swad16.32.1.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.33: Oct 22, 2016 New form in institution configuration to change WWW. (205208 lines)
2 changes necessary in database:
UPDATE actions SET Txt='Cambiar web de institución' WHERE ActCod='700' AND Language='es';
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1593','es','N','Cambiar web de institución');
Version 16.32.3: Oct 22, 2016 Width of degree web limited using CSS. (205156 lines)
Version 16.32.2: Oct 22, 2016 Width of centre web limited using CSS. (205154 lines)
Version 16.32.1: Oct 22, 2016 Width of institution web limited using CSS. (205152 lines)

View File

@ -81,6 +81,7 @@ static void Ins_RenameInstitution (struct Institution *Ins,Cns_ShortOrFullName_t
static bool Ins_CheckIfInsNameExistsInCty (const char *FieldName,const char *Name,long InsCod,long CtyCod);
static void Ins_UpdateInsNameDB (long InsCod,const char *FieldName,const char *NewInsName);
static void Ins_UpdateInsCtyDB (long InsCod,long CtyCod);
static void Ins_UpdateInsWWWDB (long InsCod,const char NewWWW[Cns_MAX_LENGTH_WWW+1]);
static void Ins_PutButtonToGoToIns (struct Institution *Ins);
static void Ins_PutFormToCreateInstitution (void);
@ -403,15 +404,27 @@ static void Ins_Configuration (bool PrintView)
"</tr>");
/***** Institution WWW *****/
if (Gbl.CurrentIns.Ins.WWW[0])
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"%s RIGHT_MIDDLE\">"
"%s:"
"</td>"
"<td class=\"DAT LEFT_MIDDLE\">",
The_ClassForm[Gbl.Prefs.Theme],
Txt_Web);
if (!PrintView &&
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) // Only system admins can change institution WWW
{
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"%s RIGHT_MIDDLE\">"
"%s:"
"</td>"
"<td class=\"DAT LEFT_MIDDLE\">",
The_ClassForm[Gbl.Prefs.Theme],
Txt_Web);
Act_FormStart (ActChgInsWWWCfg);
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"WWW\""
" maxlength=\"%u\" value=\"%s\""
" class=\"INPUT_WWW\""
" onchange=\"document.getElementById('%s').submit();\" />",
Cns_MAX_LENGTH_WWW,
Gbl.CurrentIns.Ins.WWW,
Gbl.Form.Id);
Act_FormEnd ();
}
else // I can not change institution WWW
fprintf (Gbl.F.Out,"<div class=\"EXTERNAL_WWW\">"
"<a href=\"%s\" target=\"_blank\" class=\"DAT\">"
"%s"
@ -419,9 +432,8 @@ static void Ins_Configuration (bool PrintView)
"</div>",
Gbl.CurrentIns.Ins.WWW,
Gbl.CurrentIns.Ins.WWW);
fprintf (Gbl.F.Out,"</td>"
"</tr>");
}
fprintf (Gbl.F.Out,"</td>"
"</tr>");
/***** Shortcut to the institution *****/
fprintf (Gbl.F.Out,"<tr>"
@ -1328,7 +1340,8 @@ static void Ins_ListInstitutionsForEdition (void)
" maxlength=\"%u\" value=\"%s\""
" class=\"INPUT_WWW\""
" onchange=\"document.getElementById('%s').submit();\" />",
Cns_MAX_LENGTH_WWW,Ins->WWW,
Cns_MAX_LENGTH_WWW,
Ins->WWW,
Gbl.Form.Id);
Act_FormEnd ();
fprintf (Gbl.F.Out,"</td>");
@ -1781,7 +1794,6 @@ void Ins_ChangeInsWWW (void)
extern const char *Txt_The_new_web_address_is_X;
extern const char *Txt_You_can_not_leave_the_web_address_empty;
struct Institution *Ins;
char Query[256+Cns_MAX_LENGTH_WWW];
char NewWWW[Cns_MAX_LENGTH_WWW+1];
Ins = &Gbl.Inss.EditingIns;
@ -1800,14 +1812,12 @@ void Ins_ChangeInsWWW (void)
/***** Check if new WWW is empty *****/
if (NewWWW[0])
{
/* Update the table changing old WWW by new WWW */
sprintf (Query,"UPDATE institutions SET WWW='%s' WHERE InsCod='%ld'",
NewWWW,Ins->InsCod);
DB_QueryUPDATE (Query,"can not update the web of an institution");
/***** Update database changing old WWW by new WWW *****/
Ins_UpdateInsWWWDB (Ins->InsCod,NewWWW);
strcpy (Ins->WWW,NewWWW);
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_web_address_is_X,
NewWWW);
sprintf (Gbl.Message,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
/***** Put button to go to institution changed *****/
@ -1817,10 +1827,51 @@ void Ins_ChangeInsWWW (void)
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_web_address_empty);
/***** Show the form again *****/
strcpy (Ins->WWW,NewWWW);
Ins_EditInstitutions ();
}
void Ins_ChangeInsWWWInConfig (void)
{
extern const char *Txt_The_new_web_address_is_X;
extern const char *Txt_You_can_not_leave_the_web_address_empty;
char NewWWW[Cns_MAX_LENGTH_WWW+1];
/***** Get parameters from form *****/
/* Get the new WWW for the institution */
Par_GetParToText ("WWW",NewWWW,Cns_MAX_LENGTH_WWW);
/***** Check if new WWW is empty *****/
if (NewWWW[0])
{
/***** Update database changing old WWW by new WWW *****/
Ins_UpdateInsWWWDB (Gbl.CurrentIns.Ins.InsCod,NewWWW);
strcpy (Gbl.CurrentIns.Ins.WWW,NewWWW);
/***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_new_web_address_is_X,NewWWW);
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_You_can_not_leave_the_web_address_empty);
/***** Show the form again *****/
Ins_ShowConfiguration ();
}
/*****************************************************************************/
/**************** Update database changing old WWW by new WWW ****************/
/*****************************************************************************/
static void Ins_UpdateInsWWWDB (long InsCod,const char NewWWW[Cns_MAX_LENGTH_WWW+1])
{
char Query[256+Cns_MAX_LENGTH_WWW];
/***** Update database changing old WWW by new WWW *****/
sprintf (Query,"UPDATE institutions SET WWW='%s' WHERE InsCod='%ld'",
NewWWW,InsCod);
DB_QueryUPDATE (Query,"can not update the web of an institution");
}
/*****************************************************************************/
/******************** Change the status of an institution ********************/
/*****************************************************************************/

View File

@ -117,6 +117,7 @@ void Ins_RenameInsFullInConfig (void);
void Ins_ChangeInsCtyInConfig (void);
void Ins_ContEditAfterChgInsInConfig (void);
void Ins_ChangeInsWWW (void);
void Ins_ChangeInsWWWInConfig (void);
void Ins_ChangeInsStatus (void);
void Ins_ContEditAfterChgIns (void);