Fix some PSR rules

This commit is contained in:
Laurent Destailleur 2019-03-14 16:43:19 +01:00
parent a0d8ba268e
commit cdf6e4b65a
11 changed files with 28 additions and 44 deletions

View File

@ -77,8 +77,7 @@ if ($action == 'updateMask')
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
elseif ($action == 'specimen')
else if ($action == 'specimen')
{ {
$modele=GETPOST('module', 'alpha'); $modele=GETPOST('module', 'alpha');
@ -122,7 +121,6 @@ else if ($action == 'specimen')
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
} }
// Activate a model // Activate a model
elseif ($action == 'set') elseif ($action == 'set')
{ {
@ -137,7 +135,6 @@ elseif ($action == 'del')
if ($conf->global->FACTURE_ADDON_PDF == "$value") dolibarr_del_const($db, 'FACTURE_ADDON_PDF', $conf->entity); if ($conf->global->FACTURE_ADDON_PDF == "$value") dolibarr_del_const($db, 'FACTURE_ADDON_PDF', $conf->entity);
} }
} }
// Set default model // Set default model
elseif ($action == 'setdoc') elseif ($action == 'setdoc')
{ {
@ -155,7 +152,6 @@ elseif ($action == 'setdoc')
$ret = addDocumentModel($value, $type, $label, $scandir); $ret = addDocumentModel($value, $type, $label, $scandir);
} }
} }
elseif ($action == 'setmod') elseif ($action == 'setmod')
{ {
// TODO Verifier si module numerotation choisi peut etre active // TODO Verifier si module numerotation choisi peut etre active
@ -163,8 +159,7 @@ elseif ($action == 'setmod')
dolibarr_set_const($db, "FACTURE_ADDON", $value, 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "FACTURE_ADDON", $value, 'chaine', 0, '', $conf->entity);
} }
elseif ($action == 'setribchq')
else if ($action == 'setribchq')
{ {
$rib = GETPOST('rib', 'alpha'); $rib = GETPOST('rib', 'alpha');
$chq = GETPOST('chq', 'alpha'); $chq = GETPOST('chq', 'alpha');
@ -183,8 +178,7 @@ else if ($action == 'setribchq')
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
elseif ($action == 'set_FACTURE_DRAFT_WATERMARK')
else if ($action == 'set_FACTURE_DRAFT_WATERMARK')
{ {
$draft = GETPOST('FACTURE_DRAFT_WATERMARK', 'alpha'); $draft = GETPOST('FACTURE_DRAFT_WATERMARK', 'alpha');
@ -202,7 +196,7 @@ else if ($action == 'set_FACTURE_DRAFT_WATERMARK')
} }
} }
else if ($action == 'set_INVOICE_FREE_TEXT') elseif ($action == 'set_INVOICE_FREE_TEXT')
{ {
$freetext = GETPOST('INVOICE_FREE_TEXT', 'none'); // No alpha here, we want exact string $freetext = GETPOST('INVOICE_FREE_TEXT', 'none'); // No alpha here, we want exact string
@ -219,8 +213,7 @@ else if ($action == 'set_INVOICE_FREE_TEXT')
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
elseif ($action == 'setforcedate')
else if ($action == 'setforcedate')
{ {
$forcedate = GETPOST('forcedate', 'alpha'); $forcedate = GETPOST('forcedate', 'alpha');
@ -237,8 +230,7 @@ else if ($action == 'setforcedate')
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
elseif ($action == 'setDefaultPDFModulesByType')
else if ($action == 'setDefaultPDFModulesByType')
{ {
$invoicetypemodels = GETPOST('invoicetypemodels'); $invoicetypemodels = GETPOST('invoicetypemodels');

View File

@ -173,7 +173,7 @@ if ($action == 'specimen')
} }
// Set default model // Set default model
else if ($action == 'setdoc') elseif ($action == 'setdoc')
{ {
if (dolibarr_set_const($db, "PAYMENTORDER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) if (dolibarr_set_const($db, "PAYMENTORDER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{ {

View File

@ -69,8 +69,7 @@ if ($action == 'updateMask')
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
elseif ($action == 'specimen')
else if ($action == 'specimen')
{ {
$modele=GETPOST('module', 'alpha'); $modele=GETPOST('module', 'alpha');
@ -114,14 +113,13 @@ else if ($action == 'specimen')
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
} }
} }
elseif ($action == 'setribchq')
else if ($action == 'setribchq')
{ {
$rib = GETPOST('rib','alpha'); $rib = GETPOST('rib', 'alpha');
$chq = GETPOST('chq','alpha'); $chq = GETPOST('chq', 'alpha');
$res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER",$rib,'chaine',0,'',$conf->entity); $res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER", $rib, 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER",$chq,'chaine',0,'',$conf->entity); $res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER", $chq, 'chaine', 0, '', $conf->entity);
if (! $res > 0) $error++; if (! $res > 0) $error++;
@ -134,8 +132,7 @@ else if ($action == 'setribchq')
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
elseif ($action == 'set_PROPALE_DRAFT_WATERMARK')
else if ($action == 'set_PROPALE_DRAFT_WATERMARK')
{ {
$draft = GETPOST('PROPALE_DRAFT_WATERMARK', 'alpha'); $draft = GETPOST('PROPALE_DRAFT_WATERMARK', 'alpha');
@ -151,8 +148,7 @@ else if ($action == 'set_PROPALE_DRAFT_WATERMARK')
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
elseif ($action == 'set_PROPOSAL_FREE_TEXT')
else if ($action == 'set_PROPOSAL_FREE_TEXT')
{ {
$freetext = GETPOST('PROPOSAL_FREE_TEXT', 'none'); // No alpha here, we want exact string $freetext = GETPOST('PROPOSAL_FREE_TEXT', 'none'); // No alpha here, we want exact string
@ -169,8 +165,7 @@ else if ($action == 'set_PROPOSAL_FREE_TEXT')
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
elseif ($action == 'setdefaultduration')
else if ($action == 'setdefaultduration')
{ {
$res = dolibarr_set_const($db, "PROPALE_VALIDITY_DURATION", $value, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "PROPALE_VALIDITY_DURATION", $value, 'chaine', 0, '', $conf->entity);
@ -186,7 +181,7 @@ else if ($action == 'setdefaultduration')
} }
} }
else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL')
{ {
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL", $value, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL", $value, 'chaine', 0, '', $conf->entity);
@ -201,13 +196,11 @@ else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL')
setEventMessages($langs->trans("Error"), null, 'errors'); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }
// Activate a model // Activate a model
else if ($action == 'set') elseif ($action == 'set')
{ {
$ret = addDocumentModel($value, $type, $label, $scandir); $ret = addDocumentModel($value, $type, $label, $scandir);
} }
elseif ($action == 'del') elseif ($action == 'del')
{ {
$ret = delDocumentModel($value, $type); $ret = delDocumentModel($value, $type);
@ -476,7 +469,7 @@ foreach ($dirmodels as $reldir)
print '</td>'; print '</td>';
// Info // Info
$htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip = $langs->trans("Name").': '.$module->name;
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); $htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
if ($module->type == 'pdf') if ($module->type == 'pdf')
{ {

View File

@ -129,7 +129,7 @@ elseif ($action == 'deletecontact' && $user->rights->propale->creer)
} }
} }
/* /*
else if ($action == 'setaddress' && $user->rights->propale->creer) elseif ($action == 'setaddress' && $user->rights->propale->creer)
{ {
$result=$object->setDeliveryAddress($_POST['fk_address']); $result=$object->setDeliveryAddress($_POST['fk_address']);
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);

View File

@ -107,7 +107,7 @@ elseif ($action == 'deletecontact' && $user->rights->commande->creer)
} }
} }
/* /*
else if ($action == 'setaddress' && $user->rights->commande->creer) elseif ($action == 'setaddress' && $user->rights->commande->creer)
{ {
$object->fetch($id); $object->fetch($id);
$result=$object->setDeliveryAddress($_POST['fk_address']); $result=$object->setDeliveryAddress($_POST['fk_address']);

View File

@ -288,8 +288,8 @@ elseif ($modecompta=="BOOKKEEPING")
$j=1; $j=1;
$sommes = array(); $sommes = array();
$totPerAccount = array(); $totPerAccount = array();
if (!is_array($cats) && $cats<0) { if (!is_array($cats) && $cats < 0) {
setEventMessages(null,$AccCat->errors,'errors'); setEventMessages(null, $AccCat->errors, 'errors');
} elseif (is_array($cats) && count($cats)>0) { } elseif (is_array($cats) && count($cats)>0) {
foreach ($cats as $cat) // Loop on each group foreach ($cats as $cat) // Loop on each group
{ {
@ -315,7 +315,6 @@ elseif ($modecompta=="BOOKKEEPING")
$vars[$code] = $det['NP']; $vars[$code] = $det['NP'];
} }
$result = strtr($formula, $vars); $result = strtr($formula, $vars);
//var_dump($result); //var_dump($result);

View File

@ -479,7 +479,7 @@ if (empty($reshook))
} }
} }
// TODO add alternative status // TODO add alternative status
/*else if ($action == 'reopen' && (! empty($user->rights->expedition->creer) || ! empty($user->rights->expedition->shipping_advance->validate))) /*elseif ($action == 'reopen' && (! empty($user->rights->expedition->creer) || ! empty($user->rights->expedition->shipping_advance->validate)))
{ {
$result = $object->setStatut(0); $result = $object->setStatut(0);
if ($result < 0) if ($result < 0)

View File

@ -123,7 +123,7 @@ elseif ($action == 'deletecontact' && $user->rights->expedition->creer)
} }
} }
/* /*
else if ($action == 'setaddress' && $user->rights->expedition->creer) elseif ($action == 'setaddress' && $user->rights->expedition->creer)
{ {
$object->fetch($id); $object->fetch($id);
$result=$object->setDeliveryAddress($_POST['fk_address']); $result=$object->setDeliveryAddress($_POST['fk_address']);

View File

@ -438,7 +438,7 @@ if (empty($reshook))
} }
} }
// TODO add alternative status // TODO add alternative status
/*else if ($action == 'reopen' && (! empty($user->rights->reception->creer) || ! empty($user->rights->reception->reception_advance->validate))) /*elseif ($action == 'reopen' && (! empty($user->rights->reception->creer) || ! empty($user->rights->reception->reception_advance->validate)))
{ {
$result = $object->setStatut(0); $result = $object->setStatut(0);
if ($result < 0) if ($result < 0)

View File

@ -126,7 +126,7 @@ elseif ($action == 'deletecontact' && $user->rights->reception->creer)
} }
} }
/* /*
else if ($action == 'setaddress' && $user->rights->reception->creer) elseif ($action == 'setaddress' && $user->rights->reception->creer)
{ {
$object->fetch($id); $object->fetch($id);
$result=$object->setDeliveryAddress($_POST['fk_address']); $result=$object->setDeliveryAddress($_POST['fk_address']);

View File

@ -110,7 +110,7 @@ elseif ($action == 'deletecontact' && $user->rights->societe->creer)
} }
} }
/* /*
else if ($action == 'setaddress' && $user->rights->societe->creer) elseif ($action == 'setaddress' && $user->rights->societe->creer)
{ {
$object->fetch($id); $object->fetch($id);
$result=$object->setDeliveryAddress($_POST['fk_address']); $result=$object->setDeliveryAddress($_POST['fk_address']);