fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7596]


From: Torstein
Subject: [Fmsystem-commits] [7596]
Date: Thu, 15 Sep 2011 07:42:42 +0000

Revision: 7596
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7596
Author:   vator
Date:     2011-09-15 07:42:41 +0000 (Thu, 15 Sep 2011)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/class.uicontrol_item.inc.php
    trunk/controller/inc/model/class.control_group.inc.php
    trunk/controller/inc/model/class.control_item.inc.php
    trunk/controller/templates/base/control_item.php

Added Paths:
-----------
    trunk/controller/inc/class.socontrol_group.inc.php
    trunk/controller/inc/class.socontrol_type.inc.php

Removed Paths:
-------------
    trunk/controller/inc/class.socontrol_group.inc.php

Deleted: trunk/controller/inc/class.socontrol_group.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_group.inc.php  2011-09-15 07:19:15 UTC 
(rev 7595)
+++ trunk/controller/inc/class.socontrol_group.inc.php  2011-09-15 07:42:41 UTC 
(rev 7596)
@@ -1,176 +0,0 @@
-<?php
-phpgw::import_class('controller.socommon');
-
-include_class('controller', 'control_group', 'inc/model/');
-
-class controller_socontrol_group extends controller_socommon
-{
-       protected static $so;
-
-       /**
-        * Get a static reference to the storage object associated with this 
model object
-        *
-        * @return controller_soparty the storage object
-        */
-       public static function get_instance()
-       {
-               if (self::$so == null) {
-                       self::$so = CreateObject('controller.socontrol_group');
-               }
-               return self::$so;
-       }
-
-       /**
-        * Function for adding a new activity to the database. Updates the 
activity object.
-        *
-        * @param activitycalendar_activity $activity the party to be added
-        * @return bool true if successful, false otherwise
-        */
-       function add(&$control_group)
-       {
-               
-               $control_group = $control_group->get_control_group();
-               
-               $sql = "INSERT INTO controller_control_group (group_name) 
VALUES ('$title')";
-               $result = $this->db->query($sql, __LINE__,__FILE__);
-
-               if(isset($result)) {
-                       // Set the new party ID
-                       
$control_group->set_id($this->db->get_last_insert_id('controller_control_group',
 'id'));
-                       // Forward this request to the update method
-                       return $this->update($control_group);
-               }
-               else
-               {
-                       return false;
-               }
-               
-       }
-
-       /**
-        * Update the database values for an existing activity object.
-        *
-        * @param $activity the activity to be updated
-        * @return boolean true if successful, false otherwise
-        */
-
-       function update($control_group)
-       {       
-               $id = intval($control_group->get_id());
-                       
-               $values = array(
-                       '$group_name = ' . 
$this->marshal($control_group->get_group_name(), 'string')
-               );
-               
-               //var_dump('UPDATE activity_activity SET ' . join(',', $values) 
. " WHERE id=$id");
-               $result = $this->db->query('UPDATE controller_control_group SET 
' . join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
-               
-               return isset($result);
-       }
-       
-       /**
-        * Get single procedure
-        * 
-        * @param       $id     id of the procedure to return
-        * @return a controller_procedure
-        */
-       function get_single($id)
-       {
-               $id = (int)$id;
-               
-               $sql = "SELECT p.* FROM controller_control_group p WHERE p.id = 
" . $id;
-               $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
-               $this->db->next_record();
-               
-               $control_group = new 
controller_control_group($this->unmarshal($this->db->f('id', true), 'int'));
-               
$control_group->set_group_name($this->unmarshal($this->db->f('group_name', 
true), 'string'));
-               
-               return $control_group;
-       }
-       
-       /**
-        * Get a list of procedure objects matching the specific filters
-        * 
-        * @param $start search result offset
-        * @param $results number of results to return
-        * @param $sort field to sort by
-        * @param $query LIKE-based query string
-        * @param $filters array of custom filters
-        * @return list of rental_composite objects
-        */
-       function get_control_group_array($start = 0, $results = 1000, $sort = 
null, $dir = '', $query = null, $search_option = null, $filters = array())
-       {
-               $results = array();
-               
-               //$condition = $this->get_conditions($query, 
$filters,$search_option);
-               $order = $sort ? "ORDER BY $sort $dir ": '';
-               
-               //$sql = "SELECT * FROM controller_procedure WHERE $condition 
$order";
-               $sql = "SELECT * FROM controller_control_group $order";
-               $this->db->limit_query($sql, $start, __LINE__, __FILE__, 
$limit);
-               
-               while ($this->db->next_record()) {
-                       $control_group = new 
controller_control_group($this->unmarshal($this->db->f('id', true), 'int'));
-                       
$control_group->set_group_name($this->unmarshal($this->db->f('group_name', 
true), 'string'));
-                       
-                       $results[] = $control_group;
-               }
-               
-               return $results;
-       }       
-       
-       function get_id_field_name($extended_info = false)
-       {
-               /*
-               if(!$extended_info)
-               {
-                       $ret = 'id';
-               }
-               else
-               {
-                       $ret = array
-                       (
-                               'table'                 => 'activity', // alias
-                               'field'                 => 'id',
-                               'translated'    => 'id'
-                       );
-               }
-               */
-               return $ret;
-       }
-
-       protected function get_query(string $sort_field, boolean $ascending, 
string $search_for, string $search_type, array $filters, boolean $return_count)
-       {
-               
-               
-       }
-       
-       function populate(int $control_group_id, &$control_group)
-       {
-               /*
-               if($control_group == null) {
-                       $control_group = new activitycalendar_activity((int) 
$activity_id);
-
-                       
$control_group->set_title($this->unmarshal($this->db->f('title'), 'string'));
-                       
$control_group->set_organization_id($this->unmarshal($this->db->f('organization_id'),
 'int'));
-                       
$control_group->set_group_id($this->unmarshal($this->db->f('group_id'), 'int'));
-                       
$control_group->set_district($this->unmarshal($this->db->f('district'), 'int'));
-                       
$control_group->set_office($this->unmarshal($this->db->f('office'), 'int'));
-                       
$control_group->set_category($this->unmarshal($this->db->f('category'), 'int'));
-                       
$control_group->set_state($this->unmarshal($this->db->f('state'), 'int'));
-                       
$control_group->set_target($this->unmarshal($this->db->f('target'), 'string'));
-                       
$control_group->set_description($this->unmarshal($this->db->f('description'), 
'string'));
-                       
$control_group->set_arena($this->unmarshal($this->db->f('arena'), 'string'));
-                       
$control_group->set_internal_arena($this->unmarshal($this->db->f('internal_arena'),
 'string'));
-                       
$control_group->set_time($this->unmarshal($this->db->f('time'), 'string'));
-                       
$control_group->set_last_change_date($this->unmarshal($this->db->f('last_change_date'),
 'int'));
-                       
$control_group->set_special_adaptation($this->unmarshal($this->db->f('special_adaptation',
 'bool')));
-                       
$control_group->set_secret($this->unmarshal($this->db->f('secret'), 'string'));
-                       
-                       
-               }
-               */
-               return $control_group;
-       }
-       
-}

