From cf857b712ab38ad19d51fc9a0112b85319136c78 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 14 Jun 2015 12:29:47 +0200 Subject: [PATCH 01/72] Fix: select date problem with mobile device (#3039) --- htdocs/compta/bank/virement.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index 9bf4fd9ea2e..66a61850ee8 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur - * Copytight (C) 2005-2009 Regis Houssin + * Copytight (C) 2005-2015 Regis Houssin * Copytight (C) 2012 Juanjo Menent * Copyright (C) 2015 Marcos García * @@ -180,7 +180,7 @@ print $form->select_comptes($account_to,'account_to',0,'',1); print "\n"; print ""; -$form->select_date($dateo,'','','','','add'); +$form->select_date((! empty($dateo)?$dateo:''),'','','','','add'); print "\n"; print ''; print ''; From 05cb1f7ba753af3681983832efbc64f98f7685cb Mon Sep 17 00:00:00 2001 From: fmarcet Date: Tue, 16 Jun 2015 16:59:48 +0200 Subject: [PATCH 02/72] Fix: Date filter on customer orders --- htdocs/societe/consumption.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index d7c8616a273..8512b9b0d12 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -180,7 +180,7 @@ if ($type_element == 'order') $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid; $where.= " AND d.fk_commande = c.rowid"; $where.= " AND c.entity = ".$conf->entity; - $datePrint = 'c.datef'; + $datePrint = 'c.date_commande'; $doc_number='c.ref'; $thirdTypeSelect='customer'; } From 06962cb4e6de35ac7ffde6b239347ebe887c71b2 Mon Sep 17 00:00:00 2001 From: phf Date: Tue, 23 Jun 2015 16:26:05 +0200 Subject: [PATCH 03/72] FIX : tool export handle the type "select" extrafields and return the value instead of id --- htdocs/core/modules/export/export_csv.modules.php | 7 +++++++ htdocs/core/modules/export/export_excel.modules.php | 9 ++++++++- htdocs/core/modules/export/export_tsv.modules.php | 9 ++++++++- htdocs/core/modules/modSociete.class.php | 3 +++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index ce058a93455..58f4f036d5e 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -252,6 +252,13 @@ class ExportCsv extends ModeleExports $newvalue=$this->csv_clean($newvalue,$outputlangs->charset_output); + if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7)) + { + $array = unserialize($typefield); + $array = $array['options']; + $newvalue = $array[$newvalue]; + } + fwrite($this->handle,$newvalue.$this->separator); $this->col++; } diff --git a/htdocs/core/modules/export/export_excel.modules.php b/htdocs/core/modules/export/export_excel.modules.php index 46ab465f42e..6cad56f07bb 100644 --- a/htdocs/core/modules/export/export_excel.modules.php +++ b/htdocs/core/modules/export/export_excel.modules.php @@ -305,7 +305,14 @@ class ExportExcel extends ModeleExports $newvalue=$this->excel_clean($newvalue); $typefield=isset($array_types[$code])?$array_types[$code]:''; - + + if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7)) + { + $array = unserialize($typefield); + $array = $array['options']; + $newvalue = $array[$newvalue]; + } + // Traduction newvalue if (preg_match('/^\((.*)\)$/i',$newvalue,$reg)) { diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php index 409102fd857..a077cc1772e 100644 --- a/htdocs/core/modules/export/export_tsv.modules.php +++ b/htdocs/core/modules/export/export_tsv.modules.php @@ -226,7 +226,14 @@ class ExportTsv extends ModeleExports if (preg_match('/^\((.*)\)$/i',$newvalue,$reg)) $newvalue=$outputlangs->transnoentities($reg[1]); $newvalue=$this->tsv_clean($newvalue,$outputlangs->charset_output); - + + if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7)) + { + $array = unserialize($typefield); + $array = $array['options']; + $newvalue = $array[$newvalue]; + } + fwrite($this->handle,$newvalue.$this->separator); $this->col++; } diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 4367aae3789..ea77a39e21b 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -355,6 +355,9 @@ class modSociete extends DolibarrModules case 'sellist': $typeFilter="List:".$obj->param; break; + case 'select': + $typeFilter="Select:".$obj->param; + break; } $this->export_fields_array[$r][$fieldname]=$fieldlabel; $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; From 582f9cd214b49a0124ce37e0688fc84a1f3cfce0 Mon Sep 17 00:00:00 2001 From: phf Date: Fri, 26 Jun 2015 11:04:08 +0200 Subject: [PATCH 04/72] FIX : keep filter by category or by not enough stock if we switch page --- htdocs/product/reassort.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index e824cd06b13..35e7044157f 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -194,11 +194,11 @@ if ($resql) if ($sref || $snom || $sall || GETPOST('search')) { - print_barre_liste($texte, $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy, $sortfield, $sortorder,'',$num); + print_barre_liste($texte, $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy.(!empty($search_categ) ? '&search_categ='.$search_categ : '').(!empty($toolowstock) ? '&toolowstock='.$toolowstock : ''), $sortfield, $sortorder,'',$num); } else { - print_barre_liste($texte, $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""), $sortfield, $sortorder,'',$num); + print_barre_liste($texte, $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":"").(!empty($search_categ) ? '&search_categ='.$search_categ : '').(!empty($toolowstock) ? '&toolowstock='.$toolowstock : ''), $sortfield, $sortorder,'',$num); } if (! empty($catid)) @@ -342,11 +342,11 @@ if ($resql) { if ($sref || $snom || $sall || GETPOST('search')) { - print_barre_liste('', $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy, $sortfield, $sortorder,'',$num, 0, ''); + print_barre_liste('', $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy.(!empty($search_categ) ? '&search_categ='.$search_categ : '').(!empty($toolowstock) ? '&toolowstock='.$toolowstock : ''), $sortfield, $sortorder,'',$num, 0, ''); } else { - print_barre_liste('', $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":"")."&tosell=".$tosell."&tobuy=".$tobuy, $sortfield, $sortorder,'',$num, 0, ''); + print_barre_liste('', $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":"")."&tosell=".$tosell."&tobuy=".$tobuy.(!empty($search_categ) ? '&search_categ='.$search_categ : '').(!empty($toolowstock) ? '&toolowstock='.$toolowstock : ''), $sortfield, $sortorder,'',$num, 0, ''); } } From ee643ed2a72b6ea648b15f058a9d6a6c0d3f9cfe Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 2 Jul 2015 14:08:16 +0200 Subject: [PATCH 05/72] Fix : Project list was not keeping parameters on sorts --- htdocs/projet/liste.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/projet/liste.php b/htdocs/projet/liste.php index 39fcdb64a01..857d8949c9d 100644 --- a/htdocs/projet/liste.php +++ b/htdocs/projet/liste.php @@ -119,16 +119,23 @@ if ($resql) if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").'

'; else print $langs->trans("ProjectsPublicDesc").'

'; } + + $param=''; + if ($mine) $param.='mode=mine'; + if ($socid) $param.='&socid='.$socid; + if ($search_ref) $param.='&search_ref='.$search_ref; + if ($search_label) $param.='&search_label='.$search_label; + if ($search_societe) $param.='&search_societe='.$search_societe; print '
'; print ''; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.ref","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"p.title","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Visibility"),$_SERVER["PHP_SELF"],"p.public","","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"p.title","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Visibility"),$_SERVER["PHP_SELF"],"p.public","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"",$param,'align="right"',$sortfield,$sortorder); print "\n"; print ''; From c87328b362ec6624ddaa8fc7e914c09d7d5bcf79 Mon Sep 17 00:00:00 2001 From: phf Date: Thu, 2 Jul 2015 17:00:37 +0200 Subject: [PATCH 06/72] FIX : contact country had wrong display if the country dont have translate --- htdocs/contact/class/contact.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index a5c3764fd28..fc6d8ee7ad1 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -555,7 +555,7 @@ class Contact extends CommonObject $this->country_id = $obj->country_id; $this->country_code = $obj->country_id?$obj->country_code:''; - $this->country = ($obj->country_id > 0)?$langs->transnoentitiesnoconv("Country".$obj->country_code):''; + $this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):''; $this->socid = $obj->fk_soc; $this->socname = $obj->socname; From e58957e603b200e24ef48020b4483a64981d3458 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 3 Jul 2015 08:18:32 +0200 Subject: [PATCH 07/72] Fix: broken feature: Check the entity because He may be the same reference in several entities --- htdocs/paypal/lib/paypal.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index b40b0f9fd4c..8323b4aa3eb 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -311,7 +311,7 @@ function getPaypalPaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f } // For multicompany - //$out.="&entity=".$conf->entity; // This should not be into link. Link contains already a ref of an object that allow to retreive entity + $out.="&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities return $out; } From 4fb5af74426d473ce3c65af824f606a9b6594cf1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 3 Jul 2015 10:58:55 +0200 Subject: [PATCH 08/72] Fix: reset the current entity --- htdocs/core/modules/DolibarrModules.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 045bb1ddbcf..cc2680d187c 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1412,7 +1412,6 @@ abstract class DolibarrModules global $conf; $error=0; - $entity=$conf->entity; if (is_array($this->module_parts) && ! empty($this->module_parts)) { @@ -1420,6 +1419,7 @@ abstract class DolibarrModules { if (is_array($value) && count($value) == 0) continue; // Discard empty arrays + $entity=$conf->entity; // Reset the current entity $newvalue = $value; // Serialize array parameters From 4273c4aad9445ac8234802ff96e14ea153e1610f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 3 Jul 2015 11:35:11 +0200 Subject: [PATCH 09/72] Fix: data can be just a value, not an array --- htdocs/core/modules/DolibarrModules.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index cc2680d187c..b2c650e10e1 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1431,6 +1431,11 @@ abstract class DolibarrModules $newvalue = json_encode($value['data']); if (isset($value['entity'])) $entity = $value['entity']; } + else if (isset($value['data']) && !is_array($value['data'])) + { + $newvalue = $value['data']; + if (isset($value['entity'])) $entity = $value['entity']; + } else { $newvalue = json_encode($value); From 5d14d05ce11870e474172fba10198addd7871aa7 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 3 Jul 2015 16:38:54 +0200 Subject: [PATCH 10/72] Fix : Social contribution payment deletion was not deleting the bank line --- htdocs/compta/bank/class/account.class.php | 2 +- .../class/paymentsocialcontribution.class.php | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 8bcabf7f17b..6d1e417f4ea 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1152,7 +1152,7 @@ class AccountLine extends CommonObject if ($this->rappro) { // Protection to avoid any delete of consolidated lines - $this->error="DeleteNotPossibleLineIsConsolidated"; + $this->error="ErrorDeleteNotPossibleLineIsConsolidated"; return -1; } diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index e89f2a273f8..a2640bcbc9c 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -313,17 +313,20 @@ class PaymentSocialContribution extends CommonObject { global $conf, $langs; $error=0; + + dol_syslog(get_class($this)."::delete"); $this->db->begin(); - if (! $error) + if ($this->bank_line > 0) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url"; - $sql.= " WHERE type='payment_sc' AND url_id=".$this->id; - - dol_syslog(get_class($this)."::delete sql=".$sql); - $resql = $this->db->query($sql); - if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + $accline = new AccountLine($this->db); + $accline->fetch($this->bank_line); + $result = $accline->delete(); + if($result < 0) { + $this->errors[] = $accline->error; + $error++; + } } if (! $error) From e82f4c474b36a8d3f653cd3d1ab41f9e19d6ba16 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 3 Jul 2015 22:06:24 +0200 Subject: [PATCH 11/72] Fix: for avoid error with main context hooks, with $langs object for example. --- htdocs/core/ajax/constantonoff.php | 3 ++- htdocs/main.inc.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/ajax/constantonoff.php b/htdocs/core/ajax/constantonoff.php index bbcd19b5234..331a5e87513 100644 --- a/htdocs/core/ajax/constantonoff.php +++ b/htdocs/core/ajax/constantonoff.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2011-2015 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index e432db3e025..8fbd48bc855 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -575,7 +575,7 @@ if (! defined('NOLOGIN')) exit; } else - { + { // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('main')); From 8a36353385a7eecefb2441833f33dc6eeee78f11 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 6 Jul 2015 13:18:51 +0200 Subject: [PATCH 12/72] FIX : when fetch_optionnal_by_label in Extrafields with $this->db cannot work because this->db is never instanciated --- htdocs/core/class/commondocgenerator.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index fbf5363b753..3cc8c553030 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -32,6 +32,18 @@ abstract class CommonDocGenerator { var $error=''; + public $db; + + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) { + $this->db = $db; + return 1; + } /** From b6850e36c92ec80095d60451df57056aa183b1aa Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 6 Jul 2015 16:59:03 +0200 Subject: [PATCH 13/72] fix previous commit --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 3cc8c553030..9e5a00bb650 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -32,7 +32,7 @@ abstract class CommonDocGenerator { var $error=''; - public $db; + protected $db; /** From cba902c5ae4bb19c53831abfa0ee8e67de4c27bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 7 Jul 2015 09:40:23 +0200 Subject: [PATCH 14/72] Fix: [ bug #3055 ] Product image thumbnails were not deleted after deleting the image Close #3055 --- ChangeLog | 1 + htdocs/core/lib/files.lib.php | 1 - .../tpl/document_actions_pre_headers.tpl.php | 21 +++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 28b663e99b3..0002ce6b3fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ make a Dolibarr upgrade. FIX [ bug #2855 ] Wrong translation key in localtax report page FIX [ bug #1852 ] JS error when editing a customer order line FIX [ bug #2900 ] Courtesy title is not stored in create thirdparty form +FIX [ bug #3055 ] Product image thumbnails were not deleted after deleting the image ***** ChangeLog for 3.7.1 compared to 3.7.* ***** FIX Bug in the new photo system diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 4b9e7eb520f..c92d5ab4f25 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -387,7 +387,6 @@ function dol_is_url($url) return false; } - /** * Test if a folder is empty * diff --git a/htdocs/core/tpl/document_actions_pre_headers.tpl.php b/htdocs/core/tpl/document_actions_pre_headers.tpl.php index 36b6ce75fe1..6f8c4782ddc 100644 --- a/htdocs/core/tpl/document_actions_pre_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_pre_headers.tpl.php @@ -1,5 +1,6 @@ + * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -58,7 +59,27 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') if ($urlfile) { + $dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine + $dirthumb = $dir.'/thumbs/'; // Chemin du dossier contenant la vignette + $ret = dol_delete_file($file, 0, 0, 0, $object); + + // Si elle existe, on efface la vignette + if (preg_match('/(\.jpg|\.jpeg|\.bmp|\.gif|\.png|\.tiff)$/i',$file,$regs)) + { + $photo_vignette=basename(preg_replace('/'.$regs[0].'/i','',$file).'_small'.$regs[0]); + if (file_exists(dol_osencode($dirthumb.$photo_vignette))) + { + dol_delete_file($dirthumb.$photo_vignette); + } + + $photo_vignette=basename(preg_replace('/'.$regs[0].'/i','',$file).'_mini'.$regs[0]); + if (file_exists(dol_osencode($dirthumb.$photo_vignette))) + { + dol_delete_file($dirthumb.$photo_vignette); + } + } + if ($ret) { setEventMessage($langs->trans("FileWasRemoved", $urlfile)); } else { From f0f4d8366468c5676a6fb8b3d88521143d6e4c18 Mon Sep 17 00:00:00 2001 From: phf Date: Wed, 8 Jul 2015 12:33:37 +0200 Subject: [PATCH 15/72] FIX translate Jabberid on contact page with edit view --- htdocs/contact/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 3b9a9948889..3aa733f99da 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -769,7 +769,7 @@ else print ''; // Jabberid - print ''; + print ''; print ''; if (! empty($conf->mailing->enabled)) { From 9e7cb70d63a5fcdcb9b073ec011f3b4af8b12c09 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 8 Jul 2015 16:03:15 +0200 Subject: [PATCH 16/72] Fix: missing shared parameters --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 03d044a2ee6..7111b2387bd 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -69,8 +69,8 @@ abstract class CommonObject $sql = "SELECT rowid, ref, ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX.$element; - $sql.= " WHERE entity IN (".getEntity($element).")" ; - + $sql.= " WHERE entity IN (".getEntity($element, true).")" ; + if ($id > 0) $sql.= " AND rowid = ".$db->escape($id); else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'"; else if ($ref_ext) $sql.= " AND ref_ext = '".$db->escape($ref_ext)."'"; From fbf9e6b4b8f29c96092fab10d093b20ead9bd12b Mon Sep 17 00:00:00 2001 From: Darkjeff Date: Tue, 14 Jul 2015 10:06:44 +0200 Subject: [PATCH 17/72] Clean Customer list Clean code Add VAT research If red line no case check Remove comments --- htdocs/accountancy/customer/list.php | 143 ++++++++++----------------- 1 file changed, 54 insertions(+), 89 deletions(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index eb6446ae13d..992dc5ec739 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -41,15 +41,23 @@ $langs->load("main"); $langs->load("accountancy"); $action = GETPOST('action'); + +//Select Box $codeventil = GETPOST('codeventil', 'array'); $mesCasesCochees = GETPOST('mesCasesCochees', 'array'); + +//Search Getpost +$search_invoice = GETPOST('search_invoice','alpha'); $search_ref = GETPOST('search_ref','alpha'); $search_label = GETPOST('search_label','alpha'); $search_desc = GETPOST('search_desc','alpha'); +$search_amount = GETPOST('search_amount','alpha'); +$search_account = GETPOST('search_account','alpha'); +$search_vat = GETPOST('search_vat','alpha'); +//Getpost Order and column and limit page $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); -//Should move to top with all GETPOST $page = GETPOST('page'); if ($page < 0) $page = 0; @@ -61,17 +69,9 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { $limit = $conf->liste_limit; } $offset = $limit * $page; -//End Should move to top with all GETPOST -// TODO : remove comment -//elarifr we can not use only -//$sql .= " ORDER BY l.rowid"; -// f.datef will order like FA08 FA09 FA10 FA05 FA06 FA07 FA04... -// f.facnumber will not order properly invoice / avoir / accompte you can have All AC then All AV and all FA -// l.rowid when an invoice is edited rowid are added at end of table & facturedet.rowid are not ordered -//if (! $sortfield) $sortfield="l.rowid"; if (! $sortfield) $sortfield="f.datef, f.facnumber, l.rowid"; -//if (! $sortorder) $sortorder="DESC"; + if (! $sortorder) { if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) { $sortorder = " DESC "; @@ -86,20 +86,20 @@ if (! $user->rights->accounting->ventilation->dispatch) $formventilation = new FormVentilation($db); -//Defaut AccountingAccount RowId Product / Service -//at this time ACCOUNTING_SERVICE_SOLD_ACCOUNT & ACCOUNTING_PRODUCT_SOLD_ACCOUNT are account number not accountingacount rowid -//so we need to get those default value rowid first $accounting = new AccountingAccount($db); -//TODO: we should need to check if result is a really exist accountaccount rowid..... $aarowid_s = $accounting->fetch('', ACCOUNTING_SERVICE_SOLD_ACCOUNT); $aarowid_p = $accounting->fetch('', ACCOUNTING_PRODUCT_SOLD_ACCOUNT); // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) { $search_ref=''; + $search_invoice=''; $search_label=''; $search_desc=''; + $search_amount=''; + $search_account=''; + $search_vat=''; } /* * View @@ -107,10 +107,6 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both llxHeader('', $langs->trans("Ventilation")); -//debug -//print_r($aarowid_s); -//print_r($aarowid_p); - print ' @@ -133,7 +135,7 @@ print '
'; print_titre($title?$title:$langs->trans("BackupDumpWizard")); -print '
jabberid).'">
'; +print '
'; print ''; print '
'; print $langs->trans("DatabaseName").' : '.$dolibarr_main_db_name.'
'; @@ -148,7 +150,7 @@ print '
';
trans("ExportMethod"); ?>
@@ -160,7 +162,7 @@ print '
';
@@ -182,7 +184,7 @@ print '
';
trans("MySqlExportParameters"); ?> @@ -317,7 +319,7 @@ print '
';
trans("PostgreSqlExportParameters"); ?> @@ -382,9 +384,9 @@ print '
'; value="" />
@@ -394,7 +396,7 @@ echo $file; // Define compressions array $compression=array(); -if ($label == 'MySQL') +if (in_array($type, array('mysql', 'mysqli'))) { $compression['none'] = array('function' => '', 'id' => 'radio_compression_none', 'label' => $langs->trans("None")); $compression['gz'] = array('function' => 'gzopen', 'id' => 'radio_compression_gzip', 'label' => $langs->trans("Gzip")); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6d1b24a2bc1..59645976c7c 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1023,7 +1023,7 @@ NoEventOrNoAuditSetup=No security event has been recorded yet. This can be norma NoEventFoundWithCriteria=No security event has been found for such search criterias. SeeLocalSendMailSetup=See your local sendmail setup BackupDesc=To make a complete backup of Dolibarr, you must: -BackupDesc2=Save content of documents directory (%s) that contains all uploaded and generated files (you can make a zip for example). +BackupDesc2=Save content of documents directory (%s) that contains all uploaded and generated files (So it includes all dump files generated at step 1). BackupDesc3=Save content of your database (%s) into a dump file. For this, you can use following assistant. BackupDescX=Archived directory should be stored in a secure place. BackupDescY=The generated dump file should be stored in a secure place. From 11f434d4223ca21f2ffa591bce5b3a7f8c8fc09a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Jul 2015 01:02:20 +0200 Subject: [PATCH 40/72] Bad css --- htdocs/admin/tools/listevents.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 0ff5e5f1373..6d553f1b236 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -289,7 +289,7 @@ if ($result) if ($num) { print ''; } } From f3c3bb708fe34ec3fe2c403765f9d2cc4b5bc613 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 16 Jul 2015 05:06:46 +0200 Subject: [PATCH 41/72] Move
--- htdocs/product/index.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index b00ed56166d..1b8babd9a36 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -1,9 +1,9 @@ - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2014 Regis Houssin - * Copyright (C) 2014 Charles-Fr BENKE - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2001-2006 Rodolphe Quiedeville + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005-2014 Regis Houssin + * Copyright (C) 2014 Charles-Fr BENKE + * Copyright (C) 2015 Jean-François Ferry * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -330,6 +330,7 @@ if ($result) $db->free($result); print "
"; + print '
'; } } else @@ -395,7 +396,6 @@ function activitytrim($product_type) if ($num > 0 ) { - print '
'; print ''; if ($product_type==0) From 8689b22e144f3cac564f2990ce4b41ed94a463b8 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 16 Jul 2015 05:31:05 +0200 Subject: [PATCH 42/72] Product card: remove old code --- htdocs/product/card.php | 56 ++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index af503d4a924..704a0db9442 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1010,13 +1010,13 @@ else { print '
'; - // PRIX + // Price print ''; print ''; - // MIN PRICE + // Min price print ''; print ''; @@ -1031,28 +1031,21 @@ else print '
'; } - /*if (empty($conf->accounting->enabled) && empty($conf->comptabilite->enabled) && empty($conf->accountingexpert->enabled)) - { - // Don't show accounting field when accounting id disabled. - } - else - {*/ - print '
'.$langs->trans("SellingPrice").''; print $form->selectPriceBaseType($object->price_base_type, "price_base_type"); print '
'.$langs->trans("MinPrice").''; print '
'; + print '
'; - // Accountancy_code_sell - print ''; - print ''; + // Accountancy_code_sell + print ''; + print ''; - // Accountancy_code_buy - print ''; - print ''; + // Accountancy_code_buy + print ''; + print ''; - print '
'.$langs->trans("ProductAccountancySellCode").''; - print '
'.$langs->trans("ProductAccountancySellCode").''; + print '
'.$langs->trans("ProductAccountancyBuyCode").''; - print '
'.$langs->trans("ProductAccountancyBuyCode").''; + print '
'; + print ''; - print '
'; - //} + print '
'; dol_fiche_end(); @@ -1435,22 +1428,15 @@ else print ''."\n"; } - /*if (empty($conf->accounting->enabled) && empty($conf->comptabilite->enabled) && empty($conf->accountingexpert->enabled)) - { - // Don't show accounting field when accounting id disabled. - } - else - {*/ - // Accountancy sell code - print ''.$form->editfieldkey("ProductAccountancySellCode",'accountancy_code_sell',$object->accountancy_code_sell,$object,$user->rights->produit->creer||$user->rights->service->creer,'string').''; - print $form->editfieldval("ProductAccountancySellCode",'accountancy_code_sell',$object->accountancy_code_sell,$object,$user->rights->produit->creer||$user->rights->service->creer,'string'); - print ''; + // Accountancy sell code + print ''.$form->editfieldkey("ProductAccountancySellCode",'accountancy_code_sell',$object->accountancy_code_sell,$object,$user->rights->produit->creer||$user->rights->service->creer,'string').''; + print $form->editfieldval("ProductAccountancySellCode",'accountancy_code_sell',$object->accountancy_code_sell,$object,$user->rights->produit->creer||$user->rights->service->creer,'string'); + print ''; - // Accountancy buy code - print ''.$form->editfieldkey("ProductAccountancyBuyCode",'accountancy_code_buy',$object->accountancy_code_buy,$object,$user->rights->produit->creer||$user->rights->service->creer,'string').''; - print $form->editfieldval("ProductAccountancyBuyCode",'accountancy_code_buy',$object->accountancy_code_buy,$object,$user->rights->produit->creer||$user->rights->service->creer,'string'); - print ''; - //} + // Accountancy buy code + print ''.$form->editfieldkey("ProductAccountancyBuyCode",'accountancy_code_buy',$object->accountancy_code_buy,$object,$user->rights->produit->creer||$user->rights->service->creer,'string').''; + print $form->editfieldval("ProductAccountancyBuyCode",'accountancy_code_buy',$object->accountancy_code_buy,$object,$user->rights->produit->creer||$user->rights->service->creer,'string'); + print ''; // Status (to sell) print ''.$langs->trans("Status").' ('.$langs->trans("Sell").')'; From 214dbc1ce5e496158394656664346ee928f4d429 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 16 Jul 2015 05:33:51 +0200 Subject: [PATCH 43/72] Fix: Opensurvey show description in view mode without fckeditor --- htdocs/opensurvey/card.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index bd0d2cb8a51..35837c0331d 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -220,7 +220,7 @@ else print dol_htmlentities($object->titre); print ''; // Description -print ''.$langs->trans("Description") .''; +print ''.$langs->trans("Description") .''; if ($action == 'edit') { $doleditor=new DolEditor('nouveauxcommentaires', dol_htmlentities($object->commentaires),'',120,'dolibarr_notes','In',1,1,1,ROWS_7,120); @@ -228,12 +228,7 @@ if ($action == 'edit') } else { - if (empty($conf->fckeditor->enabled)) print dol_htmlentitiesbr($object->commentaires); - else - { - $doleditor=new DolEditor('nouveauxcommentaires', dol_htmlentities($object->commentaires),'',120,'dolibarr_notes','In',1,1,1,ROWS_7,120,1); - $doleditor->Create(0,''); - } + print (dol_textishtml($object->commentaires)?$object->commentaires:dol_nl2br($object->commentaires,1,true)); } print ''; From 4ae15adc69c04fd3612263a3007199131a916279 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 16 Jul 2015 06:10:51 +0200 Subject: [PATCH 44/72] Fix: wrong link on leave tabs in user card --- htdocs/core/modules/modHoliday.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index be075f2d57a..94db453b872 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -115,7 +115,7 @@ class modHoliday extends DolibarrModules // 'group' to add a tab in group view // 'contact' to add a tab in contact view // 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) - $this->tabs = array('user:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->write:/holiday/index.php?mainmenu=holiday&id=__ID__'); + $this->tabs = array('user:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->read:/holiday/list.php?mainmenu=holiday&id=__ID__'); // Boxes $this->boxes = array(); // List of boxes @@ -155,14 +155,14 @@ class modHoliday extends DolibarrModules $r++; $this->rights[$r][0] = 20004; // Permission id (must not be already used) - $this->rights[$r][1] = 'Read hollidays for everybody'; // Permission label + $this->rights[$r][1] = 'Read holidays for everybody'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'read_all'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $r++; $this->rights[$r][0] = 20005; // Permission id (must not be already used) - $this->rights[$r][1] = 'Create/modify hollidays for everybody'; // Permission label + $this->rights[$r][1] = 'Create/modify holidays for everybody'; // Permission label $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'write_all'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) From e992a959cd525e0ffa8970ae415164bbaaa82564 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Jul 2015 10:59:00 +0200 Subject: [PATCH 45/72] Fix dbt_select --- htdocs/core/lib/security.lib.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 64e44cafbf4..78f8309a05b 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -351,7 +351,7 @@ function restrictedArea($user, $features, $objectid=0, $tableandshare='', $featu * * @return bool True if user has access, False otherwise */ -function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='', $dbt_select='') +function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='', $dbt_select='rowid') { global $db, $conf; @@ -416,32 +416,32 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh $sql.= " AND s.entity IN (".getEntity($sharedelement, 1).")"; } } - else if (in_array($feature,$checkother)) + else if (in_array($feature,$checkother)) // Test on entity and link to societe. Allowed if link is empty (Ex: contacts...). { // If external user: Check permission for external users if ($user->societe_id > 0) { - $sql = "SELECT dbt.rowid"; + $sql = "SELECT dbt.".$dbt_select; $sql.= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; - $sql.= " WHERE dbt.rowid = ".$objectid; + $sql.= " WHERE dbt.".$dbt_select." = ".$objectid; $sql.= " AND dbt.fk_soc = ".$user->societe_id; } // If internal user: Check permission for internal users that are restricted on their objects else if (! empty($conf->societe->enabled) && ($user->rights->societe->lire && ! $user->rights->societe->client->voir)) { - $sql = "SELECT dbt.rowid"; + $sql = "SELECT dbt.".$dbt_select; $sql.= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON dbt.fk_soc = sc.fk_soc AND sc.fk_user = '".$user->id."'"; - $sql.= " WHERE dbt.rowid = ".$objectid; + $sql.= " WHERE dbt.".$dbt_select." = ".$objectid; $sql.= " AND (dbt.fk_soc IS NULL OR sc.fk_soc IS NOT NULL)"; // Contact not linked to a company or to a company of user $sql.= " AND dbt.entity IN (".getEntity($sharedelement, 1).")"; } // If multicompany and internal users with all permissions, check user is in correct entity else if (! empty($conf->multicompany->enabled)) { - $sql = "SELECT dbt.rowid"; + $sql = "SELECT dbt.".$dbt_select; $sql.= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; - $sql.= " WHERE dbt.rowid = ".$objectid; + $sql.= " WHERE dbt.".$dbt_select." = ".$objectid; $sql.= " AND dbt.entity IN (".getEntity($sharedelement, 1).")"; } } From 9e39c73f5f68f6b46454cb0accff42c819f8fa12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Jul 2015 13:28:40 +0200 Subject: [PATCH 46/72] Better translation --- htdocs/langs/en_US/margins.lang | 5 ++++- htdocs/margin/admin/margin.php | 15 +++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/langs/en_US/margins.lang b/htdocs/langs/en_US/margins.lang index bc7446f51f9..eeaace73523 100644 --- a/htdocs/langs/en_US/margins.lang +++ b/htdocs/langs/en_US/margins.lang @@ -30,10 +30,13 @@ UseDiscountAsProduct=As a product UseDiscountAsService=As a service UseDiscountOnTotal=On subtotal MARGIN_METHODE_FOR_DISCOUNT_DETAILS=Defines if a global discount is treated as a product, a service, or only on subtotal for margin calculation. -MARGIN_TYPE=Margin type +MARGIN_TYPE=Buying/Cost price suggested by default for margin calculation MargeBrute=Raw margin MargeNette=Net margin +MargeType1=Margin on Best supplier price +MargeType2=Margin on Weighted Average Price (WAP) MARGIN_TYPE_DETAILS=Raw margin : Selling price - Buying price
Net margin : Selling price - Cost price +MarginTypeDesc=Margin on best buying price : Selling price - Best supplier price defined on product card
Margin on Weighted Average Price (WAP) : Selling price - Product Weighted Average Price CostPrice=Cost price BuyingCost=Cost price UnitCharges=Unit charges diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index 9a0f55010ab..2ad51c4fb28 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -31,6 +31,7 @@ require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); $langs->load("admin"); $langs->load("bills"); $langs->load("margins"); +$langs->load("stocks"); if (! $user->admin) accessforbidden(); @@ -137,11 +138,13 @@ print ''; print ""; print ''; print ''.$langs->trans("MARGIN_TYPE").''; -print ''.$langs->trans('MargeBrute'); +print ''; print ' global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == '1') print 'checked '; -print '/>
'; +print '/> '; +print $langs->trans('MargeType1'); +print '
'; /*print $langs->trans('MargeNette'); print ' global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == '2') @@ -150,18 +153,18 @@ print '/>';*/ // TODO Check that PMP is available when stock module is not enabled. If not, make this choice greyed when stock module disabled. //if (! empty($conf->stock->enabled)) //{ - print $langs->trans('MargeNette'); print ' global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == 'pmp') print 'checked '; - print '/>'; + print '/> '; + print $langs->trans('MargeType2'); //} print ''; print ''; print ''; print ''; -print ''.$langs->trans('MARGIN_TYPE_DETAILS'); -print ' ('.$langs->trans("PMP").')'; +print ''.$langs->trans('MarginTypeDesc'); +print ' ('.$langs->trans("PMPValueShort").')'; print ''; print ''; print ''; From e6aca8e4d3a0b09b593b530c1b7bb00603e59e98 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Jul 2015 13:51:23 +0200 Subject: [PATCH 47/72] Traduction manquante --- htdocs/langs/en_US/commercial.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang index 7acdc7bd7e6..ba0e9092e57 100644 --- a/htdocs/langs/en_US/commercial.lang +++ b/htdocs/langs/en_US/commercial.lang @@ -94,3 +94,4 @@ StatusProsp=Prospect status DraftPropals=Draft commercial proposals SearchPropal=Search a commercial proposal CommercialDashboard=Commercial summary +NoLimit=No limit \ No newline at end of file From 23673cf46442c1173ca4b4f48a65623332655bf6 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 16 Jul 2015 20:51:22 +0200 Subject: [PATCH 48/72] Fix: ER vat rate don't show in pdf --- htdocs/expensereport/class/expensereport.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 04f5628a224..0a1fe3d9556 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -736,7 +736,7 @@ class ExpenseReport extends CommonObject $this->lines=array(); $sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date,'; - $sql.= ' de.'.$this->fk_element.', de.fk_c_type_fees, de.fk_projet, de.tva_tx as vatrate,'; + $sql.= ' de.'.$this->fk_element.', de.fk_c_type_fees, de.fk_projet, de.tva_tx,'; $sql.= ' de.total_ht, de.total_tva, de.total_ttc,'; $sql.= ' ctf.code as code_type_fees, ctf.label as libelle_type_fees,'; $sql.= ' p.ref as ref_projet, p.title as title_projet'; @@ -773,7 +773,8 @@ class ExpenseReport extends CommonObject $deplig->type_fees_code = $objp->code_type_fees; $deplig->type_fees_libelle = $objp->libelle_type_fees; - $deplig->vatrate = $objp->vatrate; + $deplig->tva_tx = $objp->tva_tx; + $deplig->vatrate = $objp->tva_tx; $deplig->projet_ref = $objp->ref_projet; $deplig->projet_title = $objp->title_projet; From 3b547c0979c3fde1c684c6d3c961fe5bed8b551e Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 16 Jul 2015 21:17:31 +0200 Subject: [PATCH 49/72] Fix: #3244 [Homepage] Last n members link broken --- htdocs/core/boxes/box_members.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index f871226b4e9..9c166aac866 100644 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -105,6 +105,7 @@ class box_members extends ModeleBoxes $memberstatic->lastname=$objp->lastname; $memberstatic->firstname=$objp->firstname; + $memberstatic->id = $objp->rowid; $memberstatic->ref = $objp->rowid; if (! empty($objp->fk_soc)) { From f970494d1ed8c4f51bd2fc6e9282744f9d5d44ad Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 16 Jul 2015 21:29:15 +0200 Subject: [PATCH 50/72] Fix: [Homepage] colspan problem with tasks box --- htdocs/core/boxes/box_task.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index c2425b54b71..bcddc7f00e6 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -122,7 +122,7 @@ class box_task extends ModeleBoxes // Add the sum à the bottom of the boxes - $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" colspan="2" ', 'text' => $langs->trans("Total")." ".$textHead); + $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" ', 'text' => $langs->trans("Total")." ".$textHead); $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks")); $this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5)); $this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5)); From 2d3d78ecc079e4c570b958dc87df127f0d51d95e Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 16 Jul 2015 22:16:11 +0200 Subject: [PATCH 51/72] Fix: #3232 [Agenda] Setup page tab order is weird --- htdocs/core/modules/modAgenda.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 3119553f677..0e8eae911d2 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -5,8 +5,8 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2009-2011 Regis Houssin - * Copyright (C) 2013 Cedric Gross - * Copyright (C) 2015 Bahfir Abbes + * Copyright (C) 2013 Cedric Gross + * Copyright (C) 2015 Bahfir Abbes * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -64,7 +64,7 @@ class modAgenda extends DolibarrModules // Config pages //------------- - $this->config_page_url = array("agenda.php"); + $this->config_page_url = array("agenda_other.php"); // Dependancies //------------- From 440e144892408491fda7b3a1ff0924bd0e94d45a Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 16 Jul 2015 22:29:04 +0200 Subject: [PATCH 52/72] Fix: #3230 [Leaves] Module setup page is useless --- htdocs/core/modules/modHoliday.class.php | 2 +- htdocs/holiday/admin/holiday.php | 71 ------------------------ htdocs/holiday/admin/index.html | 0 3 files changed, 1 insertion(+), 72 deletions(-) delete mode 100644 htdocs/holiday/admin/holiday.php delete mode 100644 htdocs/holiday/admin/index.html diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 11ed1f7c835..fcc4930e34b 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -80,7 +80,7 @@ class modHoliday extends DolibarrModules //$this->style_sheet = '/mymodule/mymodule.css.php'; // Config pages. Put here list of php page names stored in admmin directory used to setup module. - $this->config_page_url = array("holiday.php?leftmenu=setup@holiday"); + // $this->config_page_url = array("holiday.php?leftmenu=setup@holiday"); // Dependencies $this->depends = array(); // List of modules id that must be enabled if this module is enabled diff --git a/htdocs/holiday/admin/holiday.php b/htdocs/holiday/admin/holiday.php deleted file mode 100644 index c1222213b5c..00000000000 --- a/htdocs/holiday/admin/holiday.php +++ /dev/null @@ -1,71 +0,0 @@ - - * Copyright (C) 2011 Dimitri Mouillard - * Copyright (C) 2012 Regis Houssin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * Page module configuration paid holiday. - * - * \file holiday.php - * \ingroup holiday - * \brief Page module configuration paid holiday. - */ - -require '../../main.inc.php'; -require DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; -require_once DOL_DOCUMENT_ROOT. '/core/class/html.form.class.php'; -require_once DOL_DOCUMENT_ROOT. '/user/class/user.class.php'; -require_once DOL_DOCUMENT_ROOT. '/user/class/usergroup.class.php'; - -$action=GETPOST('action'); -$optName=GETPOST('optName'); -$optValue=GETPOST('optValue'); - -$langs->load("admin"); -$langs->load("holiday"); - -// Si pas administrateur -if (! $user->admin) accessforbidden(); - - -/* - * View - */ - -// Vérification si module activé -if (empty($conf->holiday->enabled)) print $langs->trans('NotActiveModCP'); - -llxheader('',$langs->trans('TitleAdminCP')); - -$linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans('ConfCP'), $linkback, 'title_hrm.png'); - -$cp = new Holiday($db); - -print '
'.$langs->trans("GoIntoDictionaryHolidayTypes").'

