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,103 +2676,102 @@ elseif (! empty($object->id))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
if ($user->rights->fournisseur->commande->commander && $object->statut == 2 && $action == 'makeorder')
|
||||||
|
|
||||||
/*
|
|
||||||
* 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)
|
|
||||||
{
|
{
|
||||||
// Set status to ordered (action=commande)
|
// Set status to ordered (action=commande)
|
||||||
print '<!-- form to record supplier order -->'."\n";
|
print '<!-- form to record supplier order -->'."\n";
|
||||||
print '<form name="commande" action="card.php?id='.$object->id.'&action=commande" method="post">';
|
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="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="commande">';
|
print '<input type="hidden" name="action" value="commande">';
|
||||||
print load_fiche_titre($langs->trans("ToOrder"),'','');
|
print load_fiche_titre($langs->trans("ToOrder"),'','');
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ToOrder").'</td></tr>';
|
//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ToOrder").'</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("OrderDate").'</td><td>';
|
print '<tr><td>'.$langs->trans("OrderDate").'</td><td>';
|
||||||
$date_com = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
$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 $form->select_date($date_com,'',1,1,'',"commande",1,0,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("OrderMode").'</td><td>';
|
print '<tr><td>'.$langs->trans("OrderMode").'</td><td>';
|
||||||
$formorder->selectInputMethod(GETPOST('methodecommande'), "methodecommande", 1);
|
$formorder->selectInputMethod(GETPOST('methodecommande'), "methodecommande", 1);
|
||||||
print '</td></tr>';
|
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>'.$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 '<tr><td align="center" colspan="2">';
|
||||||
print '</table>';
|
print '<input type="submit" name="makeorder" class="button" value="'.$langs->trans("ToOrder").'">';
|
||||||
print '</form>';
|
print ' ';
|
||||||
print "<br>";
|
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 '<div class="fichecenter"><div class="fichehalfleft">';
|
||||||
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>';
|
* Documents generes
|
||||||
print '<tr><td>'.$langs->trans("DeliveryDate").'</td><td>';
|
*/
|
||||||
print $form->select_date('','',1,1,'',"commande",1,0,1);
|
$comfournref = dol_sanitizeFileName($object->ref);
|
||||||
print "</td></tr>\n";
|
$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 "<tr><td>".$langs->trans("Delivery")."</td><td>\n";
|
print $formfile->showdocuments('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,0,0,'','','',$object->thirdparty->default_lang);
|
||||||
$liv = array();
|
$somethingshown=$formfile->numoffiles;
|
||||||
$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);
|
// Show links to link elements
|
||||||
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('supplier_order','order_supplier'));
|
||||||
|
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
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";
|
if ($user->rights->fournisseur->commande->receptionner && ($object->statut == 3 || $object->statut == 4))
|
||||||
print "</form>\n";
|
{
|
||||||
print "<br>";
|
// 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>';
|
print '</td></tr></table>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user