Look and feel v19

This commit is contained in:
Laurent Destailleur 2023-09-19 21:05:02 +02:00
parent 492b726da9
commit 498af7d7bc
6 changed files with 62 additions and 47 deletions

View file

@ -2888,17 +2888,19 @@ if ($action == 'create' && $usercancreate) {
print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=modif&token='.newToken().'&id='.$object->id, '');
}
$arrayforbutaction = array();
// Create a purchase order
if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_SALE_ORDER)) {
if (isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT && $object->getNbOfServicesLines() > 0) {
if ($usercancreatepurchaseorder) {
print dolGetButtonAction('', $langs->trans('AddPurchaseOrder'), 'default', DOL_URL_ROOT.'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id, '');
}
$arrayforbutaction[] = array('lang'=>'orders', 'enabled'=>(isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT && $object->getNbOfServicesLines() > 0), 'perm'=>$usercancreatepurchaseorder, 'label'=>'AddPurchaseOrder', 'url'=>'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id);
/*if (isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT && $object->getNbOfServicesLines() > 0) {
if ($usercancreatepurchaseorder) {
print dolGetButtonAction('', $langs->trans('AddPurchaseOrder'), 'default', DOL_URL_ROOT.'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id, '');
}
}
}*/
// Create intervention
if (isModEnabled('ficheinter')) {
$arrayforbutaction[] = array('lang'=>'interventions', 'enabled'=>(isModEnabled("ficheinter") && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0), 'perm'=>$user->hasRight('ficheinter', 'creer'), 'label'=>'AddIntervention', 'url'=>'/fichinter/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid);
/*if (isModEnabled('ficheinter')) {
$langs->load("interventions");
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) {
@ -2908,48 +2910,55 @@ if ($action == 'create' && $usercancreate) {
print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('AddIntervention'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
}
}
}
}*/
// Create contract
if (isModEnabled('contrat') && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) {
$arrayforbutaction[] = array('lang'=>'contracts', 'enabled'=>(isModEnabled("contrat") && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)), 'perm'=>$user->hasRight('contrat', 'creer'), 'label'=>'AddContract', 'url'=>'/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid);
/*if (isModEnabled('contrat') && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) {
$langs->load("contracts");
if ($user->hasRight('contrat', 'creer')) {
print dolGetButtonAction('', $langs->trans('AddContract'), 'default', DOL_URL_ROOT.'/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid, '');
}
}
}*/
// Create shipment
$numshipping = 0;
if (isModEnabled('expedition')) {
$numshipping = $object->countNbOfShipments();
}
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
if ((getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'creer')) || (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'creer'))) {
if ($user->hasRight('expedition', 'creer')) {
print dolGetButtonAction('', $langs->trans('CreateShipment'), 'default', DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id, '');
} else {
print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
}
// Create shipment
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
if ((getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'creer')) || (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'creer'))) {
$arrayforbutaction[] = array('lang'=>'sendings', 'enabled'=>(isModEnabled("expedition") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES)))), 'perm'=>$user->hasRight('expedition', 'creer'), 'label'=>'CreateShipment', 'url'=>'/expedition/shipment.php?id='.$object->id);
/*
if ($user->hasRight('expedition', 'creer')) {
print dolGetButtonAction('', $langs->trans('CreateShipment'), 'default', DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id, '');
} else {
$langs->load("errors");
print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
}
print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
}*/
} else {
$langs->load("errors");
print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
}
}
// Create bill
$arrayforbutaction[] = array('lang'=>'bills', 'enabled'=>(isModEnabled('facture') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0), 'perm'=>($user->hasRight('facture', 'creer') && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)), 'label'=>'CreateBill', 'url'=>'/compta/facture/card.php?action=create&amp;token='.newToken().'&amp;origin='.urlencode($object->element).'&amp;originid='.$object->id.'&amp;socid='.$object->socid);
/*
if (isModEnabled('facture') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
if (isModEnabled('facture') && $user->hasRight('facture', 'creer') && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&amp;token='.newToken().'&amp;origin='.urlencode($object->element).'&amp;originid='.$object->id.'&amp;socid='.$object->socid, '');
}
}*/
print dolGetButtonAction($langs->trans("Create"), '', 'default', $arrayforbutaction);
// Set to shipped
if (($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS) && $usercanclose) {
print dolGetButtonAction('', $langs->trans('ClassifyShipped'), 'default', $_SERVER["PHP_SELF"].'?action=shipped&amp;token='.newToken().'&amp;id='.$object->id, '');
}
// Create bill
if (isModEnabled('facture') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
if (isModEnabled('facture') && $user->hasRight('facture', 'creer') && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&amp;token='.newToken().'&amp;origin='.urlencode($object->element).'&amp;originid='.$object->id.'&amp;socid='.$object->socid, '');
}
}
// Set billed or unbilled
// Note: Even if module invoice is not enabled, we should be able to use button "Classified billed"
if ($object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {

View file

@ -1758,13 +1758,13 @@ if (!empty($arrayfields['c.import_key']['checked'])) {
if (!empty($arrayfields['c.fk_statut']['checked'])) {
print '<td class="liste_titre right parentonrightofpage">';
$liststatus = array(
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSentShort"),
-2=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"),
-3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
Commande::STATUS_DRAFT => $langs->trans("StatusOrderDraftShort"),
Commande::STATUS_VALIDATED => $langs->trans("StatusOrderValidated"),
Commande::STATUS_SHIPMENTONPROCESS => $langs->trans("StatusOrderSentShort"),
-2 => $langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"),
-3 => $langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
Commande::STATUS_CLOSED => $langs->trans("StatusOrderDelivered"),
Commande::STATUS_CANCELED => $langs->trans("StatusOrderCanceledShort")
);
print $form->selectarray('search_status', $liststatus, $search_status, -5, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage', 1);
print '</td>';

View file

@ -1202,13 +1202,13 @@ if ($resql) {
if (!empty($arrayfields['c.fk_statut']['checked'])) {
print '<td class="liste_titre maxwidthonsmartphone center">';
$liststatus = array(
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSentShort"),
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
-3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
-2=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"),
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
Commande::STATUS_DRAFT => $langs->trans("StatusOrderDraftShort"),
Commande::STATUS_VALIDATED => $langs->trans("StatusOrderValidated"),
Commande::STATUS_SHIPMENTONPROCESS => $langs->trans("StatusOrderSentShort"),
-2 => $langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"),
-3 => $langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
Commande::STATUS_CLOSED => $langs->trans("StatusOrderDelivered"),
Commande::STATUS_CANCELED => $langs->trans("StatusOrderCanceledShort")
);
print $form->selectarray('search_status', $liststatus, $search_status, -5, 0, 0, '', 0, 0, 0, '', 'maxwidth125', 1);
print '</td>';

View file

@ -334,11 +334,11 @@ print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0
print '<tr><td>'.$langs->trans("Status").'</td><td>';
if ($mode == 'customer') {
$liststatus = array(
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraft"),
Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSent"),
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceled")
Commande::STATUS_DRAFT => $langs->trans("StatusOrderDraft"),
Commande::STATUS_VALIDATED => $langs->trans("StatusOrderValidated"),
Commande::STATUS_SHIPMENTONPROCESS => $langs->trans("StatusOrderSent"),
Commande::STATUS_CLOSED => $langs->trans("StatusOrderDelivered"),
Commande::STATUS_CANCELED => $langs->trans("StatusOrderCanceled")
);
print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'intcomma'), -4);
}

View file

@ -549,6 +549,9 @@ dropdown-holder {
background: none;
color: #000 !important;
}
.dropdown-content a.butAction {
display: flex;
}
.dropdown-content .butAction:hover {
box-shadow: none;
text-decoration: underline;

View file

@ -553,6 +553,9 @@ dropdown-holder {
background: none;
color: #000 !important;
}
.dropdown-content a.butAction {
display: flex;
}
.dropdown-content .butAction:hover {
box-shadow: none;
text-decoration: underline;