diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index aedd91a34eb..d3afd4035e4 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -99,6 +99,8 @@ if ($action == 'update') { $error = 0; if ($mode == 'template') { + //dolibarr_del_const($db, "MAIN_THEME", 0); // To be sure we don't have this constant set for all entities + dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 1e4c4d2e78a..b4e1f19554e 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1821,8 +1821,9 @@ if ($resql) { $total_ht = 0; $total_margin = 0; + $imaxinloop = ($limit ? min($num, $limit) : $num); $last_num = min($num, $limit); - while ($i < $last_num) { + while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); $notshippable = 0; @@ -2457,6 +2458,17 @@ if ($resql) { // Show total line 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 '
';
diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php
index 39103fdbb0a..1439ce73afe 100644
--- a/htdocs/core/tpl/commonfields_edit.tpl.php
+++ b/htdocs/core/tpl/commonfields_edit.tpl.php
@@ -63,9 +63,11 @@ foreach ($object->fields as $key => $val) {
}
print ' | ';
print ''; + if (!empty($val['picto'])) { print img_picto('', $val['picto'], '', false, 0, 0, '', 'pictofixedwidth'); } + if (in_array($val['type'], array('int', 'integer'))) { $value = GETPOSTISSET($key) ?GETPOST($key, 'int') : $object->$key; } elseif ($val['type'] == 'double') { @@ -78,6 +80,8 @@ foreach ($object->fields as $key => $val) { $check = 'restricthtml'; } $value = GETPOSTISSET($key) ? GETPOST($key, $check) : $object->$key; + } elseif (in_array($val['type'], array('date', 'datetime'))) { + $value = GETPOSTISSET($key) ? dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')) : $object->$key; } elseif ($val['type'] == 'price') { $value = GETPOSTISSET($key) ? price2num(GETPOST($key)) : price2num($object->$key); } elseif ($key == 'lang') { diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index c2962836fa2..e5b7c62aae4 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -294,8 +294,9 @@ $suburi = strstr($uri, '/'); // $suburi contains url without domain:port if ($suburi == '/') { $suburi = ''; // If $suburi is /, it is now '' } -define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...) - +if (!defined('DOL_URL_ROOT')) { + define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...) +} //print DOL_MAIN_URL_ROOT.'-'.DOL_URL_ROOT."\n"; // Define prefix MAIN_DB_PREFIX diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index cc8bae4d907..22c4921b5b1 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -209,6 +209,12 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); $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 @@ -302,9 +308,6 @@ if (empty($reshook)) { // Mass actions $objectclass = 'CommandeFournisseur'; $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; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; @@ -321,7 +324,7 @@ if (empty($reshook)) { $result = $objecttmp->valid($user); if ($result >= 0) { // 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); setEventMessages($langs->trans("SupplierOrderValidatedAndApproved"), array($objecttmp->ref)); } else { @@ -1096,7 +1099,7 @@ if ($resql) { ); 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"); } else { $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) { $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"); } if (in_array($massaction, array('presend', 'predelete', 'createbills'))) { @@ -1119,7 +1122,7 @@ if ($resql) { $url .= '&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 print ' |