From 9b64fbaa9839d6f8c290b1a0e0bf289e76bed9f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Nov 2016 16:26:18 +0100 Subject: [PATCH 1/7] Fix having the css of extrafield on td is not enough to detect it. We must have it on tr too. --- 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 83bbdda4a41..018aef19519 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4394,12 +4394,12 @@ abstract class CommonObject } if ( !empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) { - $out .= ''; + $out .= ''; $colspan='0'; } else { - $out .= ''; + $out .= ''; } // Convert date into timestamp format if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) From f5d76ac0c70cd0334a5d25d47bdc3bb0e6c82590 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Nov 2016 17:20:21 +0100 Subject: [PATCH 2/7] Fix count of contact was not complete --- htdocs/contact/class/contact.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 6a9a7df7b5e..67039fb2bef 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -122,15 +122,16 @@ class Contact extends CommonObject $sql = "SELECT count(sp.rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (sp.fk_soc = s.rowid)"; if (!$user->rights->societe->client->voir && !$user->societe_id) { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; + $sql.= " OUTER JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid"; + $sql.= " OUTER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql.= " WHERE sc.fk_user = " .$user->id; $clause = "AND"; } - $sql.= ' '.$clause.' s.entity IN ('.getEntity($this->element, 1).')'; - + $sql.= ' '.$clause.' sp.entity IN ('.getEntity($this->element, 1).')'; + if ($user->societe_id > 0) $sql.=" AND sp.fk_soc = ".$user->societe_id; + $resql=$this->db->query($sql); if ($resql) { From 15351a5a512fb158e49ee3fc4f2677f08fdca708 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Nov 2016 18:20:27 +0100 Subject: [PATCH 3/7] Fxi firstadmin param must take first active admin --- scripts/cron/cron_run_jobs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index e10d089c2a8..d60218fba22 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -82,7 +82,7 @@ if ($key != $conf->global->CRON_KEY) // If param userlogin is reserved word 'firstadmin' if ($userlogin == 'firstadmin') { - $sql='SELECT login from '.MAIN_DB_PREFIX.'user WHERE admin = 1 ORDER BY entity LIMIT 1'; + $sql='SELECT login from '.MAIN_DB_PREFIX.'user WHERE admin = 1 and statut = 1 ORDER BY entity LIMIT 1'; $resql=$db->query($sql); if ($resql) { From 90881f2fa9a7ee022a4d1416e45aaa140bc1ab3c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Nov 2016 00:09:53 +0100 Subject: [PATCH 4/7] FIX Sanitize title of ajax_dialog --- htdocs/core/lib/ajax.lib.php | 3 ++- htdocs/main.inc.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 4b0ae91ee3f..3914b59b9f6 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -322,7 +322,8 @@ function ajax_dialog($title,$message,$w=350,$h=150) { global $langs; - $msg= '
'; + $newtitle=dol_textishtml($title)?dol_string_nohtmltag($title,1):$title; + $msg= '
'; $msg.= $message; $msg.= '
'."\n"; $msg.= '