'; - -$var=!$var; -print '
'.$langs->trans('LastUpdateCP').': '."\n"; -if ($cp->getConfCP('lastUpdate')) print ''.dol_print_date($db->jdate($cp->getConfCP('lastUpdate')),'dayhour','tzuser').''; -else print $langs->trans('None'); -print "

\n"; - - -// Fin de page -llxFooter(); - -if (is_object($db)) $db->close(); \ No newline at end of file diff --git a/htdocs/holiday/admin/index.html b/htdocs/holiday/admin/index.html deleted file mode 100644 index e69de29bb2d..00000000000 From a0d74cc1a1b615cd0adcd9cadc3c82741f9a56cc Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 16 Jul 2015 22:50:50 +0200 Subject: [PATCH 53/72] Fix: #3228 [Export] Missing member ID field in users --- htdocs/core/modules/modUser.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 41598f51106..c55e65e7004 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -210,7 +210,7 @@ class modUser extends DolibarrModules $this->export_label[$r]='Liste des utilisateurs Dolibarr et attributs'; $this->export_permission[$r]=array(array("user","user","export")); $this->export_fields_array[$r]=array('u.rowid'=>"Id",'u.login'=>"Login",'u.lastname'=>"Lastname",'u.firstname'=>"Firstname",'u.office_phone'=>'Phone','u.office_fax'=>'Fax','u.email'=>'EMail','u.datec'=>"DateCreation",'u.tms'=>"DateLastModification",'u.admin'=>"Administrator",'u.statut'=>'Status','u.note'=>"Note",'u.datelastlogin'=>'LastConnexion','u.datepreviouslogin'=>'PreviousConnexion','u.fk_socpeople'=>"IdContact",'u.fk_soc'=>"IdCompany",'u.fk_member'=>"MemberId"); - $this->export_TypeFields_array[$r]=array('u.login'=>"Text",'u.lastname'=>"Text",'u.firstname'=>"Text",'u.office_phone'=>'Text','u.office_fax'=>'Text','u.email'=>'Text','u.datec'=>"Date",'u.tms'=>"Date",'u.admin'=>"Boolean",'u.statut'=>'Status','u.note'=>"Text",'u.datelastlogin'=>'Date','u.datepreviouslogin'=>'Date','u.fk_soc'=>"List:societe:nom:rowid",'u.fk_member'=>"List:adherent:nom"); + $this->export_TypeFields_array[$r]=array('u.login'=>"Text",'u.lastname'=>"Text",'u.firstname'=>"Text",'u.office_phone'=>'Text','u.office_fax'=>'Text','u.email'=>'Text','u.datec'=>"Date",'u.tms'=>"Date",'u.admin'=>"Boolean",'u.statut'=>'Status','u.note'=>"Text",'u.datelastlogin'=>'Date','u.datepreviouslogin'=>'Date','u.fk_soc'=>"List:societe:nom:rowid",'u.fk_member'=>"List:adherent:firstname"); $this->export_entities_array[$r]=array('u.rowid'=>"user",'u.login'=>"user",'u.lastname'=>"user",'u.firstname'=>"user",'u.office_phone'=>'user','u.office_fax'=>'user','u.email'=>'user','u.datec'=>"user",'u.tms'=>"user",'u.admin'=>"user",'u.statut'=>'user','u.note'=>"user",'u.datelastlogin'=>'user','u.datepreviouslogin'=>'user','u.fk_socpeople'=>"contact",'u.fk_soc'=>"company",'u.fk_member'=>"member"); if (empty($conf->adherent->enabled)) { From 5ce419922da68b9199d064973c0fc72bce78e2f4 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 17 Jul 2015 05:22:29 +0200 Subject: [PATCH 54/72] Fix: #3253 #3252 #3251 Remove print_r --- dev/examples/get_contracts.php | 2 +- htdocs/accountancy/admin/productaccount.php | 27 ++++++++++----------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/dev/examples/get_contracts.php b/dev/examples/get_contracts.php index ddfeccb5677..d1be3d9d7bf 100755 --- a/dev/examples/get_contracts.php +++ b/dev/examples/get_contracts.php @@ -73,7 +73,7 @@ $obj->socid=$argv[1]; $listofcontractsforcompany=$obj->getListOfContracts('all'); -print_r($listofcontractsforcompany); +print $listofcontractsforcompany; // -------------------- END OF YOUR CODE -------------------- diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 52c4a0d1862..5a3531af533 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -106,13 +106,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_desc=''; } -//debug move header to top -llxHeader('', $langs->trans("Accounts")); - - //TODO: modify to update all selected product with a sell account if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs->trans("Accountancy_code_sell")) { -//print_r ($changeaccount); $error = 0; $db->begin(); @@ -122,7 +117,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs-> $sql1 .= ' WHERE p.rowid IN (' . implode(',', $changeaccount) . ')'; dol_syslog('accountancy/customer/lines.php::changeaccount product sell sql= ' . $sql1); -print_r ($sql1); + $resql1 = $db->query($sql1); if (! $resql1) { $error ++; @@ -137,7 +132,6 @@ print_r ($sql1); } } - //TODO: modify to update all selected product with a buy account if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs->trans("Accountancy_code_buy")) { $error = 0; @@ -147,9 +141,16 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs-> $sql1 = "UPDATE " . MAIN_DB_PREFIX . "product as p"; $sql1 .= " SET p.accountancy_code_buy=" . $account_number_buy; $sql1 .= ' WHERE p.rowid IN (' . implode(',', $changeaccount) . ')'; -print_r ($sql1); - dol_syslog('accountancy/customer/lines.php::changeaccount product buy sql= ' . $sql1); - $resql1 = $db->query($sql1); + + // Debug + // print_r ($sql1); + + dol_syslog('accountancy/customer/lines.php::changeaccount product buy sql= ' . $sql1); + + // Debug + // print_r ($sql1); + + $resql1 = $db->query($sql1); if (! $resql1) { $error ++; setEventMessage($db->lasterror(), 'errors'); @@ -166,12 +167,10 @@ print_r ($sql1); /* * View */ -//DEBUG elarifr -//llxHeader('', $langs->trans("Accounts")); +llxHeader('', $langs->trans("Accounts")); -//For updating account export +// For updating account export print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; } // jQuery Timepicker if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER'))