fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [10391]


From: Torstein
Subject: [Fmsystem-commits] [10391]
Date: Wed, 31 Oct 2012 09:45:18 +0000

Revision: 10391
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10391
Author:   vator
Date:     2012-10-31 09:45:18 +0000 (Wed, 31 Oct 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/logistic/inc/class.sorequirement_resource_allocation.inc.php
    trunk/logistic/inc/class.uiactivity.inc.php
    trunk/logistic/inc/class.uirequirement_resource_allocation.inc.php
    trunk/logistic/inc/model/class.requirement_resource_allocation.inc.php
    trunk/logistic/templates/base/requirement/requirement_overview.xsl

Modified: trunk/logistic/inc/class.sorequirement_resource_allocation.inc.php
===================================================================
--- trunk/logistic/inc/class.sorequirement_resource_allocation.inc.php  
2012-10-31 08:41:11 UTC (rev 10390)
+++ trunk/logistic/inc/class.sorequirement_resource_allocation.inc.php  
2012-10-31 09:45:18 UTC (rev 10391)
@@ -142,20 +142,23 @@
 
 
                        $tables = "lg_requirement_resource_allocation 
allocation";
-
+                       $joins = "      {$this->left_join} phpgw_locations ON 
(phpgw_locations.location_id = allocation.location_id)";
+                       
                        if($return_count)
                        {
                                $cols = 'COUNT(DISTINCT(allocation.id)) AS 
count';
                        }
                        else
                        {
-                               $cols .= "allocation.* ";
+                               $cols .= "allocation.*, ";
+                               $cols .= "phpgw_locations.descr AS 
resource_type_descr";
+                       
                        }
-
+                       
                        $dir = $ascending ? 'ASC' : 'DESC';
                        $order = $sort_field ? "ORDER BY 
{$this->marshal($sort_field, 'field')} $dir ": '';
-
-                       return "SELECT {$cols} FROM {$tables} WHERE 
{$condition} {$order}";
+                       
+                       return "SELECT {$cols} FROM {$tables} {$joins} WHERE 
{$condition} {$order}";
                }
 
                protected function populate(int $allocation_id, &$allocation)
@@ -167,6 +170,7 @@
                                
$allocation->set_location_id($this->unmarshal($this->db->f('location_id'), 
'int'));
                                
$allocation->set_requirement_id($this->unmarshal($this->db->f('requirement_id'),
 'string'));
                                
$allocation->set_resource_id($this->unmarshal($this->db->f('resource_id'), 
'int'));
+                               
$allocation->set_resource_type_descr($this->unmarshal($this->db->f('resource_type_descr'),
 'string'));
                        }
 
                        return $allocation;

Modified: trunk/logistic/inc/class.uiactivity.inc.php
===================================================================
--- trunk/logistic/inc/class.uiactivity.inc.php 2012-10-31 08:41:11 UTC (rev 
10390)
+++ trunk/logistic/inc/class.uiactivity.inc.php 2012-10-31 09:45:18 UTC (rev 
10391)
@@ -146,11 +146,6 @@
                                        (
                                                array
                                                (
-                                                       'name'          => 
'parent_id',
-                                                       'source'        => 'id'
-                                               ),
-                                               array
-                                               (
                                                        'name'          => 
'activity_id',
                                                        'source'        => 'id'
                                                ),
@@ -387,57 +382,6 @@
                        
self::render_template_xsl(array('activity/activity_item'), $data);
                }
                
