Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
e230d72c
Commit
e230d72c
authored
10 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Increase default date range to current month instead of current day
parent
36cad55e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/admin/tools/listevents.php
+14
-7
14 additions, 7 deletions
htdocs/admin/tools/listevents.php
htdocs/core/lib/functions.lib.php
+2
-15
2 additions, 15 deletions
htdocs/core/lib/functions.lib.php
with
16 additions
and
22 deletions
htdocs/admin/tools/listevents.php
+
14
−
7
View file @
e230d72c
<?php
<?php
/* Copyright (C) 2004-201
4
Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2004-201
5
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) 2015 Bahfir Abbes <bafbes@gmail.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
*
*
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
require
'../../main.inc.php'
;
require
'../../main.inc.php'
;
require_once
DOL_DOCUMENT_ROOT
.
'/core/class/events.class.php'
;
require_once
DOL_DOCUMENT_ROOT
.
'/core/class/events.class.php'
;
require_once
DOL_DOCUMENT_ROOT
.
'/core/lib/date.lib.php'
;
if
(
!
$user
->
admin
)
if
(
!
$user
->
admin
)
accessforbidden
();
accessforbidden
();
...
@@ -66,6 +67,9 @@ $date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"
...
@@ -66,6 +67,9 @@ $date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"
// checks:if date_start>date_end then date_end=date_start + 24 hours
// 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
=
"&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"
];
$params
.
=
"&date_startmonth="
.
$_REQUEST
[
"date_startmonth"
];
$params
.
=
"&date_startday="
.
$_REQUEST
[
"date_startday"
];
$params
.
=
"&date_startday="
.
$_REQUEST
[
"date_startday"
];
...
@@ -74,10 +78,13 @@ $params.= "&date_endmonth=".$_REQUEST["date_endmonth"];
...
@@ -74,10 +78,13 @@ $params.= "&date_endmonth=".$_REQUEST["date_endmonth"];
$params
.
=
"&date_endday="
.
$_REQUEST
[
"date_endday"
];
$params
.
=
"&date_endday="
.
$_REQUEST
[
"date_endday"
];
$params
.
=
"&date_endyear="
.
$_REQUEST
[
"date_endyear"
];
$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_get_first_day
(
$nowarray
[
'year'
],
$nowarray
[
'mon'
],
false
);
}
if
(
empty
(
$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
,
$nowarray
[
'mon'
],
$nowarray
[
'mday'
],
$nowarray
[
'year'
]);
$date_end
=
dol_mktime
(
23
,
59
,
59
,
strftime
(
"%m"
,
time
()),
strftime
(
"%d"
,
time
()),
strftime
(
"%Y"
,
time
()));
}
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/lib/functions.lib.php
+
2
−
15
View file @
e230d72c
...
@@ -1127,19 +1127,6 @@ function dol_getdate($timestamp,$fast=false)
...
@@ -1127,19 +1127,6 @@ function dol_getdate($timestamp,$fast=false)
else
else
{
{
$arrayinfo
=
getdate
(
$timestamp
);
$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
;
return
$arrayinfo
;
...
@@ -2886,14 +2873,14 @@ function print_fleche_navigation($page,$file,$options='',$nextpage=0,$betweenarr
...
@@ -2886,14 +2873,14 @@ function print_fleche_navigation($page,$file,$options='',$nextpage=0,$betweenarr
print
'<div class="pagination"><ul>'
;
print
'<div class="pagination"><ul>'
;
if
(
$page
>
0
)
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>'
;
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?' ':'');
//if ($betweenarrows) print ($page > 0?' ':'').$betweenarrows.($nextpage>0?' ':'');
print
$betweenarrows
;
print
$betweenarrows
;
if
(
$nextpage
>
0
)
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>'
;
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
)
if
(
$afterarrows
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment