From 1b9039af36f318fec9d39ccba8884d3bcad71006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 26 Nov 2015 20:30:11 +0100 Subject: [PATCH 1/5] Update list.php --- htdocs/resource/list.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 29ae4a42803..9a19809d5d7 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -22,15 +22,10 @@ */ -// Change this following line to use the correct relative path (../, ../../, etc) -$res=0; -$res=@include("../main.inc.php"); // For root directory -if (! $res) $res=@include("../../main.inc.php"); // For "custom" directory -if (! $res) die("Include of main fails"); +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/resource/class/resource.class.php'; -require 'class/resource.class.php'; - -// Load traductions files requiredby by page +// Load translations files requiredby by page $langs->load("resource"); $langs->load("companies"); $langs->load("other"); @@ -52,7 +47,7 @@ $object = new Resource($db); $hookmanager->initHooks(array('resource_list')); -if (empty($sortorder)) $sortorder="DESC"; +if (empty($sortorder)) $sortorder="ASC"; if (empty($sortfield)) $sortfield="t.rowid"; if (empty($arch)) $arch = 0; @@ -89,8 +84,6 @@ llxHeader('',$pagetitle,''); $form=new Form($db); -print_fiche_titre($pagetitle,'','title_generic'); - // Confirmation suppression resource line if ($action == 'delete_resource') { @@ -102,6 +95,8 @@ $ret = $object->fetch_all($sortorder, $sortfield, $limit, $offset); if($ret == -1) { dol_print_error($db,$object->error); exit; +} else { + print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $ret+1, $object->num_all,'title_generic.png'); } if(!$ret) { print '
'.$langs->trans('NoResourceInDatabase').'
'; From e6033369a8501e5fbe2473c6f068792641743996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 26 Nov 2015 20:33:07 +0100 Subject: [PATCH 2/5] Update resource.class.php --- htdocs/resource/class/resource.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/resource/class/resource.class.php b/htdocs/resource/class/resource.class.php index 3c3f0ee6e49..e42b8983c7a 100644 --- a/htdocs/resource/class/resource.class.php +++ b/htdocs/resource/class/resource.class.php @@ -22,7 +22,6 @@ */ -// Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; require_once DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"; @@ -403,7 +402,13 @@ class Resource extends CommonObject } $sql.= " GROUP BY t.rowid"; $sql.= $this->db->order($sortfield,$sortorder); - if ($limit) $sql.= $this->db->plimit($limit+1,$offset); + $this->num_all = 0; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { + $result = $this->db->query($sql); + $this->num_all = $this->db->num_rows($result); + } + if ($limit) $sql.= $this->db->plimit($limit, $offset); dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); $resql=$this->db->query($sql); From cbcb79b1eb513ed65dbcaf0fed2347252035f290 Mon Sep 17 00:00:00 2001 From: phf Date: Fri, 27 Nov 2015 16:58:28 +0100 Subject: [PATCH 3/5] FIX jquery select of project generate js error on change event --- htdocs/core/class/html.formprojet.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index b44a30dcd05..2b7f76dedf9 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -148,7 +148,7 @@ class FormProjets if (! empty($conf->use_javascript_ajax)) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); + $comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); $out.=$comboenhancement; $nodatarole=($comboenhancement?' data-role="none"':''); $minmax='minwidth100 maxwidth300'; From 4a0ea9777239108a32bf6aad2f4a1b513f3b612f Mon Sep 17 00:00:00 2001 From: fappels Date: Sun, 29 Nov 2015 15:34:43 +0100 Subject: [PATCH 4/5] FIX #3953 rounding of buying price fix javascript for rounding of buying price --- htdocs/core/tpl/objectline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 962ecd8acaa..fd5a81240ef 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -554,7 +554,7 @@ jQuery(document).ready(function() { /* Define default price at loading */ var defaultprice = $("#fournprice_predef").find('option:selected').attr("price"); - $("#buying_price").val(Math.round(defaultprice,global->MAIN_MAX_DECIMALS_UNIT ? $conf->global->MAIN_MAX_DECIMALS_UNIT : 5); ?>)); + $("#buying_price").val(parseFloat(defaultprice).toFixed(global->MAIN_MAX_DECIMALS_UNIT ? $conf->global->MAIN_MAX_DECIMALS_UNIT : 5); ?>)); $("#fournprice_predef").change(function() { console.log("change on fournprice_predef"); From eb504ffacc7ac1c305d78c8f0d6a5e9cdb4617b9 Mon Sep 17 00:00:00 2001 From: ricardomm Date: Wed, 2 Dec 2015 11:53:23 +0100 Subject: [PATCH 5/5] minor fix accessing $db --- htdocs/product/class/product.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 4253d2c0e48..429990f7010 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3314,23 +3314,23 @@ class Product extends CommonObject if (! empty($conf->commande->enabled)) { $result=$this->load_stats_commande(0,'1,2'); - if ($result < 0) dol_print_error($db,$this->error); + if ($result < 0) dol_print_error($this->db,$this->error); $stock_commande_client=$this->stats_commande['qty']; } if (! empty($conf->expedition->enabled)) { $result=$this->load_stats_sending(0,'1,2'); - if ($result < 0) dol_print_error($db,$this->error); + if ($result < 0) dol_print_error($this->db,$this->error); $stock_sending_client=$this->stats_expedition['qty']; } if (! empty($conf->fournisseur->enabled)) { $result=$this->load_stats_commande_fournisseur(0,'1,2,3,4'); - if ($result < 0) dol_print_error($db,$this->error); + if ($result < 0) dol_print_error($this->db,$this->error); $stock_commande_fournisseur=$this->stats_commande_fournisseur['qty']; $result=$this->load_stats_reception(0,'4'); - if ($result < 0) dol_print_error($db,$this->error); + if ($result < 0) dol_print_error($this->db,$this->error); $stock_reception_fournisseur=$this->stats_reception['qty']; }