Ask not what osTicket community can do for you - ask what you can do for osTicket community

Go Back   osTicket Forums > Project Tools > osTicket Bug Tracker > Bug

Issue Type Bug   Project osTicket Bug Tracker
Pagination for the dashboard doesn't work
The pagination for the dashboard logs doesn't work.
Category Unknown
Affected Version 1.6 rc5
Priority 10 - Lowest
Status Fixed
Fixed Version 1.6 Stable
Submitted 08-11-2009
Assigned Users (none) Tags (none)

issueid=140 08-11-2009 03:15 PM
Senior Member
Pagination for the dashboard doesn't work
The pagination for the dashboard logs doesn't work.

The pagination for the dashboard logs doesn't work. When you click page 2, it loads page 1 again.
Reply

09-26-2009 08:44 AM
Junior Member
 
I don't have more than one page of syslog messages so can't easily reproduce the problem but the most obvious issue is that in,

/include/staff/syslogs.inc.php

then at line 75 where it does $pageNav=new Pagenate($total,$page,$pagelimit); then the $page isn't actually set to a page number but is set in admin.php to some PHP filename e.g. $page='syslogs.inc.php'; Clearly the intent of Pagenate() is to get a numerical value as a page offset so the fix would seem to be...

1) Somewhere before line 75 then e.g. at line 36 insert something like,

PHP Code:
//Page offset. Note you can't use "$page" as that is set to the PHP filename
$pageoffset  = ($_GET['p'] && is_numeric($_GET['p']))?$_GET['p']:1
2) Alter the line 75 where it has $pageNav=new Pagenate($total,$page,$pagelimit);

to be,

PHP Code:
$pageNav=new Pagenate($total,$pageoffset,$pagelimit); 
I'm pretty confident that should work though I have not tested this fix as I can only guess the problem until I fill my syslog.
Reply
09-29-2009 03:43 AM
Junior Member
 
I just turned logging level to DEBUG and logged in and out 15 times and my patch works as expected. So my patch fixes this bug BUT there is another separate bug that I have noticed. When you select a filter on the log type then the URL created by the pagenate() is malformed e.g. it is http://www.example.com/osticket/scp/...type=Debug&p=2
...notice how there is no & (ampersand) before the "type=Debug". I'll raise a seperate bug for this. Lincoln.
Reply
09-29-2009 03:54 AM
Junior Member
 
Fix for that last little quirk is easy. Around line 6 in /include/staff/syslogs.inc.php it has,

$qstr.='type='.urlencode($_REQUEST['type']);

so obviously change that to....

PHP Code:
    $qstr.='&type='.urlencode($_REQUEST['type']); 
i.e. stick and ampersand in front of the type=....
Reply
This petition for a change to Awaiting Feedback is currently pending
02-27-2010 07:23 AM
Senior Member
 
I created modification in order to overcome this issue, plus some enhancement in it.

Please take a look at here:
http://www.osticket.com/forums/showthread.php?t=2749

Sincerely,
Masino Sinaga

Issue Tools
Subscribe to this issue

All times are GMT -4. The time now is 03:20 AM.