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
|
||||
if (! empty($conf->facture->enabled))
|
||||
{
|
||||
@ -2664,103 +2676,102 @@ elseif (! empty($object->id))
|
||||
}
|
||||
|
||||
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
|
||||
/*
|
||||
* Documents generes
|
||||
*/
|
||||
$comfournref = dol_sanitizeFileName($object->ref);
|
||||
$file = $conf->fournisseur->dir_output . '/commande/' . $comfournref . '/' . $comfournref . '.pdf';
|
||||
$relativepath = $comfournref.'/'.$comfournref.'.pdf';
|
||||
$filedir = $conf->fournisseur->dir_output . '/commande/' . $comfournref;
|
||||
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||
$genallowed=$user->rights->fournisseur->commande->creer;
|
||||
$delallowed=$user->rights->fournisseur->commande->supprimer;
|
||||
|
||||
print $formfile->showdocuments('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,0,0,'','','',$object->thirdparty->default_lang);
|
||||
$somethingshown=$formfile->numoffiles;
|
||||
|
||||
// Show links to link elements
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('supplier_order','order_supplier'));
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
if ($user->rights->fournisseur->commande->commander && $object->statut == 2)
|
||||
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" 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>";
|
||||
// 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 ($user->rights->fournisseur->commande->receptionner && ($object->statut == 3 || $object->statut == 4))
|
||||
|
||||
|
||||
if ($action != 'makeorder')
|
||||
{
|
||||
// Set status to received (action=livraison)
|
||||
print '<!-- form to record supplier order received -->'."\n";
|
||||
print '<form action="card.php?id='.$object->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="livraison">';
|
||||
print load_fiche_titre($langs->trans("Receive"),'','');
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Receive").'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("DeliveryDate").'</td><td>';
|
||||
print $form->select_date('','',1,1,'',"commande",1,0,1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "<tr><td>".$langs->trans("Delivery")."</td><td>\n";
|
||||
$liv = array();
|
||||
$liv[''] = ' ';
|
||||
$liv['tot'] = $langs->trans("CompleteOrNoMoreReceptionExpected");
|
||||
$liv['par'] = $langs->trans("PartialWoman");
|
||||
$liv['nev'] = $langs->trans("NeverReceived");
|
||||
$liv['can'] = $langs->trans("Canceled");
|
||||
|
||||
print $form->selectarray("type",$liv);
|
||||
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Comment").'</td><td><input size="40" type="text" name="comment"></td></tr>';
|
||||
print '<tr><td align="center" colspan="2"><input type="submit" class="button" value="'.$langs->trans("Receive").'"></td></tr>';
|
||||
print "</table>\n";
|
||||
print "</form>\n";
|
||||
print "<br>";
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
|
||||
/*
|
||||
* Documents generes
|
||||
*/
|
||||
$comfournref = dol_sanitizeFileName($object->ref);
|
||||
$file = $conf->fournisseur->dir_output . '/commande/' . $comfournref . '/' . $comfournref . '.pdf';
|
||||
$relativepath = $comfournref.'/'.$comfournref.'.pdf';
|
||||
$filedir = $conf->fournisseur->dir_output . '/commande/' . $comfournref;
|
||||
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||
$genallowed=$user->rights->fournisseur->commande->creer;
|
||||
$delallowed=$user->rights->fournisseur->commande->supprimer;
|
||||
|
||||
print $formfile->showdocuments('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,0,0,'','','',$object->thirdparty->default_lang);
|
||||
$somethingshown=$formfile->numoffiles;
|
||||
|
||||
// Show links to link elements
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('supplier_order','order_supplier'));
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
if ($user->rights->fournisseur->commande->receptionner && ($object->statut == 3 || $object->statut == 4))
|
||||
{
|
||||
// Set status to received (action=livraison)
|
||||
print '<!-- form to record supplier order received -->'."\n";
|
||||
print '<form action="card.php?id='.$object->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="livraison">';
|
||||
print load_fiche_titre($langs->trans("Receive"),'','');
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Receive").'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("DeliveryDate").'</td><td>';
|
||||
print $form->select_date('','',1,1,'',"commande",1,0,1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "<tr><td>".$langs->trans("Delivery")."</td><td>\n";
|
||||
$liv = array();
|
||||
$liv[''] = ' ';
|
||||
$liv['tot'] = $langs->trans("CompleteOrNoMoreReceptionExpected");
|
||||
$liv['par'] = $langs->trans("PartialWoman");
|
||||
$liv['nev'] = $langs->trans("NeverReceived");
|
||||
$liv['can'] = $langs->trans("Canceled");
|
||||
|
||||
print $form->selectarray("type",$liv);
|
||||
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Comment").'</td><td><input size="40" type="text" name="comment"></td></tr>';
|
||||
print '<tr><td align="center" colspan="2"><input type="submit" class="button" value="'.$langs->trans("Receive").'"></td></tr>';
|
||||
print "</table>\n";
|
||||
print "</form>\n";
|
||||
print "<br>";
|
||||
}
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions=new FormActions($db);
|
||||
$somethingshown=$formactions->showactions($object,'order_supplier',$socid,0,'listaction'.($genallowed?'largetitle':''));
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions=new FormActions($db);
|
||||
$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 '</td></tr></table>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user