From f32b8bdf0095857cc99c6626ecdcc297920b976d Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Sun, 10 Jan 2010 16:06:33 -0500 Subject: [PATCH] Operator: Move search limit to config from pref Also fix pref descriptions --- operator/config/conf.xml | 2 ++ operator/config/prefs.php.dist | 10 +--------- operator/search.php | 9 ++------- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/operator/config/conf.xml b/operator/config/conf.xml index 3d96910c2..3990892ef 100644 --- a/operator/config/conf.xml +++ b/operator/config/conf.xml @@ -12,6 +12,8 @@ + 5000 + diff --git a/operator/config/prefs.php.dist b/operator/config/prefs.php.dist index 2c5160e94..9b691b884 100644 --- a/operator/config/prefs.php.dist +++ b/operator/config/prefs.php.dist @@ -17,15 +17,7 @@ $_prefs['rowsperpage'] = array( 'locked' => false, 'shared' => false, 'type' => 'number', - 'desc' => _("The columns to be displayed on the Call Detail Review screen") -); - -$_prefs['resultlimit'] = array( - 'value' => 100, - 'locked' => false, - 'shared' => false, - 'type' => 'number', - 'desc' => _("Limit the number of CDR results when searching to this number") + 'desc' => _("Maximum number of call records to show per search result page.") ); $_prefs['columns'] = array( diff --git a/operator/search.php b/operator/search.php index 30e7cc5aa..0cda93adc 100644 --- a/operator/search.php +++ b/operator/search.php @@ -27,12 +27,6 @@ if (!$vars->exists('rowstart')) { $rowstart = 0; } -$numrows = $prefs->getValue('resultlimit'); -if (!is_numeric($numrows)) { - $notification->push(_("Invalid number for rows for search limit. Using 100.")); - $numrows = 100; -} - $form = new SearchCDRForm(_("Search Call Detail Records"), $vars); if ($form->isSubmitted() && $form->validate($vars, true)) { $accountcode = $vars->get('accountcode'); @@ -47,7 +41,8 @@ if ($form->isSubmitted() && $form->validate($vars, true)) { $notification->push(_("Invalid date requested.")); } else { $data = $operator->driver->getRecords($start, $end, $accountcode, - $dcontext, $rowstart, $numrows); + $dcontext, $rowstart, + $GLOBALS['conf']['storage']['searchlimit']); if (is_a($data, 'PEAR_Error')) { $notification->push($data); $data = array(); -- 2.11.0