Added: trunk/controller/inc/class.socontrol_group.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_group.inc.php                          
(rev 0)
+++ trunk/controller/inc/class.socontrol_group.inc.php  2011-09-15 07:42:41 UTC 
(rev 7596)
@@ -0,0 +1,176 @@
+<?php
+phpgw::import_class('controller.socommon');
+
+include_class('controller', 'control_group', 'inc/model/');
+
+class controller_socontrol_group extends controller_socommon
+{
+       protected static $so;
+
+       /**
+        * Get a static reference to the storage object associated with this 
model object
+        *
+        * @return controller_soparty the storage object
+        */
+       public static function get_instance()
+       {
+               if (self::$so == null) {
+                       self::$so = CreateObject('controller.socontrol_group');
+               }
+               return self::$so;
+       }
+
+       /**
+        * Function for adding a new activity to the database. Updates the 
activity object.
+        *
+        * @param activitycalendar_activity $activity the party to be added
+        * @return bool true if successful, false otherwise
+        */
+       function add(&$control_group)
+       {
+               
+               $control_group = $control_group->get_control_group();
+               
+               $sql = "INSERT INTO controller_control_group (group_name) 
VALUES ('$control_group')";
+               $result = $this->db->query($sql, __LINE__,__FILE__);
+
+               if(isset($result)) {
+                       // Set the new party ID
+                       
$control_group->set_id($this->db->get_last_insert_id('controller_control_group',
 'id'));
+                       // Forward this request to the update method
+                       return $this->update($control_group);
+               }
+               else
+               {
+                       return false;
+               }
+               
+       }
+
+       /**
+        * Update the database values for an existing activity object.
+        *
+        * @param $activity the activity to be updated
+        * @return boolean true if successful, false otherwise
+        */
+
+       function update($control_group)
+       {       
+               $id = intval($control_group->get_id());
+                       
+               $values = array(
+                       '$group_name = ' . 
$this->marshal($control_group->get_group_name(), 'string')
+               );
+               
+               //var_dump('UPDATE activity_activity SET ' . join(',', $values) 
. " WHERE id=$id");
+               $result = $this->db->query('UPDATE controller_control_group SET 
' . join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
+               
+               return isset($result);
+       }
+       
+       /**
+        * Get single procedure
+        * 
+        * @param       $id     id of the procedure to return
+        * @return a controller_procedure
+        */
+       function get_single($id)
+       {
+               $id = (int)$id;
+               
+               $sql = "SELECT p.* FROM controller_control_group p WHERE p.id = 
" . $id;
+               $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+               $this->db->next_record();
+               
+               $control_group = new 
controller_control_group($this->unmarshal($this->db->f('id', true), 'int'));
+               
$control_group->set_group_name($this->unmarshal($this->db->f('group_name', 
true), 'string'));
+               
+               return $control_group;
+       }
+       
+       /**
+        * Get a list of procedure objects matching the specific filters
+        * 
+        * @param $start search result offset
+        * @param $results number of results to return
+        * @param $sort field to sort by
+        * @param $query LIKE-based query string
+        * @param $filters array of custom filters
+        * @return list of rental_composite objects
+        */
+       function get_control_group_array($start = 0, $results = 1000, $sort = 
null, $dir = '', $query = null, $search_option = null, $filters = array())
+       {
+               $results = array();
+               
+               //$condition = $this->get_conditions($query, 
$filters,$search_option);
+               $order = $sort ? "ORDER BY $sort $dir ": '';
+               
+               //$sql = "SELECT * FROM controller_procedure WHERE $condition 
$order";
+               $sql = "SELECT * FROM controller_control_group $order";
+               $this->db->limit_query($sql, $start, __LINE__, __FILE__, 
$limit);
+               
+               while ($this->db->next_record()) {
+                       $control_group = new 
controller_control_group($this->unmarshal($this->db->f('id', true), 'int'));
+                       
$control_group->set_group_name($this->unmarshal($this->db->f('group_name', 
true), 'string'));
+                       
+                       $results[] = $control_group;
+               }
+               
+               return $results;
+       }       
+       
+       function get_id_field_name($extended_info = false)
+       {
+               /*
+               if(!$extended_info)
+               {
+                       $ret = 'id';
+               }
+               else
+               {
+                       $ret = array
+                       (
+                               'table'                 => 'activity', // alias
+                               'field'                 => 'id',
+                               'translated'    => 'id'
+                       );
+               }
+               */
+               return $ret;
+       }
+
+       protected function get_query(string $sort_field, boolean $ascending, 
string $search_for, string $search_type, array $filters, boolean $return_count)
+       {
+               
+               
+       }
+       
+       function populate(int $control_group_id, &$control_group)
+       {
+               /*
+               if($control_group == null) {
+                       $control_group = new activitycalendar_activity((int) 
$activity_id);
+
+                       
$control_group->set_title($this->unmarshal($this->db->f('title'), 'string'));
+                       
$control_group->set_organization_id($this->unmarshal($this->db->f('organization_id'),
 'int'));
+                       
$control_group->set_group_id($this->unmarshal($this->db->f('group_id'), 'int'));
+                       
$control_group->set_district($this->unmarshal($this->db->f('district'), 'int'));
+                       
$control_group->set_office($this->unmarshal($this->db->f('office'), 'int'));
+                       
$control_group->set_category($this->unmarshal($this->db->f('category'), 'int'));
+                       
$control_group->set_state($this->unmarshal($this->db->f('state'), 'int'));
+                       
$control_group->set_target($this->unmarshal($this->db->f('target'), 'string'));
+                       
$control_group->set_description($this->unmarshal($this->db->f('description'), 
'string'));
+                       
$control_group->set_arena($this->unmarshal($this->db->f('arena'), 'string'));
+                       
$control_group->set_internal_arena($this->unmarshal($this->db->f('internal_arena'),
 'string'));
+                       
$control_group->set_time($this->unmarshal($this->db->f('time'), 'string'));
+                       
$control_group->set_last_change_date($this->unmarshal($this->db->f('last_change_date'),
 'int'));
+                       
$control_group->set_special_adaptation($this->unmarshal($this->db->f('special_adaptation',
 'bool')));
+                       
$control_group->set_secret($this->unmarshal($this->db->f('secret'), 'string'));
+                       
+                       
+               }
+               */
+               return $control_group;
+       }
+       
+}

