Commit 89253b49 authored by mattwire's avatar mattwire
Browse files

Fix #4 The paginator doesn't work for Event Templates

parent 113dd7e6
......@@ -9,6 +9,7 @@
+--------------------------------------------------------------------+
*/
use Civi\Api4\Event;
use CRM_AdvancedEvents_ExtensionUtil as E;
/**
......@@ -57,8 +58,13 @@ class CRM_AdvancedEvents_Page_AJAX {
$eventTemplatesDT['data'][] = $dtEventTemplate;
}
$eventTemplatesDT['recordsTotal'] = count($eventTemplates['values']);
$eventTemplatesDT['recordsFiltered'] = count($eventTemplates['values']);
// Get total number of templates
$events = Event::get(FALSE)
->selectRowCount()
->addWhere('is_template', '=', TRUE)
->execute();
$eventTemplatesDT['recordsTotal'] = $events->rowCount;
$eventTemplatesDT['recordsFiltered'] = $events->rowCount;
CRM_Utils_JSON::output($eventTemplatesDT);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment