mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-22 09:21:30 +01:00
Fix: Navigation into agenda tabs
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
@@ -84,8 +84,8 @@ $maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MA
|
|||||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':'');
|
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':'');
|
||||||
|
|
||||||
if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
|
if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
|
||||||
if ($status == '') $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
||||||
if (empty($action)) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW);
|
if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW);
|
||||||
|
|
||||||
if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week') {
|
if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week') {
|
||||||
$action='show_month'; $day='';
|
$action='show_month'; $day='';
|
||||||
@@ -136,7 +136,7 @@ if (GETPOST("viewperuser") || $action == 'show_peruser')
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action=='delete_action')
|
if ($action =='delete_action')
|
||||||
{
|
{
|
||||||
$event = new ActionComm($db);
|
$event = new ActionComm($db);
|
||||||
$event->fetch($actionid);
|
$event->fetch($actionid);
|
||||||
@@ -253,7 +253,8 @@ if ($status == 'done') $title=$langs->trans("DoneActions");
|
|||||||
if ($status == 'todo') $title=$langs->trans("ToDoActions");
|
if ($status == 'todo') $title=$langs->trans("ToDoActions");
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
if ($status) $param="&status=".$status;
|
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode;
|
||||||
|
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
||||||
if ($filter) $param.="&filter=".$filter;
|
if ($filter) $param.="&filter=".$filter;
|
||||||
if ($filtera) $param.="&filtera=".$filtera;
|
if ($filtera) $param.="&filtera=".$filtera;
|
||||||
if ($filtert) $param.="&filtert=".$filtert;
|
if ($filtert) $param.="&filtert=".$filtert;
|
||||||
@@ -261,9 +262,8 @@ if ($filterd) $param.="&filterd=".$filterd;
|
|||||||
if ($socid) $param.="&socid=".$socid;
|
if ($socid) $param.="&socid=".$socid;
|
||||||
if ($showbirthday) $param.="&showbirthday=1";
|
if ($showbirthday) $param.="&showbirthday=1";
|
||||||
if ($pid) $param.="&projectid=".$pid;
|
if ($pid) $param.="&projectid=".$pid;
|
||||||
if ($actioncode != '') $param.="&actioncode=".$actioncode;
|
|
||||||
if ($type) $param.="&type=".$type;
|
if ($type) $param.="&type=".$type;
|
||||||
if ($action == 'show_day' || $action == 'show_week') $param.='&action='.$action;
|
if ($action == 'show_day' || $action == 'show_week' || $action == 'show_month') $param.='&action='.$action;
|
||||||
$param.="&maxprint=".$maxprint;
|
$param.="&maxprint=".$maxprint;
|
||||||
|
|
||||||
// Show navigation bar
|
// Show navigation bar
|
||||||
@@ -313,7 +313,7 @@ $paramnoaction=preg_replace('/action=[a-z_]+/','',$param);
|
|||||||
$head = calendars_prepare_head($paramnoaction);
|
$head = calendars_prepare_head($paramnoaction);
|
||||||
|
|
||||||
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
|
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
|
||||||
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$listofextcals,$actioncode,$usergroup);
|
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$action,$listofextcals,$actioncode,$usergroup);
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
$showextcals=$listofextcals;
|
$showextcals=$listofextcals;
|
||||||
@@ -429,7 +429,7 @@ else
|
|||||||
if ($type) $sql.= " AND ca.id = ".$type;
|
if ($type) $sql.= " AND ca.id = ".$type;
|
||||||
if ($status == '0') { $sql.= " AND a.percent = 0"; }
|
if ($status == '0') { $sql.= " AND a.percent = 0"; }
|
||||||
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
|
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
|
||||||
if ($status == '50') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; } // Running
|
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
|
||||||
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
|
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
|
||||||
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
|
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
|
||||||
if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0)
|
if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0)
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ $type=GETPOST('type');
|
|||||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':''));
|
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':''));
|
||||||
|
|
||||||
if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
|
if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
|
||||||
if ($status == '') $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
||||||
if (empty($action)) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_list':$conf->global->AGENDA_DEFAULT_VIEW);
|
if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW);
|
||||||
|
|
||||||
$filter=GETPOST("filter",'',3);
|
$filter=GETPOST("filter",'',3);
|
||||||
$filtera = GETPOST("userasked","int",3)?GETPOST("userasked","int",3):GETPOST("filtera","int",3);
|
$filtera = GETPOST("userasked","int",3)?GETPOST("userasked","int",3):GETPOST("filtera","int",3);
|
||||||
@@ -126,7 +126,8 @@ $form=new Form($db);
|
|||||||
$listofextcals=array();
|
$listofextcals=array();
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
if ($status) $param="&status=".$status;
|
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode;
|
||||||
|
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
||||||
if ($filter) $param.="&filter=".$filter;
|
if ($filter) $param.="&filter=".$filter;
|
||||||
if ($filtera) $param.="&filtera=".$filtera;
|
if ($filtera) $param.="&filtera=".$filtera;
|
||||||
if ($filtert) $param.="&filtert=".$filtert;
|
if ($filtert) $param.="&filtert=".$filtert;
|
||||||
@@ -135,7 +136,6 @@ if ($socid) $param.="&socid=".$socid;
|
|||||||
if ($showbirthday) $param.="&showbirthday=1";
|
if ($showbirthday) $param.="&showbirthday=1";
|
||||||
if ($pid) $param.="&projectid=".$pid;
|
if ($pid) $param.="&projectid=".$pid;
|
||||||
if ($type) $param.="&type=".$type;
|
if ($type) $param.="&type=".$type;
|
||||||
if ($actioncode) $param.="&actioncode=".$actioncode;
|
|
||||||
|
|
||||||
$sql = "SELECT s.nom as societe, s.rowid as socid, s.client,";
|
$sql = "SELECT s.nom as societe, s.rowid as socid, s.client,";
|
||||||
$sql.= " a.id, a.datep as dp, a.datep2 as dp2,";
|
$sql.= " a.id, a.datep as dp, a.datep2 as dp2,";
|
||||||
@@ -166,7 +166,7 @@ if ($usergroup > 0) $sql.= " AND ugu.fk_user = a.fk_user_action";
|
|||||||
if ($type) $sql.= " AND c.id = ".$type;
|
if ($type) $sql.= " AND c.id = ".$type;
|
||||||
if ($status == '0') { $sql.= " AND a.percent = 0"; }
|
if ($status == '0') { $sql.= " AND a.percent = 0"; }
|
||||||
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
|
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
|
||||||
if ($status == '50') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; } // Running
|
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
|
||||||
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
|
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
|
||||||
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
|
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
|
||||||
if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0)
|
if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0)
|
||||||
@@ -217,7 +217,7 @@ if ($resql)
|
|||||||
$head = calendars_prepare_head($param);
|
$head = calendars_prepare_head($param);
|
||||||
|
|
||||||
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
|
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
|
||||||
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1,$actioncode,$usergroup);
|
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$action,-1,$actioncode,$usergroup);
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
// Add link to show birthdays
|
// Add link to show birthdays
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ $paramnoaction=preg_replace('/action=[a-z_]+/','',$param);
|
|||||||
$head = calendars_prepare_head($paramnoaction);
|
$head = calendars_prepare_head($paramnoaction);
|
||||||
|
|
||||||
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
|
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
|
||||||
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$listofextcals,$actioncode,$usergroup);
|
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$action,$listofextcals,$actioncode,$usergroup);
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
print_fiche_titre($s,$link.' '.$nav, '');
|
print_fiche_titre($s,$link.' '.$nav, '');
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
* @param int $usergroupid Id of group to filter on users
|
* @param int $usergroupid Id of group to filter on users
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals=array(), $actioncode='', $usergroupid='')
|
function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid='')
|
||||||
{
|
{
|
||||||
global $conf, $user, $langs, $db, $hookmanager;
|
global $conf, $user, $langs, $db, $hookmanager;
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
|
|||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print $langs->trans("Status");
|
print $langs->trans("Status");
|
||||||
print ' </td><td class="nowrap maxwidthonsmartphone">';
|
print ' </td><td class="nowrap maxwidthonsmartphone">';
|
||||||
$formactions->form_select_status_action('formaction',$status,1,'complete',1,2);
|
$formactions->form_select_status_action('formaction',$status,1,'status',1,2);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user