From e9de76af7ac614428a8c4a1dbe360130c8f2e182 Mon Sep 17 00:00:00 2001
From: A Sigalas <asig@sigalas.eu>
Date: Fri, 1 Dec 2017 11:04:31 +0000
Subject: [PATCH] Set option for num_rows

---
 api/js/etemplate/et2_widget_historylog.js | 4 ++++
 api/src/Storage/Tracking.php              | 1 +
 2 files changed, 5 insertions(+)

diff --git a/api/js/etemplate/et2_widget_historylog.js b/api/js/etemplate/et2_widget_historylog.js
index 00858178f4..6db4bc1ae7 100644
--- a/api/js/etemplate/et2_widget_historylog.js
+++ b/api/js/etemplate/et2_widget_historylog.js
@@ -420,6 +420,10 @@ var et2_historylog = (function(){ "use strict"; return et2_valueWidget.extend([e
 		// Skip getting data if there's no ID
 		if(!this.value.id) return;
 
+		// Set num_rows to fetch via nextmatch
+		if ( this.options.value['num_rows'] )
+			_queriedRange['num_rows'] = this.options.value['num_rows'];
+
 		// Pass the fetch call to the API
 		this.egw().dataFetch(
 			this.getInstanceManager().etemplate_exec_id,
diff --git a/api/src/Storage/Tracking.php b/api/src/Storage/Tracking.php
index 21d4d1e584..1dda952f3f 100644
--- a/api/src/Storage/Tracking.php
+++ b/api/src/Storage/Tracking.php
@@ -56,6 +56,7 @@ use notifications;
  * $content['history'] = array(
  * 	'id' => 123,
  *  'app' => 'calendar',
+ *  'num_rows' => 50, // optional, defaults to 50
  *  'status-widgets' => array(
  * 		'title' => 'label',	// no need to set, as default is label
  * 		'date'  => 'datetime',