[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [6884] Merge 6882:6883 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [6884] Merge 6882:6883 from trunk |
Date: |
Mon, 31 Jan 2011 14:20:30 +0000 |
Revision: 6884
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6884
Author: sigurdne
Date: 2011-01-31 14:20:30 +0000 (Mon, 31 Jan 2011)
Log Message:
-----------
Merge 6882:6883 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/property/inc/class.botts.inc.php
branches/Version-1_0-branch/property/inc/class.sotts.inc.php
branches/Version-1_0-branch/property/inc/class.uitts.inc.php
branches/Version-1_0-branch/property/js/yahoo/tts.index.js
Property Changed:
----------------
branches/Version-1_0-branch/
Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
-
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881
+
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883
Modified: branches/Version-1_0-branch/property/inc/class.botts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.botts.inc.php
2011-01-31 14:19:39 UTC (rev 6883)
+++ branches/Version-1_0-branch/property/inc/class.botts.inc.php
2011-01-31 14:20:30 UTC (rev 6884)
@@ -92,8 +92,8 @@
$start_date =
phpgw::get_var('start_date', 'string');
$end_date =
phpgw::get_var('end_date', 'string');
$location_code =
phpgw::get_var('location_code');
+ $vendor_id =
phpgw::get_var('vendor_id', 'int');
-
// $this->start = $start
? $start : 0;
$this->start =
isset($_REQUEST['start']) ? $start :
$this->start;
@@ -109,7 +109,7 @@
$this->start_date =
isset($_REQUEST['start_date']) ? $start_date :
$this->start_date;
$this->end_date =
isset($_REQUEST['end_date']) ? $end_date :
$this->end_date;
$this->location_code = isset($location_code) &&
$location_code ? $location_code : '';
-
+ $this->vendor_id =
isset($_REQUEST['vendor_id']) ? $vendor_id :
$this->vendor_id;
$this->p_num =
phpgw::get_var('p_num');
}
@@ -138,6 +138,7 @@
$this->allrows =
isset($data['allrows'])?$data['allrows']:'';
$this->start_date =
isset($data['start_date'])?$data['start_date']:'';
$this->end_date =
isset($data['end_date'])?$data['end_date']:'';
+ $this->vendor_id =
isset($data['vendor_id'])?$data['vendor_id']:'';
}
function column_list($selected =
array(),$type_id='',$allrows='')
@@ -306,7 +307,7 @@
'status_id' => $this->status_id,'cat_id' =>
$this->cat_id,'district_id' => $this->district_id,
'part_of_town_id' => $this->part_of_town_id,
'start_date'=>$start_date,'end_date'=>$end_date,
'allrows'=>$this->allrows,'user_id' =>
$this->user_id,'external'=>$external, 'dry_run' => $dry_run,
- 'location_code' => $this->location_code,
'p_num' => $this->p_num));
+ 'location_code' => $this->location_code,
'p_num' => $this->p_num, 'vendor_id' => $this->vendor_id));
$this->total_records = $this->so->total_records;
$this->sum_budget = $this->so->sum_budget;
@@ -407,7 +408,7 @@
}
}
if( $ticket['vendor_id'])
- {
+ {;
if(isset($vendor_cache[$ticket['vendor_id']]))
{
$ticket['vendor'] =
$vendor_cache[$ticket['vendor_id']];
@@ -430,7 +431,6 @@
}
}
}
-
return $tickets;
}
@@ -996,4 +996,25 @@
$this->fields_updated = $this->so->fields_updated;
return $receipt;
}
+
+ public function get_vendors($selected)
+ {
+ $vendors = $this->so->get_vendors();
+ foreach ($vendors as &$vendor)
+ {
+ if($vendor['id'] == $selected)
+ {
+ $vendor['selected'] = 1;
+ break;
+ }
+ }
+
+ $default_value = array
+ (
+ 'id' => '',
+ 'name' => lang('vendor')
+ );
+ array_unshift($vendors,$default_value);
+ return $vendors;
+ }
}
Modified: branches/Version-1_0-branch/property/inc/class.sotts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sotts.inc.php
2011-01-31 14:19:39 UTC (rev 6883)
+++ branches/Version-1_0-branch/property/inc/class.sotts.inc.php
2011-01-31 14:20:30 UTC (rev 6884)
@@ -122,7 +122,7 @@
$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'] ? $data['cat_id']:0;
+ $cat_id = isset($data['cat_id']) &&
$data['cat_id'] ? (int)$data['cat_id']:0;
$district_id = isset($data['district_id']) &&
$data['district_id'] ? (int)$data['district_id']:0;
$part_of_town_id= isset($data['part_of_town_id']) &&
$data['part_of_town_id'] ? (int)$data['part_of_town_id']:0;
$allrows =
isset($data['allrows'])?$data['allrows']:'';
@@ -133,6 +133,7 @@
$new = isset($data['new']) ?
$data['new'] : '';
$location_code = isset($data['location_code']) ?
$data['location_code'] : '';
$p_num = isset($data['p_num']) ?
$data['p_num'] : '';
+ $vendor_id = isset($data['vendor_id']) &&
$data['vendor_id'] ? (int)$data['vendor_id']:0;
$this->grants =
$GLOBALS['phpgw']->session->appsession('grants_ticket','property');
@@ -307,6 +308,12 @@
$where = 'AND';
}
+ if ($vendor_id > 0)
+ {
+ $filtermethod .= " $where vendor_id=" .
(int)$vendor_id;
+ $where = 'AND';
+ }
+
if ($user_id > 0)
{
$filtermethod .= " {$where}
(assignedto={$user_id}";
@@ -1247,4 +1254,23 @@
return false;
}
}
+
+ public function get_vendors()
+ {
+ $vendors = array();
+ $sql = "SELECT DISTINCT fm_vendor.id,
fm_vendor.org_name FROM fm_tts_tickets {$this->join} fm_vendor ON
fm_tts_tickets.vendor_id = fm_vendor.id ORDER BY org_name ASC";
+
+ $this->db->query($sql, __LINE__,__FILE__);
+
+ while ($this->db->next_record())
+ {
+ $vendors[] = array
+ (
+ 'id' => $this->db->f('id'),
+ 'name' => $this->db->f('org_name',
true)
+ );
+ }
+
+ return $vendors;
+ }
}
Modified: branches/Version-1_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uitts.inc.php
2011-01-31 14:19:39 UTC (rev 6883)
+++ branches/Version-1_0-branch/property/inc/class.uitts.inc.php
2011-01-31 14:20:30 UTC (rev 6884)
@@ -97,6 +97,7 @@
$this->status_id =
$this->bo->status_id;
$this->user_id =
$this->bo->user_id;
$this->cat_id =
$this->bo->cat_id;
+ $this->vendor_id =
$this->bo->vendor_id;
$this->district_id =
$this->bo->district_id;
$this->part_of_town_id =
$this->bo->part_of_town_id;
$this->allrows =
$this->bo->allrows;
@@ -140,6 +141,7 @@
'status_id' =>
$this->status_id,
'user_id' =>
$this->user_id,
'cat_id' =>
$this->cat_id,
+ 'vendor_id' =>
$this->vendor_id,
'district_id' => $this->district_id,
'part_of_town_id'=>
$this->part_of_town_id,
'allrows' =>
$this->allrows,
@@ -441,6 +443,7 @@
$allrows = phpgw::get_var('allrows',
'bool');
$datatable = array();
+ $order_read = $this->acl->check('.ticket.order',
PHPGW_ACL_READ, 'property');
if( phpgw::get_var('phpgw_return_as') != 'json' )
{
@@ -464,6 +467,7 @@
."sort: '{$this->sort}',"
."order: '{$this->order}',"
."cat_id:'{$this->cat_id}',"
+ ."vendor_id:'{$this->vendor_id}',"
."status_id: '{$this->status_id}',"
."user_id: '{$this->user_id}',"
."query: '{$this->query}',"
@@ -482,6 +486,7 @@
'sort'
=> $this->sort,
'order'
=> $this->order,
'cat_id'
=> $this->cat_id,
+ 'vendor_id'
=> $this->vendor_id,
'status_id'
=> $this->status_id,
'user_id'
=> $this->user_id,
'query'
=> $this->query,
@@ -548,6 +553,7 @@
'district_id' => $this->district_id,
'part_of_town_id' => $this->part_of_town_id,
'cat_id' => $this->cat_id,
+
'vendor_id' => $this->vendor_id,
'status' => $this->status
)
),
@@ -600,7 +606,7 @@
'type' => 'select',
'style' => 'filter',
'values' => $values_combo_box[4],
-
'onchange'=> 'onChangeSelect();',
+
'onchange'=> 'onChangeSelect("user_id");',
'tab_index' => 5
),
array
@@ -707,6 +713,21 @@
)
)
);
+
+ if($order_read)
+ {
+
$datatable['actions']['form'][0]['fields']['field'][] = array
+ (
+ 'id' =>
'sel_vendor_id', // testing traditional listbox for long list
+ 'name'
=> 'vendor_id',
+ 'value'
=> lang('vendor'),
+ 'type'
=> 'select',
+ 'style'
=> 'filter',
+
'values' => $this->bo->get_vendors($this->vendor_id),
+
'onchange'=> 'onChangeSelect("vendor_id");',
+
'tab_index' => 12
+ );
+ }
}
else
{
@@ -828,7 +849,7 @@
$uicols['name'][] = 'status';
$uicols['descr'][] = lang('status');
- if( $this->acl->check('.ticket.order', PHPGW_ACL_READ,
'property') )
+ if( $order_read )
{
$uicols['name'][] = 'order_id';
$uicols['descr'][] = lang('order id');
@@ -1441,6 +1462,7 @@
(
'sort' => $this->sort,
'var' => 'finnish_date',
+
'order' => $this->order,
'extra' => array
(
Modified: branches/Version-1_0-branch/property/js/yahoo/tts.index.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/tts.index.js 2011-01-31
14:19:39 UTC (rev 6883)
+++ branches/Version-1_0-branch/property/js/yahoo/tts.index.js 2011-01-31
14:20:30 UTC (rev 6884)
@@ -47,9 +47,9 @@
elCell.innerHTML = "<P align=\"right\">"+oData+"</p>";
}
- this.onChangeSelect = function()
+ this.onChangeSelect = function(type)
{
- var myselect=document.getElementById("sel_user_id");
+ var myselect=document.getElementById("sel_"+ type);
for (var i=0; i<myselect.options.length; i++)
{
if (myselect.options[i].selected==true)
@@ -57,7 +57,7 @@
break;
}
}
- eval("path_values.user_id='"+myselect.options[i].value+"'");
+ eval("path_values." +type +"='"+myselect.options[i].value+"'");
execute_ds();
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [6884] Merge 6882:6883 from trunk,
Sigurd Nes <=