-               public function view_2()
-               {
-                       $activity_id = phpgw::get_var('id');
-                       $project_id = phpgw::get_var('project_id');
-                       if (isset($_POST['edit_activity']))
-                       {
-                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiactivity.edit', 'id' => $activity_id, 
'project_id' => $project_id));
-                       }
-                       else if (isset($_POST['new_activity']))
-                       {
-                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiactivity.edit', 'project_id' => $project_id));
-                       }
-                       else
-                       {
-                               if ($activity_id && is_numeric($activity_id))
-                               {
-                                       $activity = 
$this->so->get_single($activity_id);
-                                       $responsible_user = 
$this->so->get_responsible_user($activity->get_responsible_user_id());
-                                       
$activity->set_responsible_user_name($responsible_user);
-                               }
-
-                               $activity_array = $activity->toArray();
-
-                               if ($this->flash_msgs)
-                               {
-                                       $msgbox_data = 
$GLOBALS['phpgw']->common->msgbox_data($this->flash_msgs);
-                                       $msgbox_data = 
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
-                               }
-
-                               $activity->set_project_id($project_id);
-                               
-                               $data = array
-                               (
-                                       'activity' => $activity->toArray()
-                               );
-
-                               if($activity->get_parent_id() > 0)
-                               {
-                                       $parent_activity = 
$this->so->get_single($activity->get_parent_id());
-                                       $data['parent_activity'] = 
$parent_activity->toArray();
-                               }
-                               
-                               echo $activity->get_id();
-                               
-                               $activity_children = 
$this->so->get($activity->get_id());
-                               
-                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('logistic') . '::' . lang('Project');
-                               
self::render_template_xsl(array('activity/activity_item_2'), $data);
-                       }
-               }
-               
                public function save()
                {
                        $activity_id = phpgw::get_var('id');

Modified: trunk/logistic/inc/class.uirequirement_resource_allocation.inc.php
===================================================================
--- trunk/logistic/inc/class.uirequirement_resource_allocation.inc.php  
2012-10-31 08:41:11 UTC (rev 10390)
+++ trunk/logistic/inc/class.uirequirement_resource_allocation.inc.php  
2012-10-31 09:45:18 UTC (rev 10391)
@@ -134,6 +134,11 @@
                                                        'sortable' => true,
                                                ),
                                                array(
+                                                       'key' => 
'resource_type',
+                                                       'label' => 
lang('Resource type'),
+                                                       'sortable' => true
+                                               ),
+                                               array(
                                                        'key' => 
'requirement_id',
                                                        'label' => 
lang('Requirememnt id'),
                                                        'sortable' => true
@@ -157,7 +162,6 @@
 
                public function query()
                {
-
                        $params = array(
                                'start' => phpgw::get_var('startIndex', 'int', 
'REQUEST', 0),
                                'results' => phpgw::get_var('results', 'int', 
'REQUEST', null),

Modified: trunk/logistic/inc/model/class.requirement_resource_allocation.inc.php
===================================================================
--- trunk/logistic/inc/model/class.requirement_resource_allocation.inc.php      
2012-10-31 08:41:11 UTC (rev 10390)
+++ trunk/logistic/inc/model/class.requirement_resource_allocation.inc.php      
2012-10-31 09:45:18 UTC (rev 10391)
@@ -38,6 +38,8 @@
                protected $resource_id;
                protected $location_id;
                protected $create_user;
+               
+               protected $resource_type_descr;
 
                /**
                 * Constructor.  Takes an optional ID.  If a contract is 
created from outside
@@ -99,7 +101,17 @@
                {
                        return $this->create_user;
                }
+               
+               public function set_resource_type_descr($resource_type_descr)
+               {
+                       $this->resource_type_descr = $resource_type_descr;
+               }
 
+               public function get_resource_type_descr()
+               {
+                       return $this->resource_type_descr;
+               }
+
                /**
                * Get a static reference to the storage object associated with 
this model object
                *
@@ -118,6 +130,7 @@
                {
                        return array(
                                'id' => $this->get_id(),
+                               'resource_type_descr' => 
$this->get_resource_type_descr(),
                                'requirement_id' => $this->get_requirement_id(),
                                'resource_id' => $this->get_resource_id(),
                                'location_id' => $this->get_location_id()

Modified: trunk/logistic/templates/base/requirement/requirement_overview.xsl
===================================================================
--- trunk/logistic/templates/base/requirement/requirement_overview.xsl  
2012-10-31 08:41:11 UTC (rev 10390)
+++ trunk/logistic/templates/base/requirement/requirement_overview.xsl  
2012-10-31 09:45:18 UTC (rev 10391)
@@ -40,7 +40,7 @@
                                </form>
                                </div>
                                
-                       <h2 style="clear:both;">Allokering av krav</h2>
+                       <h2 style="clear:both;">Allokerte ressurser</h2>
                        <div id="allocation-container"></div>
        </div>
        <xsl:call-template name="datasource-definition" />
@@ -96,10 +96,11 @@
                                var requestUrl = phpGWLink('index.php', oArgs, 
true);
                        
                                var myColumnDefs = [ 
-                               {key:"id", sortable:true}, 
+                               {key:"id", sortable:true},
+                               {key:"resource_type_descr", 
label:'Ressurstype', sortable:true}, 
                                {key:"requirement_id", sortable:true}, 
                                {key:"location_id", sortable:true}, 
-                               {key:"resource_id", sortable:true} 
+                               {key:"resource_id", sortable:true}
                            ]; 
                        
                                
YAHOO.portico.inlineTableHelper('allocation-container', requestUrl, 
myColumnDefs);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]