Increase default date range to current month instead of current day
This commit is contained in:
parent
36cad55ed7
commit
e230d72cea
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
||||
/* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -25,6 +25,7 @@
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
if (! $user->admin)
|
||||
accessforbidden();
|
||||
@ -64,7 +65,10 @@ $date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startd
|
||||
$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]);
|
||||
|
||||
// checks:if date_start>date_end then date_end=date_start + 24 hours
|
||||
if($date_start>$date_end) $date_end=$date_start+86400;
|
||||
if ($date_start > $date_end) $date_end=$date_start+86400;
|
||||
|
||||
$now = dol_now();
|
||||
$nowarray = dol_getdate($now);
|
||||
|
||||
$params = "&search_code=$search_code&search_ip=$search_ip&search_user=$search_user&search_desc=$search_desc&search_ua=$search_ua";
|
||||
$params.= "&date_startmonth=".$_REQUEST["date_startmonth"];
|
||||
@ -74,10 +78,13 @@ $params.= "&date_endmonth=".$_REQUEST["date_endmonth"];
|
||||
$params.= "&date_endday=".$_REQUEST["date_endday"];
|
||||
$params.= "&date_endyear=".$_REQUEST["date_endyear"];
|
||||
|
||||
if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
||||
if (empty($date_start)) // We define date_start and date_end
|
||||
{
|
||||
$date_start=dol_mktime(0,0,0,strftime("%m",time()),strftime("%d",time()),strftime("%Y",time()));
|
||||
$date_end=dol_mktime(23,59,59,strftime("%m",time()),strftime("%d",time()),strftime("%Y",time()));
|
||||
$date_start=dol_get_first_day($nowarray['year'],$nowarray['mon'],false);
|
||||
}
|
||||
if (empty($date_end))
|
||||
{
|
||||
$date_end=dol_mktime(23,59,59,$nowarray['mon'],$nowarray['mday'],$nowarray['year']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1127,19 +1127,6 @@ function dol_getdate($timestamp,$fast=false)
|
||||
else
|
||||
{
|
||||
$arrayinfo=getdate($timestamp);
|
||||
|
||||
/*$startday=isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1;
|
||||
if($startday==1)
|
||||
{
|
||||
if ($arrayinfo["wday"]==0)
|
||||
{
|
||||
$arrayinfo["wday"]=6;
|
||||
}
|
||||
else
|
||||
{
|
||||
$arrayinfo["wday"]=$arrayinfo["wday"]-1;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
return $arrayinfo;
|
||||
@ -2886,14 +2873,14 @@ function print_fleche_navigation($page,$file,$options='',$nextpage=0,$betweenarr
|
||||
print '<div class="pagination"><ul>';
|
||||
if ($page > 0)
|
||||
{
|
||||
if (empty($conf->dol_use_jmobile)) print '<li><a class="paginationprevious" href="'.$file.'?page='.($page-1).$options.'"><</a></li>';
|
||||
if (empty($conf->dol_use_jmobile)) print '<li class="pagination"><a class="paginationprevious" href="'.$file.'?page='.($page-1).$options.'"><</a></li>';
|
||||
else print '<li><a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$file.'?page='.($page-1).$options.'">'.$langs->trans("Previous").'</a></li>';
|
||||
}
|
||||
//if ($betweenarrows) print ($page > 0?' ':'').$betweenarrows.($nextpage>0?' ':'');
|
||||
print $betweenarrows;
|
||||
if ($nextpage > 0)
|
||||
{
|
||||
if (empty($conf->dol_use_jmobile)) print '<li><a class="paginationnext" href="'.$file.'?page='.($page+1).$options.'">></a></li>';
|
||||
if (empty($conf->dol_use_jmobile)) print '<li class="pagination"><a class="paginationnext" href="'.$file.'?page='.($page+1).$options.'">></a></li>';
|
||||
else print '<li><a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$file.'?page='.($page+1).$options.'">'.$langs->trans("Next").'</a></li>';
|
||||
}
|
||||
if ($afterarrows)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user