From b95ab2239f5ddeae6e2092bc6e37d51d5e1343c3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 12 Nov 2012 09:43:12 +0100 Subject: [PATCH 1/2] Fix: remove unused code --- htdocs/compta/sociales/class/chargesociales.class.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 41f93281f85..87d90301fb5 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -407,17 +407,6 @@ class ChargeSociales extends CommonObject $sql = 'SELECT sum(amount) as amount'; $sql.= ' FROM '.MAIN_DB_PREFIX.$table; $sql.= ' WHERE '.$field.' = '.$this->id; - // No need to filter on conf->entity because there is already a filter on the primary key of element. - // getSommePaiement must return list of paiement for this id, whatever is the entity. - // Filtering on entity must be before or later probably - /* - $sql = 'SELECT SUM(pc.amount) as amount'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'paiementcharge as pc'; - $sql.= ', '.MAIN_DB_PREFIX.'chargesociales as c'; - $sql.= ' WHERE c.entity = '.$conf->entity; - $sql.= ' AND pc.fk_charge = c.rowid'; - $sql.= ' AND pc.fk_charge = '.$this->id; - */ dol_syslog(get_class($this)."::getSommePaiement sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); From 5faa7fb075658e15c6f0d2af0cdac589c5dc5bfb Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 12 Nov 2012 19:09:53 +0100 Subject: [PATCH 2/2] Fix: for module name with number --- htdocs/core/class/conf.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 8f3a1080111..ae35425bf09 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -160,19 +160,19 @@ class Conf if ($value && preg_match('/^MAIN_MODULE_/',$key)) { // If this is constant for a new tab page activated by a module. - if (preg_match('/^MAIN_MODULE_([A-Z_]+)_TABS_/i',$key)) + if (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i',$key)) { $params=explode(':',$value,2); $this->tabs_modules[$params[0]][]=$value; } // If this is constant for a sms engine - elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_SMS$/i',$key,$reg)) + elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_SMS$/i',$key,$reg)) { $modulename=strtolower($reg[1]); $this->sms_engine_modules[$modulename]=$modulename; // Add this module in list of modules that provide SMS } // If this is constant for all generic part activated by a module - elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_([A-Z]+)$/i',$key,$reg)) + elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i',$key,$reg)) { $modulename = strtolower($reg[1]); $partname = strtolower($reg[2]); @@ -185,7 +185,7 @@ class Conf $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value)); } // If this is a module constant (must be at end) - elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)$/i',$key,$reg)) + elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)$/i',$key,$reg)) { $modulename=strtolower($reg[1]); if ($modulename == 'propale') $modulename='propal';