fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10145] display of bim type requirement (admin)


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [10145] display of bim type requirement (admin)
Date: Mon, 08 Oct 2012 11:02:25 +0000

Revision: 10145
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10145
Author:   erikhl
Date:     2012-10-08 11:02:24 +0000 (Mon, 08 Oct 2012)
Log Message:
-----------
display of bim type requirement (admin)

Modified Paths:
--------------
    trunk/logistic/inc/class.sobim_type_requirement.inc.php
    trunk/logistic/inc/class.uibim_type_requirement.inc.php
    trunk/logistic/inc/model/class.bim_item_type_requirement.inc.php
    trunk/logistic/templates/base/bim_type_requirement_item.xsl

Modified: trunk/logistic/inc/class.sobim_type_requirement.inc.php
===================================================================
--- trunk/logistic/inc/class.sobim_type_requirement.inc.php     2012-10-08 
10:59:02 UTC (rev 10144)
+++ trunk/logistic/inc/class.sobim_type_requirement.inc.php     2012-10-08 
11:02:24 UTC (rev 10145)
@@ -76,7 +76,7 @@
                        {
                                $ret = array
                                (
-                                       'table'                 => 'project', 
// alias
+                                       'table'                 => 
'type_requirement', // alias
                                        'field'                 => 'id',
                                        'translated'    => 'id'
                                );
@@ -89,7 +89,7 @@
                {
                        $clauses = array('1=1');
 
-                       if($search_for)
+                       /*if($search_for)
                        {
                                $like_pattern = "'%" . 
$this->db->db_addslashes($search_for) . "%'";
                                $like_clauses = array();
@@ -103,12 +103,12 @@
                                {
                                        $clauses[] = '(' . join(' OR ', 
$like_clauses) . ')';
                                }
-                       }
+                       }*/
 
                        $filter_clauses = array();
                        if(isset($filters[$this->get_id_field_name()]))
                        {
-                               $filter_clauses[] = 
"lg_bim_item_type_requirement.id = 
{$this->marshal($filters[$this->get_id_field_name()],'int')}";
+                               $filter_clauses[] = "type_requirement.id = 
{$this->marshal($filters[$this->get_id_field_name()],'int')}";
                        }
 
                        if(count($filter_clauses))
@@ -139,11 +139,11 @@
                        return "SELECT {$cols} FROM {$tables} WHERE 
{$condition} {$order}";
                }
 
-               protected function populate(int $id, 
&$bim_item_type_requirement)
+               protected function populate(int $req_id, 
&$bim_item_type_requirement)
                {
                        if($bim_item_type_requirement == null)
                        {
-                               $bim_item_type_requirement = new 
logistic_bim_item_type_requirement((int) $id);
+                               $bim_item_type_requirement = new 
logistic_bim_item_type_requirement((int) $req_id);
 
                                
$bim_item_type_requirement->set_entity_id($this->unmarshal($this->db->f('entity_id'),
 'int'));
                                
$bim_item_type_requirement->set_category_id($this->unmarshal($this->db->f('category_id'),
 'int'));
@@ -151,7 +151,7 @@
                                
$bim_item_type_requirement->set_project_type_id($this->unmarshal($this->db->f('project_type_id'),
 'int'));
                        }
 
-                       return $project;
+                       return $bim_item_type_requirement;
                }
 
                protected function update($object)

Modified: trunk/logistic/inc/class.uibim_type_requirement.inc.php
===================================================================
--- trunk/logistic/inc/class.uibim_type_requirement.inc.php     2012-10-08 
10:59:02 UTC (rev 10144)
+++ trunk/logistic/inc/class.uibim_type_requirement.inc.php     2012-10-08 
11:02:24 UTC (rev 10145)
@@ -98,9 +98,6 @@
                        $result_objects = array();
                        $result_count = 0;
 
-                       //Retrieve a project identifier and load corresponding 
project
-                       $project_id = phpgw::get_var('project_id');
-
                        $exp_param = phpgw::get_var('export');
                        $export = false;
                        if (isset($exp_param))
@@ -168,8 +165,8 @@
                                        'toolbar' => array(
                                                'item' => array(
                                                        array('type' => 
'filter',
-                                                               'name' => 
'bim_type',
-                                                               'text' => 
lang('Bim types') . ':',
+                                                               'name' => 
'entity_type',
+                                                               'text' => 
lang('Entity types') . ':',
                                                                'list' => 
$entity_list,
                                                        ),
                                                        array('type' => 'text',
@@ -194,11 +191,16 @@
                                        'source' => 
self::link(array('menuaction' => 'logistic.uibim_type_requirement.index', 
'phpgw_return_as' => 'json')),
                                        'field' => array(
                                                array(
-                                                       'key' => 'location_id',
-                                                       'label' => 
lang('Location'),
+                                                       'key' => 'entiry_id',
+                                                       'label' => 
lang('Entity'),
                                                        'sortable' => true
                                                ),
                                                array(
+                                                       'key' => 'category_id',
+                                                       'label' => 
lang('Category'),
+                                                       'sortable' => true
+                                               ),
+                                               array(
                                                        'key' => 'id',
                                                        'label' => lang('ID'),
                                                        'sortable' => true,
@@ -291,4 +293,31 @@
 
                        return $attrib_data;
                }
+
+               public function view()
+               {
+                       $entity_so      = 
CreateObject('property.soadmin_entity');
+                       $custom = createObject('phpgwapi.custom_fields');
+                       $req_type_id = phpgw::get_var('id');
+                       if($req_type_id && is_numeric($req_type_id))
+                       {
+                               $req_type = $this->so->get_single($req_type_id);
+                               $entity = 
$entity_so->read_single($req_type->get_entity_id());
+                               $category = 
$entity_so->read_single_category($req_type->get_entity_id(),$req_type->get_category_id());
+
+                               $project_type_array = 
$this->so_project->get_project_types();
+
+                               $data = array
+                                               (
+                                               'img_go_home' => 
'rental/templates/base/images/32x32/actions/go-home.png',
+                                               'req_type' => $req_type,
+                                               'entity' => $entity,
+                                               'category' => $category,
+                                               'attributes' => $attributes
+                                       );
+
+                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('logistic') . '::' . lang('Project type');
+                               
self::render_template_xsl(array('bim_type_requirement_item'), $data);
+                       }
+               }
        }

Modified: trunk/logistic/inc/model/class.bim_item_type_requirement.inc.php
===================================================================
--- trunk/logistic/inc/model/class.bim_item_type_requirement.inc.php    
2012-10-08 10:59:02 UTC (rev 10144)
+++ trunk/logistic/inc/model/class.bim_item_type_requirement.inc.php    
2012-10-08 11:02:24 UTC (rev 10145)
@@ -113,4 +113,15 @@
 
                        return self::$so;
                }
+
+               public function serialize()
+               {
+                       return array(
+                               'id' => $this->get_id(),
+                               'entity_id' => $this->get_entity_id(),
+                               'category_id' => $this->get_category_id(),
+                               'atributes' => $this->get_cust_attribute_id(),
+                               'project_type_id' => 
$this->get_project_type_id()
+                       );
+               }
        }
\ No newline at end of file

Modified: trunk/logistic/templates/base/bim_type_requirement_item.xsl
===================================================================
--- trunk/logistic/templates/base/bim_type_requirement_item.xsl 2012-10-08 
10:59:02 UTC (rev 10144)
+++ trunk/logistic/templates/base/bim_type_requirement_item.xsl 2012-10-08 
11:02:24 UTC (rev 10145)
@@ -31,7 +31,7 @@
                                                                </select>
                                                        </xsl:when>
                                                        <xsl:otherwise>
-                                                               <xsl:value-of 
select="project_type_id" />
+                                                               <xsl:value-of 
select="req_type/project_type_id" />
                                                        </xsl:otherwise>
                                                </xsl:choose>
                                        </dd>
@@ -65,8 +65,11 @@
                                                        </dd>
                                                </xsl:when>
                                                <xsl:otherwise>
-                                                       Visningsmodus!
-                                                       <xsl:value-of 
select="cust_attribute_id" />
+                                                       <xsl:value-of 
select="entity/name" />
+                                                       <xsl:value-of 
select="category/name" />
+                                                       <xsl:for-each 
select="attributes">
+                                                               <xsl:value-of 
select="name" /><br/>
+                                                       </xsl:for-each>
                                                </xsl:otherwise>
                                        </xsl:choose>
                                </dl>




reply via email to

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