示例#1
0
 public function getFilterFields()
 {
     $months = 6;
     $billruns = array();
     $timestamp = time();
     for ($i = 0; $i < $months; $i++) {
         $billrun_key = Billrun_Util::getBillrunKey($timestamp);
         if ($billrun_key >= '201401') {
             $billruns[$billrun_key] = $billrun_key;
         } else {
             break;
         }
         $timestamp = strtotime("1 month ago", $timestamp);
     }
     arsort($billruns);
     //		$plansModel = new PlansModel();
     //		$plansCursor = $plansModel->getData();
     //		$plans = array();
     //		foreach ($plansCursor as $p) {
     //			$plans[(string) $p->getId()->getMongoID()] = $p["name"];
     //		}
     $usage_filter_values = $this->getBalancesFields();
     unset($usage_filter_values['aid'], $usage_filter_values['sid'], $usage_filter_values['billrun_month'], $usage_filter_values['current_plan']);
     //		$usage_filter_values = array_merge($basic_columns, $extra_columns);
     $planNames = array_unique(array_keys(Billrun_Plan::getPlans()['by_name']));
     $planNames = array_combine($planNames, $planNames);
     $operators = array('equals' => '=', 'lt' => '<', 'lte' => '<=', 'gt' => '>', 'gte' => '>=');
     $filter_fields = array('aid' => array('key' => 'aid', 'db_key' => 'aid', 'input_type' => 'number', 'comparison' => 'equals', 'display' => 'Account id', 'default' => ''), 'sid' => array('key' => 'sid', 'db_key' => 'sid', 'input_type' => 'number', 'comparison' => 'equals', 'display' => 'Subscriber id', 'default' => ''), 'usage_type' => array('key' => 'manual_key', 'db_key' => 'nofilter', 'input_type' => 'multiselect', 'display' => 'Usage', 'values' => $usage_filter_values, 'singleselect' => 1, 'default' => array()), 'usage_filter' => array('key' => 'manual_operator', 'db_key' => 'nofilter', 'input_type' => 'multiselect', 'display' => '', 'values' => $operators, 'singleselect' => 1, 'default' => array()), 'usage_value' => array('key' => 'manual_value', 'db_key' => 'nofilter', 'input_type' => 'number', 'display' => '', 'default' => ''), 'plan' => array('key' => 'plan', 'db_key' => 'current_plan', 'input_type' => 'multiselect', 'comparison' => '$in', 'ref_coll' => 'plans', 'ref_key' => 'name', 'display' => 'Plan', 'values' => $planNames, 'default' => array()), 'billrun' => array('key' => 'billrun', 'db_key' => 'billrun_month', 'input_type' => 'multiselect', 'comparison' => '$in', 'display' => 'Billrun', 'values' => $billruns, 'default' => array()));
     return array_merge($filter_fields, parent::getFilterFields());
 }
示例#2
0
文件: Events.php 项目: ngchie/system
 public function getFilterFields()
 {
     $search_by_values = array('event_type' => 'Event type', 'source' => 'Source');
     $operators = array('equals' => 'equals', 'like' => 'contains', 'ne' => 'not equals', 'starts_with' => 'starts with', 'ends_with' => 'ends with');
     $filter_fields = array('aid' => array('key' => 'aid', 'db_key' => array('aid', 'returned_value.account_id'), 'input_type' => 'number', 'comparison' => 'equals', 'display' => 'Account id', 'default' => ''), 'sid' => array('key' => 'sid', 'db_key' => array('sid', 'returned_value.subscriber_id'), 'input_type' => 'number', 'comparison' => 'equals', 'display' => 'Subscriber id', 'default' => ''), 'search_by' => array('key' => 'manual_key', 'db_key' => 'nofilter', 'input_type' => 'multiselect', 'display' => 'Search by', 'values' => $search_by_values, 'singleselect' => 1, 'default' => array()), 'usage_filter' => array('key' => 'manual_operator', 'db_key' => 'nofilter', 'input_type' => 'multiselect', 'display' => '', 'values' => $operators, 'singleselect' => 1, 'default' => array()), 'usage_value' => array('key' => 'manual_value', 'db_key' => 'nofilter', 'input_type' => 'text', 'display' => '', 'default' => ''));
     return array_merge($filter_fields, parent::getFilterFields());
 }
