New: now use tabs for agenda
This commit is contained in:
parent
ff015ccf56
commit
547443c4b6
@ -39,7 +39,7 @@ $filter=GETPOST("filter");
|
|||||||
$filtera = GETPOST("userasked","int")?GETPOST("userasked","int"):GETPOST("filtera","int");
|
$filtera = GETPOST("userasked","int")?GETPOST("userasked","int"):GETPOST("filtera","int");
|
||||||
$filtert = GETPOST("usertodo","int")?GETPOST("usertodo","int"):GETPOST("filtert","int");
|
$filtert = GETPOST("usertodo","int")?GETPOST("usertodo","int"):GETPOST("filtert","int");
|
||||||
$filterd = GETPOST("userdone","int")?GETPOST("userdone","int"):GETPOST("filterd","int");
|
$filterd = GETPOST("userdone","int")?GETPOST("userdone","int"):GETPOST("filterd","int");
|
||||||
$showbirthday = GETPOST("showbirthday","int")?GETPOST("showbirthday","int"):0;
|
$showbirthday = GETPOST("showbirthday","int");
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield");
|
$sortfield = GETPOST("sortfield");
|
||||||
$sortorder = GETPOST("sortorder");
|
$sortorder = GETPOST("sortorder");
|
||||||
@ -231,9 +231,32 @@ if ($action=='show_day')
|
|||||||
$param.='&year='.$year.'&month='.$month.($day?'&day='.$day:'');
|
$param.='&year='.$year.'&month='.$month.($day?'&day='.$day:'');
|
||||||
//print 'x'.$param;
|
//print 'x'.$param;
|
||||||
|
|
||||||
print_fiche_titre($title,$nav);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$head = calendars_prepare_head('');
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'card', $langs->trans('Events'), 0, 'action');
|
||||||
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showborthday,$filtera,$filtert,$filterd,$pid,$socid);
|
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showborthday,$filtera,$filtert,$filterd,$pid,$socid);
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
// Add link to show birthdays
|
||||||
|
$newparam=$param; // newparam is for birthday links
|
||||||
|
$newparam=preg_replace('/showbirthday=[0-1]/i','showbirthday='.(empty($showbirthday)?1:0),$newparam);
|
||||||
|
if (! preg_match('/showbirthday=/i',$newparam)) $newparam.='&showbirthday=1';
|
||||||
|
$link='<a href="'.$_SERVER['PHP_SELF'];
|
||||||
|
$link.='?'.$newparam;
|
||||||
|
$link.='">';
|
||||||
|
if (empty($showbirthday)) $link.=$langs->trans("AgendaShowBirthdayEvents");
|
||||||
|
else $link.=$langs->trans("AgendaHideBirthdayEvents");
|
||||||
|
$link.='</a>';
|
||||||
|
|
||||||
|
print_fiche_titre($title,$link.' '.$nav);
|
||||||
|
//print '<br>';
|
||||||
|
|
||||||
|
//print_fiche_titre($link,'','');
|
||||||
|
|
||||||
|
|
||||||
// Get event in an array
|
// Get event in an array
|
||||||
@ -470,17 +493,6 @@ if (is_readable($color_file))
|
|||||||
}
|
}
|
||||||
if (! is_array($theme_datacolor)) $theme_datacolor=array(array(120,130,150), array(200,160,180), array(190,190,220));
|
if (! is_array($theme_datacolor)) $theme_datacolor=array(array(120,130,150), array(200,160,180), array(190,190,220));
|
||||||
|
|
||||||
// Add link to show birthdays
|
|
||||||
$newparam=$param; // newparam is for birthday links
|
|
||||||
$newparam=preg_replace('/showbirthday=[0-1]/i','showbirthday='.(empty($showbirthday)?1:0),$newparam);
|
|
||||||
if (! preg_match('/showbirthday=/i',$newparam)) $newparam.='&showbirthday=1';
|
|
||||||
$link='<a href="'.$_SERVER['PHP_SELF'];
|
|
||||||
$link.='?'.$newparam;
|
|
||||||
$link.='">';
|
|
||||||
if (empty($showbirthday)) $link.=$langs->trans("AgendaShowBirthdayEvents");
|
|
||||||
else $link.=$langs->trans("AgendaHideBirthdayEvents");
|
|
||||||
$link.='</a>';
|
|
||||||
print_fiche_titre('',$link);
|
|
||||||
|
|
||||||
if (empty($action) || $action == 'show_month') // View by month
|
if (empty($action) || $action == 'show_month') // View by month
|
||||||
{
|
{
|
||||||
@ -626,6 +638,19 @@ else // View by day
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
/* TODO Add RSS Links
|
||||||
|
print '
|
||||||
|
<a href="" id="actionagenda_ical_link"><img src="'.DOL_URL_ROOT.'/theme/common/ical.gif"/></a>
|
||||||
|
<a href="" id="actionagenda_vcal_link"><img src="'.DOL_URL_ROOT.'/theme/common/vcal.gif"/></a>
|
||||||
|
<a href="" id="actionagenda_rss_link"><img src="'.DOL_URL_ROOT.'/theme/common/rss.gif" /></a>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$("#actionagenda_rss_link").attr("href","/public/agenda/agendaexport.php?format=rss&type=ActionAgenda&exportkey=dolibarr&token="+getToken()+"&status="+getStatus()+"&userasked="+getUserasked()+"&usertodo="+getUsertodo()+"&userdone="+getUserdone()+"&year="+getYear()+"&month="+getMonth()+"&day="+getDay()+"&showbirthday="+getShowbirthday()+"&action="+getAction()+"&projectid="+getProjectid()+"");
|
||||||
|
$("#actionagenda_ical_link").attr("href","/public/agenda/agendaexport.php?format=ical&type=ActionAgenda&exportkey=dolibarr&token="+getToken()+"&status="+getStatus()+"&userasked="+getUserasked()+"&usertodo="+getUsertodo()+"&userdone="+getUserdone()+"&year="+getYear()+"&month="+getMonth()+"&day="+getDay()+"&showbirthday="+getShowbirthday()+"&action="+getAction()+"&projectid="+getProjectid()+"");
|
||||||
|
$("#actionagenda_vcal_link").attr("href","/public/agenda/agendaexport.php?format=vcal&type=ActionAgenda&exportkey=dolibarr&token="+getToken()+"&status="+getStatus()+"&userasked="+getUserasked()+"&usertodo="+getUsertodo()+"&userdone="+getUserdone()+"&year="+getYear()+"&month="+getMonth()+"&day="+getDay()+"&showbirthday="+getShowbirthday()+"&action="+getAction()+"&projectid="+getProjectid()+"");
|
||||||
|
</script>
|
||||||
|
';
|
||||||
|
*/
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date$ - $Revision$');
|
||||||
|
|
||||||
|
|||||||
@ -44,9 +44,11 @@ $day=GETPOST("day",'int');
|
|||||||
$pid=GETPOST("projectid",'int');
|
$pid=GETPOST("projectid",'int');
|
||||||
$status=GETPOST("status",'alpha');
|
$status=GETPOST("status",'alpha');
|
||||||
|
|
||||||
|
$filter=GETPOST("filter");
|
||||||
$filtera = GETPOST("userasked","int")?GETPOST("userasked","int"):GETPOST("filtera","int");
|
$filtera = GETPOST("userasked","int")?GETPOST("userasked","int"):GETPOST("filtera","int");
|
||||||
$filtert = GETPOST("usertodo","int")?GETPOST("usertodo","int"):GETPOST("filtert","int");
|
$filtert = GETPOST("usertodo","int")?GETPOST("usertodo","int"):GETPOST("filtert","int");
|
||||||
$filterd = GETPOST("userdone","int")?GETPOST("userdone","int"):GETPOST("filterd","int");
|
$filterd = GETPOST("userdone","int")?GETPOST("userdone","int"):GETPOST("filterd","int");
|
||||||
|
$showbirthday = GETPOST("showbirthday","int");
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
@ -117,6 +119,7 @@ if ($filtera) $param.="&filtera=".$filtera;
|
|||||||
if ($filtert) $param.="&filtert=".$filtert;
|
if ($filtert) $param.="&filtert=".$filtert;
|
||||||
if ($filterd) $param.="&filterd=".$filterd;
|
if ($filterd) $param.="&filterd=".$filterd;
|
||||||
if ($socid) $param.="&socid=".$socid;
|
if ($socid) $param.="&socid=".$socid;
|
||||||
|
if ($showbirthday) $param.="&showbirthday=1";
|
||||||
if ($pid) $param.="&projectid=".$pid;
|
if ($pid) $param.="&projectid=".$pid;
|
||||||
if ($_GET["type"]) $param.="&type=".$_REQUEST["type"];
|
if ($_GET["type"]) $param.="&type=".$_REQUEST["type"];
|
||||||
|
|
||||||
@ -176,17 +179,33 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$societe = new Societe($db);
|
$societe = new Societe($db);
|
||||||
$societe->fetch($socid);
|
$societe->fetch($socid);
|
||||||
|
$newtitle=$langs->trans($title).' '.$langs->trans("For").' '.$societe->nom;
|
||||||
print_barre_liste($langs->trans($title).' '.$langs->trans("For").' '.$societe->nom, $page, $_SERVER["PHP_SELF"], $param,$sortfield,$sortorder,'',$num);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print_barre_liste($langs->trans($title), $page, $_SERVER["PHP_SELF"], $param,$sortfield,$sortorder,'',$num);
|
$newtitle=$langs->trans($title);
|
||||||
}
|
}
|
||||||
|
|
||||||
//print '<br>';
|
|
||||||
|
|
||||||
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showborthday,$filtera,$filtert,$filterd,$pid,$socid);
|
$head = calendars_prepare_head('');
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'card', $langs->trans('Events'), 0, 'action');
|
||||||
|
print_actions_filter($form,$canedit,$status,$year,$month,$day,$showborthday,$filtera,$filtert,$filterd,$pid,$socid);
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
// Add link to show birthdays
|
||||||
|
$newparam=$param; // newparam is for birthday links
|
||||||
|
$newparam=preg_replace('/showbirthday=[0-1]/i','showbirthday='.(empty($showbirthday)?1:0),$newparam);
|
||||||
|
if (! preg_match('/showbirthday=/i',$newparam)) $newparam.='&showbirthday=1';
|
||||||
|
$link='<a href="'.$_SERVER['PHP_SELF'];
|
||||||
|
$link.='?'.$newparam;
|
||||||
|
$link.='">';
|
||||||
|
if (empty($showbirthday)) $link.=$langs->trans("AgendaShowBirthdayEvents");
|
||||||
|
else $link.=$langs->trans("AgendaHideBirthdayEvents");
|
||||||
|
$link.='</a>';
|
||||||
|
|
||||||
|
print_barre_liste($newtitle, $page, $_SERVER["PHP_SELF"], $param,$sortfield,$sortorder,$link,$num,0);
|
||||||
|
//print '<br>';
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
print "<table class=\"noborder\" width=\"100%\">";
|
print "<table class=\"noborder\" width=\"100%\">";
|
||||||
@ -204,7 +223,7 @@ if ($resql)
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$contactstatic = new Contact($db);
|
$contactstatic = new Contact($db);
|
||||||
$now=gmmktime();
|
$now=dol_now();
|
||||||
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
|
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|||||||
@ -113,7 +113,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbort
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</form><br>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,4 +353,30 @@ function actions_prepare_head($action)
|
|||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define head array for tabs of agenda setup pages
|
||||||
|
* @return Array of head
|
||||||
|
*/
|
||||||
|
function calendars_prepare_head($param)
|
||||||
|
{
|
||||||
|
global $langs, $conf, $user;
|
||||||
|
|
||||||
|
$h = 0;
|
||||||
|
$head = array();
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php'.($param?'?'.$param:'');
|
||||||
|
$head[$h][1] = $langs->trans("Agenda");
|
||||||
|
$head[$h][2] = 'card';
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
// Show more tabs from modules
|
||||||
|
// Entries must be declared in modules descriptor with line
|
||||||
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||||
|
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
|
||||||
|
complete_head_from_modules($conf,$langs,$object,$head,$h,'agenda');
|
||||||
|
|
||||||
|
return $head;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Loading…
Reference in New Issue
Block a user