modx-pro / Tickets

Tickets system for MODX Revolution
35 stars 52 forks source link

totalVar and placeholder with total count of tickets #4

Closed alroniks closed 11 years ago

alroniks commented 11 years ago

Add parameter totalVar to TicketLatest snippet and add ability to get count of tickets in section via placeholder.

I did it in getLatestTickets method from tickets.class.php:

$totalVar = (isset($data['totalVar']))? $data['totalVar'] : 'tickets.total';
$this->modx->setPlaceholder($totalVar,$result['total']);
bezumkin commented 11 years ago

Added parameter toPlaceholder for checking result on empty.

And also you can use getResources for retrieve latest tickets with totalVar.