diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c05c70cb1ad..c34945cc0e3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -509,7 +509,7 @@ class CommonObject if (! $this->table_element) { - dol_syslog("CommonObject::load_previous_next was called on objet with property table_element not defined", LOG_ERR); + dol_syslog("CommonObject::load_previous_next_ref was called on objet with property table_element not defined", LOG_ERR); return -1; } diff --git a/htdocs/includes/dolibarr_changes.txt b/htdocs/includes/dolibarr_changes.txt index 162be0546e0..344fd7de586 100644 --- a/htdocs/includes/dolibarr_changes.txt +++ b/htdocs/includes/dolibarr_changes.txt @@ -37,6 +37,8 @@ with // LDR To open in same window //var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth); window.location.href=pRef +* Replace hard coded string with i18n["String"]; + PHP-BARCODE: diff --git a/htdocs/includes/jsgantt/jsgantt.js b/htdocs/includes/jsgantt/jsgantt.js index 7e675cebd3b..bee6102f1fd 100644 --- a/htdocs/includes/jsgantt/jsgantt.js +++ b/htdocs/includes/jsgantt/jsgantt.js @@ -1065,7 +1065,8 @@ Complete-Displays task percent complete

// DRAW the date format selector at bottom left. Another potential GanttChart parameter to hide/show this selector vLeftTable += '' + - '  Powered by jsGantt      Format:'; + // LDR '  Powered by jsGantt      Format:'; + '         '+i18n["Period"]+':   '; if (vFormatArr.join().indexOf("minute")!=-1) { if (vFormat=='minute') vLeftTable += ''+i18n["sMinute"]; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 2ab0e78d7da..33f24b02b07 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -24,7 +24,7 @@ * \brief Fichier de la classe de gestion des projets * \version $Id$ */ -require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); /** * \class Project @@ -354,11 +354,11 @@ class Project extends CommonObject function delete($user, $notrigger=0) { global $conf; - + $error=0; $this->db->begin(); - + if (! $error) { // Delete linked contacts diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 236edf036ed..57136f0c2c9 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -35,6 +35,14 @@ $langs->load("companies"); $projectid = isset($_GET["id"])?$_GET["id"]:''; // Security check +if (empty($user->rights->projet->all->lire)) +{ + $_GET["mode"]='mine'; + $_POST["mode"]='mine'; + $_REQUEST["mode"]='mine'; +} +$mine = $_REQUEST['mode']=='mine' ? 1 : 0; +if (! $user->rights->projet->all->lire) $mine=1; // Special for projects if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'projet', $projectid); @@ -191,6 +199,9 @@ if ($id > 0 || ! empty($ref)) // Ref print ''.$langs->trans('Ref').''; + // Define a complementary filter for search of next/prev ref. + $projectsListId = $project->getProjectsAuthorizedForUser($user,$mine,1); + $project->next_prev_filter=" rowid in (".$projectsListId.")"; print $html->showrefnav($project,'ref',$linkback,1,'ref','ref',''); print ''; diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index cb3ac36966f..1ee83a0ead4 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -35,6 +35,14 @@ $langs->load('other'); $id=empty($_GET['id']) ? 0 : intVal($_GET['id']); // Security check +if (empty($user->rights->projet->all->lire)) +{ + $_GET["mode"]='mine'; + $_POST["mode"]='mine'; + $_REQUEST["mode"]='mine'; +} +$mine = $_REQUEST['mode']=='mine' ? 1 : 0; +if (! $user->rights->projet->all->lire) $mine=1; // Special for projects $socid=0; $id = isset($_GET["id"])?$_GET["id"]:''; if ($user->societe_id) $socid=$user->societe_id; @@ -59,6 +67,7 @@ $project = new Project($db); if (! $project->fetch($_GET['id'],$_GET['ref']) > 0) { dol_print_error($db); + exit; } @@ -150,6 +159,9 @@ if ($id > 0 || ! empty($ref)) // Ref print ''.$langs->trans("Ref").''; + // Define a complementary filter for search of next/prev ref. + $projectsListId = $project->getProjectsAuthorizedForUser($user,$mine,1); + $project->next_prev_filter=" rowid in (".$projectsListId.")"; print $form->showrefnav($project,'ref','',1,'ref','ref'); print ''; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index d9890816a5e..6f9e05b3356 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -46,14 +46,25 @@ if ($conf->facture->enabled) $langs->load("bills"); if ($conf->commande->enabled) $langs->load("orders"); if ($conf->propal->enabled) $langs->load("propal"); -// Security check $projectid=''; $ref=''; if (isset($_GET["id"])) { $projectid=$_GET["id"]; } if (isset($_GET["ref"])) { $ref=$_GET["ref"]; } -if ($projectid == '' && $ref == '') accessforbidden(); +if ($projectid == '' && $ref == '') +{ + dol_print_error('','Bad parameter'); + exit; +} // Security check +if (empty($user->rights->projet->all->lire)) +{ + $_GET["mode"]='mine'; + $_POST["mode"]='mine'; + $_REQUEST["mode"]='mine'; +} +$mine = $_REQUEST['mode']=='mine' ? 1 : 0; +if (! $user->rights->projet->all->lire) $mine=1; // Special for projects if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'projet', $projectid); @@ -82,6 +93,9 @@ dol_fiche_head($head, 'element', $langs->trans("Project"),0,($project->public?'p print ''; print ''; diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index 4205f523a2b..ea9b2cee173 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -48,10 +48,20 @@ if (! empty($_REQUEST['socid_id'])) if ($projectid == '' && $projectref == '' && ($_GET['action'] != "create" && $_POST['action'] != "add" && $_POST["action"] != "update" && !$_POST["cancel"])) accessforbidden(); // Security check +if (empty($user->rights->projet->all->lire)) +{ + $_GET["mode"]='mine'; + $_POST["mode"]='mine'; + $_REQUEST["mode"]='mine'; +} +$mine = $_REQUEST['mode']=='mine' ? 1 : 0; +if (! $user->rights->projet->all->lire) $mine=1; // Special for projects if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'projet', $projectid); + + /* * Actions */ @@ -229,13 +239,14 @@ if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == "yes" && * View */ +$html = new Form($db); +$formfile = new FormFile($db); +$userstatic = new User($db); + + $help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; llxHeader("",$langs->trans("Projects"),$help_url); -$html = new Form($db); -$formfile = new FormFile($db); - -$userstatic=new User($db); if ($_GET["action"] == 'create' && $user->rights->projet->creer) { @@ -403,11 +414,13 @@ else } else { - print '
'.$langs->trans("Ref").''; +// Define a complementary filter for search of next/prev ref. +$projectsListId = $project->getProjectsAuthorizedForUser($user,$mine,1); +$project->next_prev_filter=" rowid in (".$projectsListId.")"; print $form->showrefnav($project,'ref','',1,'ref','ref'); print '
'; // Ref print ''; diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 574f98ffd81..9a3037c24d6 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -36,7 +36,6 @@ require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php"); -$projectid=''; $projectid=isset($_REQUEST["id"])?$_REQUEST["id"]:$_POST["id"]; // Security check @@ -46,6 +45,8 @@ if (empty($user->rights->projet->all->lire)) $_POST["mode"]='mine'; $_REQUEST["mode"]='mine'; } +$mine = $_REQUEST['mode']=='mine' ? 1 : 0; +if (! $user->rights->projet->all->lire) $mine=1; // Special for projects if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'projet', $projectid); @@ -112,6 +113,9 @@ print '
'.$langs->trans("Ref").''; + // Define a complementary filter for search of next/prev ref. + $projectsListId = $project->getProjectsAuthorizedForUser($user,$mine,1); + $project->next_prev_filter=" rowid in (".$projectsListId.")"; print $html->showrefnav($project,'ref','',1,'ref','ref'); print '
'; print ''; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 54b8c453dcd..f61312de7f0 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -35,7 +35,7 @@ $langs->load("projects"); $mine = $_REQUEST['mode']=='mine' ? 1 : 0; // Security check -if (! $user->rights->projet->all->lire) $mine=1; +if (! $user->rights->projet->all->lire) $mine=1; // Special for projects if ($user->societe_id > 0) $socid = $user->societe_id; if (!$user->rights->projet->lire) accessforbidden(); diff --git a/htdocs/projet/jsgantt_language.js.php b/htdocs/projet/jsgantt_language.js.php index 269493f5a93..889ecf08c2b 100644 --- a/htdocs/projet/jsgantt_language.js.php +++ b/htdocs/projet/jsgantt_language.js.php @@ -71,5 +71,6 @@ i18n["October"] = "transnoentities("October") ?>"; i18n["November"] = "transnoentities("November") ?>"; i18n["December"] = "transnoentities("December") ?>"; i18n["Quarter"] = "transnoentities("Quarter") ?>"; +i18n["Period"] = "transnoentities("Period") ?>"; diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php index ab634b06bad..5655ba6fd2b 100644 --- a/htdocs/projet/note.php +++ b/htdocs/projet/note.php @@ -32,6 +32,14 @@ $langs->load('projects'); $id = isset($_GET["id"])?$_GET["id"]:''; // Security check +if (empty($user->rights->projet->all->lire)) +{ + $_GET["mode"]='mine'; + $_POST["mode"]='mine'; + $_REQUEST["mode"]='mine'; +} +$mine = $_REQUEST['mode']=='mine' ? 1 : 0; +if (! $user->rights->projet->all->lire) $mine=1; // Special for projects if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'projet', $id); @@ -117,6 +125,9 @@ if ($id > 0 || ! empty($ref)) // Ref print '';
'; print $langs->trans("Ref"); print ''; +// Define a complementary filter for search of next/prev ref. +$projectsListId = $project->getProjectsAuthorizedForUser($user,$mine,1); +$project->next_prev_filter=" rowid in (".$projectsListId.")"; print $form->showrefnav($project,'ref','',1,'ref','ref','',$param); print '
'.$langs->trans("Ref").''; + // Define a complementary filter for search of next/prev ref. + $projectsListId = $project->getProjectsAuthorizedForUser($user,$mine,1); + $project->next_prev_filter=" rowid in (".$projectsListId.")"; print $html->showrefnav($project,'ref','',1,'ref','ref'); print '