Added: trunk/controller/inc/class.socontrol_type.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_type.inc.php                           
(rev 0)
+++ trunk/controller/inc/class.socontrol_type.inc.php   2011-09-15 07:42:41 UTC 
(rev 7596)
@@ -0,0 +1,176 @@
+<?php
+phpgw::import_class('controller.socommon');
+
+include_class('controller', 'control_type', 'inc/model/');
+
+class controller_socontrol_type extends controller_socommon
+{
+       protected static $so;
+
+       /**
+        * Get a static reference to the storage object associated with this 
model object
+        *
+        * @return controller_soparty the storage object
+        */
+       public static function get_instance()
+       {
+               if (self::$so == null) {
+                       self::$so = CreateObject('controller.socontrol_type');
+               }
+               return self::$so;
+       }
+
+       /**
+        * Function for adding a new activity to the database. Updates the 
activity object.
+        *
+        * @param activitycalendar_activity $activity the party to be added
+        * @return bool true if successful, false otherwise
+        */
+       function add(&$control_type)
+       {
+               
+               $control_type = $control_type->get_control_type();
+               
+               $sql = "INSERT INTO controller_control_type (type_name) VALUES 
('$title')";
+               $result = $this->db->query($sql, __LINE__,__FILE__);
+
+               if(isset($result)) {
+                       // Set the new party ID
+                       
$control_type->set_id($this->db->get_last_insert_id('controller_control_type', 
'id'));
+                       // Forward this request to the update method
+                       return $this->update($control_type);
+               }
+               else
+               {
+                       return false;
+               }
+               
+       }
+
+       /**
+        * Update the database values for an existing activity object.
+        *
+        * @param $activity the activity to be updated
+        * @return boolean true if successful, false otherwise
+        */
+
+       function update($control_type)
+       {       
+               $id = intval($control_type->get_id());
+                       
+               $values = array(
+                       '$type_name = ' . 
$this->marshal($control_type->get_type_name(), 'string')
+               );
+               
+               //var_dump('UPDATE activity_activity SET ' . join(',', $values) 
. " WHERE id=$id");
+               $result = $this->db->query('UPDATE controller_control_type SET 
' . join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
+               
+               return isset($result);
+       }
+       
+       /**
+        * Get single procedure
+        * 
+        * @param       $id     id of the procedure to return
+        * @return a controller_procedure
+        */
+       function get_single($id)
+       {
+               $id = (int)$id;
+               
+               $sql = "SELECT p.* FROM controller_control_type p WHERE p.id = 
" . $id;
+               $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
+               $this->db->next_record();
+               
+               $control_type = new 
controller_control_type($this->unmarshal($this->db->f('id', true), 'int'));
+               
$control_type->set_type_name($this->unmarshal($this->db->f('type_name', true), 
'string'));
+               
+               return $control_type;
+       }
+       
+       /**
+        * Get a list of procedure objects matching the specific filters
+        * 
+        * @param $start search result offset
+        * @param $results number of results to return
+        * @param $sort field to sort by
+        * @param $query LIKE-based query string
+        * @param $filters array of custom filters
+        * @return list of rental_composite objects
+        */
+       function get_control_type_array($start = 0, $results = 1000, $sort = 
null, $dir = '', $query = null, $search_option = null, $filters = array())
+       {
+               $results = array();
+               
+               //$condition = $this->get_conditions($query, 
$filters,$search_option);
+               $order = $sort ? "ORDER BY $sort $dir ": '';
+               
+               //$sql = "SELECT * FROM controller_procedure WHERE $condition 
$order";
+               $sql = "SELECT * FROM controller_control_type $order";
+               $this->db->limit_query($sql, $start, __LINE__, __FILE__, 
$limit);
+               
+               while ($this->db->next_record()) {
+                       $control_type = new 
controller_control_type($this->unmarshal($this->db->f('id', true), 'int'));
+                       
$control_type->set_title($this->unmarshal($this->db->f('title', true), 
'string'));
+                       
+                       $results[] = $control_type;
+               }
+               
+               return $results;
+       }       
+       
+       function get_id_field_name($extended_info = false)
+       {
+               /*
+               if(!$extended_info)
+               {
+                       $ret = 'id';
+               }
+               else
+               {
+                       $ret = array
+                       (
+                               'table'                 => 'activity', // alias
+                               'field'                 => 'id',
+                               'translated'    => 'id'
+                       );
+               }
+               */
+               return $ret;
+       }
+
+       protected function get_query(string $sort_field, boolean $ascending, 
string $search_for, string $search_type, array $filters, boolean $return_count)
+       {
+               
+               
+       }
+       
+       function populate(int $control_type_id, &$control_type)
+       {
+               /*
+               if($control_type == null) {
+                       $control_type = new activitycalendar_activity((int) 
$activity_id);
+
+                       
$control_type->set_title($this->unmarshal($this->db->f('title'), 'string'));
+                       
$control_type->set_organization_id($this->unmarshal($this->db->f('organization_id'),
 'int'));
+                       
$control_type->set_type_id($this->unmarshal($this->db->f('type_id'), 'int'));
+                       
$control_type->set_district($this->unmarshal($this->db->f('district'), 'int'));
+                       
$control_type->set_office($this->unmarshal($this->db->f('office'), 'int'));
+                       
$control_type->set_category($this->unmarshal($this->db->f('category'), 'int'));
+                       
$control_type->set_state($this->unmarshal($this->db->f('state'), 'int'));
+                       
$control_type->set_target($this->unmarshal($this->db->f('target'), 'string'));
+                       
$control_type->set_description($this->unmarshal($this->db->f('description'), 
'string'));
+                       
$control_type->set_arena($this->unmarshal($this->db->f('arena'), 'string'));
+                       
$control_type->set_internal_arena($this->unmarshal($this->db->f('internal_arena'),
 'string'));
+                       
$control_type->set_time($this->unmarshal($this->db->f('time'), 'string'));
+                       
$control_type->set_last_change_date($this->unmarshal($this->db->f('last_change_date'),
 'int'));
+                       
$control_type->set_special_adaptation($this->unmarshal($this->db->f('special_adaptation',
 'bool')));
+                       
$control_type->set_secret($this->unmarshal($this->db->f('secret'), 'string'));
+                       
+                       
+               }
+               */
+               return $control_type;
+       }
+       
+}

