FIX : link project from other company conf

This commit is contained in:
ATM-Nicolas 2017-12-04 17:43:35 +01:00
parent 44e5566ee5
commit 36bcd26e27
2 changed files with 15 additions and 4 deletions

View File

@ -207,3 +207,4 @@ OppStatusPENDING=Pending
OppStatusWON=Won
OppStatusLOST=Lost
Budget=Budget
AllowToLinkFromOtherCompany=Allow to link project from other company<br /><br /><u>Supported values :</u><br />- "all" : Link all projects<br />- A list of thirdparty id separated with commas : Link all projects with these thirdparty defined<br />Example : 11524,4795,53<br /><br />N.B.: Leave empty to disable this configuration

View File

@ -274,6 +274,12 @@ elseif ($action == 'updateoptions')
}
}
}
else if ($action == "linkOtherCompany")
{
$projectToSelect = GETPOST('projectToSelect');
dolibarr_set_const($db, 'PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY', $projectToSelect, 'chaine', 0, '', $conf->entity); //Allow to disable this configuration if empty value
}
/*
@ -912,16 +918,20 @@ print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("AllowToSelectProjectFromOtherCompany").'</td>';
print '<td align="center" width="300">';
echo ajax_constantonoff('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY');
print '<td align="right" width="60" colspan="2">';
print '<form action="project.php" method="POST">';
print '<input type="hidden" id="action" name="action" value="linkOtherCompany" />';
print '<input type="text" id="projectToSelect" name="projectToSelect" value="'.$conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.'"/>&nbsp;';
print $form->textwithpicto('', $langs->trans('AllowToLinkFromOtherCompany'));
print '<input type="submit" class="button" name="PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY" value="'.$langs->trans("Modify").'">';
print '</form>';
print '</td>';
print '<td align="center" width="20">&nbsp;</td>';
print '</tr>';
print '</table></form>';
llxFooter();
$db->close();