NEW Uniformize behaviour: Action to make order is an action button.
This commit is contained in:
parent
373f918543
commit
d945a0de92
@ -2613,6 +2613,18 @@ elseif (! empty($object->id))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($object->statut == 2)
|
||||||
|
{
|
||||||
|
if ($user->rights->fournisseur->commande->commander)
|
||||||
|
{
|
||||||
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=makeorder#makeorder">'.$langs->trans("MakeOrder").'</a></div>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">'.$langs->trans("MakeOrder").'</a></div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Create bill
|
// Create bill
|
||||||
if (! empty($conf->facture->enabled))
|
if (! empty($conf->facture->enabled))
|
||||||
{
|
{
|
||||||
@ -2664,6 +2676,39 @@ elseif (! empty($object->id))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($user->rights->fournisseur->commande->commander && $object->statut == 2 && $action == 'makeorder')
|
||||||
|
{
|
||||||
|
// Set status to ordered (action=commande)
|
||||||
|
print '<!-- form to record supplier order -->'."\n";
|
||||||
|
print '<form name="commande" id="makeorder" action="card.php?id='.$object->id.'&action=commande" method="post">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="action" value="commande">';
|
||||||
|
print load_fiche_titre($langs->trans("ToOrder"),'','');
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ToOrder").'</td></tr>';
|
||||||
|
print '<tr><td>'.$langs->trans("OrderDate").'</td><td>';
|
||||||
|
$date_com = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
||||||
|
print $form->select_date($date_com,'',1,1,'',"commande",1,0,1);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td>'.$langs->trans("OrderMode").'</td><td>';
|
||||||
|
$formorder->selectInputMethod(GETPOST('methodecommande'), "methodecommande", 1);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td>'.$langs->trans("Comment").'</td><td><input size="40" type="text" name="comment" value="'.GETPOST('comment').'"></td></tr>';
|
||||||
|
print '<tr><td align="center" colspan="2">';
|
||||||
|
print '<input type="submit" name="makeorder" class="button" value="'.$langs->trans("ToOrder").'">';
|
||||||
|
print ' ';
|
||||||
|
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
||||||
|
print '</td></tr>';
|
||||||
|
print '</table>';
|
||||||
|
print '</form>';
|
||||||
|
print "<br>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($action != 'makeorder')
|
||||||
|
{
|
||||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2687,32 +2732,6 @@ elseif (! empty($object->id))
|
|||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
|
|
||||||
if ($user->rights->fournisseur->commande->commander && $object->statut == 2)
|
|
||||||
{
|
|
||||||
// Set status to ordered (action=commande)
|
|
||||||
print '<!-- form to record supplier order -->'."\n";
|
|
||||||
print '<form name="commande" action="card.php?id='.$object->id.'&action=commande" method="post">';
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print '<input type="hidden" name="action" value="commande">';
|
|
||||||
print load_fiche_titre($langs->trans("ToOrder"),'','');
|
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ToOrder").'</td></tr>';
|
|
||||||
print '<tr><td>'.$langs->trans("OrderDate").'</td><td>';
|
|
||||||
$date_com = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
|
||||||
print $form->select_date($date_com,'',1,1,'',"commande",1,0,1);
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("OrderMode").'</td><td>';
|
|
||||||
$formorder->selectInputMethod(GETPOST('methodecommande'), "methodecommande", 1);
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Comment").'</td><td><input size="40" type="text" name="comment" value="'.GETPOST('comment').'"></td></tr>';
|
|
||||||
print '<tr><td align="center" colspan="2"><input type="submit" class="button" value="'.$langs->trans("ToOrder").'"></td></tr>';
|
|
||||||
print '</table>';
|
|
||||||
print '</form>';
|
|
||||||
print "<br>";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($user->rights->fournisseur->commande->receptionner && ($object->statut == 3 || $object->statut == 4))
|
if ($user->rights->fournisseur->commande->receptionner && ($object->statut == 3 || $object->statut == 4))
|
||||||
{
|
{
|
||||||
// Set status to received (action=livraison)
|
// Set status to received (action=livraison)
|
||||||
@ -2751,17 +2770,9 @@ elseif (! empty($object->id))
|
|||||||
$formactions=new FormActions($db);
|
$formactions=new FormActions($db);
|
||||||
$somethingshown=$formactions->showactions($object,'order_supplier',$socid,0,'listaction'.($genallowed?'largetitle':''));
|
$somethingshown=$formactions->showactions($object,'order_supplier',$socid,0,'listaction'.($genallowed?'largetitle':''));
|
||||||
|
|
||||||
|
|
||||||
// List of actions on element
|
|
||||||
/* Hidden because" available into "Log" tab
|
|
||||||
print '<br>';
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
|
||||||
$formactions=new FormActions($db);
|
|
||||||
$somethingshown=$formactions->showactions($object,'order_supplier',$socid);
|
|
||||||
*/
|
|
||||||
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user