Modified: trunk/controller/inc/class.uicontrol_item.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_item.inc.php   2011-09-15 07:19:15 UTC 
(rev 7595)
+++ trunk/controller/inc/class.uicontrol_item.inc.php   2011-09-15 07:42:41 UTC 
(rev 7596)
@@ -7,8 +7,6 @@
        phpgw::import_class('controller.socontrol_type');
        
        include_class('controller', 'control', 'inc/model/');
-       include_class('controller', 'control_group', 'inc/model/');
-       include_class('controller', 'control_type', 'inc/model/');
        
        class controller_uicontrol_item extends controller_uicommon
        {
@@ -37,7 +35,7 @@
                
                public function index()
                {
-                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"controller::control";
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"controller::control_item";
                        
                        $repeat_type = $this->bo->get_rpt_type_list();
                        $repeat_day = $this->bo->get_rpt_day_list();
@@ -71,14 +69,14 @@
                                }
                        }
                        
-                       $control_item_type_array = 
$this->so_control_type->get_control_type_array();
-                       $control_item_group_array = 
$this->so_control_group->get_control_group_array();
+                       $control_type_array = 
$this->so_control_type->get_control_type_array();
+                       $control_group_array = 
$this->so_control_group->get_control_group_array();
                        
                        $this->render('control_item.php', array
                                                (
                                                'editable' => true,
-                                               'control_type_array' => 
$control_item_type_array,
-                                               'control_group_array' => 
$control_item_group_array 
+                                               'control_type_array' => 
$control_type_array,
+                                               'control_group_array' => 
$control_group_array 
                                                )
                                        );
                }

