diff --git a/swad_changelog.h b/swad_changelog.h index a67b71c1f..faaa7ec14 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -127,22 +127,23 @@ // TODO: Put Raśl Hinojosa (iSWAD developer) in a row of marks file of EC (B,C) and publish file // TODO: In search of users and findUsers banned users should not appear in listing!!!!! -// TODO: Send attached photos via SOAP? -// TODO: In list of users, institution should be the institution photo with internal link to institution +// TODO: Send attached photos via SOAP? // TODO: Upload photos/files from SWADroid using MIME attachments /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.246.2 (2016-07-26)" +#define Log_PLATFORM_VERSION "SWAD 15.247.1 (2016-07-27)" #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 15.247.1: Jul 27, 2016 In listings of users ready for printing, show institution name instead of logo. (204102 lines) + Version 15.247: Jul 26, 2016 In listings of users, show institution logo with link to institution. (204093 lines) Version 15.246.2: Jul 26, 2016 List of users in web service use the list filled instead of querying database a second time to get all user's data. Code refactoring in copying of user's data in web service. (204089 lines) Version 15.246.1: Jul 26, 2016 Attendance of users and e-mail to users use the list filled instead of querying database a second time to get all user's data. (204093 lines) diff --git a/swad_institution.c b/swad_institution.c index efb776222..fa3c39dd3 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -186,6 +186,27 @@ void Ins_SeeInsWithPendingCtrs (void) DB_FreeMySQLResult (&mysql_res); } +/*****************************************************************************/ +/********************** Draw institution logo with link **********************/ +/*****************************************************************************/ + +void Ins_DrawInstitutionLogoWithLink (struct Institution *Ins,unsigned Size,bool PutLink) + { + if (PutLink) + { + Act_FormStart (ActSeeInsInf); + Ins_PutParamInsCod (Ins->InsCod); + Act_LinkFormSubmit (Ins->FullName,NULL,NULL); + } + Log_DrawLogo (Sco_SCOPE_INS,Ins->InsCod,Ins->FullName, + Size,NULL,true); + if (PutLink) + { + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + } + } + /*****************************************************************************/ /****************** Draw institution logo and name with link *****************/ /*****************************************************************************/ diff --git a/swad_institution.h b/swad_institution.h index 242900ec3..39e171a6f 100644 --- a/swad_institution.h +++ b/swad_institution.h @@ -92,6 +92,7 @@ typedef enum void Ins_SeeInsWithPendingCtrs (void); +void Ins_DrawInstitutionLogoWithLink (struct Institution *Ins,unsigned Size,bool PutLink); void Ins_DrawInstitutionLogoAndNameWithLink (struct Institution *Ins,Act_Action_t Action, const char *ClassLink,const char *ClassLogo); diff --git a/swad_logo.c b/swad_logo.c index 6434db929..0392824b2 100644 --- a/swad_logo.c +++ b/swad_logo.c @@ -139,30 +139,30 @@ void Log_DrawLogo (Sco_Scope_t Scope,long Cod,const char *AltText, if (LogoFound) Cod = InsCod; } - } - if (LogoFound || PutIconIfNotExists) - { - /***** Draw logo *****/ - fprintf (Gbl.F.Out,"\"%s\""); + if (LogoFound || PutIconIfNotExists) + { + /***** Draw logo *****/ + fprintf (Gbl.F.Out,"\"%s\""); + } } } } diff --git a/swad_statistic.c b/swad_statistic.c index 66f6c31ad..e05dfeaba 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -4980,19 +4980,9 @@ static void Sta_GetAndShowInss (const char *Query,const char *TxtFigure) /***** Write link to institution *****/ fprintf (Gbl.F.Out,"", The_ClassForm[Gbl.Prefs.Theme]); - - /* Icon and name of this institution */ - Act_FormStart (ActSeeInsInf); - Ins_PutParamInsCod (Ins.InsCod); - Act_LinkFormSubmit (Ins.FullName,The_ClassForm[Gbl.Prefs.Theme],NULL); - Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.FullName, - 40,NULL,true); - fprintf (Gbl.F.Out,"
%u" - "", + Ins_DrawInstitutionLogoWithLink (&Ins,40,true); + fprintf (Gbl.F.Out,"
%u", NumberThisRow); - Act_FormEnd (); - - fprintf (Gbl.F.Out,""); /***** End of user's cell *****/ fprintf (Gbl.F.Out,""); diff --git a/swad_user.c b/swad_user.c index 236476149..d77bdf830 100644 --- a/swad_user.c +++ b/swad_user.c @@ -134,9 +134,7 @@ static void Usr_WriteRowTchAllData (struct UsrData *UsrDat); static void Usr_WriteRowAdmData (unsigned NumUsr,struct UsrData *UsrDat); static void Usr_RestrictLengthUsrName (struct UsrData *UsrDat); static void Usr_WriteMainUsrDataExceptUsrID (struct UsrData *UsrDat, - const char *BgColor, - const char *InstitutionName, - const char *InstitutionLink); + const char *BgColor); static void Usr_WriteEmail (struct UsrData *UsrDat,const char *BgColor); static void Usr_WriteUsrData (const char *BgColor, const char *Data,const char *Link, @@ -2842,9 +2840,10 @@ void Usr_WriteRowUsrMainData (unsigned NumUsr,struct UsrData *UsrDat, Ins.InsCod = UsrDat->InsCod; Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA); Usr_RestrictLengthUsrName (UsrDat); - Usr_WriteMainUsrDataExceptUsrID (UsrDat,BgColor, - Ins.ShortName,Ins.WWW[0] ? Ins.WWW : - NULL); + Usr_WriteMainUsrDataExceptUsrID (UsrDat,BgColor); + fprintf (Gbl.F.Out,"",BgColor); + Ins_DrawInstitutionLogoWithLink (&Ins,25,true); + fprintf (Gbl.F.Out,""); /***** End row *****/ fprintf (Gbl.F.Out,""); @@ -2886,9 +2885,11 @@ static void Usr_WriteRowGstAllData (struct UsrData *UsrDat) /***** Write rest of guest's main data *****/ Ins.InsCod = UsrDat->InsCod; Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA); - Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd], - Ins.ShortName,NULL); + Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd]); Usr_WriteEmail (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd]); + Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd], + Ins.FullName, + NULL,true,false); /***** Write the rest of the data of the guest *****/ if (UsrDat->Tch.CtrCod > 0) @@ -2988,9 +2989,11 @@ static void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames) /***** Write rest of main student's data *****/ Ins.InsCod = UsrDat->InsCod; Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA); - Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd], - Ins.ShortName,NULL); + Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd]); Usr_WriteEmail (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd]); + Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd], + Ins.FullName, + NULL,true,UsrDat->Accepted); /***** Write the rest of the data of the student *****/ Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd], @@ -3103,9 +3106,11 @@ static void Usr_WriteRowTchAllData (struct UsrData *UsrDat) /***** Write rest of main teacher's data *****/ Ins.InsCod = UsrDat->InsCod; Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA); - Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd], - Ins.ShortName,NULL); + Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd]); Usr_WriteEmail (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd]); + Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd], + Ins.FullName, + NULL,true,UsrDat->Accepted); /***** Write the rest of teacher's data *****/ if (ShowData && UsrDat->Tch.CtrCod > 0) @@ -3181,10 +3186,11 @@ static void Usr_WriteRowAdmData (unsigned NumUsr,struct UsrData *UsrDat) Ins.InsCod = UsrDat->InsCod; Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA); Usr_RestrictLengthUsrName (UsrDat); - Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd], - Ins.ShortName,Ins.WWW[0] ? Ins.WWW : - NULL); - fprintf (Gbl.F.Out,""); + Usr_WriteMainUsrDataExceptUsrID (UsrDat,Gbl.ColorRows[Gbl.RowEvenOdd]); + fprintf (Gbl.F.Out,"",Gbl.ColorRows[Gbl.RowEvenOdd]); + Ins_DrawInstitutionLogoWithLink (&Ins,25,true); + fprintf (Gbl.F.Out,"" + ""); /***** Write degrees which are administrated by this administrator *****/ Deg_GetAndWriteInsCtrDegAdminBy (UsrDat->UsrCod, @@ -3208,9 +3214,7 @@ static void Usr_RestrictLengthUsrName (struct UsrData *UsrDat) /*****************************************************************************/ static void Usr_WriteMainUsrDataExceptUsrID (struct UsrData *UsrDat, - const char *BgColor, - const char *InstitutionName, - const char *InstitutionLink) + const char *BgColor) { Usr_WriteUsrData (BgColor, UsrDat->Surname1[0] ? UsrDat->Surname1 : @@ -3224,10 +3228,6 @@ static void Usr_WriteMainUsrDataExceptUsrID (struct UsrData *UsrDat, UsrDat->FirstName[0] ? UsrDat->FirstName : " ", NULL,true,UsrDat->Accepted); - Usr_WriteUsrData (BgColor, - UsrDat->InsCod > 0 ? InstitutionName : - " ", - InstitutionLink,true,UsrDat->Accepted); } /*****************************************************************************/ @@ -3270,7 +3270,10 @@ static void Usr_WriteUsrData (const char *BgColor, "DAT_SMALL"), BgColor); if (Link != NULL) - fprintf (Gbl.F.Out,"",Link); + fprintf (Gbl.F.Out,"", + Link, + Accepted ? "DAT_SMALL_NOBR_N" : + "DAT_SMALL_NOBR"); fprintf (Gbl.F.Out,"%s",Data); if (NonBreak) fprintf (Gbl.F.Out," "); @@ -5426,6 +5429,7 @@ static void Usr_ListMainDataGsts (bool PutCheckBoxToSelectUsr) /* Get list of user's IDs */ ID_GetListIDsFromUsrCod (&UsrDat); + /* Show row for this guest */ Usr_WriteRowUsrMainData (NumUsr + 1,&UsrDat,true); } @@ -5488,6 +5492,7 @@ static void Usr_ListMainDataStds (bool PutCheckBoxToSelectUsr) /* Get list of user's IDs */ ID_GetListIDsFromUsrCod (&UsrDat); + /* Show row for this student */ Usr_WriteRowUsrMainData (NumUsr + 1,&UsrDat,PutCheckBoxToSelectUsr); } @@ -5561,6 +5566,7 @@ static void Usr_ListMainDataTchs (bool PutCheckBoxToSelectUsr) /* Get list of user's IDs */ ID_GetListIDsFromUsrCod (&UsrDat); + /* Show row for this teacher */ Usr_WriteRowUsrMainData (NumUsr + 1,&UsrDat,PutCheckBoxToSelectUsr); } @@ -5607,8 +5613,8 @@ void Usr_ListAllDataGsts (void) FieldNames[ 2] = Txt_Surname_1; FieldNames[ 3] = Txt_Surname_2; FieldNames[ 4] = Txt_First_name; - FieldNames[ 5] = Txt_Institution; - FieldNames[ 6] = Txt_Email; + FieldNames[ 5] = Txt_Email; + FieldNames[ 6] = Txt_Institution; FieldNames[ 7] = Txt_Centre; FieldNames[ 8] = Txt_Department; FieldNames[ 9] = Txt_Office; @@ -5724,8 +5730,8 @@ void Usr_ListAllDataStds (void) FieldNames[ 2] = Txt_Surname_1; FieldNames[ 3] = Txt_Surname_2; FieldNames[ 4] = Txt_First_name; - FieldNames[ 5] = Txt_Institution; - FieldNames[ 6] = Txt_Email; + FieldNames[ 5] = Txt_Email; + FieldNames[ 6] = Txt_Institution; FieldNames[ 7] = Txt_Local_address; FieldNames[ 8] = Txt_Phone; FieldNames[ 9] = Txt_Family_address; @@ -5954,8 +5960,8 @@ void Usr_ListAllDataTchs (void) FieldNames[ 2] = Txt_Surname_1; FieldNames[ 3] = Txt_Surname_2; FieldNames[ 4] = Txt_First_name; - FieldNames[ 5] = Txt_Institution; - FieldNames[ 6] = Txt_Email; + FieldNames[ 5] = Txt_Email; + FieldNames[ 6] = Txt_Institution; FieldNames[ 7] = Txt_Centre; FieldNames[ 8] = Txt_Department; FieldNames[ 9] = Txt_Office; @@ -7323,9 +7329,7 @@ static void Usr_DrawClassPhoto (Usr_ClassPhotoType_t ClassPhotoType, bool TRIsOpen = false; bool PutCheckBoxToSelectUsr = (ClassPhotoType == Usr_CLASS_PHOTO_SEL || ClassPhotoType == Usr_CLASS_PHOTO_SEL_SEE); - bool ItsMe; bool ShowPhoto; - bool ShowData; bool UsrIsTheMsgSender; const char *ClassPhoto = "PHOTO21x28"; // Default photo size int LengthUsrData = 10; // Maximum number of characters of user data @@ -7369,11 +7373,6 @@ static void Usr_DrawClassPhoto (Usr_ClassPhotoType_t ClassPhotoType, /* Get list of user's IDs */ ID_GetListIDsFromUsrCod (&UsrDat); - ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat.UsrCod); - ShowData = (ItsMe || UsrDat.Accepted || - Gbl.Usrs.Me.LoggedRole == Rol_DEG_ADM || - Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM); - /***** Begin user's cell *****/ fprintf (Gbl.F.Out,"