diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 257df35828e..895136f82f0 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -67,8 +67,8 @@ $search_note = GETPOST('search_note', 'alpha'); $dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); $datestart = dol_mktime(0, 0, 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int')); $dateend = dol_mktime(0, 0, 0, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int')); -if ($search_status == '' && ! GETPOSTISSET('search_status')) $search_status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); -if (empty($action) && ! GETPOSTISSET('action')) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); +if ($search_status == '' && !GETPOSTISSET('search_status')) $search_status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); +if (empty($action) && !GETPOSTISSET('action')) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); $filter = GETPOST("search_filter", 'alpha', 3) ?GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); $filtert = GETPOST("search_filtert", "int", 3) ?GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3); diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 93ac680484f..11b6717216b 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -388,7 +388,7 @@ class Utils if ($compression == 'none') fclose($handle); if ($compression == 'gz') gzclose($handle); if ($compression == 'bz') bzclose($handle); - if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error + if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error $errormsg = ''; } else diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index c0eb1249012..9ce35616561 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -25,7 +25,7 @@ * \brief Page to make custom reports */ -if (! defined('USE_CUSTOME_REPORT_AS_INCLUDE')) +if (!defined('USE_CUSTOME_REPORT_AS_INCLUDE')) { require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; @@ -37,7 +37,7 @@ if (! defined('USE_CUSTOME_REPORT_AS_INCLUDE')) $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) - $mode = GETPOST('mode', 'alpha') ? GETPOST('mode', 'alpha') : 'graph'; + $mode = GETPOST('mode', 'alpha') ? GETPOST('mode', 'alpha') : 'graph'; $objecttype = GETPOST('objecttype', 'aZ09'); $tabfamily = GETPOST('tabfamily', 'aZ09'); @@ -93,21 +93,21 @@ $parameters = array('objecttype'=>$objecttype, 'tabfamily'=>$tabfamily); $reshook = $hookmanager->executeHooks('loadDataForCustomReports', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); elseif (is_array($hookmanager->resArray)) { - if (! empty($hookmanager->resArray['title'])) { // Add entries for tabs + if (!empty($hookmanager->resArray['title'])) { // Add entries for tabs $title = $hookmanager->resArray['title']; } - if (! empty($hookmanager->resArray['picto'])) { // Add entries for tabs + if (!empty($hookmanager->resArray['picto'])) { // Add entries for tabs $picto = $hookmanager->resArray['picto']; } - if (! empty($hookmanager->resArray['head'])) { // Add entries for tabs + if (!empty($hookmanager->resArray['head'])) { // Add entries for tabs $head = array_merge($head, $hookmanager->resArray['head']); } - if (! empty($hookmanager->resArray['arrayoftype'])) { // Add entries from hook - foreach($hookmanager->resArray['arrayoftype'] as $key => $val) { + if (!empty($hookmanager->resArray['arrayoftype'])) { // Add entries from hook + foreach ($hookmanager->resArray['arrayoftype'] as $key => $val) { $arrayoftype[$key] = $val; } } - if (! empty($hookmanager->resArray['modenotusedforlist'])) { // Show objecttype selection even if objecttype is set + if (!empty($hookmanager->resArray['modenotusedforlist'])) { // Show objecttype selection even if objecttype is set $modenotusedforlist = $hookmanager->resArray['modenotusedforlist']; } } @@ -125,7 +125,7 @@ if ($objecttype) { $ObjectClassName = $arrayoftype[$objecttype]['ObjectClassName']; $object = new $ObjectClassName($db); } - catch(Exception $e) { + catch (Exception $e) { print 'Failed to load class for type '.$objecttype; } } @@ -145,7 +145,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); -$search_component_params=array(''); +$search_component_params = array(''); /* @@ -160,9 +160,9 @@ $search_component_params=array(''); * View */ -$form=new Form($db); +$form = new Form($db); -if (! defined('USE_CUSTOME_REPORT_AS_INCLUDE')) { +if (!defined('USE_CUSTOME_REPORT_AS_INCLUDE')) { llxHeader('', $langs->transnoentitiesnoconv('CustomReports'), ''); dol_fiche_head($head, 'customreports', $title, -1, $picto); @@ -170,13 +170,13 @@ if (! defined('USE_CUSTOME_REPORT_AS_INCLUDE')) { // Check parameters if ($action == 'viewgraph') { - if (! count($search_measures)) { + if (!count($search_measures)) { setEventMessages($langs->trans("AtLeastOneMeasureIsRequired"), null, 'warnings'); } elseif ($mode == 'graph' && count($search_xaxis) > 1) { setEventMessages($langs->trans("OnlyOneFieldForXAxisIsPossible"), null, 'warnings'); $search_xaxis = array(0 => $search_xaxis[0]); } - if (! count($search_xaxis)) { + if (!count($search_xaxis)) { setEventMessages($langs->trans("AtLeastOneXAxisIsRequired"), null, 'warnings'); } elseif ($mode == 'graph' && $search_graph == 'bars' && count($search_measures) > 3) { setEventMessages($langs->trans("GraphInBarsAreLimitedTo3Measures"), null, 'warnings'); @@ -184,11 +184,11 @@ if ($action == 'viewgraph') { } } -$tmparray=dol_getdate(dol_now()); -$endyear=$tmparray['year']; -$endmonth=$tmparray['mon']; -$datelastday=dol_get_last_day($endyear, $endmonth, 1); -$startyear=$endyear-2; +$tmparray = dol_getdate(dol_now()); +$endyear = $tmparray['year']; +$endmonth = $tmparray['mon']; +$datelastday = dol_get_last_day($endyear, $endmonth, 1); +$startyear = $endyear - 2; $param = ''; @@ -207,7 +207,7 @@ print '