FIX Projet is not prefilled when created from overwiew page
This commit is contained in:
parent
171414bed6
commit
3340598cf8
@ -76,6 +76,7 @@ $action = GETPOST('action', 'alpha');
|
|||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$lineid = GETPOST('lineid', 'int');
|
$lineid = GETPOST('lineid', 'int');
|
||||||
|
$projectid = GETPOST('projectid', 'int');
|
||||||
$origin = GETPOST('origin', 'alpha');
|
$origin = GETPOST('origin', 'alpha');
|
||||||
$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility
|
$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility
|
||||||
|
|
||||||
@ -228,7 +229,7 @@ if (empty($reshook))
|
|||||||
// Link to a project
|
// Link to a project
|
||||||
else if ($action == 'classin' && $user->rights->commande->creer)
|
else if ($action == 'classin' && $user->rights->commande->creer)
|
||||||
{
|
{
|
||||||
$object->setProject(GETPOST('projectid'));
|
$object->setProject(GETPOST('projectid','int'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add order
|
// Add order
|
||||||
@ -259,8 +260,8 @@ if (empty($reshook))
|
|||||||
$object->note_private = GETPOST('note_private','none');
|
$object->note_private = GETPOST('note_private','none');
|
||||||
$object->note_public = GETPOST('note_public','none');
|
$object->note_public = GETPOST('note_public','none');
|
||||||
$object->source = GETPOST('source_id');
|
$object->source = GETPOST('source_id');
|
||||||
$object->fk_project = GETPOST('projectid');
|
$object->fk_project = GETPOST('projectid','int');
|
||||||
$object->ref_client = GETPOST('ref_client');
|
$object->ref_client = GETPOST('ref_client','alpha');
|
||||||
$object->modelpdf = GETPOST('model');
|
$object->modelpdf = GETPOST('model');
|
||||||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||||
@ -1389,7 +1390,6 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
if ($socid > 0)
|
if ($socid > 0)
|
||||||
$res = $soc->fetch($socid);
|
$res = $soc->fetch($socid);
|
||||||
|
|
||||||
$projectid = 0;
|
|
||||||
$remise_absolue = 0;
|
$remise_absolue = 0;
|
||||||
|
|
||||||
$currency_code = $conf->currency;
|
$currency_code = $conf->currency;
|
||||||
@ -1486,7 +1486,6 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
$remise_percent = $soc->remise_percent;
|
$remise_percent = $soc->remise_percent;
|
||||||
$remise_absolue = 0;
|
$remise_absolue = 0;
|
||||||
$dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER)?-1:'';
|
$dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER)?-1:'';
|
||||||
$projectid = 0;
|
|
||||||
|
|
||||||
if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code;
|
if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code;
|
||||||
|
|
||||||
@ -1494,7 +1493,6 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
$note_public = $object->getDefaultCreateValueFor('note_public');
|
$note_public = $object->getDefaultCreateValueFor('note_public');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<form name="crea_commande" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
|
print '<form name="crea_commande" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|||||||
@ -349,7 +349,7 @@ if ($action == 'create')
|
|||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input type="button" class="button" value="'.$langs->trans("Cancel").'" onclick="javascript:history.go(-1)">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -67,6 +67,7 @@ $action = GETPOST('action', 'alpha');
|
|||||||
$origin = GETPOST('origin', 'alpha');
|
$origin = GETPOST('origin', 'alpha');
|
||||||
$originid = GETPOST('originid', 'int');
|
$originid = GETPOST('originid', 'int');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
|
$projectid = GETPOST('projectid', 'int');
|
||||||
$lineid = GETPOST('lineid', 'int');
|
$lineid = GETPOST('lineid', 'int');
|
||||||
$contactid = GETPOST('contactid','int');
|
$contactid = GETPOST('contactid','int');
|
||||||
|
|
||||||
@ -265,7 +266,7 @@ if (empty($reshook))
|
|||||||
$object->remise_percent = GETPOST('remise_percent');
|
$object->remise_percent = GETPOST('remise_percent');
|
||||||
$object->remise_absolue = GETPOST('remise_absolue');
|
$object->remise_absolue = GETPOST('remise_absolue');
|
||||||
$object->socid = GETPOST('socid');
|
$object->socid = GETPOST('socid');
|
||||||
$object->fk_project = GETPOST('projectid');
|
$object->fk_project = GETPOST('projectid','int');
|
||||||
$object->modelpdf = GETPOST('model');
|
$object->modelpdf = GETPOST('model');
|
||||||
$object->author = $user->id; // deprecated
|
$object->author = $user->id; // deprecated
|
||||||
$object->note = GETPOST('note','none');
|
$object->note = GETPOST('note','none');
|
||||||
@ -283,7 +284,7 @@ if (empty($reshook))
|
|||||||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||||
$object->fk_account = GETPOST('fk_account', 'int');
|
$object->fk_account = GETPOST('fk_account', 'int');
|
||||||
$object->fk_project = GETPOST('projectid');
|
$object->fk_project = GETPOST('projectid','int');
|
||||||
$object->modelpdf = GETPOST('model');
|
$object->modelpdf = GETPOST('model');
|
||||||
$object->author = $user->id; // deprecated
|
$object->author = $user->id; // deprecated
|
||||||
$object->note = GETPOST('note','none');
|
$object->note = GETPOST('note','none');
|
||||||
@ -890,7 +891,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Set project
|
// Set project
|
||||||
else if ($action == 'classin' && $user->rights->supplier_proposal->creer) {
|
else if ($action == 'classin' && $user->rights->supplier_proposal->creer) {
|
||||||
$object->setProject($_POST['projectid']);
|
$object->setProject(GETPOST('projectid'),'int');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delai de livraison
|
// Delai de livraison
|
||||||
@ -1103,9 +1104,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$formproject = new FormProjets($db);
|
$formproject = new FormProjets($db);
|
||||||
|
|
||||||
$projectid = 0;
|
if ($origin == 'project') $projectid = ($originid ? $originid : 0);
|
||||||
if ($origin == 'project')
|
|
||||||
$projectid = ($originid ? $originid : 0);
|
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>' . $langs->trans("Project") . '</td><td colspan="2">';
|
print '<td>' . $langs->trans("Project") . '</td><td colspan="2">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user