[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [6680] property: Filter request on district
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [6680] property: Filter request on district |
Date: |
Thu, 16 Dec 2010 13:36:36 +0000 |
Revision: 6680
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6680
Author: sigurdne
Date: 2010-12-16 13:36:36 +0000 (Thu, 16 Dec 2010)
Log Message:
-----------
property: Filter request on district
Modified Paths:
--------------
trunk/property/inc/class.borequest.inc.php
trunk/property/inc/class.sorequest.inc.php
trunk/property/inc/class.uirequest.inc.php
trunk/property/js/yahoo/request.index.js
Modified: trunk/property/inc/class.borequest.inc.php
===================================================================
--- trunk/property/inc/class.borequest.inc.php 2010-12-16 13:11:57 UTC (rev
6679)
+++ trunk/property/inc/class.borequest.inc.php 2010-12-16 13:36:36 UTC (rev
6680)
@@ -66,17 +66,17 @@
$this->use_session = true;
}
- $start = phpgw::get_var('start', 'int', 'REQUEST', 0);
- $query = phpgw::get_var('query');
- $sort = phpgw::get_var('sort');
- $order = phpgw::get_var('order');
- $filter = phpgw::get_var('filter', 'int');
- $cat_id = phpgw::get_var('cat_id', 'int');
- $status_id = phpgw::get_var('status_id');
- $allrows = phpgw::get_var('allrows', 'bool');
- $this->p_num =
phpgw::get_var('p_num');
+ $start = phpgw::get_var('start',
'int', 'REQUEST', 0);
+ $query = phpgw::get_var('query');
+ $sort = phpgw::get_var('sort');
+ $order = phpgw::get_var('order');
+ $filter = phpgw::get_var('filter',
'int');
+ $district_id = phpgw::get_var('district_id', 'int');
+ $cat_id = phpgw::get_var('cat_id',
'int');
+ $status_id = phpgw::get_var('status_id');
+ $allrows = phpgw::get_var('allrows',
'bool');
+ $this->p_num = phpgw::get_var('p_num');
-
if(isset($_POST['start']) || isset($_GET['start']))
{
$this->start = $start;
@@ -97,6 +97,10 @@
{
$this->order = $order;
}
+ if(isset($_POST['district_id']) ||
isset($_GET['district_id']))
+ {
+ $this->district_id = $district_id;
+ }
if(isset($_POST['cat_id']) || isset($_GET['cat_id']))
{
$this->cat_id = $cat_id;
@@ -127,12 +131,13 @@
{
$data =
$GLOBALS['phpgw']->session->appsession('session_data','request');
- $this->start = $data['start'];
- $this->query = $data['query'];
- $this->filter = $data['filter'];
- $this->sort = $data['sort'];
- $this->order = $data['order'];
- $this->cat_id = $data['cat_id'];
+ $this->start = $data['start'];
+ $this->query = $data['query'];
+ $this->filter = $data['filter'];
+ $this->sort = $data['sort'];
+ $this->order = $data['order'];
+ $this->district_id = $data['district_id'];
+ $this->cat_id = $data['cat_id'];
$this->status_id = $data['status_id'];
}
@@ -265,7 +270,7 @@
function read($data)
{
$request = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'filter' => $this->filter,'cat_id' => $this->cat_id,'status_id' =>
$this->status_id,
+
'filter' => $this->filter,'district_id' => $this->district_id,'cat_id'
=> $this->cat_id,'status_id' => $this->status_id,
'project_id' =>
$data['project_id'],'allrows'=>$data['allrows'],'list_descr' =>
$data['list_descr'],
'dry_run'=>$data['dry_run'], 'p_num' => $this->p_num));
$this->total_records = $this->so->total_records;
Modified: trunk/property/inc/class.sorequest.inc.php
===================================================================
--- trunk/property/inc/class.sorequest.inc.php 2010-12-16 13:11:57 UTC (rev
6679)
+++ trunk/property/inc/class.sorequest.inc.php 2010-12-16 13:36:36 UTC (rev
6680)
@@ -165,22 +165,21 @@
function read($data)
{
- if(is_array($data))
- {
- $start = isset($data['start'])
&& $data['start'] ? $data['start'] : 0;
- $filter =
isset($data['filter'])?$data['filter']:'';
- $query =
isset($data['query'])?$data['query']:'';
- $sort = isset($data['sort'])
&& $data['sort'] ? $data['sort'] : 'DESC';
- $order =
isset($data['order'])?$data['order']:'';
- $cat_id =
isset($data['cat_id'])?$data['cat_id']:0;
- $status_id =
isset($data['status_id']) && $data['status_id'] ? $data['status_id']:0;
- $project_id =
isset($data['project_id'])?$data['project_id']:'';
- $allrows =
isset($data['allrows'])?$data['allrows']:'';
- $list_descr =
isset($data['list_descr'])?$data['list_descr']:'';
- $dry_run =
isset($data['dry_run']) ? $data['dry_run'] : '';
- $p_num = isset($data['p_num'])
? $data['p_num'] : '';
- }
+ $start = isset($data['start']) &&
$data['start'] ? $data['start'] : 0;
+ $filter =
isset($data['filter'])?$data['filter']:'';
+ $query =
isset($data['query'])?$data['query']:'';
+ $sort = isset($data['sort']) &&
$data['sort'] ? $data['sort'] : 'DESC';
+ $order =
isset($data['order'])?$data['order']:'';
+ $cat_id =
isset($data['cat_id'])?$data['cat_id']:0;
+ $status_id = isset($data['status_id']) &&
$data['status_id'] ? $data['status_id']:0;
+ $district_id = isset($data['district_id']) &&
$data['district_id'] ? $data['district_id']:0;
+ $project_id =
isset($data['project_id'])?$data['project_id']:'';
+ $allrows =
isset($data['allrows'])?$data['allrows']:'';
+ $list_descr =
isset($data['list_descr'])?$data['list_descr']:'';
+ $dry_run = isset($data['dry_run']) ?
$data['dry_run'] : '';
+ $p_num = isset($data['p_num']) ?
$data['p_num'] : '';
+
$entity_table = 'fm_request';
$cols .= $entity_table . '.location_code';
@@ -287,6 +286,12 @@
$where = 'AND';
}
+ if($district_id)
+ {
+ $filtermethod .= " {$where}
fm_part_of_town.district_id = {$district_id}";
+ $where= 'AND';
+ }
+
if($query)
{
if(stristr($query, '.') && $p_num)
Modified: trunk/property/inc/class.uirequest.inc.php
===================================================================
--- trunk/property/inc/class.uirequest.inc.php 2010-12-16 13:11:57 UTC (rev
6679)
+++ trunk/property/inc/class.uirequest.inc.php 2010-12-16 13:36:36 UTC (rev
6680)
@@ -85,6 +85,7 @@
$this->filter =
$this->bo->filter;
$this->cat_id =
$this->bo->cat_id;
$this->status_id =
$this->bo->status_id;
+ $this->district_id =
$this->bo->district_id;
$this->allrows =
$this->bo->allrows;
$this->p_num =
$this->bo->p_num;
@@ -94,14 +95,15 @@
{
$data = array
(
- 'start' => $this->start,
- 'query' => $this->query,
- 'sort' => $this->sort,
- 'order' => $this->order,
- 'filter' => $this->filter,
- 'cat_id' => $this->cat_id,
- 'status_id' => $this->status_id,
- 'allrows' => $this->allrows
+ 'start' => $this->start,
+ 'query' => $this->query,
+ 'sort' => $this->sort,
+ 'order' => $this->order,
+ 'filter' => $this->filter,
+ 'cat_id' => $this->cat_id,
+ 'status_id' => $this->status_id,
+ 'district_id' => $this->district_id,
+ 'allrows' => $this->allrows
);
$this->bo->save_sessiondata($data);
}
@@ -177,20 +179,25 @@
."project_id:'{$project_id}',"
."filter:'{$this->filter}',"
."status_id:'{$this->status_id}',"
+
."district_id: '{$this->district_id}',"
."cat_id:'{$this->cat_id}'";
- $values_combo_box[0] =
$this->cats->formatted_xslt_list(array('select_name' => 'cat_id','selected' =>
$this->cat_id,'globals' => True));
+ $values_combo_box[0] =
$this->bocommon->select_district_list('filter',$this->district_id);
+ $default_value = array
('id'=>'','name'=>lang('no district'));
+ array_unshift
($values_combo_box[0],$default_value);
+
+ $values_combo_box[1] =
$this->cats->formatted_xslt_list(array('select_name' => 'cat_id','selected' =>
$this->cat_id,'globals' => True));
$default_value = array ('cat_id'=>'','name'=>
lang('no category'));
- array_unshift
($values_combo_box[0]['cat_list'],$default_value);
+ array_unshift
($values_combo_box[1]['cat_list'],$default_value);
- $values_combo_box[1] =
$this->bo->select_status_list('filter',$this->status_id);
+ $values_combo_box[2] =
$this->bo->select_status_list('filter',$this->status_id);
$default_value = array ('id'=>'','name'=>
lang('no status'));
- array_unshift
($values_combo_box[1],$default_value);
+ array_unshift
($values_combo_box[2],$default_value);
- $values_combo_box[2] =
$this->bocommon->get_user_list('filter',$this->filter,$extra=false,$default=false,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1);
- array_unshift
($values_combo_box[2],array('user_id'=>$GLOBALS['phpgw_info']['user']['account_id'],'name'=>$GLOBALS['phpgw_info']['user']['fullname']));
+ $values_combo_box[3] =
$this->bocommon->get_user_list('filter',$this->filter,$extra=false,$default=false,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1);
+ array_unshift
($values_combo_box[3],array('user_id'=>$GLOBALS['phpgw_info']['user']['account_id'],'name'=>$GLOBALS['phpgw_info']['user']['fullname']));
$default_value = array
('user_id'=>'','name'=>lang('no user'));
- array_unshift
($values_combo_box[2],$default_value);
+ array_unshift
($values_combo_box[3],$default_value);
$datatable['actions']['form'] = array(
array(
@@ -202,18 +209,27 @@
'filter' => $this->filter,
'status_id' => $this->status_id,
'project_id' => $project_id,
+ 'district_id' =>
$this->district_id,
'query'
=> $this->query
)
),
'fields' => array(
'field' => array(
+ array(
//boton DISTRICT
+
'id' => 'btn_district_id',
+
'name' => 'district_id',
+
'value' => lang('district'),
+
'type' => 'button',
+
'style' => 'filter',
+
'tab_index' => 1
+ ),
array( //boton
CATEGORY
'id' =>
'btn_cat_id',
'name' =>
'cat_id',
'value'
=> lang('Category'),
'type' =>
'button',
'style' =>
'filter',
- 'tab_index'
=> 1
+ 'tab_index'
=> 2
),
array( //boton
STATUS
'id' =>
'btn_status_id',
@@ -221,7 +237,7 @@
'value'
=> lang('Status'),
'type' =>
'button',
'style' =>
'filter',
- 'tab_index'
=> 2
+ 'tab_index'
=> 3
),
array( //boton
FILTER
'id' =>
'btn_user_id',
@@ -229,25 +245,25 @@
'value'
=> lang('User'),
'type' =>
'button',
'style' =>
'filter',
- 'tab_index'
=> 3
+ 'tab_index'
=> 4
),
array(
'type' => 'button',
'id' => 'btn_export',
'value' => lang('download'),
-
'tab_index' => 8
+
'tab_index' => 9
),
array(
'type' => 'button',
'id' => 'btn_update',
'value' => lang('Update project'),
-
'tab_index' => 7
+
'tab_index' => 8
),
array(
'type' => 'button',
'id' => 'btn_new',
'value' => lang('add'),
-
'tab_index' => 6
+
'tab_index' => 7
),
array( //boton
SEARCH
'id' =>
'btn_search',
@@ -255,7 +271,7 @@
'value'
=> lang('search'),
'onkeypress' => 'return pulsar(event)',
'type' =>
'button',
- 'tab_index'
=> 5
+ 'tab_index'
=> 6
),
array( //hidden request
'type' => 'hidden',
@@ -271,7 +287,7 @@
'type' =>
'text',
'size'
=> 28,
'onkeypress' => 'return pulsar(event)',
- 'tab_index'
=> 4
+ 'tab_index'
=> 5
),
array(
'type'=> 'link',
@@ -280,21 +296,25 @@
array(
'menuaction' =>
'property.uirequest.priority_key'))."','','width=350,height=250')",
'value' => lang('Priority key'),
-
'tab_index' => 3
+
'tab_index' => 4
)
),
'hidden_value' => array(
-
array( //div values combo_box_0
-
'id' => 'values_combo_box_0',
-
'value' =>
$this->bocommon->select2String($values_combo_box[0]['cat_list'], 'cat_id')
//i.e. id,value/id,vale/
-
),
-
array( //div values combo_box_1
+
array( //div values combo_box_0
+
'id' =>
'values_combo_box_0',
+
'value' =>
$this->bocommon->select2String($values_combo_box[0])
+
),
+
array( //div values combo_box_1
'id' => 'values_combo_box_1',
-
'value' =>
$this->bocommon->select2String($values_combo_box[1])
+
'value' =>
$this->bocommon->select2String($values_combo_box[1]['cat_list'], 'cat_id')
//i.e. id,value/id,vale/
),
-
array( //div values combo_box_2
+
array( //div values combo_box_2
'id' => 'values_combo_box_2',
-
'value' =>
$this->bocommon->select2String($values_combo_box[2], 'user_id')
+
'value' =>
$this->bocommon->select2String($values_combo_box[2])
+
),
+
array( //div values combo_box_3
+
'id' => 'values_combo_box_3',
+
'value' =>
$this->bocommon->select2String($values_combo_box[3], 'user_id')
)
)
)
@@ -546,21 +566,17 @@
// Pagination and sort values
$datatable['pagination']['records_start'] =
(int)$this->bo->start;
$datatable['pagination']['records_limit'] =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
- //$datatable['pagination']['records_returned'] =
count($request_list);
$datatable['pagination']['records_total'] =
$this->bo->total_records;
-
if($dry_run)
{
$datatable['pagination']['records_returned'] =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
}
else
{
- $datatable['pagination']['records_returned']=
count($entity_list);
+ $datatable['pagination']['records_returned']=
count($request_list);
}
-
-
$appname =
lang('request');
$function_msg = lang('list
request');
Modified: trunk/property/js/yahoo/request.index.js
===================================================================
--- trunk/property/js/yahoo/request.index.js 2010-12-16 13:11:57 UTC (rev
6679)
+++ trunk/property/js/yahoo/request.index.js 2010-12-16 13:36:36 UTC (rev
6680)
@@ -2,11 +2,12 @@
// Declaration of request.index vars
//--------------------------------------------------------
//define SelectButton
- var oMenuButton_0, oMenuButton_1, oMenuButton_2;
+ var oMenuButton_0, oMenuButton_1, oMenuButton_2, oMenuButton_3;
var selectsButtons = [
- {order:0,
var_URL:'cat_id',name:'btn_cat_id',style:'categorybutton',dependiente:''},
- {order:1,
var_URL:'status_id',name:'btn_status_id',style:'districtbutton',dependiente:''},
- {order:2, var_URL:'filter',
name:'btn_user_id',style:'ownerIdbutton',dependiente:''}
+ {order:0,
var_URL:'district_id',name:'btn_district_id',style:'districtbutton',dependiente:''},
+ {order:1,
var_URL:'cat_id',name:'btn_cat_id',style:'categorybutton',dependiente:''},
+ {order:2,
var_URL:'status_id',name:'btn_status_id',style:'districtbutton',dependiente:''},
+ {order:3, var_URL:'filter',
name:'btn_user_id',style:'ownerIdbutton',dependiente:''}
]
// define buttons
@@ -44,24 +45,30 @@
if(flag_particular_setting=='init')
{
// console.log(path_values);
- //category
- index =
locate_in_array_options(0,"value",path_values.cat_id);
+ //district
+ index =
locate_in_array_options(0,"value",path_values.district_id);
if(index)
{
oMenuButton_0.set("label", ("<em>" +
array_options[0][index][1] + "</em>"));
}
- //status
- index =
locate_in_array_options(1,"value",path_values.status_id);
+ //category
+ index =
locate_in_array_options(1,"value",path_values.cat_id);
if(index)
{
oMenuButton_1.set("label", ("<em>" +
array_options[1][index][1] + "</em>"));
}
- //user
- index =
locate_in_array_options(2,"value",path_values.filter);
+ //status
+ index =
locate_in_array_options(2,"value",path_values.status_id);
if(index)
{
oMenuButton_2.set("label", ("<em>" +
array_options[2][index][1] + "</em>"));
}
+ //user
+ index =
locate_in_array_options(3,"value",path_values.filter);
+ if(index)
+ {
+ oMenuButton_3.set("label", ("<em>" +
array_options[3][index][1] + "</em>"));
+ }
oMenuButton_0.focus();
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [6680] property: Filter request on district,
Sigurd Nes <=