示例#3
0
文件: Queue.php 项目: ngchie/system
 public function getFilterFields()
 {
     $filter_fields = array('older_then' => array('key' => 'older_then', 'db_key' => 'urt', 'input_type' => 'date', 'comparison' => '$lte', 'display' => 'Older then', 'default' => (new Zend_Date(strtotime("+1 day"), null, new Zend_Locale('he_IL')))->toString('YYYY-MM-dd HH:mm:ss')), 'next_calculator' => array('key' => 'next_calculator', 'db_key' => 'calc_name', 'input_type' => 'multiselect', 'comparison' => '$in', 'display' => 'Next Calculator', 'values' => Billrun_Factory::config()->getConfigValue('queue.calculators'), 'default' => array()), 'type' => array('key' => 'type1', 'db_key' => 'type', 'input_type' => 'multiselect', 'comparison' => '$in', 'display' => 'Type', 'values' => Billrun_Factory::config()->getConfigValue('admin_panel.queue.source'), 'default' => array()));
     foreach ($filter_fields['next_calculator']['values'] as $key => $val) {
         $filter_fields['next_calculator']['values'][$val] = $val;
         unset($filter_fields['next_calculator']['values'][$key]);
     }
     return array_merge($filter_fields, parent::getFilterFields());
 }
示例#4
0
 public function getFilterFields()
 {
     $filter_fields = array('type' => array('key' => 'source', 'db_key' => 'source', 'input_type' => 'text', 'comparison' => 'contains', 'display' => 'Type', 'default' => ''));
     return array_merge($filter_fields, parent::getFilterFields());
 }
示例#5
0
 public function getFilterFields()
 {
     $months = 6;
     $previous_billruns = array();
     $timestamp = time();
     for ($i = 1; $i <= $months; $i++) {
         $timestamp = strtotime("1 month ago", $timestamp);
         $billrun_key = Billrun_Util::getBillrunKey($timestamp);
         if ($billrun_key >= '201401') {
             $previous_billruns[$billrun_key] = $billrun_key;
         }
     }
     arsort($previous_billruns);
     $current_billrun_key = '000000';
     $current_billrun = array($current_billrun_key => 'Current billrun');
     $billruns = $current_billrun + $previous_billruns;
     $filter_fields = array('aid' => array('key' => 'aid', 'db_key' => 'aid', 'input_type' => 'number', 'comparison' => 'equals', 'display' => 'Account id', 'default' => ''), 'sid' => array('key' => 'sid', 'db_key' => 'sid', 'input_type' => 'number', 'comparison' => 'equals', 'display' => 'Subscriber id', 'default' => ''), 'from' => array('key' => 'from', 'db_key' => 'urt', 'input_type' => 'date', 'comparison' => '$gte', 'display' => 'From', 'default' => (new Zend_Date(strtotime('2013-01-01'), null, new Zend_Locale('he_IL')))->toString('YYYY-MM-dd HH:mm:ss')), 'to' => array('key' => 'to', 'db_key' => 'urt', 'input_type' => 'date', 'comparison' => '$lte', 'display' => 'To', 'default' => (new Zend_Date(strtotime("next month"), null, new Zend_Locale('he_IL')))->toString('YYYY-MM-dd HH:mm:ss')), 'usage' => array('key' => 'usage', 'db_key' => 'usaget', 'input_type' => 'multiselect', 'comparison' => '$in', 'display' => 'Usage', 'values' => Billrun_Factory::config()->getConfigValue('admin_panel.line_usages'), 'default' => array()), 'billrun' => array('key' => 'billrun', 'db_key' => 'billrun', 'input_type' => 'multiselect', 'comparison' => '$in', 'display' => 'Billrun', 'values' => $billruns, 'default' => $current_billrun_key));
     return array_merge($filter_fields, parent::getFilterFields());
 }
示例#6
0
 public function getFilterFields()
 {
     $filter_fields = array('date' => array('key' => 'date', 'db_key' => array('from', 'to'), 'input_type' => 'date', 'comparison' => array('$lte', '$gte'), 'display' => 'Date', 'default' => (new Zend_Date(null, null, new Zend_Locale('he_IL')))->toString('YYYY-MM-dd HH:mm:ss')));
     return array_merge($filter_fields, parent::getFilterFields());
 }
示例#7
0
文件: Log.php 项目: ngchie/system
 public function getFilterFields()
 {
     $filter_fields = array('type' => array('key' => 'source', 'db_key' => 'source', 'input_type' => 'multiselect', 'comparison' => '$in', 'display' => 'Type', 'values' => Billrun_Factory::config()->getConfigValue('admin_panel.log.source'), 'default' => array()));
     return array_merge($filter_fields, parent::getFilterFields());
 }