prepare new rule
This commit is contained in:
parent
174ddc5fd4
commit
5c78eca68a
@ -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)
|
// In loops, tmpday contains day nb in current month (can be zero or negative for days of previous month)
|
||||||
//var_dump($eventarray);
|
//var_dump($eventarray);
|
||||||
for ($iter_week = 0; $iter_week < 6; $iter_week++)
|
for ($iter_week = 0; $iter_week < 6; $iter_week++) {
|
||||||
{
|
|
||||||
echo " <tr>\n";
|
echo " <tr>\n";
|
||||||
for ($iter_day = 0; $iter_day < 7; $iter_day++)
|
for ($iter_day = 0; $iter_day < 7; $iter_day++) {
|
||||||
{
|
if ($tmpday <= 0) {
|
||||||
/* Show days before the beginning of the current month (previous month) */
|
/* Show days before the beginning of the current month (previous month) */
|
||||||
if ($tmpday <= 0)
|
|
||||||
{
|
|
||||||
$style = 'cal_other_month cal_past';
|
$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 ' <td class="'.$style.' nowrap" width="14%" valign="top">';
|
echo ' <td class="'.$style.' nowrap" width="14%" valign="top">';
|
||||||
show_day_events($db, $max_day_in_prev_month + $tmpday, $prev_month, $prev_year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam);
|
show_day_events($db, $max_day_in_prev_month + $tmpday, $prev_month, $prev_year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam);
|
||||||
echo " </td>\n";
|
echo " </td>\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);
|
$curtime = dol_mktime(0, 0, 0, $month, $tmpday, $year);
|
||||||
$style = 'cal_current_month';
|
$style = 'cal_current_month';
|
||||||
if ($iter_day == 6) $style .= ' cal_current_month_right';
|
if ($iter_day == 6) $style .= ' cal_current_month_right';
|
||||||
@ -1151,8 +1147,8 @@ if (empty($action) || $action == 'show_month') // View by month
|
|||||||
echo ' <td class="'.$style.' nowrap" width="14%" valign="top">';
|
echo ' <td class="'.$style.' nowrap" width="14%" valign="top">';
|
||||||
show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam);
|
show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam);
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
} /* Show days after the current month (next month) */
|
} else {
|
||||||
else {
|
/* Show days after the current month (next month) */
|
||||||
$style = 'cal_other_month';
|
$style = 'cal_other_month';
|
||||||
if ($iter_day == 6) $style .= ' cal_other_month_right';
|
if ($iter_day == 6) $style .= ' cal_other_month_right';
|
||||||
echo ' <td class="'.$style.' nowrap" width="14%" valign="top">';
|
echo ' <td class="'.$style.' nowrap" width="14%" valign="top">';
|
||||||
@ -1169,8 +1165,8 @@ if (empty($action) || $action == 'show_month') // View by month
|
|||||||
print '<input type="hidden" name="actionmove" value="mupdate">';
|
print '<input type="hidden" name="actionmove" value="mupdate">';
|
||||||
print '<input type="hidden" name="backtopage" value="'.dol_escape_htmltag($_SERVER['PHP_SELF']).'?'.dol_escape_htmltag($_SERVER['QUERY_STRING']).'">';
|
print '<input type="hidden" name="backtopage" value="'.dol_escape_htmltag($_SERVER['PHP_SELF']).'?'.dol_escape_htmltag($_SERVER['QUERY_STRING']).'">';
|
||||||
print '<input type="hidden" name="newdate" id="newdate">';
|
print '<input type="hidden" name="newdate" id="newdate">';
|
||||||
} elseif ($action == 'show_week') // View by week
|
} elseif ($action == 'show_week') {
|
||||||
{
|
// View by week
|
||||||
$newparam = $param; // newparam is for birthday links
|
$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('/showbirthday=/i', 'showbirthday_=', $newparam); // To avoid replacement when replace day= is done
|
||||||
$newparam = preg_replace('/action=show_month&?/i', '', $newparam);
|
$newparam = preg_replace('/action=show_month&?/i', '', $newparam);
|
||||||
@ -1186,8 +1182,7 @@ if (empty($action) || $action == 'show_month') // View by month
|
|||||||
print '<table width="100%" class="noborder nocellnopadd cal_pannel cal_month">';
|
print '<table width="100%" class="noborder nocellnopadd cal_pannel cal_month">';
|
||||||
print ' <tr class="liste_titre">';
|
print ' <tr class="liste_titre">';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < 7)
|
while ($i < 7) {
|
||||||
{
|
|
||||||
echo ' <td align="center">'.$langs->trans("Day".(($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7))."</td>\n";
|
echo ' <td align="center">'.$langs->trans("Day".(($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7))."</td>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -1195,8 +1190,7 @@ if (empty($action) || $action == 'show_month') // View by month
|
|||||||
|
|
||||||
echo " <tr>\n";
|
echo " <tr>\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
|
// Show days of the current week
|
||||||
$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd');
|
$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd');
|
||||||
$tmparray = dol_getdate($curtime, true);
|
$tmparray = dol_getdate($curtime, true);
|
||||||
|
|||||||
@ -694,14 +694,13 @@ while ($currentdaytoshow < $lastdaytoshow) {
|
|||||||
{
|
{
|
||||||
$event->fetch_userassigned();
|
$event->fetch_userassigned();
|
||||||
$listofuserid = $event->userassigned;
|
$listofuserid = $event->userassigned;
|
||||||
foreach ($listofuserid as $userid => $tmp)
|
foreach ($listofuserid as $userid => $tmp) {
|
||||||
{
|
|
||||||
if (!in_array($userid, $usernamesid)) $usernamesid[$userid] = $userid;
|
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 = "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";
|
$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";
|
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;
|
if ($usergroup > 0) $sql .= " AND ug.fk_usergroup = ".$usergroup;
|
||||||
//print $sql;
|
//print $sql;
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
if ($num)
|
if ($num)
|
||||||
|
|||||||
@ -553,14 +553,14 @@ if ($action == 'create')
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} /* ************************************************************************** */
|
} else {
|
||||||
/* */
|
/* ************************************************************************** */
|
||||||
/* Visu et edition */
|
/* */
|
||||||
/* */
|
/* Visu et edition */
|
||||||
/* ************************************************************************** */
|
/* */
|
||||||
else {
|
/* ************************************************************************** */
|
||||||
if (($_GET["id"] || $_GET["ref"]) && $action != 'edit')
|
|
||||||
{
|
if (($_GET["id"] || $_GET["ref"]) && $action != 'edit') {
|
||||||
$object = new Account($db);
|
$object = new Account($db);
|
||||||
if ($_GET["id"])
|
if ($_GET["id"])
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user