Fixing style errors.

This commit is contained in:
stickler-ci 2021-03-01 20:00:32 +00:00
parent 32ef55cd9e
commit 54d35fa59f
4 changed files with 34 additions and 46 deletions

View File

@ -105,7 +105,6 @@ if ($action == 'set') {
if ($resultCreat<0) { if ($resultCreat<0) {
setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
} }
} elseif ($action == 'specimen') { // For orders } elseif ($action == 'specimen') { // For orders
$modele = GETPOST('module', 'alpha'); $modele = GETPOST('module', 'alpha');

View File

@ -158,8 +158,7 @@ if (($action == 'add' || (GETPOST('add') && $action != 'update')) || GETPOST('ac
$defaultvalue = ''; $defaultvalue = '';
} }
} }
if (GETPOST('actionmodify')) if (GETPOST('actionmodify')) {
{
$object->id=$id; $object->id=$id;
$object->type=$mode; $object->type=$mode;
$object->page=$urlpage; $object->page=$urlpage;
@ -182,8 +181,7 @@ if (($action == 'add' || (GETPOST('add') && $action != 'update')) || GETPOST('ac
} }
// Delete line from delete picto // Delete line from delete picto
if ($action == 'delete') if ($action == 'delete') {
{
$object->id=$id; $object->id=$id;
$result=$object->delete($user); $result=$object->delete($user);
if ($result<0) { if ($result<0) {
@ -359,7 +357,6 @@ print '</tr>';
$result=$object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type'=>$mode,'t.entity'=>array($user->entity,$conf->entity))); $result=$object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type'=>$mode,'t.entity'=>array($user->entity,$conf->entity)));
if (!is_array($result) && $result<0) { if (!is_array($result) && $result<0) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} elseif (count($result)>0) { } elseif (count($result)>0) {
foreach ($result as $key=>$defaultvalue) { foreach ($result as $key=>$defaultvalue) {

View File

@ -148,23 +148,17 @@ class DefaultValues extends CommonObject
if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0;
// Unset fields that are disabled // Unset fields that are disabled
foreach ($this->fields as $key => $val) foreach ($this->fields as $key => $val) {
{ if (isset($val['enabled']) && empty($val['enabled'])) {
if (isset($val['enabled']) && empty($val['enabled']))
{
unset($this->fields[$key]); unset($this->fields[$key]);
} }
} }
// Translate some data of arrayofkeyval // Translate some data of arrayofkeyval
if (is_object($langs)) if (is_object($langs)) {
{ foreach ($this->fields as $key => $val) {
foreach ($this->fields as $key => $val) if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
{ foreach ($val['arrayofkeyval'] as $key2 => $val2) {
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval']))
{
foreach ($val['arrayofkeyval'] as $key2 => $val2)
{
$this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2);
} }
} }
@ -300,8 +294,7 @@ class DefaultValues extends CommonObject
if ($resql) { if ($resql) {
$num = $this->db->num_rows($resql); $num = $this->db->num_rows($resql);
$i = 0; $i = 0;
while ($i < ($limit ? min($limit, $num) : $num)) while ($i < ($limit ? min($limit, $num) : $num)) {
{
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$record = new self($this->db); $record = new self($this->db);

View File

@ -612,7 +612,6 @@ class User extends CommonObject
{ {
global $conf; global $conf;
if (!empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) { if (!empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) {
// Load user->default_values for user. TODO Save this in memcached ? // Load user->default_values for user. TODO Save this in memcached ?
require_once DOL_DOCUMENT_ROOT.'/core/class/defaultvalues.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/defaultvalues.class.php';