Version 15.180.4

This commit is contained in:
Antonio Cañas Vargas 2016-04-05 14:04:23 +02:00
parent b87dcf03e9
commit 72334113b7
5 changed files with 89 additions and 33 deletions

View File

@ -126,19 +126,20 @@
// TODO: Do not show e-mails of administrators and teachers in lists openly // TODO: Do not show e-mails of administrators and teachers in lists openly
// TODO: Fix bug in marks reported by Francisco Ocaña // TODO: Fix bug in marks reported by Francisco Ocaña
// TODO: In Statistics > Degrees, show only degrees with students // TODO: In Statistics > Degrees, show only degrees with students
// TODO: Change layout of confirm / reject registration. Use green and red buttons
/*****************************************************************************/ /*****************************************************************************/
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.180.2 (2016-04-05)" #define Log_PLATFORM_VERSION "SWAD 15.180.4 (2016-04-05)"
#define CSS_FILE "swad15.178.2.css" #define CSS_FILE "swad15.178.2.css"
#define JS_FILE "swad15.178.2.js" #define JS_FILE "swad15.178.2.js"
// Number of lines (includes comments but not blank lines) has been got with the following command: // 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 // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/* /*
Version 15.180.4: Apr 05, 2016 Fixed bug in images in test questions. (198512 lines)
Version 15.180.3: Apr 05, 2016 Changed layout of confirm / reject registration. (198482 lines)
Version 15.180.2: Apr 05, 2016 Contextual link to remove one survey question. (198459 lines) Version 15.180.2: Apr 05, 2016 Contextual link to remove one survey question. (198459 lines)
Version 15.180.1: Apr 05, 2016 Fized minor layout bug in edition of a test question. (198430 lines) Version 15.180.1: Apr 05, 2016 Fized minor layout bug in edition of a test question. (198430 lines)
Version 15.180: Apr 05, 2016 Changes in form to edit a test question. Version 15.180: Apr 05, 2016 Changes in form to edit a test question.

View File

@ -508,9 +508,10 @@
#define Cfg_TIME_TO_DELETE_PARAMS_TO_COMMANDS ((time_t)( 15UL*60UL)) // Temporary files with params to commands are deleted after these seconds #define Cfg_TIME_TO_DELETE_PARAMS_TO_COMMANDS ((time_t)( 15UL*60UL)) // Temporary files with params to commands are deleted after these seconds
#define Cfg_TIME_TO_DELETE_PHOTOS_TMP_FILES ((time_t)( 1UL*60UL*60UL)) // Temporary files related to photos after these seconds #define Cfg_TIME_TO_DELETE_IMAGES_TMP_FILES ((time_t)( 2UL*60UL*60UL)) // Temporary files related to images after these seconds
#define Cfg_TIME_TO_DELETE_PHOTOS_TMP_FILES ((time_t)( 2UL*60UL*60UL)) // Temporary files related to photos after these seconds
#define Cfg_TIME_TO_DELETE_TEST_TMP_FILES ((time_t)( 1UL*60UL*60UL)) // Temporary files related to imported test questions after these seconds #define Cfg_TIME_TO_DELETE_TEST_TMP_FILES ((time_t)( 2UL*60UL*60UL)) // Temporary files related to imported test questions after these seconds
#define Cfg_TIME_TO_DELETE_ENROLLMENT_REQUESTS ((time_t)( 30UL*24UL*60UL*60UL)) // Past these seconds, remove expired enrollment requests #define Cfg_TIME_TO_DELETE_ENROLLMENT_REQUESTS ((time_t)( 30UL*24UL*60UL*60UL)) // Past these seconds, remove expired enrollment requests

View File

