mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-31 14:12:29 +01:00
FIX parameter $action replaced with $mode. $action reserved for action
This commit is contained in:
@@ -1863,23 +1863,23 @@ if ($id > 0) {
|
||||
$linkback = '';
|
||||
// Link to other agenda views
|
||||
$linkback .= img_picto($langs->trans("BackToList"), 'object_list', 'class="hideonsmartphone pictoactionview"');
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback .= '</li>';
|
||||
$linkback .= '<li class="noborder litext">';
|
||||
$linkback .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="hideonsmartphone pictoactionview"');
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewCal").'</a>';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewCal").'</a>';
|
||||
$linkback .= '</li>';
|
||||
$linkback .= '<li class="noborder litext">';
|
||||
$linkback .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone pictoactionview"');
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewWeek").'</a>';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewWeek").'</a>';
|
||||
$linkback .= '</li>';
|
||||
$linkback .= '<li class="noborder litext">';
|
||||
$linkback .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"');
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
$linkback .= '</li>';
|
||||
$linkback .= '<li class="noborder litext">';
|
||||
$linkback .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="hideonsmartphone pictoactionview"');
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewPerUser").'</a>';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?mode=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewPerUser").'</a>';
|
||||
|
||||
//$linkback.=$out;
|
||||
|
||||
|
||||
@@ -1359,7 +1359,7 @@ class ActionComm extends CommonObject
|
||||
$response->warning_delay = $conf->agenda->warning_delay / 60 / 60 / 24;
|
||||
$response->label = $langs->trans("ActionsToDo");
|
||||
$response->labelShort = $langs->trans("ActionsToDoShort");
|
||||
$response->url = DOL_URL_ROOT.'/comm/action/list.php?action=show_list&actioncode=0&status=todo&mainmenu=agenda';
|
||||
$response->url = DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&actioncode=0&status=todo&mainmenu=agenda';
|
||||
if ($user->rights->agenda->allactions->read) {
|
||||
$response->url .= '&filtert=-1';
|
||||
}
|
||||
|
||||
@@ -140,18 +140,18 @@ if ($object->id > 0) {
|
||||
print dol_get_fiche_head($head, 'documents', $langs->trans("Action"), -1, 'action');
|
||||
|
||||
$linkback = img_picto($langs->trans("BackToList"), 'object_list', 'class="hideonsmartphone pictoactionview"');
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
// Link to other agenda views
|
||||
$out = '';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewPerUser").'</a>';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?mode=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewPerUser").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewCal").'</a>';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewCal").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewWeek").'</a>';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewWeek").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
|
||||
$linkback .= $out;
|
||||
|
||||
|
||||
@@ -97,6 +97,11 @@ if (empty($user->rights->agenda->allactions->read) || $filter == 'mine') { // I
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$mode = GETPOST('mode', 'aZ09');
|
||||
if (empty($mode) && preg_match('/show_/', $action)) {
|
||||
$mode = $action; // For backward compatibility
|
||||
}
|
||||
$resourceid = GETPOST("search_resourceid", "int");
|
||||
$year = GETPOST("year", "int") ?GETPOST("year", "int") : date("Y");
|
||||
$month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m");
|
||||
@@ -134,20 +139,20 @@ if ($status == '' && !GETPOSTISSET('search_status')) {
|
||||
|
||||
$defaultview = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
|
||||
$defaultview = (empty($user->conf->AGENDA_DEFAULT_VIEW) ? $defaultview : $user->conf->AGENDA_DEFAULT_VIEW);
|
||||
if (empty($action) && !GETPOSTISSET('action')) {
|
||||
$action = $defaultview;
|
||||
if (empty($mode) && !GETPOSTISSET('mode')) {
|
||||
$mode = $defaultview;
|
||||
}
|
||||
if ($action == 'default') { // When action is default, we want a calendar view and not the list
|
||||
$action = (($defaultview != 'show_list') ? $defaultview : 'show_month');
|
||||
if ($mode == 'default') { // When action is default, we want a calendar view and not the list
|
||||
$mode = (($defaultview != 'show_list') ? $defaultview : 'show_month');
|
||||
}
|
||||
if (GETPOST('viewcal', 'int') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') {
|
||||
$action = 'show_month'; $day = '';
|
||||
if (GETPOST('viewcal', 'int') && GETPOST('mode', 'alpha') != 'show_day' && GETPOST('mode', 'alpha') != 'show_week') {
|
||||
$mode = 'show_month'; $day = '';
|
||||
} // View by month
|
||||
if (GETPOST('viewweek', 'int') || GETPOST('action', 'alpha') == 'show_week') {
|
||||
$action = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d"));
|
||||
if (GETPOST('viewweek', 'int') || GETPOST('mode', 'alpha') == 'show_week') {
|
||||
$mode = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d"));
|
||||
} // View by week
|
||||
if (GETPOST('viewday', 'int') || GETPOST('action', 'alpha') == 'show_day') {
|
||||
$action = 'show_day'; $day = ($day ? $day : date("d"));
|
||||
if (GETPOST('viewday', 'int') || GETPOST('mode', 'alpha') == 'show_day') {
|
||||
$mode = 'show_day'; $day = ($day ? $day : date("d"));
|
||||
} // View by day
|
||||
|
||||
$object = new ActionComm($db);
|
||||
@@ -168,7 +173,7 @@ if ($user->socid && $socid) {
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST("viewlist", 'alpha') || $action == 'show_list') {
|
||||
if (GETPOST("viewlist", 'alpha') || $mode == 'show_list') {
|
||||
$param = '';
|
||||
if (is_array($_POST)) {
|
||||
foreach ($_POST as $key => $val) {
|
||||
@@ -179,14 +184,14 @@ if (GETPOST("viewlist", 'alpha') || $action == 'show_list') {
|
||||
}
|
||||
}
|
||||
if (!preg_match('/action=/', $param)) {
|
||||
$param .= ($param ? '&' : '').'action=show_list';
|
||||
$param .= ($param ? '&' : '').'mode=show_list';
|
||||
}
|
||||
//print $param;
|
||||
header("Location: ".DOL_URL_ROOT.'/comm/action/list.php?'.$param);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (GETPOST("viewperuser", 'alpha') || $action == 'show_peruser') {
|
||||
if (GETPOST("viewperuser", 'alpha') || $mode == 'show_peruser') {
|
||||
$param = '';
|
||||
if (is_array($_POST)) {
|
||||
foreach ($_POST as $key => $val) {
|
||||
@@ -202,7 +207,7 @@ if (GETPOST("viewperuser", 'alpha') || $action == 'show_peruser') {
|
||||
}
|
||||
|
||||
/*
|
||||
if ($action == 'delete_action') {
|
||||
if ($action == 'delete_action' && $user->rights->agenda->delete) {
|
||||
$event = new ActionComm($db);
|
||||
$event->fetch($actionid);
|
||||
$event->fetch_optionals();
|
||||
@@ -307,7 +312,7 @@ if (empty($user->conf->AGENDA_DISABLE_EXT)) {
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($action) || $action == 'show_month') {
|
||||
if (empty($mode) || $mode == 'show_month') {
|
||||
$prev = dol_get_prev_month($month, $year);
|
||||
$prev_year = $prev['year'];
|
||||
$prev_month = $prev['month'];
|
||||
@@ -331,7 +336,7 @@ if (empty($action) || $action == 'show_month') {
|
||||
}
|
||||
$lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'tzuserrel');
|
||||
}
|
||||
if ($action == 'show_week') {
|
||||
if ($mode == 'show_week') {
|
||||
$prev = dol_get_first_day_week($day, $month, $year);
|
||||
$prev_year = $prev['prev_year'];
|
||||
$prev_month = $prev['prev_month'];
|
||||
@@ -356,7 +361,7 @@ if ($action == 'show_week') {
|
||||
|
||||
$tmpday = $first_day;
|
||||
}
|
||||
if ($action == 'show_day') {
|
||||
if ($mode == 'show_day') {
|
||||
$prev = dol_get_prev_day($day, $month, $year);
|
||||
$prev_year = $prev['year'];
|
||||
$prev_month = $prev['month'];
|
||||
@@ -415,13 +420,13 @@ if ($pid) {
|
||||
if ($type) {
|
||||
$param .= "&search_type=".urlencode($type);
|
||||
}
|
||||
if ($action == 'show_day' || $action == 'show_week' || $action == 'show_month') {
|
||||
$param .= '&action='.urlencode($action);
|
||||
}
|
||||
$param .= "&maxprint=".urlencode($maxprint);
|
||||
if ($mode == 'show_day' || $mode == 'show_week' || $mode == 'show_month') {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
}
|
||||
|
||||
// Show navigation bar
|
||||
if (empty($action) || $action == 'show_month') {
|
||||
if (empty($mode) || $mode == 'show_month') {
|
||||
$nav = "<a href=\"?year=".$prev_year."&month=".$prev_month.$param."\"><i class=\"fa fa-chevron-left\"></i></a> \n";
|
||||
$nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $month, 1, $year), "%b %Y");
|
||||
$nav .= " </span>\n";
|
||||
@@ -431,7 +436,7 @@ if (empty($action) || $action == 'show_month') {
|
||||
}
|
||||
$picto = 'calendar';
|
||||
}
|
||||
if ($action == 'show_week') {
|
||||
if ($mode == 'show_week') {
|
||||
$nav = "<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."\"><i class=\"fa fa-chevron-left\" title=\"".dol_escape_htmltag($langs->trans("Previous"))."\"></i></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";
|
||||
@@ -441,8 +446,8 @@ if ($action == 'show_week') {
|
||||
}
|
||||
$picto = 'calendarweek';
|
||||
}
|
||||
if ($action == 'show_day') {
|
||||
$nav = "<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."aaa\"><i class=\"fa fa-chevron-left\"></i></a> \n";
|
||||
if ($mode == 'show_day') {
|
||||
$nav = "<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."\"><i class=\"fa fa-chevron-left\"></i></a> \n";
|
||||
$nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "daytextshort");
|
||||
$nav .= " </span>\n";
|
||||
$nav .= " <a href=\"?year=".$next_year."&month=".$next_month."&day=".$next_day.$param."\"><i class=\"fa fa-chevron-right\"></i></a>\n";
|
||||
@@ -465,16 +470,16 @@ $param .= '&year='.$year.'&month='.$month.($day ? '&day='.$day : '');
|
||||
|
||||
|
||||
/*$tabactive = '';
|
||||
if ($action == 'show_month') $tabactive = 'cardmonth';
|
||||
if ($action == 'show_week') $tabactive = 'cardweek';
|
||||
if ($action == 'show_day') $tabactive = 'cardday';
|
||||
if ($action == 'show_list') $tabactive = 'cardlist';
|
||||
if ($action == 'show_pertuser') $tabactive = 'cardperuser';
|
||||
if ($action == 'show_pertype') $tabactive = 'cardpertype';
|
||||
if ($mode == 'show_month') $tabactive = 'cardmonth';
|
||||
if ($mode == 'show_week') $tabactive = 'cardweek';
|
||||
if ($mode == 'show_day') $tabactive = 'cardday';
|
||||
if ($mode == 'show_list') $tabactive = 'cardlist';
|
||||
if ($mode == 'show_pertuser') $tabactive = 'cardperuser';
|
||||
if ($mode == 'show_pertype') $tabactive = 'cardpertype';
|
||||
*/
|
||||
|
||||
$paramnoaction = preg_replace('/action=[a-z_]+/', '', $param);
|
||||
$paramnoactionodate = preg_replace('/action=[a-z_]+/', '', $paramnodate);
|
||||
$paramnoaction = preg_replace('/mode=[a-z_]+/', '', preg_replace('/action=[a-z_]+/', '', $param));
|
||||
$paramnoactionodate = preg_replace('/mode=[a-z_]+/', '', preg_replace('/action=[a-z_]+/', '', $paramnodate));
|
||||
|
||||
$head = calendars_prepare_head($paramnoaction);
|
||||
|
||||
@@ -483,37 +488,38 @@ if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
}
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
//print dol_get_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
|
||||
//print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, '', $resourceid);
|
||||
//print dol_get_fiche_end();
|
||||
|
||||
$viewmode = '';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle'.($action == 'show_month' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle'.($mode == 'show_month' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_month&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle'.($action == 'show_week' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle'.($mode == 'show_week' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_week&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle'.($action == 'show_day' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle'.($mode == 'show_day' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?mode=show_peruser&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
@@ -536,7 +542,7 @@ $newparam = '';
|
||||
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
|
||||
$tmpforcreatebutton = dol_getdate(dol_now(), true);
|
||||
|
||||
$newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year'];
|
||||
$newparam .= '&month='.((int) $month).'&year='.((int) $tmpforcreatebutton['year']).'&mode='.urlencode($mode);
|
||||
|
||||
//$param='month='.$monthshown.'&year='.$year;
|
||||
$hourminsec = '100000';
|
||||
@@ -554,7 +560,7 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on
|
||||
$s .= 'jQuery(document).ready(function () {'."\n";
|
||||
$s .= 'jQuery(".check_birthday").click(function() { console.log("Toggle birthdays"); jQuery(".family_birthday").toggle(); });'."\n";
|
||||
$s .= 'jQuery(".check_holiday").click(function() { console.log("Toggle holidays"); jQuery(".family_holiday").toggle(); });'."\n";
|
||||
if ($action == "show_week" || $action == "show_month" || empty($action)) {
|
||||
if ($mode == "show_week" || $mode == "show_month" || empty($mode)) {
|
||||
// Code to enable drag and drop
|
||||
$s .= 'jQuery( "div.sortable" ).sortable({connectWith: ".sortable", placeholder: "ui-state-highlight", items: "div.movable", receive: function( event, ui ) {'."\n";
|
||||
// Code to submit form
|
||||
@@ -723,7 +729,7 @@ if ($filtert > 0 || $usergroup > 0) {
|
||||
$sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
|
||||
}
|
||||
//var_dump($day.' '.$month.' '.$year);
|
||||
if ($action == 'show_day') {
|
||||
if ($mode == 'show_day') {
|
||||
$sql .= " AND (";
|
||||
$sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'";
|
||||
$sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')";
|
||||
@@ -901,7 +907,7 @@ if ($showbirthday) {
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'socpeople as sp';
|
||||
$sql .= ' WHERE (priv=0 OR (priv=1 AND fk_user_creat='.((int) $user->id).'))';
|
||||
$sql .= " AND sp.entity IN (".getEntity('socpeople').")";
|
||||
if ($action == 'show_day') {
|
||||
if ($mode == 'show_day') {
|
||||
$sql .= ' AND MONTH(birthday) = '.((int) $month);
|
||||
$sql .= ' AND DAY(birthday) = '.((int) $day);
|
||||
} else {
|
||||
@@ -974,12 +980,12 @@ $sql .= " WHERE u.rowid = x.fk_user";
|
||||
$sql .= " AND u.statut = '1'"; // Show only active users (0 = inactive user, 1 = active user)
|
||||
$sql .= " AND (x.statut = '2' OR x.statut = '3')"; // Show only public leaves (2 = leave wait for approval, 3 = leave approved)
|
||||
|
||||
if ($action == 'show_day') {
|
||||
if ($mode == 'show_day') {
|
||||
// Request only leaves for the current selected day
|
||||
$sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date without time
|
||||
} elseif ($action == 'show_week') {
|
||||
} elseif ($mode == 'show_week') {
|
||||
// TODO: Add filter to reduce database request
|
||||
} elseif ($action == 'show_month') {
|
||||
} elseif ($mode == 'show_month') {
|
||||
// TODO: Add filter to reduce database request
|
||||
}
|
||||
|
||||
@@ -1371,11 +1377,11 @@ print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param,
|
||||
print $s;
|
||||
|
||||
|
||||
if (empty($action) || $action == 'show_month') { // View by month
|
||||
if (empty($mode) || $mode == 'show_month') { // View by month
|
||||
$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);
|
||||
$newparam = preg_replace('/action=show_week&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/mode=show_month&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/mode=show_week&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/day=[0-9]+&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/month=[0-9]+&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/year=[0-9]+&?/i', '', $newparam);
|
||||
@@ -1479,12 +1485,12 @@ if (empty($action) || $action == 'show_month') { // View by month
|
||||
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="newdate" id="newdate">';
|
||||
} elseif ($action == 'show_week') {
|
||||
} elseif ($mode == '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);
|
||||
$newparam = preg_replace('/action=show_week&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/mode=show_month&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/mode=show_week&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/day=[0-9]+&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/month=[0-9]+&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/year=[0-9]+&?/i', '', $newparam);
|
||||
@@ -1544,8 +1550,8 @@ if (empty($action) || $action == 'show_month') { // View by month
|
||||
} else // View by day
|
||||
{
|
||||
$newparam = $param; // newparam is for birthday links
|
||||
$newparam = preg_replace('/action=show_month&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/action=show_week&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/mode=show_month&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/mode=show_week&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/viewday=[0-9]+&?/i', '', $newparam);
|
||||
$newparam .= '&viewday=1';
|
||||
// Code to show just one day
|
||||
@@ -1661,7 +1667,7 @@ $db->close();
|
||||
function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $nonew = 0)
|
||||
{
|
||||
global $user, $conf, $langs;
|
||||
global $action, $filter, $filtert, $status, $actioncode, $usergroup; // Filters used into search form
|
||||
global $action, $mode, $filter, $filtert, $status, $actioncode, $usergroup; // Filters used into search form
|
||||
global $theme_datacolor;
|
||||
global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused;
|
||||
|
||||
@@ -1676,7 +1682,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
print "\n";
|
||||
|
||||
$curtime = dol_mktime(0, 0, 0, $month, $day, $year);
|
||||
$urltoshow = DOL_URL_ROOT.'/comm/action/index.php?action=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year.$newparam;
|
||||
$urltoshow = DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year.$newparam;
|
||||
$urltocreate = '';
|
||||
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
|
||||
$newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year;
|
||||
@@ -1829,10 +1835,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
}
|
||||
|
||||
$h = ''; $nowrapontd = 1;
|
||||
if ($action == 'show_day') {
|
||||
if ($mode == 'show_day') {
|
||||
$h = 'height: 100%; '; $nowrapontd = 0;
|
||||
}
|
||||
if ($action == 'show_week') {
|
||||
if ($mode == 'show_week') {
|
||||
$h = 'height: 100%; '; $nowrapontd = 0;
|
||||
}
|
||||
|
||||
@@ -2064,11 +2070,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
|
||||
$i++;
|
||||
} else {
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action='.$action.'&maxprint=0&month='.$monthshown.'&year='.$year;
|
||||
print ($status ? '&status='.$status : '').($filter ? '&filter='.$filter : '');
|
||||
print ($filtert ? '&search_filtert='.$filtert : '');
|
||||
print ($usergroup ? '&search_usergroup='.$usergroup : '');
|
||||
print ($actioncode != '' ? '&search_actioncode='.$actioncode : '');
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode='.$mode.'&maxprint=0&month='.((int) $monthshown).'&year='.((int) $year);
|
||||
print ($status ? '&status='.$status : '').($filter ? '&filter='.urlencode($filter) : '');
|
||||
print ($filtert ? '&search_filtert='.urlencode($filtert) : '');
|
||||
print ($usergroup ? '&search_usergroup='.urlencode($usergroup) : '');
|
||||
print ($actioncode != '' ? '&search_actioncode='.urlencode($actioncode) : '');
|
||||
print '">'.img_picto("all", "1downarrow_selected.png").' ...';
|
||||
print ' +'.(count($eventarray[$daykey]) - $maxprint);
|
||||
print '</a>';
|
||||
|
||||
@@ -72,13 +72,13 @@ $linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php">'.$langs->trans("
|
||||
// Link to other agenda views
|
||||
$out = '';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewPerUser").'</a>';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?mode=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewPerUser").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewCal").'</a>';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewCal").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewWeek").'</a>';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewWeek").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
|
||||
$linkback .= $out;
|
||||
|
||||
|
||||
@@ -45,6 +45,11 @@ $langs->loadLangs(array("users", "companies", "agenda", "commercial", "other", "
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'actioncommlist'; // To manage different context of search
|
||||
|
||||
$mode = GETPOST('mode', 'aZ09');
|
||||
if (empty($mode) && preg_match('/show_/', $action)) {
|
||||
$mode = $action; // For backward compatibility
|
||||
}
|
||||
$resourceid = GETPOST("search_resourceid", "int") ?GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int");
|
||||
$pid = GETPOST("search_projectid", 'int', 3) ?GETPOST("search_projectid", 'int', 3) : GETPOST("projectid", 'int', 3);
|
||||
$search_status = (GETPOST("search_status", 'aZ09') != '') ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09');
|
||||
@@ -80,8 +85,8 @@ $dateend_dtend = dol_mktime(23, 59, 59, GETPOST('dateend_dtendmonth', 'int'), GE
|
||||
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 (empty($mode) && !GETPOSTISSET('mode')) {
|
||||
$mode = (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);
|
||||
@@ -178,7 +183,7 @@ if ($user->socid && $socid) {
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
$action = 'list'; $massaction = '';
|
||||
$mode = 'list'; $massaction = '';
|
||||
}
|
||||
|
||||
if (GETPOST("viewcal") || GETPOST("viewweek") || GETPOST("viewday")) {
|
||||
@@ -409,7 +414,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
|
||||
// Add fields from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
@@ -542,7 +547,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
|
||||
// Add where from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
// Count total nb of records
|
||||
@@ -641,31 +646,31 @@ $viewyear = is_object($object) ? dol_print_date($object->datep, '%Y') : '';
|
||||
$viewmonth = is_object($object) ? dol_print_date($object->datep, '%m') : '';
|
||||
$viewday = is_object($object) ? dol_print_date($object->datep, '%d') : '';
|
||||
$viewmode = '';
|
||||
$viewmode .= '<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.$viewyear.'&month='.$viewmonth.'&day='.$viewday.$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_month&year='.$viewyear.'&month='.$viewmonth.'&day='.$viewday.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.$viewyear.'&month='.$viewmonth.'&day='.$viewday.$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_week&year='.$viewyear.'&month='.$viewmonth.'&day='.$viewday.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.$viewyear.'&month='.$viewmonth.'&day='.$viewday.$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.$viewyear.'&month='.$viewmonth.'&day='.$viewday.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.$viewyear.'&month='.$viewmonth.'&day='.$viewday.$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?mode=show_peruser&year='.$viewyear.'&month='.$viewmonth.'&day='.$viewday.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
@@ -696,7 +701,7 @@ $url .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam
|
||||
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, '', $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create);
|
||||
|
||||
$param .= '&action='.$action;
|
||||
$param .= '&mode='.$mode;
|
||||
|
||||
print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1 * $nbtotalofrecords, 'object_action', 0, $nav.$newcardbutton, '', $limit, 0, 0, 1, $viewmode);
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ if (!isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) {
|
||||
$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW = 3;
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$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);
|
||||
$usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3);
|
||||
@@ -90,8 +92,7 @@ if (empty($user->rights->agenda->allactions->read) || $filter == 'mine') { // I
|
||||
$filtert = $user->id;
|
||||
}
|
||||
|
||||
//$action=GETPOST('action','alpha');
|
||||
$action = 'show_pertype';
|
||||
$mode = 'show_pertype';
|
||||
$resourceid = GETPOST("search_resourceid", "int") ?GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int");
|
||||
$year = GETPOST("year", "int") ?GETPOST("year", "int") : date("Y");
|
||||
$month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m");
|
||||
@@ -146,21 +147,21 @@ $end_d = 53;
|
||||
if ($status == '' && !GETPOSTISSET('status')) {
|
||||
$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 (empty($mode) && !GETPOSTISSET('mode')) {
|
||||
$mode = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
|
||||
}
|
||||
|
||||
if (GETPOST('viewcal', 'alpha') && $action != 'show_day' && $action != 'show_week' && $action != 'show_peruser') {
|
||||
$action = 'show_month'; $day = '';
|
||||
if (GETPOST('viewcal', 'alpha') && $mode != 'show_day' && $mode != 'show_week' && $mode != 'show_peruser') {
|
||||
$mode = 'show_month'; $day = '';
|
||||
} // View by month
|
||||
if (GETPOST('viewweek', 'alpha') || $action == 'show_week') {
|
||||
$action = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d"));
|
||||
if (GETPOST('viewweek', 'alpha') || $mode == 'show_week') {
|
||||
$mode = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d"));
|
||||
} // View by week
|
||||
if (GETPOST('viewday', 'alpha') || $action == 'show_day') {
|
||||
$action = 'show_day'; $day = ($day ? $day : date("d"));
|
||||
if (GETPOST('viewday', 'alpha') || $mode == 'show_day') {
|
||||
$mode = 'show_day'; $day = ($day ? $day : date("d"));
|
||||
} // View by day
|
||||
if (GETPOST('viewyear', 'alpha') || $action == 'show_year') {
|
||||
$action = 'show_year';
|
||||
if (GETPOST('viewyear', 'alpha') || $mode == 'show_year') {
|
||||
$mode = 'show_year';
|
||||
} // View by year
|
||||
|
||||
// Load translation files required by the page
|
||||
@@ -179,7 +180,8 @@ if ($user->socid && $socid) {
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'delete_action') {
|
||||
/*
|
||||
if ($action == 'delete_action' && $user->rights->agenda->delete) {
|
||||
$event = new ActionComm($db);
|
||||
$event->fetch($actionid);
|
||||
$event->fetch_optionals();
|
||||
@@ -188,7 +190,7 @@ if ($action == 'delete_action') {
|
||||
|
||||
$result = $event->delete();
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
@@ -298,8 +300,8 @@ if ($pid) {
|
||||
if ($type) {
|
||||
$param .= "&search_type=".urlencode($type);
|
||||
}
|
||||
if ($action == 'show_day' || $action == 'show_week' || $action == 'show_month' || $action != 'show_peruser') {
|
||||
$param .= '&action='.urlencode($action);
|
||||
if ($mode == 'show_day' || $mode == 'show_week' || $mode == 'show_month' || $mode != 'show_peruser') {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
}
|
||||
if ($begin_h != '') {
|
||||
$param .= '&begin_h='.urlencode($begin_h);
|
||||
@@ -375,7 +377,7 @@ if ($conf->use_javascript_ajax) {
|
||||
$s .= 'jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });'."\n";
|
||||
$s .= 'jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });'."\n";
|
||||
$s .= 'jQuery(".family_birthday").toggle();'."\n";
|
||||
if ($action == "show_week" || $action == "show_month" || empty($action)) {
|
||||
if ($mode == "show_week" || $mode == "show_month" || empty($mode)) {
|
||||
$s .= 'jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {';
|
||||
}
|
||||
$s .= '});'."\n";
|
||||
@@ -413,31 +415,31 @@ if ($conf->use_javascript_ajax) {
|
||||
$massactionbutton = '';
|
||||
|
||||
$viewmode = '';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle btnTitleSelected reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle btnTitleSelected reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?mode=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
@@ -566,7 +568,7 @@ if ($socid > 0) {
|
||||
if ($filtert > 0 || $usergroup > 0) {
|
||||
$sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
|
||||
}
|
||||
if ($action == 'show_day') {
|
||||
if ($mode == 'show_day') {
|
||||
$sql .= " AND (";
|
||||
$sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'";
|
||||
$sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')";
|
||||
@@ -750,8 +752,8 @@ if (!is_array($theme_datacolor)) {
|
||||
|
||||
$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);
|
||||
$newparam = preg_replace('/action=show_week&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/mode=show_month&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/mode=show_week&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/day=[0-9]+&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/month=[0-9]+&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/year=[0-9]+&?/i', '', $newparam);
|
||||
@@ -903,7 +905,7 @@ jQuery(document).ready(function() {
|
||||
else if (ids.indexOf(",") > -1) /* There is several events */
|
||||
{
|
||||
/* alert(\'several events\'); */
|
||||
url = "'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&filtert="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day;
|
||||
url = "'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&filtert="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day;
|
||||
window.location.href = url;
|
||||
}
|
||||
else /* One event */
|
||||
|
||||
@@ -43,6 +43,8 @@ if (!isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) {
|
||||
$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW = 3;
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$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);
|
||||
$usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3);
|
||||
@@ -90,8 +92,7 @@ if (empty($user->rights->agenda->allactions->read) || $filter == 'mine') { // I
|
||||
$filtert = $user->id;
|
||||
}
|
||||
|
||||
//$action=GETPOST('action','alpha');
|
||||
$action = 'show_peruser'; //We use 'show_week' mode
|
||||
$mode = 'show_peruser';
|
||||
$resourceid = GETPOST("search_resourceid", "int") ?GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int");
|
||||
$year = GETPOST("year", "int") ?GETPOST("year", "int") : date("Y");
|
||||
$month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m");
|
||||
@@ -155,19 +156,19 @@ if ($end_d < $begin_d) {
|
||||
if ($status == '' && !GETPOSTISSET('status')) {
|
||||
$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 (empty($mode) && !GETPOSTISSET('mode')) {
|
||||
$mode = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
|
||||
}
|
||||
|
||||
if (GETPOST('viewcal', 'alpha') && $action != 'show_day' && $action != 'show_week' && $action != 'show_peruser') {
|
||||
$action = 'show_month'; $day = '';
|
||||
} // View by month
|
||||
if (GETPOST('viewweek', 'alpha') || $action == 'show_week') {
|
||||
$action = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d"));
|
||||
} // View by week
|
||||
if (GETPOST('viewday', 'alpha') || $action == 'show_day') {
|
||||
$action = 'show_day'; $day = ($day ? $day : date("d"));
|
||||
} // View by day
|
||||
if (GETPOST('viewcal', 'alpha') && $mode != 'show_day' && $mode != 'show_week' && $mode != 'show_peruser') {
|
||||
$mode = 'show_month'; $day = '';
|
||||
} // View by month
|
||||
if (GETPOST('viewweek', 'alpha') || $mode == 'show_week') {
|
||||
$mode = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d"));
|
||||
} // View by week
|
||||
if (GETPOST('viewday', 'alpha') || $mode == 'show_day') {
|
||||
$mode = 'show_day'; $day = ($day ? $day : date("d"));
|
||||
} // View by day
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('users', 'agenda', 'other', 'commercial'));
|
||||
@@ -185,7 +186,8 @@ if ($user->socid && $socid) {
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'delete_action') {
|
||||
/*
|
||||
if ($action == 'delete_action' && $user->rights->agenda->delete) {
|
||||
$event = new ActionComm($db);
|
||||
$event->fetch($actionid);
|
||||
$event->fetch_optionals();
|
||||
@@ -194,7 +196,7 @@ if ($action == 'delete_action') {
|
||||
|
||||
$result = $event->delete();
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
@@ -304,8 +306,8 @@ if ($pid) {
|
||||
if ($type) {
|
||||
$param .= "&search_type=".urlencode($type);
|
||||
}
|
||||
if ($action == 'show_day' || $action == 'show_week' || $action == 'show_month' || $action != 'show_peruser') {
|
||||
$param .= '&action='.urlencode($action);
|
||||
if ($mode != 'show_peruser') {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
}
|
||||
if ($begin_h != '') {
|
||||
$param .= '&begin_h='.urlencode($begin_h);
|
||||
@@ -385,7 +387,7 @@ if ($conf->use_javascript_ajax) {
|
||||
$s .= 'jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });'."\n";
|
||||
$s .= 'jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });'."\n";
|
||||
$s .= 'jQuery(".family_birthday").toggle();'."\n";
|
||||
if ($action == "show_week" || $action == "show_month" || empty($action)) {
|
||||
if ($mode == "show_week" || $mode == "show_month" || empty($mode)) {
|
||||
$s .= 'jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {';
|
||||
}
|
||||
$s .= '});'."\n";
|
||||
@@ -423,31 +425,31 @@ if ($conf->use_javascript_ajax) {
|
||||
$massactionbutton = '';
|
||||
|
||||
$viewmode = '';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle btnTitleSelected reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle btnTitleSelected reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?mode=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
@@ -593,7 +595,7 @@ if ($socid > 0) {
|
||||
if ($filtert > 0 || $usergroup > 0) {
|
||||
$sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
|
||||
}
|
||||
if ($action == 'show_day') {
|
||||
if ($mode == 'show_day') {
|
||||
$sql .= " AND (";
|
||||
$sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'";
|
||||
$sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')";
|
||||
@@ -779,8 +781,8 @@ if (!is_array($theme_datacolor)) {
|
||||
|
||||
$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);
|
||||
$newparam = preg_replace('/action=show_week&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/mode=show_month&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/mode=show_week&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/day=[0-9]+&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/month=[0-9]+&?/i', '', $newparam);
|
||||
$newparam = preg_replace('/year=[0-9]+&?/i', '', $newparam);
|
||||
@@ -806,7 +808,7 @@ while ($currentdaytoshow < $lastdaytoshow) {
|
||||
echo '<tr class="liste_titre">';
|
||||
echo '<td class="nopaddingtopimp nopaddingbottomimp nowraponsmartphone">';
|
||||
|
||||
if ($canedit && $action == 'show_peruser') {
|
||||
if ($canedit && $mode == 'show_peruser') {
|
||||
// Filter on hours
|
||||
print img_picto('', 'clock', 'class="fawidth30 inline-block paddingleft"');
|
||||
print '<span class="hideonsmartphone" title="'.$langs->trans("VisibleTimeRange").'">'.$langs->trans("Hours").'</span>';
|
||||
@@ -1071,7 +1073,7 @@ jQuery(document).ready(function() {
|
||||
else if (ids.indexOf(",") > -1) /* There is several events */
|
||||
{
|
||||
/* alert(\'several events\'); */
|
||||
url = "'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&filtert="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day;
|
||||
url = "'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&filtert="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day;
|
||||
window.location.href = url;
|
||||
}
|
||||
else /* One event */
|
||||
|
||||
@@ -183,7 +183,7 @@ function show_array_actions_to_do($max = 5)
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastActionsToDo", $max).'</th>';
|
||||
print '<th colspan="2" class="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&status=todo">'.$langs->trans("FullList").'</a></th>';
|
||||
print '<th colspan="2" class="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&status=todo">'.$langs->trans("FullList").'</a></th>';
|
||||
print '</tr>';
|
||||
|
||||
$i = 0;
|
||||
@@ -299,7 +299,7 @@ function show_array_last_actions_done($max = 5)
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastDoneTasks", $max).'</th>';
|
||||
print '<th colspan="2" class="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&status=done">'.$langs->trans("FullList").'</a></th>';
|
||||
print '<th colspan="2" class="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&status=done">'.$langs->trans("FullList").'</a></th>';
|
||||
print '</tr>';
|
||||
|
||||
$i = 0;
|
||||
@@ -479,22 +479,22 @@ function calendars_prepare_head($param)
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/comm/action/list.php?action=show_list'.($param ? '&'.$param : '');
|
||||
$head[$h][0] = DOL_URL_ROOT.'/comm/action/list.php?mode=show_list'.($param ? '&'.$param : '');
|
||||
$head[$h][1] = $langs->trans("ViewList");
|
||||
$head[$h][2] = 'cardlist';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?action=show_month'.($param ? '&'.$param : '');
|
||||
$head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?mode=show_month'.($param ? '&'.$param : '');
|
||||
$head[$h][1] = $langs->trans("ViewCal");
|
||||
$head[$h][2] = 'cardmonth';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?action=show_week'.($param ? '&'.$param : '');
|
||||
$head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?mode=show_week'.($param ? '&'.$param : '');
|
||||
$head[$h][1] = $langs->trans("ViewWeek");
|
||||
$head[$h][2] = 'cardweek';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?action=show_day'.($param ? '&'.$param : '');
|
||||
$head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?mode=show_day'.($param ? '&'.$param : '');
|
||||
$head[$h][1] = $langs->trans("ViewDay");
|
||||
$head[$h][2] = 'cardday';
|
||||
$h++;
|
||||
|
||||
@@ -1730,7 +1730,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
|
||||
if ($donetodo) {
|
||||
$tmp = '';
|
||||
if (get_class($filterobj) == 'Societe') {
|
||||
$tmp .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&socid='.$filterobj->id.'&status=done">';
|
||||
$tmp .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&socid='.$filterobj->id.'&status=done">';
|
||||
}
|
||||
$tmp .= ($donetodo != 'done' ? $langs->trans("ActionsToDoShort") : '');
|
||||
$tmp .= ($donetodo != 'done' && $donetodo != 'todo' ? ' / ' : '');
|
||||
|
||||
@@ -635,7 +635,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
if ($donetodo) {
|
||||
$tmp = '';
|
||||
if (get_class($filterobj) == 'Societe') {
|
||||
$tmp .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&socid='.$filterobj->id.'&status=done">';
|
||||
$tmp .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&socid='.$filterobj->id.'&status=done">';
|
||||
}
|
||||
$tmp .= ($donetodo != 'done' ? $langs->trans("ActionsToDoShort") : '');
|
||||
$tmp .= ($donetodo != 'done' && $donetodo != 'todo' ? ' / ' : '');
|
||||
|
||||
@@ -325,7 +325,7 @@ class modAgenda extends DolibarrModules
|
||||
'type'=>'left',
|
||||
'titre'=>'List',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda',
|
||||
'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda',
|
||||
'langs'=>'agenda',
|
||||
'position'=>110,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
@@ -339,7 +339,7 @@ class modAgenda extends DolibarrModules
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuToDoMyActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine',
|
||||
'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine',
|
||||
'langs'=>'agenda',
|
||||
'position'=>111,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
@@ -353,7 +353,7 @@ class modAgenda extends DolibarrModules
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuDoneMyActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine',
|
||||
'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine',
|
||||
'langs'=>'agenda',
|
||||
'position'=>112,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
@@ -367,7 +367,7 @@ class modAgenda extends DolibarrModules
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuToDoActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1',
|
||||
'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1',
|
||||
'langs'=>'agenda',
|
||||
'position'=>113,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
@@ -381,7 +381,7 @@ class modAgenda extends DolibarrModules
|
||||
'type'=>'left',
|
||||
'titre'=>'MenuDoneActions',
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1',
|
||||
'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1',
|
||||
'langs'=>'agenda',
|
||||
'position'=>114,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
|
||||
@@ -186,7 +186,7 @@ if (!empty($conf->use_javascript_ajax)) {
|
||||
}
|
||||
|
||||
$nav = '';
|
||||
$nav .= '<form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
|
||||
$nav .= '<form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?mode=show_peruser'.$param.'">';
|
||||
if ($actioncode || GETPOSTISSET('actioncode')) {
|
||||
$nav .= '<input type="hidden" name="actioncode" value="'.$actioncode.'">';
|
||||
}
|
||||
|
||||
@@ -323,18 +323,18 @@ if (!$ret) {
|
||||
print dol_get_fiche_head($head, 'resources', $langs->trans("Action"), -1, 'action');
|
||||
|
||||
$linkback = img_picto($langs->trans("BackToList"), 'object_list', 'class="hideonsmartphone pictoactionview"');
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
// Link to other agenda views
|
||||
$out = '';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">'.$langs->trans("ViewPerUser").'</a>';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?mode=show_peruser&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">'.$langs->trans("ViewPerUser").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">'.$langs->trans("ViewCal").'</a>';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_month&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">'.$langs->trans("ViewCal").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">'.$langs->trans("ViewWeek").'</a>';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">'.$langs->trans("ViewWeek").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
|
||||
$linkback .= $out;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user