[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [10708] logistic: show criteria on requirements
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [10708] logistic: show criteria on requirements |
Date: |
Wed, 23 Jan 2013 10:39:55 +0000 |
Revision: 10708
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10708
Author: sigurdne
Date: 2013-01-23 10:39:53 +0000 (Wed, 23 Jan 2013)
Log Message:
-----------
logistic: show criteria on requirements
Modified Paths:
--------------
trunk/logistic/inc/class.sorequirement.inc.php
trunk/logistic/inc/class.uiactivity.inc.php
trunk/logistic/inc/class.uirequirement.inc.php
trunk/logistic/inc/model/class.requirement.inc.php
Modified: trunk/logistic/inc/class.sorequirement.inc.php
===================================================================
--- trunk/logistic/inc/class.sorequirement.inc.php 2013-01-23 08:47:03 UTC
(rev 10707)
+++ trunk/logistic/inc/class.sorequirement.inc.php 2013-01-23 10:39:53 UTC
(rev 10708)
@@ -191,4 +191,4 @@
}
return self::$so;
}
- }
\ No newline at end of file
+ }
Modified: trunk/logistic/inc/class.uiactivity.inc.php
===================================================================
--- trunk/logistic/inc/class.uiactivity.inc.php 2013-01-23 08:47:03 UTC (rev
10707)
+++ trunk/logistic/inc/class.uiactivity.inc.php 2013-01-23 10:39:53 UTC (rev
10708)
@@ -655,11 +655,16 @@
'sortable' => false
),
array(
- 'key' => 'location_id',
+ 'key' =>
'location_label',
'label' =>
lang('Resource type'),
'sortable' => false
),
array(
+ 'key' => 'criterias',
+ 'label' =>
lang('Criterias'),
+ 'sortable' => false
+ ),
+ array(
'key' => 'link',
'hidden' => true
),
Modified: trunk/logistic/inc/class.uirequirement.inc.php
===================================================================
--- trunk/logistic/inc/class.uirequirement.inc.php 2013-01-23 08:47:03 UTC
(rev 10707)
+++ trunk/logistic/inc/class.uirequirement.inc.php 2013-01-23 10:39:53 UTC
(rev 10708)
@@ -158,17 +158,56 @@
$rows[] = $result->serialize();
}
}
+
+ //Sigurd
+ $custom = createObject('phpgwapi.custom_fields');
+
//_debug_array($rows);
$line_id = 0; // optional preselect
foreach($rows as &$entry)
{
-//FIXME: hent verdier
-/*
+//-----------Sigurd
$_filters = array('requirement_id' =>
$entry['id']);
$requirement_values_array =
$this->so_requirement_value->get(0, false, $sort_field, $sort_ascending,
$search_for, $search_type, $_filters);
-*/
+ $location_id = $entry['location_id'];
+ $criterias = array();
+ if( count( $requirement_values_array ) > 0 )
+ {
+ foreach($requirement_values_array as
$requirement_value)
+ {
+ $loc_arr =
$GLOBALS['phpgw']->locations->get_name($location_id);
+ $cust_attribute_id =
$requirement_value->get_cust_attribute_id();
+
+ $attrib_data =
$custom->get('property', $loc_arr['location'], $cust_attribute_id);
+
+ $_criterie =
$attrib_data['input_text'];
+
+
if(isset($attrib_data['choice']))
+ {
+ foreach
($attrib_data['choice'] as $_choice)
+ {
+
if($_choice['id'] == $requirement_value->get_value())
+ {
+
$_criterie .= "::{$_choice['value']}";
+ break;
+ }
+ }
+ }
+ else
if($requirement_value->get_value())
+ {
+ $_criterie .=
"::{$requirement_value->get_value()}";
+ }
+
+ $criterias[] = $_criterie;
+
+// $operator =
$requirement_value->get_operator();
+ }
+ }
+ $entry['criterias'] = implode(',',$criterias);
+
+//-------------
$_checked = '';
if($entry['id'] == $line_id)
@@ -288,7 +327,7 @@
'sortable' => false
),
array(
- 'key' => 'location_id',
+ 'key' =>
'location_label',
'label' =>
lang('Resource type'),
'sortable' => false
),
Modified: trunk/logistic/inc/model/class.requirement.inc.php
===================================================================
--- trunk/logistic/inc/model/class.requirement.inc.php 2013-01-23 08:47:03 UTC
(rev 10707)
+++ trunk/logistic/inc/model/class.requirement.inc.php 2013-01-23 10:39:53 UTC
(rev 10708)
@@ -156,7 +156,8 @@
'start_date' => $this->get_start_date() ?
date($date_format, $this->get_start_date()): '',
'end_date' => $this->get_end_date() ?
date($date_format, $this->get_end_date()): '',
'no_of_items' => $this->get_no_of_items(),
- 'location_id' => $category_label,
+ 'location_id' => $this->get_location_id(),
+ 'location_label' => $category_label,
);
}
@@ -232,4 +233,4 @@
return $status;
}
- }
\ No newline at end of file
+ }
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [10708] logistic: show criteria on requirements,
Sigurd Nes <=