Skip to content

Commit

Permalink
Merge pull request osTicket#495 from protich/issue/489
Browse files Browse the repository at this point in the history
Pagination
  • Loading branch information
protich committed Mar 11, 2013
2 parents b897cf3 + 712772b commit 6934f91
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
3 changes: 2 additions & 1 deletion assets/default/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -702,9 +702,10 @@ body {
.Icon.phoneTicket {
background-image: url('../images/icons/ticket_source_phone.gif');
}
.Icon.otherTicket {
.Icon.otherTicket, .Icon.apiTicket {
background-image: url('../images/icons/ticket_source_other.gif');
}

.Icon.attachment {
background-image: url('../images/icons/attachment.gif');
}
Expand Down
20 changes: 14 additions & 6 deletions include/client/tickets.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
$order_by =$sortOptions[$sort];

$order_by=$order_by?$order_by:'ticket_created';
if($_REQUEST['order'] && $orderWays[strtoupper($_REQUEST['order'])])
if($_REQUEST['order'] && $orderWays[strtoupper($_REQUEST['order'])])
$order=$orderWays[strtoupper($_REQUEST['order'])];

$order=$order?$order:'ASC';
Expand Down Expand Up @@ -69,7 +69,8 @@
}

$total=db_count('SELECT count(DISTINCT ticket.ticket_id) '.$qfrom.' '.$qwhere);
$pageNav=new Pagenate($total,$page, PAGE_LIMIT);
$page=($_GET['p'] && is_numeric($_GET['p']))?$_GET['p']:1;
$pageNav=new Pagenate($total, $page, PAGE_LIMIT);
$pageNav->setURL('tickets.php',$qstr.'&sort='.urlencode($_REQUEST['sort']).'&order='.urlencode($_REQUEST['order']));

//more stuff...
Expand All @@ -95,8 +96,15 @@
<input type="text" name="q" size="20" value="<?php echo Format::htmlchars($_REQUEST['q']); ?>">
<select name="status">
<option value="">&mdash; Any Status &mdash;</option>
<option value="open" <?php echo ($status=='open')?'selected="selected"':'';?>>Open</option>
<option value="closed" <?php echo ($status=='closed')?'selected="selected"':'';?>>Closed</option>
<option value="open"
<?php echo ($status=='open')?'selected="selected"':'';?>>Open (<?php echo $thisclient->getNumOpenTickets(); ?>)</option>
<?php
if($thisclient->getNumClosedTickets()) {
?>
<option value="closed"
<?php echo ($status=='closed')?'selected="selected"':'';?>>Closed (<?php echo $thisclient->getNumClosedTickets(); ?>)</option>
<?php
} ?>
</select>
<input type="submit" value="Go">
</form>
Expand Down Expand Up @@ -144,7 +152,7 @@
?>
<tr id="<?php echo $row['ticketID']; ?>">
<td class="centered">
<a class="Icon <?php echo strtolower($row['source']); ?>Ticket" title="<?php echo $row['email']; ?>"
<a class="Icon <?php echo strtolower($row['source']); ?>Ticket" title="<?php echo $row['email']; ?>"
href="tickets.php?id=<?php echo $row['ticketID']; ?>"><?php echo $ticketID; ?></a>
</td>
<td>&nbsp;<?php echo Format::db_date($row['created']); ?></td>
Expand All @@ -165,7 +173,7 @@
</tbody>
</table>
<?php
if($res && $num>0) {
if($res && $num>0) {
echo '<div>&nbsp;Page:'.$pageNav->getPageLinks().'&nbsp;</div>';
}
?>

0 comments on commit 6934f91

Please sign in to comment.