diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 2eec5c5a880..41c4504bbf2 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1777,7 +1777,7 @@ class Contact extends CommonObject * @param int $active 1=Active only, 0=Not active only, -1=All * @return int <0 if KO, >0 if OK */ - function loadCacheOfProspStatus($active=1) + public function loadCacheOfProspStatus($active = 1) { global $langs; @@ -1800,7 +1800,7 @@ class Contact extends CommonObject * * @return string Libelle */ - function getLibProspLevel() + public function getLibProspLevel() { return $this->LibProspLevel($this->fk_prospectlevel); } @@ -1811,7 +1811,7 @@ class Contact extends CommonObject * @param int $fk_prospectlevel Prospect level * @return string label of level */ - function LibProspLevel($fk_prospectlevel) + public function LibProspLevel($fk_prospectlevel) { global $langs; @@ -1832,7 +1832,7 @@ class Contact extends CommonObject * @return int <0 if KO, >0 if OK * @deprecated Use update function instead */ - function set_prospect_level(User $user) + public function setProspectLevel(User $user) { return $this->update($this->id, $user); } @@ -1844,9 +1844,9 @@ class Contact extends CommonObject * @param string $label Label to use for status for added status * @return string Libelle */ - function getLibProspCommStatut($mode=0, $label='') + public function getLibProspCommStatut($mode = 0, $label = '') { - return $this->LibProspCommStatut($this->stcomm_id, $mode, $label, $this->stcomm_picto); + return $this->libProspCommStatut($this->stcomm_id, $mode, $label, $this->stcomm_picto); } /** @@ -1856,13 +1856,13 @@ class Contact extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @param string $label Label to use for status for added status * @param string $picto Name of image file to show ('filenew', ...) - * If no extension provided, we use '.png'. Image must be stored into theme/xxx/img directory. - * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img - * Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img - * Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1) + * If no extension provided, we use '.png'. Image must be stored into theme/xxx/img directory. + * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img + * Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img + * Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1) * @return string Libelle du statut */ - function LibProspCommStatut($statut, $mode=0, $label='', $picto='') + public function libProspCommStatut($statut, $mode = 0, $label = '', $picto = '') { global $langs; $langs->load('customers'); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index eb681385973..cb616252705 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -93,7 +93,7 @@ $search_import_key = GETPOST("search_import_key", "alpha"); $search_country = GETPOST("search_country", 'intcomma'); $search_roles = GETPOST("search_roles", 'array'); $search_level = GETPOST("search_level", "array"); -$search_stcomm = GETPOST('search_stcomm','int'); +$search_stcomm = GETPOST('search_stcomm', 'int'); if ($search_status == '') $search_status = 1; // always display active customer first @@ -1010,23 +1010,22 @@ while ($i < min($num, $limit)) print ''; print $contactstatic->getLibProspLevel(); print ""; - if (! $i) $totalarray['nbfield']++; + if (!$i) $totalarray['nbfield']++; } if (! empty($arrayfields['p.fk_stcommcontact']['checked'])) { // Prospect status print '
'; - print '
'.$contactstatic->LibProspCommStatut($obj->stcomm_id,2,$contactstatic->cacheprospectstatus[$obj->stcomm_id]['label'], $obj->stcomm_picto); + print '
' . $contactstatic->libProspCommStatut($obj->stcomm_id, 2, $contactstatic->cacheprospectstatus[$obj->stcomm_id]['label'], $obj->stcomm_picto); print '
-
'; - foreach($contactstatic->cacheprospectstatus as $key => $val) - { - $titlealt='default'; - if (! empty($val['code']) && ! in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt=$val['label']; - if ($obj->stcomm_id != $val['id']) print ''.img_action($titlealt,$val['code'],$val['picto']).''; + foreach ($contactstatic->cacheprospectstatus as $key => $val) { + $titlealt = 'default'; + if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt = $val['label']; + if ($obj->stcomm_id != $val['id']) print '' . img_action($titlealt, $val['code'], $val['picto']) . ''; } print '
'; - if (! $i) $totalarray['nbfield']++; + if (!$i) $totalarray['nbfield']++; } // Extra fields diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index a67edd33df5..e44cfe90208 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -179,32 +179,35 @@ class FormCompany extends Form * @param int $empty Add empty value in list * @return void */ - function form_prospect_contact_level($page, $selected='', $htmlname='prospect_contact_level_id', $empty=0) + function form_prospect_contact_level($page, $selected = '', $htmlname = 'prospect_contact_level_id', $empty = 0) { global $user, $langs; - print '
'; + print ''; print ''; - print ''; + print ''; - dol_syslog(__METHOD__,LOG_DEBUG); + dol_syslog(__METHOD__, LOG_DEBUG); $sql = "SELECT code, label"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_prospectcontactlevel"; - $sql.= " WHERE active > 0"; - $sql.= " ORDER BY sortorder"; + $sql .= " FROM " . MAIN_DB_PREFIX . "c_prospectcontactlevel"; + $sql .= " WHERE active > 0"; + $sql .= " ORDER BY sortorder"; $resql = $this->db->query($sql); if ($resql) { $options = array(); - if ($empty) { + if ($empty) + { $options[''] = ''; } - while ($obj = $this->db->fetch_object($resql)) { + while ($obj = $this->db->fetch_object($resql)) + { $level = $langs->trans($obj->code); - if ($level == $obj->code) { + if ($level == $obj->code) + { $level = $langs->trans($obj->label); } @@ -214,8 +217,8 @@ class FormCompany extends Form print Form::selectarray($htmlname, $options, $selected); } else dol_print_error($this->db); - if (! empty($htmlname) && $user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); - print ''; + if (!empty($htmlname) && $user->admin) print ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); + print ''; print '
'; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b9e5f538c47..5c9ca5f9bdc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3441,13 +3441,13 @@ function img_picto_common($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0 * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $numaction Action id or code to show * @param string $picto Name of image file to show ('filenew', ...) - * If no extension provided, we use '.png'. Image must be stored into theme/xxx/img directory. - * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img - * Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img - * Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1) + * If no extension provided, we use '.png'. Image must be stored into theme/xxx/img directory. + * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img + * Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img + * Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1) * @return string Return an img tag */ -function img_action($titlealt, $numaction, $picto='') +function img_action($titlealt, $numaction, $picto = '') { global $langs; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index b730f24d70c..b8f79c1a079 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3978,13 +3978,13 @@ class Societe extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @param string $label Label to use for status for added status * @param string $picto Name of image file to show ('filenew', ...) - * If no extension provided, we use '.png'. Image must be stored into theme/xxx/img directory. - * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img - * Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img - * Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1) + * If no extension provided, we use '.png'. Image must be stored into theme/xxx/img directory. + * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img + * Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img + * Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1) * @return string Label of prospection status */ - public function LibProspCommStatut($status, $mode = 0, $label = '', $picto='') + public function LibProspCommStatut($status, $mode = 0, $label = '', $picto = '') { // phpcs:enable global $langs;