diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index a67ad379ca9..5c79be62197 100644 --- a/htdocs/printing/admin/printing.php +++ b/htdocs/printing/admin/printing.php @@ -33,7 +33,9 @@ use OAuth\Common\Storage\DoliStorage; // Load translation files required by the page $langs->loadLangs(array('admin', 'printing', 'oauth')); -if (!$user->admin) accessforbidden(); +if (!$user->admin) { + accessforbidden(); +} $action = GETPOST('action', 'aZ09'); $mode = GETPOST('mode', 'alpha'); @@ -41,9 +43,13 @@ $value = GETPOST('value', 'alpha', 0, null, null, 1); // The value may be __goog $varname = GETPOST('varname', 'alpha'); $driver = GETPOST('driver', 'alpha'); -if (!empty($driver)) $langs->load($driver); +if (!empty($driver)) { + $langs->load($driver); +} -if (!$mode) $mode = 'config'; +if (!$mode) { + $mode = 'config'; +} $OAUTH_SERVICENAME_GOOGLE = 'Google'; @@ -52,21 +58,21 @@ $OAUTH_SERVICENAME_GOOGLE = 'Google'; * Action */ -if (($mode == 'test' || $mode == 'setup') && empty($driver)) -{ +if (($mode == 'test' || $mode == 'setup') && empty($driver)) { setEventMessages($langs->trans('PleaseSelectaDriverfromList'), null); header("Location: ".$_SERVER['PHP_SELF'].'?mode=config'); exit; } -if ($action == 'setconst' && $user->admin) -{ +if ($action == 'setconst' && $user->admin) { $error = 0; $db->begin(); foreach ($_POST['setupdriver'] as $setupconst) { //print '
'.print_r($setupconst, true).''; $result = dolibarr_set_const($db, $setupconst['varname'], $setupconst['value'], 'chaine', 0, '', $conf->entity); - if (!$result > 0) $error++; + if (!$result > 0) { + $error++; + } } if (!$error) { @@ -79,12 +85,13 @@ if ($action == 'setconst' && $user->admin) $action = ''; } -if ($action == 'setvalue' && $user->admin) -{ +if ($action == 'setvalue' && $user->admin) { $db->begin(); $result = dolibarr_set_const($db, $varname, $value, 'chaine', 0, '', $conf->entity); - if (!$result > 0) $error++; + if (!$result > 0) { + $error++; + } if (!$error) { $db->commit(); @@ -110,8 +117,7 @@ print load_fiche_titre($langs->trans("PrintingSetup"), $linkback, 'title_setup') $head = printingAdminPrepareHead($mode); -if ($mode == 'setup' && $user->admin) -{ +if ($mode == 'setup' && $user->admin) { print ''; } -if ($mode == 'config' && $user->admin) -{ +if ($mode == 'config' && $user->admin) { print dol_get_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic'); print $langs->trans("PrintingDesc")."