fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10111] fix on datatable show alle elements


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [10111] fix on datatable show alle elements
Date: Thu, 04 Oct 2012 08:53:35 +0000

Revision: 10111
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10111
Author:   erikhl
Date:     2012-10-04 08:53:35 +0000 (Thu, 04 Oct 2012)
Log Message:
-----------
fix on datatable show alle elements

Modified Paths:
--------------
    trunk/logistic/inc/class.soproject.inc.php
    trunk/logistic/inc/class.uiproject.inc.php
    trunk/logistic/inc/model/class.project.inc.php

Modified: trunk/logistic/inc/class.soproject.inc.php
===================================================================
--- trunk/logistic/inc/class.soproject.inc.php  2012-10-04 08:52:55 UTC (rev 
10110)
+++ trunk/logistic/inc/class.soproject.inc.php  2012-10-04 08:53:35 UTC (rev 
10111)
@@ -35,7 +35,14 @@
        class logistic_soproject extends logistic_socommon
        {
                protected static $so;
+               protected $db3;
 
+               public function __construct()
+               {
+                       parent::__construct();
+                       $this->db3 = clone $this->db;
+               }
+
                /**
                 * Get a static reference to the storage object associated with 
this model object
                 *
@@ -146,7 +153,7 @@
                        {
                                $filter_clauses[] = "{$table_alias}.id = 
{$this->marshal($filters[$this->get_id_field_name()],'int')}";
                        }
-                       if(isset($filters['project_type']) && 
!$filters['project_type'] == '')
+                       if(isset($filters['project_type']) && 
(!$filters['project_type'] == '' || !$filters['project_type'] == 0))
                        {
                                $filter_clauses[] = 
"{$table_alias}.project_type_id = {$this->marshal($filters['project_type'], 
'int')}";
                        }
@@ -175,7 +182,7 @@
                        }
                        else
                        {
-                               $cols .= "* ";
+                               $cols .= "$table_alias.* ";
                        }
 
                        $dir = $ascending ? 'ASC' : 'DESC';
@@ -183,7 +190,7 @@
 
                        //var_dump("SELECT {$cols} FROM {$tables} {$joins} 
WHERE {$condition} {$order}");
 
-                       return "SELECT {$cols} FROM {$tables} {$joins} WHERE 
{$condition} {$order}";
+                       return "SELECT {$cols} FROM {$tables} WHERE 
{$condition} {$order}";
                }
 
                protected function populate(int $project_id, &$project)
@@ -229,11 +236,11 @@
                private function get_project_type_label($id)
                {
                        $sql = "SELECT name FROM lg_project_type where id=$id";
-                       $this->db->query($sql, __LINE__, __FILE__);
+                       $this->db3->query($sql, __LINE__, __FILE__);
 
-                       while ($this->db->next_record())
+                       while ($this->db3->next_record())
                        {
-                               return $this->db->f('name');
+                               return $this->db3->f('name');
                        }
                }
 

Modified: trunk/logistic/inc/class.uiproject.inc.php
===================================================================
--- trunk/logistic/inc/class.uiproject.inc.php  2012-10-04 08:52:55 UTC (rev 
10110)
+++ trunk/logistic/inc/class.uiproject.inc.php  2012-10-04 08:53:35 UTC (rev 
10111)
@@ -54,6 +54,13 @@
 
                        $this->so = CreateObject('logistic.soproject');
 
+                       $read    = $GLOBALS['phpgw']->acl->check('.project', 
PHPGW_ACL_READ, 'logistic');//1
+                       $add     = $GLOBALS['phpgw']->acl->check('.project', 
PHPGW_ACL_ADD, 'logistic');//2
+                       $edit    = $GLOBALS['phpgw']->acl->check('.project', 
PHPGW_ACL_EDIT, 'logistic');//4
+                       $delete  = $GLOBALS['phpgw']->acl->check('.project', 
PHPGW_ACL_DELETE, 'logistic');//8
+
+                       $manage  = $GLOBALS['phpgw']->acl->check('.project', 
16, 'logistic');//16
+
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"logistic::project";
                }
 
@@ -88,7 +95,7 @@
                        $result_objects = array();
                        $result_count = 0;
 
-                       //Retrieve a contract identifier and load corresponding 
contract
+                       //Retrieve a project identifier and load corresponding 
project
                        $project_id = phpgw::get_var('project_id');
 
                        $exp_param = phpgw::get_var('export');
@@ -117,7 +124,7 @@
                                        $object_count = 
$this->so->get_count($search_for, $search_type, $filters);
                                        break;
                        }
-
+                       //var_dump($result_objects);
                        //Create an empty row set
                        $rows = array();
                        foreach ($result_objects as $result)
@@ -161,7 +168,7 @@
                        {
                                return $this->query();
                        }
-//                     self::add_javascript('logistic', 'yahoo', 
'datatable.js');
+
                        self::add_javascript('phpgwapi', 'yahoo', 
'datatable.js');
                        phpgwapi_yui::load_widget('datatable');
                        phpgwapi_yui::load_widget('paginator');
@@ -359,7 +366,7 @@
                                        (
                                        'value_id' => !empty($project) ? 
$project->get_id() : 0,
                                        'img_go_home' => 
'rental/templates/base/images/32x32/actions/go-home.png',
-                                       'project' => $project_array,
+                                       'project' => $project,
                                        'view' => 'view_project'
                                );
 
@@ -394,7 +401,7 @@
                                        (
                                        'value_id' => !empty($project) ? 
$project->get_id() : 0,
                                        'img_go_home' => 
'rental/templates/base/images/32x32/actions/go-home.png',
-                                       'project' => $project_array
+                                       'project' => $project
                                );
 
                                $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('logistic') . '::' . lang('Project type');

Modified: trunk/logistic/inc/model/class.project.inc.php
===================================================================
--- trunk/logistic/inc/model/class.project.inc.php      2012-10-04 08:52:55 UTC 
(rev 10110)
+++ trunk/logistic/inc/model/class.project.inc.php      2012-10-04 08:53:35 UTC 
(rev 10111)
@@ -28,7 +28,7 @@
        */
 
                include_class('logistic', 'model', '/inc/model/');
-               
+
                class logistic_project extends logistic_model
                {
                                public static $so;
@@ -42,7 +42,7 @@
                                /**
                                * Constructor.  Takes an optional ID.  If a 
contract is created from outside
                                * the database the ID should be empty so the 
database can add one according to its logic.
-                               * 
+                               *
                                * @param int $id the id of this project
                                */
                                public function __construct(int $id = null)
@@ -67,42 +67,42 @@
 
                                public function get_name()
                                {
-                                       return $this->name; 
+                                       return $this->name;
                                }
-                               
+
                                public function 
set_project_type_id($project_type_id)
                                {
                                        $this->project_type_id = 
$project_type_id;
                                }
-                               
+
                                public function get_project_type_id()
                                {
                                        return $this->project_type_id;
                                }
-                               
+
                                public function 
set_project_type_label($project_type_label)
                                {
                                        $this->project_type_label = 
$project_type_label;
                                }
-                               
+
                                public function get_project_type_label()
                                {
                                        return $this->project_type_label;
                                }
-                               
+
                                public function set_description($description)
                                {
                                        $this->description = $description;
                                }
-                               
+
                                public function get_description()
                                {
                                        return $this->description;
                                }
-                               
+
                                /**
                                * Get a static reference to the storage object 
associated with this model object
-                               * 
+                               *
                                * @return the storage object
                                */
                                public static function get_so()




reply via email to

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