From 5c78eca68a0f4efa1aa5a09b17cbbefddcd74dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 May 2020 21:14:44 +0200 Subject: [PATCH] prepare new rule --- htdocs/comm/action/index.php | 32 +++++++++++++------------------- htdocs/comm/action/peruser.php | 10 ++++------ htdocs/compta/bank/card.php | 16 ++++++++-------- 3 files changed, 25 insertions(+), 33 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 8b852689b99..e0ded511928 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1124,22 +1124,18 @@ if (empty($action) || $action == 'show_month') // View by month // In loops, tmpday contains day nb in current month (can be zero or negative for days of previous month) //var_dump($eventarray); - for ($iter_week = 0; $iter_week < 6; $iter_week++) - { + for ($iter_week = 0; $iter_week < 6; $iter_week++) { echo " \n"; - for ($iter_day = 0; $iter_day < 7; $iter_day++) - { - /* Show days before the beginning of the current month (previous month) */ - if ($tmpday <= 0) - { + for ($iter_day = 0; $iter_day < 7; $iter_day++) { + if ($tmpday <= 0) { + /* Show days before the beginning of the current month (previous month) */ $style = 'cal_other_month cal_past'; - if ($iter_day == 6) $style .= ' cal_other_month_right'; + if ($iter_day == 6) $style .= ' cal_other_month_right'; echo ' '; show_day_events($db, $max_day_in_prev_month + $tmpday, $prev_month, $prev_year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam); echo " \n"; - } /* Show days of the current month */ - elseif ($tmpday <= $max_day_in_month) - { + } elseif ($tmpday <= $max_day_in_month) { + /* Show days of the current month */ $curtime = dol_mktime(0, 0, 0, $month, $tmpday, $year); $style = 'cal_current_month'; if ($iter_day == 6) $style .= ' cal_current_month_right'; @@ -1151,8 +1147,8 @@ if (empty($action) || $action == 'show_month') // View by month echo ' '; show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam); echo " \n"; - } /* Show days after the current month (next month) */ - else { + } else { + /* Show days after the current month (next month) */ $style = 'cal_other_month'; if ($iter_day == 6) $style .= ' cal_other_month_right'; echo ' '; @@ -1169,8 +1165,8 @@ if (empty($action) || $action == 'show_month') // View by month print ''; print ''; print ''; -} elseif ($action == 'show_week') // View by week -{ +} elseif ($action == 'show_week') { + // View by week $newparam = $param; // newparam is for birthday links $newparam = preg_replace('/showbirthday=/i', 'showbirthday_=', $newparam); // To avoid replacement when replace day= is done $newparam = preg_replace('/action=show_month&?/i', '', $newparam); @@ -1186,8 +1182,7 @@ if (empty($action) || $action == 'show_month') // View by month print ''; print ' '; $i = 0; - while ($i < 7) - { + while ($i < 7) { echo ' \n"; $i++; } @@ -1195,8 +1190,7 @@ if (empty($action) || $action == 'show_month') // View by month echo " \n"; - for ($iter_day = 0; $iter_day < 7; $iter_day++) - { + for ($iter_day = 0; $iter_day < 7; $iter_day++) { // Show days of the current week $curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd'); $tmparray = dol_getdate($curtime, true); diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index f76503ddc2b..ef2c60e5ae6 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -694,14 +694,13 @@ while ($currentdaytoshow < $lastdaytoshow) { { $event->fetch_userassigned(); $listofuserid = $event->userassigned; - foreach ($listofuserid as $userid => $tmp) - { + foreach ($listofuserid as $userid => $tmp) { if (!in_array($userid, $usernamesid)) $usernamesid[$userid] = $userid; } } } - } /* Use this list to have for all users */ - else { + } else { + /* Use this list to have for all users */ $sql = "SELECT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; if ($usergroup > 0) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user"; @@ -709,8 +708,7 @@ while ($currentdaytoshow < $lastdaytoshow) { if ($usergroup > 0) $sql .= " AND ug.fk_usergroup = ".$usergroup; //print $sql; $resql = $db->query($sql); - if ($resql) - { + if ($resql) { $num = $db->num_rows($resql); $i = 0; if ($num) diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 9459df7579f..c99f303210b 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -553,14 +553,14 @@ if ($action == 'create') print ''; print ''; -} /* ************************************************************************** */ -/* */ -/* Visu et edition */ -/* */ -/* ************************************************************************** */ -else { - if (($_GET["id"] || $_GET["ref"]) && $action != 'edit') - { +} else { + /* ************************************************************************** */ + /* */ + /* Visu et edition */ + /* */ + /* ************************************************************************** */ + + if (($_GET["id"] || $_GET["ref"]) && $action != 'edit') { $object = new Account($db); if ($_GET["id"]) {
'.$langs->trans("Day".(($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7))."