@ -342,36 +342,39 @@ void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction)
void Enr_ReqAcceptRegisterInCrs (void) void Enr_ReqAcceptRegisterInCrs (void)
{ {
extern const char *Txt_Enrollment;
extern const char *Txt_A_teacher_or_administrator_has_enrolled_you_into_the_course_; extern const char *Txt_A_teacher_or_administrator_has_enrolled_you_into_the_course_;
extern const char *Txt_Confirm_my_enrollment; extern const char *Txt_Confirm_my_enrollment;
extern const char *Txt_Remove_me_from_this_course; extern const char *Txt_Remove_me_from_this_course;
/***** Start frame *****/
Lay_StartRoundFrame (NULL,Txt_Enrollment,NULL);
/***** Show message *****/ /***** Show message *****/
sprintf (Gbl.Message,Txt_A_teacher_or_administrator_has_enrolled_you_into_the_course_, sprintf (Gbl.Message,Txt_A_teacher_or_administrator_has_enrolled_you_into_the_course_,
Gbl.CurrentCrs.Crs.FullName); Gbl.CurrentCrs.Crs.FullName);
Lay_ShowAlert (Lay_INFO,Gbl.Message); Lay_ShowAlert (Lay_INFO,Gbl.Message);
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
/***** Send button to accept register in the current course *****/ /***** Send button to accept register in the current course *****/
Lay_PutContextualLink (Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActAccEnrStd : Act_FormStart (Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActAccEnrStd :
ActAccEnrTch, ActAccEnrTch);
NULL,"ok_green16x16.gif", Lay_PutCreateButtonInline (Txt_Confirm_my_enrollment);
Txt_Confirm_my_enrollment,Txt_Confirm_my_enrollment); Act_FormEnd ();
/***** Send button to refuse register in the current course *****/ /***** Send button to refuse register in the current course *****/
Lay_PutContextualLink (Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActRemMe_Std : Act_FormStart (Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActRemMe_Std :
ActRemMe_Tch, ActRemMe_Tch);
NULL,"remove-on64x64.png", Lay_PutRemoveButtonInline (Txt_Remove_me_from_this_course);
Txt_Remove_me_from_this_course,Txt_Remove_me_from_this_course); Act_FormEnd ();
fprintf (Gbl.F.Out,"</div>"); /***** End frame *****/
Lay_EndRoundFrame ();
/***** Mark possible notification as seen *****/ /***** Mark possible notification as seen *****/
Ntf_MarkNotifAsSeen (Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? Ntf_EVENT_ENROLLMENT_STUDENT : Ntf_MarkNotifAsSeen (Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? Ntf_EVENT_ENROLLMENT_STUDENT :
Ntf_EVENT_ENROLLMENT_TEACHER, Ntf_EVENT_ENROLLMENT_TEACHER,
-1L,Gbl.CurrentCrs.Crs.CrsCod, -1L,Gbl.CurrentCrs.Crs.CrsCod,
Gbl.Usrs.Me.UsrDat.UsrCod); Gbl.Usrs.Me.UsrDat.UsrCod);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -191,6 +191,9 @@ void Img_GetAndProcessImageFileFromForm (struct Image *Image,
Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_IMG,Cfg_FOLDER_IMG_TMP); Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_IMG,Cfg_FOLDER_IMG_TMP);
Fil_CreateDirIfNotExists (PathImgPriv); Fil_CreateDirIfNotExists (PathImgPriv);
/***** Remove old temporary private files *****/
Fil_RemoveOldTmpFiles (PathImgPriv,Cfg_TIME_TO_DELETE_IMAGES_TMP_FILES,false);
/***** End the reception of original not processed image /***** End the reception of original not processed image
(it can be very big) into a temporary file *****/ (it can be very big) into a temporary file *****/
Image->Status = Img_FILE_NONE; Image->Status = Img_FILE_NONE;
@ -286,6 +289,7 @@ void Img_MoveImageToDefinitiveDirectory (struct Image *Image)
void Img_ShowImage (struct Image *Image,const char *ClassImg) void Img_ShowImage (struct Image *Image,const char *ClassImg)
{ {
extern const char *Txt_Image_not_found;
char FileNameImgPriv[PATH_MAX+1]; char FileNameImgPriv[PATH_MAX+1];
char FullPathImgPriv[PATH_MAX+1]; char FullPathImgPriv[PATH_MAX+1];
char URL[PATH_MAX+1]; char URL[PATH_MAX+1];
@ -298,8 +302,7 @@ void Img_ShowImage (struct Image *Image,const char *ClassImg)
if (Image->Status != Img_NAME_STORED_IN_DB) if (Image->Status != Img_NAME_STORED_IN_DB)
return; return;
/***** Create a temporary public directory /***** Create a temporary public directory used to show the image *****/
used to download the zip file *****/
Brw_CreateDirDownloadTmp (); Brw_CreateDirDownloadTmp ();
/***** Build private path to image *****/ /***** Build private path to image *****/
@ -310,21 +313,27 @@ void Img_ShowImage (struct Image *Image,const char *ClassImg)
Image->Name[1], Image->Name[1],
FileNameImgPriv); FileNameImgPriv);
/***** Create symbolic link from temporary public directory to private file /***** Check if private image file exists *****/
in order to gain access to it for showing/downloading *****/ if (Fil_CheckIfPathExists (FullPathImgPriv))
Brw_CreateTmpPublicLinkToPrivateFile (FullPathImgPriv,FileNameImgPriv); {
/***** Create symbolic link from temporary public directory to private file
in order to gain access to it for showing/downloading *****/
Brw_CreateTmpPublicLinkToPrivateFile (FullPathImgPriv,FileNameImgPriv);
/***** Create URL pointing to symbolic link *****/ /***** Create URL pointing to symbolic link *****/
sprintf (URL,"%s/%s/%s/%s", sprintf (URL,"%s/%s/%s/%s",
Cfg_HTTPS_URL_SWAD_PUBLIC,Cfg_FOLDER_FILE_BROWSER_TMP, Cfg_HTTPS_URL_SWAD_PUBLIC,Cfg_FOLDER_FILE_BROWSER_TMP,
Gbl.FileBrowser.TmpPubDir, Gbl.FileBrowser.TmpPubDir,
FileNameImgPriv); FileNameImgPriv);
/***** Show image *****/ /***** Show image *****/
fprintf (Gbl.F.Out,"<div>" fprintf (Gbl.F.Out,"<div>"
"<img src=\"%s\" alt=\"\" class=\"%s\"/>" "<img src=\"%s\" alt=\"\" class=\"%s\"/>"
"</div>", "</div>",
URL,ClassImg); URL,ClassImg);
}
else
Lay_ShowAlert (Lay_WARNING,Txt_Image_not_found);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -10229,6 +10229,27 @@ const char *Txt_Enroll_in_groups =
"Inscreva-me em grupos "; "Inscreva-me em grupos ";
#endif #endif
const char *Txt_Enrollment =
#if L==1
"Inscripci&oacute;";
#elif L==2
"Einschreibung";
#elif L==3
"Enrollment";
#elif L==4
"Inscripci&oacute;n";
#elif L==5
"Inscription";
#elif L==6
"Inscripci&oacute;n"; // Okoteve traducción
#elif L==7
"Registrazione";
#elif L==8
"Rejestracja";
#elif L==9
"Inscri&ccedil;&atilde;o";
#endif
const char *Txt_Enrollment_confirmed = const char *Txt_Enrollment_confirmed =
#if L==1 #if L==1
"Inscripci&oacute;n confirmada"; // Necessita traduccio "Inscripci&oacute;n confirmada"; // Necessita traduccio
@ -14306,6 +14327,27 @@ const char *Txt_Image =
"Imagem"; "Imagem";
#endif #endif
const char *Txt_Image_not_found =
#if L==1
"Imatge no trobat";
#elif L==2
"Abbild nicht gefunden";
#elif L==3
"Image not found";
#elif L==4
"Imagen no encontrada";
#elif L==5
"Image non trouv&eacute;e";
#elif L==6
"Ta'&atilde;nga nah&aacute;niri juhupapyre";
#elif L==7
"Immagine non trovata";
#elif L==8
"Obraz nie znaleziono";
#elif L==9
"Imagem n&atilde;o encontrada";
#endif
const char *Txt_Import_questions = const char *Txt_Import_questions =
#if L==1 #if L==1
"Importar preguntas"; // Necessita traduccio "Importar preguntas"; // Necessita traduccio