mirror of https://github.com/acanas/swad-core.git
Version 17.20.5
This commit is contained in:
parent
0eede22f65
commit
92d0017db3
|
@ -256,13 +256,14 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 17.20.4 (2017-10-07)"
|
#define Log_PLATFORM_VERSION "SWAD 17.20.5 (2017-10-07)"
|
||||||
#define CSS_FILE "swad17.0.css"
|
#define CSS_FILE "swad17.0.css"
|
||||||
#define JS_FILE "swad17.17.1.js"
|
#define JS_FILE "swad17.17.1.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 17.20.5: Oct 07, 2017 Title of project is now a link to show the project and its documents. (233024 lines)
|
||||||
Version 17.20.4: Oct 07, 2017 Changes in layout of project. (232972 lines)
|
Version 17.20.4: Oct 07, 2017 Changes in layout of project. (232972 lines)
|
||||||
Version 17.20.3: Oct 07, 2017 Changes in layout of project.
|
Version 17.20.3: Oct 07, 2017 Changes in layout of project.
|
||||||
Fixed bug when hiding/shown a project. (232971 lines)
|
Fixed bug when hiding/shown a project. (232971 lines)
|
||||||
|
|
|
@ -3368,11 +3368,14 @@ static void Brw_ShowFileBrowserProject (void)
|
||||||
/***** Show the project *****/
|
/***** Show the project *****/
|
||||||
Prj_ShowOneUniqueProject (&Prj);
|
Prj_ShowOneUniqueProject (&Prj);
|
||||||
|
|
||||||
/***** Write top before showing file browser *****/
|
/***** Show project documents *****/
|
||||||
Brw_WriteTopBeforeShowingFileBrowser ();
|
if (Prj_CheckIfICanAdminDocsProject (Prj.PrjCod))
|
||||||
|
{
|
||||||
/***** Show the file browser *****/
|
Brw_WriteTopBeforeShowingFileBrowser ();
|
||||||
Brw_ShowFileBrowser ();
|
Brw_ShowFileBrowser ();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Ale_ShowAlert (Ale_WARNING,"You have no access to project documents.");
|
||||||
|
|
||||||
/***** End box *****/
|
/***** End box *****/
|
||||||
Box_EndBox ();
|
Box_EndBox ();
|
||||||
|
|
|
@ -204,11 +204,11 @@ void Ico_PutContextualIconToEdit (Act_Action_t NextAction,void (*FuncParams) ())
|
||||||
|
|
||||||
void Ico_PutContextualIconToViewFiles (Act_Action_t NextAction,void (*FuncParams) ())
|
void Ico_PutContextualIconToViewFiles (Act_Action_t NextAction,void (*FuncParams) ())
|
||||||
{
|
{
|
||||||
extern const char *Txt_Files;
|
extern const char *Txt_Project_documents;
|
||||||
|
|
||||||
Lay_PutContextualLink (NextAction,NULL,FuncParams,
|
Lay_PutContextualLink (NextAction,NULL,FuncParams,
|
||||||
"folder64x64.gif",
|
"folder64x64.gif",
|
||||||
Txt_Files,NULL,
|
Txt_Project_documents,NULL,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,9 +133,11 @@ static void Prj_RemUsrFromPrj (Prj_RoleInProject_t RoleInProject);
|
||||||
|
|
||||||
static void Prj_GetParamPrjOrder (void);
|
static void Prj_GetParamPrjOrder (void);
|
||||||
|
|
||||||
static void Prj_PutFormsToRemEditOnePrj (long PrjCod,bool Hidden);
|
static void Prj_PutFormsToRemEditOnePrj (long PrjCod,bool Hidden,
|
||||||
|
bool ICanAdminDocsProject);
|
||||||
|
|
||||||
static bool Prj_CheckIfICanEditProject (long PrjCod);
|
static bool Prj_CheckIfICanEditProject (long PrjCod);
|
||||||
|
static bool Prj_GetIfIAmMemberOfProject (long PrjCod);
|
||||||
static bool Prj_GetIfIAmTutorInProject (long PrjCod);
|
static bool Prj_GetIfIAmTutorInProject (long PrjCod);
|
||||||
|
|
||||||
static void Prj_PutParams (void);
|
static void Prj_PutParams (void);
|
||||||
|
@ -610,6 +612,7 @@ void Prj_PrintOneProject (void)
|
||||||
static void Prj_ShowOneProject (struct Project *Prj,Prj_ProjectView_t ProjectView)
|
static void Prj_ShowOneProject (struct Project *Prj,Prj_ProjectView_t ProjectView)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Today;
|
extern const char *Txt_Today;
|
||||||
|
extern const char *Txt_Project_documents;
|
||||||
extern const char *Txt_Preassigned_QUESTION;
|
extern const char *Txt_Preassigned_QUESTION;
|
||||||
extern const char *Txt_Yes;
|
extern const char *Txt_Yes;
|
||||||
extern const char *Txt_No;
|
extern const char *Txt_No;
|
||||||
|
@ -622,6 +625,7 @@ static void Prj_ShowOneProject (struct Project *Prj,Prj_ProjectView_t ProjectVie
|
||||||
extern const char *Txt_Required_knowledge;
|
extern const char *Txt_Required_knowledge;
|
||||||
extern const char *Txt_Required_materials;
|
extern const char *Txt_Required_materials;
|
||||||
static unsigned UniqueId = 0;
|
static unsigned UniqueId = 0;
|
||||||
|
bool ICanAdminDocsProject = Prj_CheckIfICanAdminDocsProject (Prj->PrjCod);
|
||||||
|
|
||||||
/***** Write first row of data of this project *****/
|
/***** Write first row of data of this project *****/
|
||||||
/* Forms to remove/edit this project */
|
/* Forms to remove/edit this project */
|
||||||
|
@ -634,7 +638,8 @@ static void Prj_ShowOneProject (struct Project *Prj,Prj_ProjectView_t ProjectVie
|
||||||
// no break
|
// no break
|
||||||
case Prj_FILE_BROWSER_PROJECT:
|
case Prj_FILE_BROWSER_PROJECT:
|
||||||
fprintf (Gbl.F.Out,"\">");
|
fprintf (Gbl.F.Out,"\">");
|
||||||
Prj_PutFormsToRemEditOnePrj (Prj->PrjCod,Prj->Hidden);
|
Prj_PutFormsToRemEditOnePrj (Prj->PrjCod,Prj->Hidden,
|
||||||
|
ICanAdminDocsProject);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf (Gbl.F.Out,"\">");
|
fprintf (Gbl.F.Out,"\">");
|
||||||
|
@ -684,11 +689,23 @@ static void Prj_ShowOneProject (struct Project *Prj,Prj_ProjectView_t ProjectVie
|
||||||
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP");
|
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP");
|
||||||
if (ProjectView == Prj_LIST_PROJECTS)
|
if (ProjectView == Prj_LIST_PROJECTS)
|
||||||
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
|
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
|
||||||
fprintf (Gbl.F.Out,"\">"
|
fprintf (Gbl.F.Out,"\">");
|
||||||
"<div class=\"%s\">%s</div>",
|
if (ICanAdminDocsProject)
|
||||||
Prj->Hidden ? "ASG_TITLE_LIGHT" :
|
{
|
||||||
"ASG_TITLE",
|
Act_FormStart (ActAdmDocPrj);
|
||||||
Prj->Title);
|
Prj_PutParams ();
|
||||||
|
Act_LinkFormSubmit (Txt_Project_documents,
|
||||||
|
Prj->Hidden ? "ASG_TITLE_LIGHT" :
|
||||||
|
"ASG_TITLE",
|
||||||
|
NULL);
|
||||||
|
fprintf (Gbl.F.Out,"%s</a>",Prj->Title);
|
||||||
|
Act_FormEnd ();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
fprintf (Gbl.F.Out,"<div class=\"%s\">%s</div>",
|
||||||
|
Prj->Hidden ? "ASG_TITLE_LIGHT" :
|
||||||
|
"ASG_TITLE",
|
||||||
|
Prj->Title);
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
/* Department */
|
/* Department */
|
||||||
|
@ -1717,7 +1734,8 @@ void Prj_PutHiddenParamPrjOrder (void)
|
||||||
/****************** Put a link (form) to edit one project ********************/
|
/****************** Put a link (form) to edit one project ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Prj_PutFormsToRemEditOnePrj (long PrjCod,bool Hidden)
|
static void Prj_PutFormsToRemEditOnePrj (long PrjCod,bool Hidden,
|
||||||
|
bool ICanAdminDocsProject)
|
||||||
{
|
{
|
||||||
Gbl.Prjs.PrjCodToEdit = PrjCod; // Used as parameter in contextual links
|
Gbl.Prjs.PrjCodToEdit = PrjCod; // Used as parameter in contextual links
|
||||||
|
|
||||||
|
@ -1734,16 +1752,35 @@ static void Prj_PutFormsToRemEditOnePrj (long PrjCod,bool Hidden)
|
||||||
|
|
||||||
/***** Put form to edit project *****/
|
/***** Put form to edit project *****/
|
||||||
Ico_PutContextualIconToEdit (ActEdiOnePrj,Prj_PutParams);
|
Ico_PutContextualIconToEdit (ActEdiOnePrj,Prj_PutParams);
|
||||||
|
|
||||||
/***** Put form to view project file browser *****/
|
|
||||||
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
|
|
||||||
Ico_PutContextualIconToViewFiles (ActAdmDocPrj,Prj_PutParams);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***** Put form to admin project documents *****/
|
||||||
|
if (ICanAdminDocsProject)
|
||||||
|
Ico_PutContextualIconToViewFiles (ActAdmDocPrj,Prj_PutParams);
|
||||||
|
|
||||||
/***** Put form to print project *****/
|
/***** Put form to print project *****/
|
||||||
Ico_PutContextualIconToPrint (ActPrnOnePrj,Prj_PutParams);
|
Ico_PutContextualIconToPrint (ActPrnOnePrj,Prj_PutParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/***************** Can I admin documents of a given project? *****************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
bool Prj_CheckIfICanAdminDocsProject (long PrjCod)
|
||||||
|
{
|
||||||
|
switch (Gbl.Usrs.Me.Role.Logged)
|
||||||
|
{
|
||||||
|
case Rol_STD:
|
||||||
|
case Rol_NET:
|
||||||
|
case Rol_TCH:
|
||||||
|
return Prj_GetIfIAmMemberOfProject (PrjCod);
|
||||||
|
case Rol_SYS_ADM:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************ Can I edit a given project? ************************/
|
/************************ Can I edit a given project? ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1762,6 +1799,20 @@ static bool Prj_CheckIfICanEditProject (long PrjCod)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*********************** Am I member of a given project? *********************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static bool Prj_GetIfIAmMemberOfProject (long PrjCod)
|
||||||
|
{
|
||||||
|
char Query[256];
|
||||||
|
|
||||||
|
sprintf (Query,"SELECT COUNT(*) FROM prj_usr"
|
||||||
|
" WHERE PrjCod=%ld AND UsrCod=%ld",
|
||||||
|
PrjCod,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||||
|
return (bool) (DB_QueryCOUNT (Query,"can not check if I am a member of a project") != 0);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********************** Am I tutor in a given project? **********************/
|
/*********************** Am I tutor in a given project? **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -133,6 +133,8 @@ void Prj_RemEva (void);
|
||||||
|
|
||||||
void Prj_PutHiddenParamPrjOrder (void);
|
void Prj_PutHiddenParamPrjOrder (void);
|
||||||
|
|
||||||
|
bool Prj_CheckIfICanAdminDocsProject (long PrjCod);
|
||||||
|
|
||||||
void Prj_RequestCreatePrj (void);
|
void Prj_RequestCreatePrj (void);
|
||||||
void Prj_RequestEditPrj (void);
|
void Prj_RequestEditPrj (void);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue