Merge pull request #27079 from atm-lena/16.0_FIX_AddContactToTask_FormConfirmGetTooLong

Add contact to project and tasks : formconfirm get url too long
This commit is contained in:
Laurent Destailleur 2023-12-14 01:35:08 +01:00 committed by GitHub
commit b5a1ebd01a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -126,7 +126,7 @@ if ($action == 'addcontact') {
$formquestion[] = array('type'=> 'other', 'name'=>'tasksavailable', 'label'=>'', 'value' => '<input type="hidden" id="tasksavailable" name="tasksavailable" value="'.implode(',', array_keys($task_to_affect)).'">');
}
$formconfirmtoaddtasks = $form->formconfirm($_SERVER['PHP_SELF'] . $url_redirect, $text, '', 'addcontact_confirm', $formquestion, '', 1, 300, 590);
$formconfirmtoaddtasks = $form->formconfirm($_SERVER['PHP_SELF'] . $url_redirect, $text, '', 'addcontact_confirm', $formquestion, '', ((count($formquestion) > 10) ? 0 : 1), 300, 590);
$formconfirmtoaddtasks .='
<script>
$(document).ready(function() {
@ -150,7 +150,13 @@ if ($action == 'addcontact') {
// Add new contact
if ($action == 'addcontact_confirm' && $user->rights->projet->creer) {
$contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
if (GETPOST('confirm', 'alpha') == 'no') {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
$contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
if (! ($contactid > 0)) {