diff --git a/swad_changelog.h b/swad_changelog.h
index 248da9750..db96f9fd6 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -137,13 +137,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 15.201 (2016-04-21)"
+#define Log_PLATFORM_VERSION "SWAD 15.201.1 (2016-04-22)"
#define CSS_FILE "swad15.198.css"
#define JS_FILE "swad15.197.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.201.1: Apr 22, 2016 Code refactoring in record card. (200778 lines)
Version 15.201: Apr 21, 2016 New private file zone for the teachers who belong to a course. (200768 lines)
50 changes necessary in database:
CREATE TABLE notif_backup LIKE notif;
diff --git a/swad_record.c b/swad_record.c
index 8814c8258..29e738957 100644
--- a/swad_record.c
+++ b/swad_record.c
@@ -60,7 +60,7 @@ extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
#define Rec_INSTITUTION_LOGO_SIZE 64
#define Rec_DEGREE_LOGO_SIZE 64
-#define Rec_USR_MIN_AGE 16 // years old
+#define Rec_USR_MIN_AGE 12 // years old
#define Rec_USR_MAX_AGE 120 // years old
#define Rec_SHOW_OFFICE_HOURS_DEFAULT true
@@ -83,6 +83,9 @@ static bool Rec_GetParamShowOfficeHours (void);
static void Rec_ShowCrsRecord (Rec_RecordViewType_t TypeOfView,struct UsrData *UsrDat,
const char *Anchor);
static void Rec_ShowMyCrsRecordUpdated (void);
+
+static void Rec_ShowInstitution (struct Institution *Ins,bool PutFormLinks);
+
static void Rec_WriteLinkToDataProtectionClause (void);
static void Rec_GetUsrExtraDataFromRecordForm (struct UsrData *UsrDat);
@@ -2083,51 +2086,11 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
Lay_StartRoundFrameTable (StrRecordWidth,2,NULL);
/***** Institution *****/
- fprintf (Gbl.F.Out,"
"
- "",
- Rec_C1_TOP,Rec_C1_TOP);
- if (UsrDat->InsCod > 0)
- {
- Ins.InsCod = UsrDat->InsCod;
+ fprintf (Gbl.F.Out," |
");
+ Ins.InsCod = UsrDat->InsCod;
+ if (Ins.InsCod > 0)
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA);
-
- /* Form to go to the institution */
- if (PutFormLinks)
- {
- Act_FormGoToStart (ActSeeInsInf);
- Ins_PutParamInsCod (Ins.InsCod);
- Act_LinkFormSubmit (Ins.FullName,NULL);
- }
- Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.ShortName,
- Rec_INSTITUTION_LOGO_SIZE,NULL,true);
- if (PutFormLinks)
- {
- fprintf (Gbl.F.Out,"");
- Act_FormEnd ();
- }
- }
- fprintf (Gbl.F.Out,""
- "",
- Rec_C2_TOP,Rec_C1_TOP);
- if (UsrDat->InsCod > 0)
- {
- /* Form to go to the institution */
- if (PutFormLinks)
- {
- Act_FormGoToStart (ActSeeInsInf);
- Ins_PutParamInsCod (Ins.InsCod);
- Act_LinkFormSubmit (Ins.FullName,"REC_HEAD");
- }
- fprintf (Gbl.F.Out,"%s",Ins.FullName);
- if (PutFormLinks)
- {
- fprintf (Gbl.F.Out,"");
- Act_FormEnd ();
- }
- }
- fprintf (Gbl.F.Out," | ");
+ Rec_ShowInstitution (&Ins,PutFormLinks);
/***** Photo *****/
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
@@ -3147,6 +3110,55 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
Lay_EndRoundFrameTable ();
}
+/*****************************************************************************/
+/*********************** Show institution in record card *********************/
+/*****************************************************************************/
+
+static void Rec_ShowInstitution (struct Institution *Ins,bool PutFormLinks)
+ {
+ fprintf (Gbl.F.Out,"",
+ Rec_C1_TOP,Rec_C1_TOP);
+ if (Ins->InsCod > 0)
+ {
+ /* Form to go to the institution */
+ if (PutFormLinks)
+ {
+ Act_FormGoToStart (ActSeeInsInf);
+ Ins_PutParamInsCod (Ins->InsCod);
+ Act_LinkFormSubmit (Ins->FullName,NULL);
+ }
+ Log_DrawLogo (Sco_SCOPE_INS,Ins->InsCod,Ins->ShortName,
+ Rec_INSTITUTION_LOGO_SIZE,NULL,true);
+ if (PutFormLinks)
+ {
+ fprintf (Gbl.F.Out,"");
+ Act_FormEnd ();
+ }
+ }
+ fprintf (Gbl.F.Out," | "
+ "",
+ Rec_C2_TOP,Rec_C1_TOP);
+ if (Ins->InsCod > 0)
+ {
+ /* Form to go to the institution */
+ if (PutFormLinks)
+ {
+ Act_FormGoToStart (ActSeeInsInf);
+ Ins_PutParamInsCod (Ins->InsCod);
+ Act_LinkFormSubmit (Ins->FullName,"REC_HEAD");
+ }
+ fprintf (Gbl.F.Out,"%s",Ins->FullName);
+ if (PutFormLinks)
+ {
+ fprintf (Gbl.F.Out,"");
+ Act_FormEnd ();
+ }
+ }
+ fprintf (Gbl.F.Out," | ");
+ }
+
/*****************************************************************************/
/*********************** Write a link to netiquette rules ********************/
/*****************************************************************************/