Search on a specific day is possible into per user view.

This commit is contained in:
Laurent Destailleur 2014-09-06 17:55:33 +02:00
parent bc7d839c64
commit 63bfc093c3
2 changed files with 12 additions and 10 deletions

View File

@ -86,6 +86,14 @@ $type=GETPOST("type");
$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':'');
$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear'));
if ($dateselect > 0)
{
$day=GETPOST('dateselectday');
$month=GETPOST('dateselectmonth');
$year=GETPOST('dateselectyear');
}
$tmp=empty($conf->global->MAIN_DEFAULT_WORKING_HOURS)?'9-18':$conf->global->MAIN_DEFAULT_WORKING_HOURS;
$tmparray=explode('-',$tmp);
$begin_h = GETPOST('begin_h')?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9);
@ -226,7 +234,6 @@ $max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
$tmpday = $first_day;
$nav ="<a href=\"?year=".$prev_year."&amp;month=".$prev_month."&amp;day=".$prev_day.$param."\">".img_previous($langs->trans("Previous"))."</a>\n";
$nav.=" <span id=\"month_name\">".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y").", ".$langs->trans("Week")." ".$week;
$nav.=" </span>\n";
@ -234,6 +241,10 @@ $nav.="<a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;day=".$next_
$nav.=" &nbsp; (<a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
$picto='calendarweek';
$nav.=' &nbsp; <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
$nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
$nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
$nav.='</form>';
// Must be after the nav definition
$param.='&year='.$year.'&month='.$month.($day?'&day='.$day:'');

View File

@ -159,15 +159,6 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '<input type="number" class="short" name="begin_d" value="'.$begin_d.'" min="1" max="7"> - ';
print '<input type="number" class="short" name="end_d" value="'.$end_d.'" min="1" max="7">';
print '</td></tr>';
// Filter on day
print '<tr>';
print '<td class="nowrap">'.$langs->trans("Week").'</td>';
print "<td class='nowrap maxwidthonsmartphone'>";
print '<input type="date" name="day_date" value="';
if (isset($_REQUEST['day_date'])) print $_REQUEST['day_date'];
print '">';
print '</td></tr>';
}
// Hooks