diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index e8208fd6df6c34409912a7fdb8b38311bbd52ac2..27b9f08fd9cf6eee6896de27310ab33be66a08de 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -246,11 +246,11 @@ class Contact extends CommonObject $sql .= ", poste='".$this->db->escape($this->poste)."'"; $sql .= ", fax='".$this->db->escape($this->fax)."'"; $sql .= ", email='".$this->db->escape($this->email)."'"; - $sql .= ", note='".$this->db->escape($this->note)."'"; - $sql .= ", phone = '".$this->db->escape($this->phone_pro)."'"; - $sql .= ", phone_perso = '".$this->db->escape($this->phone_perso)."'"; - $sql .= ", phone_mobile = '".$this->db->escape($this->phone_mobile)."'"; - $sql .= ", jabberid = '".$this->db->escape($this->jabberid)."'"; + $sql .= ", note='".(isset($this->db->escape($this->note))?"'".$this->db->escape($this->note)."'":"null")."'"; + $sql .= ", phone = '".(isset($this->db->escape($this->phone_pro))?"'".$this->db->escape($this->phone_pro)."'":"null")."'"; + $sql .= ", phone_perso = '".(isset($this->db->escape($this->phone_perso))?"'".$this->db->escape($this->phone_perso)."'":"null")."'"; + $sql .= ", phone_mobile = '".(isset($this->db->escape($this->phone_mobile))?"'".$this->db->escape($this->phone_mobile)."'":"null")."'"; + $sql .= ", jabberid = '".(isset($this->db->escape($this->jabberid))?"'".$this->db->escape($this->jabberid)."'":"null")."'"; $sql .= ", priv = '".$this->priv."'"; $sql .= ", fk_user_modif=".($user->id > 0 ? "'".$user->id."'":"null"); $sql .= ", default_lang=".($this->default_lang?"'".$this->default_lang."'":"null"); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 3b16988abe5ecbd54b58052bd9a1dcd35ceb56f0..18becb5d0e4377b0e3b9ab07ea8dd93d84f29efd 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -48,7 +48,7 @@ function print_eldy_menu($db,$atarget,$type_user) // Home $classname=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "home") + if (isset($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "home") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } @@ -76,7 +76,7 @@ function print_eldy_menu($db,$atarget,$type_user) $langs->load("suppliers"); $classname=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "companies") + if (isset($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "companies") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } @@ -110,14 +110,14 @@ function print_eldy_menu($db,$atarget,$type_user) } // Products-Services - $tmpentry=array('enabled'=>($conf->product->enabled || $conf->service->enabled), 'perms'=>($user->rights->produit->lire || $user->rights->service->lire), 'module'=>'product|service'); - $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); - if ($showmode) - { + $tmpentry=array('enabled'=>($conf->product->enabled || $conf->service->enabled), 'perms'=>($user->rights->produit->lire || $user->rights->service->lire), 'module'=>'product|service'); + $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); + if ($showmode) + { $langs->load("products"); $classname=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "products") + if (isset($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } @@ -167,7 +167,7 @@ function print_eldy_menu($db,$atarget,$type_user) $langs->load("commercial"); $classname=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "commercial") + if (isset($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "commercial") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } @@ -209,7 +209,7 @@ function print_eldy_menu($db,$atarget,$type_user) $langs->load("compta"); $classname=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy") + if (isset($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "accountancy") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } @@ -252,7 +252,7 @@ function print_eldy_menu($db,$atarget,$type_user) $langs->load("banks"); $classname=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "bank") + if (isset($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "bank") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } @@ -294,7 +294,7 @@ function print_eldy_menu($db,$atarget,$type_user) $langs->load("projects"); $classname=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "project") + if (isset($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "project") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } @@ -336,7 +336,7 @@ function print_eldy_menu($db,$atarget,$type_user) $langs->load("other"); $classname=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "tools") + if (isset($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "tools") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } @@ -378,7 +378,7 @@ function print_eldy_menu($db,$atarget,$type_user) $langs->load("shop"); $classname=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop") + if (isset($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "shop") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } @@ -406,7 +406,7 @@ function print_eldy_menu($db,$atarget,$type_user) if ($showmode) { $classname=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members") + if (isset($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } @@ -451,10 +451,10 @@ function print_eldy_menu($db,$atarget,$type_user) { $idsel=(empty($newTabMenu[$i]['mainmenu'])?'none':$newTabMenu[$i]['mainmenu']); - $showmode=dol_eldy_showmenu($type_user,$newTabMenu[$i],$listofmodulesforexternal); + $showmode=dol_eldy_showmenu($type_user,$newTabMenu[$i],$listofmodulesforexternal); - if ($showmode == 1) - { + if ($showmode == 1) + { if (preg_match("/^(http:\/\/|https:\/\/)/i",$newTabMenu[$i]['url'])) { $url = $newTabMenu[$i]['url']; @@ -1462,36 +1462,36 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) } -/** - * Function to test if an entry is enabled or not - * - * @param string $type_user 0=We need backoffice menu, 1=We need frontoffice menu - * @param array &$menuentry Array for menu entry - * @param array &$listofmodulesforexternal Array with list of modules allowed to external users - * @return int 0=Hide, 1=Show, 2=Show gray - */ -function dol_eldy_showmenu($type_user, &$menuentry, &$listofmodulesforexternal) -{ - //print 'type_user='.$type_user.' module='.$menuentry['module'].' enabled='.$menuentry['enabled'].' perms='.$menuentry['perms']; - //print 'ok='.in_array($menuentry['module'], $listofmodulesforexternal); - - if (empty($menuentry['enabled'])) return 0; // Entry disabled by condition - if ($type_user && $menuentry['module']) - { - $tmploops=explode('|',$menuentry['module']); - $found=0; - foreach($tmploops as $tmploop) - { - if (in_array($tmploop, $listofmodulesforexternal)) { - $found++; break; - } - } - if (! $found) return 0; // Entry is for menus all excluded to external users - } - if (! $menuentry['perms'] && $type_user) return 0; // No permissions and user is external - if (! $menuentry['perms'] && ! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) return 0; // No permissions and option to hide when not allowed, even for internal user, is on - if (! $menuentry['perms']) return 2; // No permissions and user is external - return 1; +/** + * Function to test if an entry is enabled or not + * + * @param string $type_user 0=We need backoffice menu, 1=We need frontoffice menu + * @param array &$menuentry Array for menu entry + * @param array &$listofmodulesforexternal Array with list of modules allowed to external users + * @return int 0=Hide, 1=Show, 2=Show gray + */ +function dol_eldy_showmenu($type_user, &$menuentry, &$listofmodulesforexternal) +{ + //print 'type_user='.$type_user.' module='.$menuentry['module'].' enabled='.$menuentry['enabled'].' perms='.$menuentry['perms']; + //print 'ok='.in_array($menuentry['module'], $listofmodulesforexternal); + + if (empty($menuentry['enabled'])) return 0; // Entry disabled by condition + if ($type_user && $menuentry['module']) + { + $tmploops=explode('|',$menuentry['module']); + $found=0; + foreach($tmploops as $tmploop) + { + if (in_array($tmploop, $listofmodulesforexternal)) { + $found++; break; + } + } + if (! $found) return 0; // Entry is for menus all excluded to external users + } + if (! $menuentry['perms'] && $type_user) return 0; // No permissions and user is external + if (! $menuentry['perms'] && ! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) return 0; // No permissions and option to hide when not allowed, even for internal user, is on + if (! $menuentry['perms']) return 2; // No permissions and user is external + return 1; } ?> diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index 2fa4c667b9dee88fe2f79d1c9bfd2b93e8527903..1e55a6256f3b1941dd523db303cbbff3bc10fd0c 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -43,6 +43,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode var $prefixcustomer='CU'; var $prefixsupplier='SU'; + var $prefixIsRequired; // Le champ prefix du tiers doit etre renseigne quand on utilise {pre} /** @@ -57,6 +58,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode $this->code_modifiable_invalide = 1; $this->code_modifiable_null = 1; $this->code_auto = 1; + $this->prefixIsRequired = 0; } diff --git a/htdocs/includes/nusoap/lib/Mail/PEAR.php b/htdocs/includes/nusoap/lib/Mail/PEAR.php index 3e0c465b00e8eaba8424a1b5d0af6b8c4c51a85c..406ef9c23baefa425d29bbb4f60fa1613ae905b0 100755 --- a/htdocs/includes/nusoap/lib/Mail/PEAR.php +++ b/htdocs/includes/nusoap/lib/Mail/PEAR.php @@ -559,10 +559,10 @@ class PEAR $ec = 'PEAR_Error'; } if ($skipmsg) { - $a = &new $ec($code, $mode, $options, $userinfo); + $a = new $ec($code, $mode, $options, $userinfo); return $a; } else { - $a = &new $ec($message, $code, $mode, $options, $userinfo); + $a = new $ec($message, $code, $mode, $options, $userinfo); return $a; } } diff --git a/htdocs/includes/nusoap/lib/Mail/mimeDecode.php b/htdocs/includes/nusoap/lib/Mail/mimeDecode.php index 4a09f567c892f6a24f1e90e014754cb5aa3ce1d1..7ac931c2fb4c50620e613e454f5368c922f15495 100755 --- a/htdocs/includes/nusoap/lib/Mail/mimeDecode.php +++ b/htdocs/includes/nusoap/lib/Mail/mimeDecode.php @@ -307,7 +307,7 @@ class Mail_mimeDecode extends PEAR break; case 'message/rfc822': - $obj = &new Mail_mimeDecode($body); + $obj = new Mail_mimeDecode($body); $return->parts[] = $obj->decode(array('include_bodies' => $this->_include_bodies, 'decode_bodies' => $this->_decode_bodies, 'decode_headers' => $this->_decode_headers));