mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 10:21:32 +01:00
Fix some PSR rules
This commit is contained in:
@@ -77,8 +77,7 @@ if ($action == 'updateMask')
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'specimen')
|
||||
elseif ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST('module', 'alpha');
|
||||
|
||||
@@ -122,7 +121,6 @@ else if ($action == 'specimen')
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// Activate a model
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
// Set default model
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
@@ -155,7 +152,6 @@ elseif ($action == 'setdoc')
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
}
|
||||
|
||||
elseif ($action == 'setmod')
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
|
||||
else if ($action == 'setribchq')
|
||||
elseif ($action == 'setribchq')
|
||||
{
|
||||
$rib = GETPOST('rib', 'alpha');
|
||||
$chq = GETPOST('chq', 'alpha');
|
||||
@@ -183,8 +178,7 @@ else if ($action == 'setribchq')
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'set_FACTURE_DRAFT_WATERMARK')
|
||||
elseif ($action == 'set_FACTURE_DRAFT_WATERMARK')
|
||||
{
|
||||
$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
|
||||
|
||||
@@ -219,8 +213,7 @@ else if ($action == 'set_INVOICE_FREE_TEXT')
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setforcedate')
|
||||
elseif ($action == 'setforcedate')
|
||||
{
|
||||
$forcedate = GETPOST('forcedate', 'alpha');
|
||||
|
||||
@@ -237,8 +230,7 @@ else if ($action == 'setforcedate')
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setDefaultPDFModulesByType')
|
||||
elseif ($action == 'setDefaultPDFModulesByType')
|
||||
{
|
||||
$invoicetypemodels = GETPOST('invoicetypemodels');
|
||||
|
||||
|
||||
@@ -69,8 +69,7 @@ if ($action == 'updateMask')
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'specimen')
|
||||
elseif ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST('module', 'alpha');
|
||||
|
||||
@@ -114,14 +113,13 @@ else if ($action == 'specimen')
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setribchq')
|
||||
elseif ($action == 'setribchq')
|
||||
{
|
||||
$rib = GETPOST('rib','alpha');
|
||||
$chq = GETPOST('chq','alpha');
|
||||
$rib = GETPOST('rib', 'alpha');
|
||||
$chq = GETPOST('chq', 'alpha');
|
||||
|
||||
$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_RIB_NUMBER", $rib, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER", $chq, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
@@ -134,8 +132,7 @@ else if ($action == 'setribchq')
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'set_PROPALE_DRAFT_WATERMARK')
|
||||
elseif ($action == 'set_PROPALE_DRAFT_WATERMARK')
|
||||
{
|
||||
$draft = GETPOST('PROPALE_DRAFT_WATERMARK', 'alpha');
|
||||
|
||||
@@ -151,8 +148,7 @@ else if ($action == 'set_PROPALE_DRAFT_WATERMARK')
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'set_PROPOSAL_FREE_TEXT')
|
||||
elseif ($action == 'set_PROPOSAL_FREE_TEXT')
|
||||
{
|
||||
$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');
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setdefaultduration')
|
||||
elseif ($action == 'setdefaultduration')
|
||||
{
|
||||
$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);
|
||||
|
||||
@@ -201,13 +196,11 @@ else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL')
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
elseif ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
@@ -476,7 +469,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '</td>';
|
||||
|
||||
// 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"));
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
|
||||
@@ -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']);
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
|
||||
@@ -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);
|
||||
$result=$object->setDeliveryAddress($_POST['fk_address']);
|
||||
|
||||
@@ -288,8 +288,8 @@ elseif ($modecompta=="BOOKKEEPING")
|
||||
$j=1;
|
||||
$sommes = array();
|
||||
$totPerAccount = array();
|
||||
if (!is_array($cats) && $cats<0) {
|
||||
setEventMessages(null,$AccCat->errors,'errors');
|
||||
if (!is_array($cats) && $cats < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
} elseif (is_array($cats) && count($cats)>0) {
|
||||
foreach ($cats as $cat) // Loop on each group
|
||||
{
|
||||
@@ -315,7 +315,6 @@ elseif ($modecompta=="BOOKKEEPING")
|
||||
$vars[$code] = $det['NP'];
|
||||
}
|
||||
|
||||
|
||||
$result = strtr($formula, $vars);
|
||||
|
||||
//var_dump($result);
|
||||
|
||||
@@ -479,7 +479,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
// 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);
|
||||
if ($result < 0)
|
||||
|
||||
@@ -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);
|
||||
$result=$object->setDeliveryAddress($_POST['fk_address']);
|
||||
|
||||
@@ -438,7 +438,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
// 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);
|
||||
if ($result < 0)
|
||||
|
||||
@@ -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);
|
||||
$result=$object->setDeliveryAddress($_POST['fk_address']);
|
||||
|
||||
@@ -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);
|
||||
$result=$object->setDeliveryAddress($_POST['fk_address']);
|
||||
|
||||
Reference in New Issue
Block a user