Modified: trunk/controller/inc/model/class.control_group.inc.php
===================================================================
--- trunk/controller/inc/model/class.control_group.inc.php      2011-09-15 
07:19:15 UTC (rev 7595)
+++ trunk/controller/inc/model/class.control_group.inc.php      2011-09-15 
07:42:41 UTC (rev 7596)
@@ -41,7 +41,7 @@
                public static function get_so()
                {
                        if (self::$so == null) {
-                               self::$so = 
CreateObject('controller_control_group');
+                               self::$so = 
CreateObject('controller.socontrol_group');
                        }
                        
                        return self::$so;

Modified: trunk/controller/inc/model/class.control_item.inc.php
===================================================================
--- trunk/controller/inc/model/class.control_item.inc.php       2011-09-15 
07:19:15 UTC (rev 7595)
+++ trunk/controller/inc/model/class.control_item.inc.php       2011-09-15 
07:42:41 UTC (rev 7596)
@@ -82,7 +82,7 @@
                public static function get_so()
                {
                        if (self::$so == null) {
-                               self::$so = 
CreateObject('controller.sopurpose');
+                               self::$so = 
CreateObject('controller.socontrol_item');
                        }
                        
                        return self::$so;

Modified: trunk/controller/templates/base/control_item.php
===================================================================
--- trunk/controller/templates/base/control_item.php    2011-09-15 07:19:15 UTC 
(rev 7595)
+++ trunk/controller/templates/base/control_item.php    2011-09-15 07:42:41 UTC 
(rev 7596)
@@ -43,7 +43,7 @@
                                                <select id="control_group" 
name="control_group">
                                                        <?php 
                                                                foreach 
($control_group_array as $control_group) {
-                                                                       echo 
"<option value='" . $control_group->get_id() . "'>" . 
$control_group->get_title() . "</option>";
+                                                                       echo 
"<option value='" . $control_group->get_id() . "'>" . 
$control_group->get_group_name() . "</option>";
                                                                }
                                                        ?>
                                                </select>




reply via email to

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