Fix look and feel v16
This commit is contained in:
parent
985c581c01
commit
f261846990
@ -1821,8 +1821,9 @@ if ($resql) {
|
|||||||
$total_ht = 0;
|
$total_ht = 0;
|
||||||
$total_margin = 0;
|
$total_margin = 0;
|
||||||
|
|
||||||
|
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||||
$last_num = min($num, $limit);
|
$last_num = min($num, $limit);
|
||||||
while ($i < $last_num) {
|
while ($i < $imaxinloop) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$notshippable = 0;
|
$notshippable = 0;
|
||||||
@ -2457,6 +2458,17 @@ if ($resql) {
|
|||||||
// Show total line
|
// Show total line
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
||||||
|
|
||||||
|
// If no record found
|
||||||
|
if ($num == 0) {
|
||||||
|
$colspan = 1;
|
||||||
|
foreach ($arrayfields as $key => $val) {
|
||||||
|
if (!empty($val['checked'])) {
|
||||||
|
$colspan++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||||
|
|||||||
@ -209,6 +209,12 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
|
|||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
|
$permissiontoread = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire);
|
||||||
|
$permissiontoadd = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
|
||||||
|
$permissiontodelete = ($user->rights->fournisseur->commande->supprimer || $user->rights->supplier_order->supprimer);
|
||||||
|
$permissiontovalidate = $permissiontoadd;
|
||||||
|
$permissiontoapprove = ($user->rights->fournisseur->commande->approuver || $user->rights->supplier_order->approuver);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -302,9 +308,6 @@ if (empty($reshook)) {
|
|||||||
// Mass actions
|
// Mass actions
|
||||||
$objectclass = 'CommandeFournisseur';
|
$objectclass = 'CommandeFournisseur';
|
||||||
$objectlabel = 'SupplierOrders';
|
$objectlabel = 'SupplierOrders';
|
||||||
$permissiontoread = $user->rights->fournisseur->commande->lire;
|
|
||||||
$permissiontodelete = $user->rights->fournisseur->commande->supprimer;
|
|
||||||
$permissiontovalidate = $user->rights->fournisseur->commande->creer;
|
|
||||||
$uploaddir = $conf->fournisseur->commande->dir_output;
|
$uploaddir = $conf->fournisseur->commande->dir_output;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
|
|
||||||
@ -321,7 +324,7 @@ if (empty($reshook)) {
|
|||||||
$result = $objecttmp->valid($user);
|
$result = $objecttmp->valid($user);
|
||||||
if ($result >= 0) {
|
if ($result >= 0) {
|
||||||
// If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step
|
// If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step
|
||||||
if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $user->rights->fournisseur->commande->approuver && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $objecttmp->hasProductsOrServices(1))) {
|
if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $permissiontoapprove && !(!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $objecttmp->hasProductsOrServices(1))) {
|
||||||
$result = $objecttmp->approve($user);
|
$result = $objecttmp->approve($user);
|
||||||
setEventMessages($langs->trans("SupplierOrderValidatedAndApproved"), array($objecttmp->ref));
|
setEventMessages($langs->trans("SupplierOrderValidatedAndApproved"), array($objecttmp->ref));
|
||||||
} else {
|
} else {
|
||||||
@ -1096,7 +1099,7 @@ if ($resql) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if ($permissiontovalidate) {
|
if ($permissiontovalidate) {
|
||||||
if ($user->rights->fournisseur->commande->approuver && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) {
|
if ($permissiontoapprove && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) {
|
||||||
$arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ValidateAndApprove");
|
$arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ValidateAndApprove");
|
||||||
} else {
|
} else {
|
||||||
$arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate");
|
$arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate");
|
||||||
@ -1106,7 +1109,7 @@ if ($resql) {
|
|||||||
if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
|
if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
|
||||||
$arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisSupplier");
|
$arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisSupplier");
|
||||||
}
|
}
|
||||||
if ($user->rights->fournisseur->commande->supprimer) {
|
if ($permissiontodelete) {
|
||||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
}
|
}
|
||||||
if (in_array($massaction, array('presend', 'predelete', 'createbills'))) {
|
if (in_array($massaction, array('presend', 'predelete', 'createbills'))) {
|
||||||
@ -1119,7 +1122,7 @@ if ($resql) {
|
|||||||
$url .= '&socid='.((int) $socid);
|
$url .= '&socid='.((int) $socid);
|
||||||
$url .= '&backtopage='.urlencode(DOL_URL_ROOT.'/fourn/commande/list.php?socid='.((int) $socid));
|
$url .= '&backtopage='.urlencode(DOL_URL_ROOT.'/fourn/commande/list.php?socid='.((int) $socid));
|
||||||
}
|
}
|
||||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer));
|
$newcardbutton = dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', $permissitiontoadd);
|
||||||
|
|
||||||
// Lines of title fields
|
// Lines of title fields
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
@ -1532,7 +1535,9 @@ if ($resql) {
|
|||||||
$totalarray = array('nbfield' => 0, 'val' => array(), 'pos' => array());
|
$totalarray = array('nbfield' => 0, 'val' => array(), 'pos' => array());
|
||||||
$totalarray['val']['cf.total_ht'] = 0;
|
$totalarray['val']['cf.total_ht'] = 0;
|
||||||
$totalarray['val']['cf.total_ttc'] = 0;
|
$totalarray['val']['cf.total_ttc'] = 0;
|
||||||
while ($i < min($num, $limit)) {
|
|
||||||
|
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||||
|
while ($i < $imaxinloop) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$notshippable = 0;
|
$notshippable = 0;
|
||||||
@ -1855,6 +1860,17 @@ if ($resql) {
|
|||||||
// Show total line
|
// Show total line
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
||||||
|
|
||||||
|
// If no record found
|
||||||
|
if ($num == 0) {
|
||||||
|
$colspan = 1;
|
||||||
|
foreach ($arrayfields as $key => $val) {
|
||||||
|
if (!empty($val['checked'])) {
|
||||||
|
$colspan++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||||
@ -1876,8 +1892,8 @@ if ($resql) {
|
|||||||
$urlsource .= str_replace('&', '&', $param);
|
$urlsource .= str_replace('&', '&', $param);
|
||||||
|
|
||||||
$filedir = $diroutputmassaction;
|
$filedir = $diroutputmassaction;
|
||||||
$genallowed = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire);
|
$genallowed = $permissiontoread;
|
||||||
$delallowed = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
|
$delallowed = $permissiontoadd;
|
||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_supplier_order', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
|
print $formfile->showdocuments('massfilesarea_supplier_order', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user