Correction pour validation Stickler CI / stickler-ci

This commit is contained in:
kamel 2020-04-27 18:01:07 +02:00
parent 4dd42496fa
commit 28d330996c
5 changed files with 44 additions and 42 deletions

View File

@ -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');

View File

@ -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 '<td class="center">';
print $contactstatic->getLibProspLevel();
print "</td>";
if (! $i) $totalarray['nbfield']++;
if (!$i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['p.fk_stcommcontact']['checked']))
{
// Prospect status
print '<td class="center nowrap"><div class="nowrap">';
print '<div class="inline-block">'.$contactstatic->LibProspCommStatut($obj->stcomm_id,2,$contactstatic->cacheprospectstatus[$obj->stcomm_id]['label'], $obj->stcomm_picto);
print '<div class="inline-block">' . $contactstatic->libProspCommStatut($obj->stcomm_id, 2, $contactstatic->cacheprospectstatus[$obj->stcomm_id]['label'], $obj->stcomm_picto);
print '</div> - <div class="inline-block">';
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 '<a class="pictosubstatus" href="'.$_SERVER["PHP_SELF"].'?stcommcontactid='.$obj->rowid.'&stcomm='.$val['code'].'&action=setstcomm'.$param.($page?'&page='.urlencode($page):'').'">'.img_action($titlealt,$val['code'],$val['picto']).'</a>';
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 '<a class="pictosubstatus" href="' . $_SERVER["PHP_SELF"] . '?stcommcontactid=' . $obj->rowid . '&stcomm=' . $val['code'] . '&action=setstcomm' . $param . ($page ? '&page=' . urlencode($page) : '') . '">' . img_action($titlealt, $val['code'], $val['picto']) . '</a>';
}
print '</div></div></td>';
if (! $i) $totalarray['nbfield']++;
if (!$i) $totalarray['nbfield']++;
}
// Extra fields

View File

@ -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 '<form method="post" action="'.$page.'">';
print '<form method="post" action="' . $page . '">';
print '<input type="hidden" name="action" value="setprospectcontactlevel">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
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 '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
if (!empty($htmlname) && $user->admin) print ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">';
print '</form>';
}

View File

@ -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;

View File

@ -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;