Merge pull request #5135 from atm-alexis/develop_NEW_allow_link_project

NEW allow a document to be linked to project from another customer
This commit is contained in:
Laurent Destailleur 2016-05-05 22:24:32 +02:00
commit d2df537d43
3 changed files with 19 additions and 3 deletions

View File

@ -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");

View File

@ -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

View File

@ -933,7 +933,22 @@ else
print '<input type="submit" class="button" name="PROJECT_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
print "</td>";
}
print '</tr></table></form>';
print '</tr>';
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("AllowToSelectProjectFromOtherCompany").'</td>';
print '<td align="center" width="300">';
echo ajax_constantonoff('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY');
print '</td>';
print '<td align="center" width="20">&nbsp;</td>';
print '</tr>';
print '</table></form>';
llxFooter();
$db->close();