diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index c532fd799bd..f160e4cd500 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -138,7 +138,7 @@ class FormProjets $sql.= " WHERE p.entity IN (".getEntity('project', 1).")"; if ($projectsListId !== false) $sql.= " AND p.rowid IN (".$projectsListId.")"; if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; - if ($socid > 0) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)"; + if ($socid > 0 && empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)"; if (!empty($filterkey)) { $sql .= ' AND p.title LIKE "%'.$this->db->escape($filterkey).'%"'; $sql .= ' OR p.ref LIKE "%'.$this->db->escape($filterkey).'%"'; @@ -204,7 +204,7 @@ class FormProjets if ($discard_close == 2) $disabled=1; $labeltoshow.=' - '.$langs->trans("Closed"); } - else if ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid)) + else if ( empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY) && $socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid)) { $disabled=1; $labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany"); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9122546a1f3..a04600ae6ed 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -68,6 +68,7 @@ SearchFilter=Search filters options NumberOfKeyToSearch=Nbr of characters to trigger search: %s ViewFullDateActions=Show full dates events in the third sheet NotAvailableWhenAjaxDisabled=Not available when Ajax disabled +AllowToSelectProjectFromOtherCompany=In document, allow to link it to project from another company JavascriptDisabled=JavaScript disabled UsePopupCalendar=Use popup for dates input UsePreviewTabs=Use preview tabs diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index ca351f7d1bb..5233832ea05 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -933,7 +933,22 @@ else print ''; print ""; } -print ''; +print ''; + +$var=!$var; +print '