";
print '| '.$langs->trans("DateStart").' | ';
- print $form->selectDate($datestart ? $datestart : -1, 'start', '', '', '', 'add', 1, 1);
+ print $form->selectDate(!empty($datestart) ? $datestart : -1, 'start', '', '', '', 'add', 1, 1);
print ' |
';
// Date End
print "";
print '| '.$langs->trans("DateEnd").' | ';
- print $form->selectDate($dateend ? $dateend : -1, 'end', '', '', '', 'add', 1, 1);
+ print $form->selectDate(!empty($dateend) ? $dateend : -1, 'end', '', '', '', 'add', 1, 1);
print ' |
';
// Number of terms
diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php
index 1225f5304be..b664d784e7e 100644
--- a/htdocs/loan/list.php
+++ b/htdocs/loan/list.php
@@ -42,6 +42,7 @@ $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
+$massaction = GETPOST('massaction', 'alpha');
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) {
$page = 0;
} // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
@@ -148,6 +149,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
}
$db->free($resql);
}
+$arrayfields = array();
// Complete request and execute it with limit
$sql .= $db->order($sortfield, $sortorder);
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 8a5aecf1513..ac465b16bd7 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1485,7 +1485,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
}
- if ($type == 1 && $conf->workstation->enabled) {
+ if ($type == 1 && isModEnabled("workstation")) {
// Default workstation
print '| '.$langs->trans("DefaultWorkstation").' | ';
print img_picto($langs->trans("DefaultWorkstation"), 'workstation', 'class="pictofixedwidth"');
diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php
index 10581d19b7c..9946e7a9077 100644
--- a/htdocs/product/reassort.php
+++ b/htdocs/product/reassort.php
@@ -133,7 +133,7 @@ $helpurl = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
$form = new Form($db);
$htmlother = new FormOther($db);
-if ($objp->stock_physique < 0) { print ''; }
+if (!empty($objp->stock_physique) && $objp->stock_physique < 0) { print ''; }
$sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
$sql .= ' p.fk_product_type, p.tms as datem,';
diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php
index 02cbc9af957..11ab664c6c0 100644
--- a/htdocs/reception/contact.php
+++ b/htdocs/reception/contact.php
@@ -72,7 +72,7 @@ if ($origin == 'reception') {
} else {
if ($origin == 'supplierorder' || $origin == 'order_supplier') {
$result = restrictedArea($user, 'fournisseur', $origin_id, 'commande_fournisseur', 'commande');
- } elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
+ } elseif (empty($user->hasRight($origin, "lire")) && empty($user->hasRight($origin, "read"))) {
accessforbidden();
}
}
diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php
index 5a5ccb08bf6..7bf61f3021f 100644
--- a/htdocs/salaries/payments.php
+++ b/htdocs/salaries/payments.php
@@ -97,6 +97,7 @@ $search_chq_number = GETPOST('search_chq_number', 'int');
$filtre = GETPOST("filtre", 'restricthtml');
+$search_type_id = '';
if (!GETPOST('search_type_id', 'int')) {
$newfiltre = str_replace('filtre=', '', $filtre);
$filterarray = explode('-', $newfiltre);
@@ -532,6 +533,7 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar
$i = 0;
$total = 0;
$totalarray = array();
+$totalarray['nbfield'] = 0;
while ($i < ($limit ? min($num, $limit) : $num)) {
$obj = $db->fetch_object($resql);
if (empty($obj)) {
@@ -697,7 +699,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield';
}
- $totalarray['val']['totalttcfield'] += $obj->amount;
+ if (!$i) {
+ $totalarray['val']['totalttcfield'] = $obj->amount;
+ } else {
+ $totalarray['val']['totalttcfield'] += $obj->amount;
+ }
+
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|