mirror of https://github.com/acanas/swad-core.git
Version18.114.
This commit is contained in:
parent
359fccacc0
commit
1b4e4f6a9c
|
@ -455,11 +455,12 @@ En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 18.114.1 (2019-04-18)"
|
#define Log_PLATFORM_VERSION "SWAD 18.114.2 (2019-04-18)"
|
||||||
#define CSS_FILE "swad18.112.1.css"
|
#define CSS_FILE "swad18.112.1.css"
|
||||||
#define JS_FILE "swad18.114.js"
|
#define JS_FILE "swad18.114.js"
|
||||||
/*
|
/*
|
||||||
Version 18.114.1: Apr 18, 2019 Changes in translation of title related to project locking/unlocking. (? lines)
|
Version 18.114.2: Apr 18, 2019 Icons to inform about locked/unlocked project edition. (243023 lines)
|
||||||
|
Version 18.114.1: Apr 18, 2019 Changes in translation of title related to project locking/unlocking. (243024 lines)
|
||||||
Version 18.114: Apr 17, 2019 Project locking/unlocking is made via AJAX. (243023 lines)
|
Version 18.114: Apr 17, 2019 Project locking/unlocking is made via AJAX. (243023 lines)
|
||||||
Version 18.113: Apr 17, 2019 Individual locking of the edition of each project through a padlock icon. Only the teacher of the subject can lock / unlock each project. Suggested by Pedro Villar Castro. (243000 lines)
|
Version 18.113: Apr 17, 2019 Individual locking of the edition of each project through a padlock icon. Only the teacher of the subject can lock / unlock each project. Suggested by Pedro Villar Castro. (243000 lines)
|
||||||
ALTER TABLE projects ADD COLUMN Locked ENUM('N','Y') NOT NULL DEFAULT 'N' AFTER DptCod;
|
ALTER TABLE projects ADD COLUMN Locked ENUM('N','Y') NOT NULL DEFAULT 'N' AFTER DptCod;
|
||||||
|
|
|
@ -88,19 +88,25 @@ static const char *Prj_Proposal_DB[Prj_NUM_PROPOSAL_TYPES] =
|
||||||
"unmodified", // Prj_PROPOSAL_UNMODIFIED
|
"unmodified", // Prj_PROPOSAL_UNMODIFIED
|
||||||
};
|
};
|
||||||
|
|
||||||
/***** Image for preassigned and non-preassigned projects *****/
|
/***** Preassigned/non-preassigned project *****/
|
||||||
static const char *PreassignedNonpreassigImage[Prj_NUM_PREASSIGNED_NONPREASSIG] =
|
static const char *PreassignedNonpreassigImage[Prj_NUM_PREASSIGNED_NONPREASSIG] =
|
||||||
{
|
{
|
||||||
"user.svg", // Prj_PREASSIGNED
|
"user.svg", // Prj_PREASSIGNED
|
||||||
"user-slash.svg", // Prj_NONPREASSIG
|
"user-slash.svg", // Prj_NONPREASSIG
|
||||||
};
|
};
|
||||||
/*
|
|
||||||
static const char *PreassignedNonpreassigImage[Prj_NUM_PREASSIGNED_NONPREASSIG] =
|
/***** Locked/unlocked project edition *****/
|
||||||
|
static const char *Prj_LockIcons[Prj_NUM_LOCKED_UNLOCKED] =
|
||||||
{
|
{
|
||||||
"lock.svg", // Prj_PREASSIGNED
|
"lock.svg", // Prj_LOCKED
|
||||||
"unlock.svg", // Prj_NONPREASSIG
|
"unlock.svg", // Prj_UNLOCKED
|
||||||
};
|
};
|
||||||
*/
|
static const Act_Action_t Prj_LockActions[Prj_NUM_LOCKED_UNLOCKED] =
|
||||||
|
{
|
||||||
|
ActUnlPrj, // Prj_LOCKED
|
||||||
|
ActLckPrj, // Prj_UNLOCKED
|
||||||
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************************** Private variables *****************************/
|
/***************************** Private variables *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -181,6 +187,7 @@ static void Prj_PutFormsToRemEditOnePrj (const struct Project *Prj,
|
||||||
static bool Prj_CheckIfICanEditProject (long PrjCod);
|
static bool Prj_CheckIfICanEditProject (long PrjCod);
|
||||||
static bool Prj_CheckIfICanLockProject (void);
|
static bool Prj_CheckIfICanLockProject (void);
|
||||||
static void Prj_FormLockUnlock (const struct Project *Prj);
|
static void Prj_FormLockUnlock (const struct Project *Prj);
|
||||||
|
static void Prj_PutIconOffLockedUnlocked (const struct Project *Prj);
|
||||||
|
|
||||||
static void Prj_ResetProject (struct Project *Prj);
|
static void Prj_ResetProject (struct Project *Prj);
|
||||||
|
|
||||||
|
@ -2227,13 +2234,17 @@ static void Prj_PutFormsToRemEditOnePrj (const struct Project *Prj,
|
||||||
/***** Put form to print project *****/
|
/***** Put form to print project *****/
|
||||||
Ico_PutContextualIconToPrint (ActPrnOnePrj,Prj_PutCurrentParams);
|
Ico_PutContextualIconToPrint (ActPrnOnePrj,Prj_PutCurrentParams);
|
||||||
|
|
||||||
/***** Put form to lock project *****/
|
/***** Locked/unlocked project edition *****/
|
||||||
if (Prj_CheckIfICanLockProject ())
|
if (Prj_CheckIfICanLockProject ())
|
||||||
{
|
{
|
||||||
|
/* Put form to lock/unlock project edition */
|
||||||
fprintf (Gbl.F.Out,"<div id=\"prj_lck_%ld\">",Prj->PrjCod);
|
fprintf (Gbl.F.Out,"<div id=\"prj_lck_%ld\">",Prj->PrjCod);
|
||||||
Prj_FormLockUnlock (Prj);
|
Prj_FormLockUnlock (Prj);
|
||||||
fprintf (Gbl.F.Out,"</div>");
|
fprintf (Gbl.F.Out,"</div>");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
/* Put icon toinform about locked/unlocked project edition */
|
||||||
|
Prj_PutIconOffLockedUnlocked (Prj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2290,23 +2301,13 @@ static bool Prj_CheckIfICanLockProject (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********************** Form to lock/unlock a project ***********************/
|
/******************** Form to lock/unlock project edition ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Prj_FormLockUnlock (const struct Project *Prj)
|
static void Prj_FormLockUnlock (const struct Project *Prj)
|
||||||
{
|
{
|
||||||
extern const char *Txt_LOCKED_UNLOCKED[Prj_NUM_LOCKED_UNLOCKED];
|
extern const char *Txt_LOCKED_UNLOCKED[Prj_NUM_LOCKED_UNLOCKED];
|
||||||
char *OnSubmit;
|
char *OnSubmit;
|
||||||
static const Act_Action_t Prj_LockActions[Prj_NUM_LOCKED_UNLOCKED] =
|
|
||||||
{
|
|
||||||
ActUnlPrj, // Prj_LOCKED
|
|
||||||
ActLckPrj, // Prj_UNLOCKED
|
|
||||||
};
|
|
||||||
static const char *Prj_LockIcons[Prj_NUM_LOCKED_UNLOCKED] =
|
|
||||||
{
|
|
||||||
"lock.svg", // Prj_LOCKED
|
|
||||||
"unlock.svg", // Prj_UNLOCKED
|
|
||||||
};
|
|
||||||
/*
|
/*
|
||||||
+---------------------+
|
+---------------------+
|
||||||
| div (parent of form)|
|
| div (parent of form)|
|
||||||
|
@ -2319,7 +2320,7 @@ static void Prj_FormLockUnlock (const struct Project *Prj)
|
||||||
+---------------------+
|
+---------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/***** Form and icon to mark note as favourite *****/
|
/***** Form and icon to lock/unlock project edition *****/
|
||||||
/* Form with icon */
|
/* Form with icon */
|
||||||
if (asprintf (&OnSubmit,"updateDivLockUnlockProject(this,"
|
if (asprintf (&OnSubmit,"updateDivLockUnlockProject(this,"
|
||||||
"'act=%ld&ses=%s&PrjCod=%ld');"
|
"'act=%ld&ses=%s&PrjCod=%ld');"
|
||||||
|
@ -2336,6 +2337,18 @@ static void Prj_FormLockUnlock (const struct Project *Prj)
|
||||||
free ((void *) OnSubmit);
|
free ((void *) OnSubmit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/********* Put icon to inform about locked/unlocked project edition **********/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Prj_PutIconOffLockedUnlocked (const struct Project *Prj)
|
||||||
|
{
|
||||||
|
extern const char *Txt_LOCKED_UNLOCKED[Prj_NUM_LOCKED_UNLOCKED];
|
||||||
|
|
||||||
|
/***** Icon to inform about locked/unlocked project edition *****/
|
||||||
|
Ico_PutIconOff (Prj_LockIcons[Prj->Locked],Txt_LOCKED_UNLOCKED[Prj->Locked]);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************** List all the projects ****************************/
|
/************************** List all the projects ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2940,7 +2953,6 @@ void Prj_ShowProject (void)
|
||||||
|
|
||||||
void Prj_LockProjectEdition (void)
|
void Prj_LockProjectEdition (void)
|
||||||
{
|
{
|
||||||
// extern const char *Txt_The_edition_of_project_X_is_now_locked;
|
|
||||||
struct Project Prj;
|
struct Project Prj;
|
||||||
|
|
||||||
/***** Allocate memory for the project *****/
|
/***** Allocate memory for the project *****/
|
||||||
|
@ -2956,16 +2968,14 @@ void Prj_LockProjectEdition (void)
|
||||||
|
|
||||||
if (Prj_CheckIfICanEditProject (Prj.PrjCod))
|
if (Prj_CheckIfICanEditProject (Prj.PrjCod))
|
||||||
{
|
{
|
||||||
/***** Hide project *****/
|
/***** Lock project edition *****/
|
||||||
DB_QueryUPDATE ("can not lock project",
|
DB_QueryUPDATE ("can not lock project edition",
|
||||||
"UPDATE projects SET Locked='Y'"
|
"UPDATE projects SET Locked='Y'"
|
||||||
" WHERE PrjCod=%ld AND CrsCod=%ld",
|
" WHERE PrjCod=%ld AND CrsCod=%ld",
|
||||||
Prj.PrjCod,Gbl.Hierarchy.Crs.CrsCod);
|
Prj.PrjCod,Gbl.Hierarchy.Crs.CrsCod);
|
||||||
Prj.Locked = Prj_LOCKED;
|
Prj.Locked = Prj_LOCKED;
|
||||||
|
|
||||||
/***** Write message to show the change made *****/
|
/***** Show updated form and icon *****/
|
||||||
// Ale_ShowAlert (Ale_SUCCESS,Txt_The_edition_of_project_X_is_now_locked,
|
|
||||||
// Prj.Title);
|
|
||||||
Prj_FormLockUnlock (&Prj);
|
Prj_FormLockUnlock (&Prj);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2976,9 +2986,6 @@ void Prj_LockProjectEdition (void)
|
||||||
|
|
||||||
/***** All the output is made, so don't write anymore *****/
|
/***** All the output is made, so don't write anymore *****/
|
||||||
Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true;
|
Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true;
|
||||||
|
|
||||||
/***** Show projects again *****/
|
|
||||||
// Prj_ShowProjectsInCurrentPage ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2987,7 +2994,6 @@ void Prj_LockProjectEdition (void)
|
||||||
|
|
||||||
void Prj_UnlockProjectEdition (void)
|
void Prj_UnlockProjectEdition (void)
|
||||||
{
|
{
|
||||||
// extern const char *Txt_The_edition_of_project_X_is_now_unlocked;
|
|
||||||
struct Project Prj;
|
struct Project Prj;
|
||||||
|
|
||||||
/***** Allocate memory for the project *****/
|
/***** Allocate memory for the project *****/
|
||||||
|
@ -3003,16 +3009,14 @@ void Prj_UnlockProjectEdition (void)
|
||||||
|
|
||||||
if (Prj_CheckIfICanEditProject (Prj.PrjCod))
|
if (Prj_CheckIfICanEditProject (Prj.PrjCod))
|
||||||
{
|
{
|
||||||
/***** Show project *****/
|
/***** Unlock project edition *****/
|
||||||
DB_QueryUPDATE ("can not unlock project",
|
DB_QueryUPDATE ("can not unlock project edition",
|
||||||
"UPDATE projects SET Locked='N'"
|
"UPDATE projects SET Locked='N'"
|
||||||
" WHERE PrjCod=%ld AND CrsCod=%ld",
|
" WHERE PrjCod=%ld AND CrsCod=%ld",
|
||||||
Prj.PrjCod,Gbl.Hierarchy.Crs.CrsCod);
|
Prj.PrjCod,Gbl.Hierarchy.Crs.CrsCod);
|
||||||
Prj.Locked = Prj_UNLOCKED;
|
Prj.Locked = Prj_UNLOCKED;
|
||||||
|
|
||||||
/***** Write message to show the change made *****/
|
/***** Show updated form and icon *****/
|
||||||
// Ale_ShowAlert (Ale_SUCCESS,Txt_The_edition_of_project_X_is_now_unlocked,
|
|
||||||
// Prj.Title);
|
|
||||||
Prj_FormLockUnlock (&Prj);
|
Prj_FormLockUnlock (&Prj);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3023,9 +3027,6 @@ void Prj_UnlockProjectEdition (void)
|
||||||
|
|
||||||
/***** All the output is made, so don't write anymore *****/
|
/***** All the output is made, so don't write anymore *****/
|
||||||
Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true;
|
Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true;
|
||||||
|
|
||||||
/***** Show projects again *****/
|
|
||||||
// Prj_ShowProjectsInCurrentPage ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
36
swad_text.c
36
swad_text.c
|
@ -17584,43 +17584,43 @@ const char *Txt_Locations =
|
||||||
const char *Txt_LOCKED_UNLOCKED[Prj_NUM_LOCKED_UNLOCKED] =
|
const char *Txt_LOCKED_UNLOCKED[Prj_NUM_LOCKED_UNLOCKED] =
|
||||||
{
|
{
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Edició bloquejada. Premi per desbloquejar-la."
|
"Edició bloquejada"
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
"Gesperrte Ausgabe. Drücke zum Entsperren."
|
"Gesperrte Ausgabe"
|
||||||
#elif L==3 // en
|
#elif L==3 // en
|
||||||
"Locked edition. Press to unlock it."
|
"Locked edition"
|
||||||
#elif L==4 // es
|
#elif L==4 // es
|
||||||
"Edición bloqueada. Pulse para desbloquearla."
|
"Edición bloqueada"
|
||||||
#elif L==5 // fr
|
#elif L==5 // fr
|
||||||
"Edition verrouillée. Appuyez pour la déverrouiller."
|
"Edition verrouillée"
|
||||||
#elif L==6 // gn
|
#elif L==6 // gn
|
||||||
"Edición bloqueada. Pulse para desbloquearla." // Okoteve traducción
|
"Edición bloqueada" // Okoteve traducción
|
||||||
#elif L==7 // it
|
#elif L==7 // it
|
||||||
"Edizione bloccata. Premere per sbloccarela."
|
"Edizione bloccata"
|
||||||
#elif L==8 // pl
|
#elif L==8 // pl
|
||||||
"Zamknięta edycja. Naciśnij, aby go odblokować."
|
"Zamknięta edycja"
|
||||||
#elif L==9 // pt
|
#elif L==9 // pt
|
||||||
"Edição bloqueada. Pressione para desbloquear."
|
"Edição bloqueada"
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Edició permesa. Premi per bloquejar-la."
|
"Edició permesa"
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
"Erlaubte Ausgabe. Drücken Sie, um es zu sperren."
|
"Erlaubte Ausgabe"
|
||||||
#elif L==3 // en
|
#elif L==3 // en
|
||||||
"Allowed edition. Press to lock it."
|
"Allowed edition"
|
||||||
#elif L==4 // es
|
#elif L==4 // es
|
||||||
"Edición permitida. Pulse para bloquearla."
|
"Edición permitida"
|
||||||
#elif L==5 // fr
|
#elif L==5 // fr
|
||||||
"Édition autorisée. Appuyez sur pour la verrouiller."
|
"Édition autorisée"
|
||||||
#elif L==6 // gn
|
#elif L==6 // gn
|
||||||
"Edición permitida. Pulse para bloquearla." // Okoteve traducción
|
"Edición permitida" // Okoteve traducción
|
||||||
#elif L==7 // it
|
#elif L==7 // it
|
||||||
"Edizione consentita. Premere per bloccarla."
|
"Edizione consentita"
|
||||||
#elif L==8 // pl
|
#elif L==8 // pl
|
||||||
"Dozwolone wydanie. Naciśnij, aby go zablokować."
|
"Dozwolone wydanie"
|
||||||
#elif L==9 // pt
|
#elif L==9 // pt
|
||||||
"Edição permitida. Pressione para travar."
|
"Edição permitida"
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue