fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7622]


From: Torstein
Subject: [Fmsystem-commits] [7622]
Date: Fri, 16 Sep 2011 08:22:44 +0000

Revision: 7622
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7622
Author:   vator
Date:     2011-09-16 08:22:44 +0000 (Fri, 16 Sep 2011)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/class.socontrol_item.inc.php
    trunk/controller/inc/class.uicontrol_item.inc.php
    trunk/controller/inc/class.uicontrol_item2.inc.php

Removed Paths:
-------------
    trunk/controller/inc/class.socontrol_type.inc.php
    trunk/controller/inc/control_item_list.php

Modified: trunk/controller/inc/class.socontrol_item.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_item.inc.php   2011-09-16 08:22:26 UTC 
(rev 7621)
+++ trunk/controller/inc/class.socontrol_item.inc.php   2011-09-16 08:22:44 UTC 
(rev 7622)
@@ -125,7 +125,7 @@
                        
$control_item->set_what_to_do($this->unmarshal($this->db->f('what_to_do', 
true), 'string'));
                        
$control_item->set_how_to_do($this->unmarshal($this->db->f('how_to_do', true), 
'string'));
                        
$control_item->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
 true), 'int'));
-                       
$control_item->set_control_type_id($this->unmarshal($this->db->f('control_type_id',
 true), 'int'));
+                       
$control_item->set_control_area_id($this->unmarshal($this->db->f('control_area_id',
 true), 'int'));
                        
                        $results[] = $control_item;
                }
@@ -221,7 +221,7 @@
                }
                else
                {
-                       $cols = 'id, title, required, 
controller_control_item.what_to_do_desc as what_to_do, 
controller_control_item.how_to_do_desc as how_to_do, control_group_id, 
control_type_id';
+                       $cols = 'id, title, required, 
controller_control_item.what_to_do_desc as what_to_do, 
controller_control_item.how_to_do_desc as how_to_do, control_group_id, 
control_area_id';
                }
                
                $dir = $ascending ? 'ASC' : 'DESC';
@@ -252,7 +252,7 @@
                        
$control_item->set_what_to_do($this->unmarshal($this->db->f('what_to_do', 
true), 'string'));
                        
$control_item->set_how_to_do($this->unmarshal($this->db->f('how_to_do', true), 
'string'));
                        
$control_item->set_control_group_id($this->unmarshal($this->db->f('control_group_id',
 true), 'int'));
-                       
$control_item->set_control_type_id($this->unmarshal($this->db->f('control_type_id',
 true), 'int'));
+                       
$control_item->set_control_area_id($this->unmarshal($this->db->f('control_area_id',
 true), 'int'));
                }
                
                return $control_item;

Deleted: trunk/controller/inc/class.socontrol_type.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol_type.inc.php   2011-09-16 08:22:26 UTC 
(rev 7621)
+++ trunk/controller/inc/class.socontrol_type.inc.php   2011-09-16 08:22:44 UTC 
(rev 7622)
@@ -1,176 +0,0 @@
-<?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-16 08:22:26 UTC 
(rev 7621)
+++ trunk/controller/inc/class.uicontrol_item.inc.php   2011-09-16 08:22:44 UTC 
(rev 7622)
@@ -4,7 +4,7 @@
        phpgw::import_class('controller.socontrol');
        phpgw::import_class('controller.socontrol_item');
        phpgw::import_class('controller.socontrol_group');
-       phpgw::import_class('controller.socontrol_type');
+       phpgw::import_class('controller.socontrol_area');
        
        include_class('controller', 'control', 'inc/model/');
        
@@ -15,7 +15,7 @@
                private $so_proc;
                private $so_control_item;
                private $so_control_group;
-               private $so_control_type;
+               private $so_control_area;
                
                public $public_functions = array
                (
@@ -31,7 +31,7 @@
                        $this->so = CreateObject('controller.socontrol');
                        $this->so_control_item = 
CreateObject('controller.socontrol_item');
                        $this->so_control_group = 
CreateObject('controller.socontrol_group');
-                       $this->so_control_type = 
CreateObject('controller.socontrol_type');
+                       $this->so_control_area = 
CreateObject('controller.socontrol_area');
                        $this->bo = CreateObject('property.boevent',true);
                }
                
@@ -51,7 +51,7 @@
                                        $control_item->set_what_to_desc( 
strtotime( phpgw::get_var('what_to_desc')  ) );
                                        $control_item->set_how_to_desc( 
strtotime( phpgw::get_var('how_to_desc') ) );
                                        $control_item->set_control_group_id( 
strtotime( phpgw::get_var('control_group_id') ) );
-                                       $control_item->set_control_type_id( 
strtotime( phpgw::get_var('control_type_id') ) );
+                                       $control_item->set_control_area_id( 
strtotime( phpgw::get_var('control_area_id') ) );
                                                                        
                                        $this->so->add($control_item);
                                }
@@ -65,19 +65,19 @@
                                        $control_item->set_what_to_desc( 
strtotime( phpgw::get_var('what_to_desc')  ) );
                                        $control_item->set_how_to_desc( 
strtotime( phpgw::get_var('how_to_desc') ) );
                                        $control_item->set_control_group_id( 
strtotime( phpgw::get_var('control_group_id') ) );
-                                       $control_item->set_control_type_id( 
strtotime( phpgw::get_var('control_type_id') ) );
+                                       $control_item->set_control_area_id( 
strtotime( phpgw::get_var('control_area_id') ) );
                                                                        
                                        $this->so->add($control_item);
                                }
                        }
                        
-                       $control_type_array = 
$this->so_control_type->get_control_type_array();
+                       $control_area_array = 
$this->so_control_area->get_control_area_array();
                        $control_group_array = 
$this->so_control_group->get_control_group_array();
                        
                        $this->render('control_item.php', array
                                                (
                                                'editable' => true,
-                                               'control_type_array' => 
$control_type_array,
+                                               'control_area_array' => 
$control_area_array,
                                                'control_group_array' => 
$control_group_array 
                                                )
                                        );

Modified: trunk/controller/inc/class.uicontrol_item2.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_item2.inc.php  2011-09-16 08:22:26 UTC 
(rev 7621)
+++ trunk/controller/inc/class.uicontrol_item2.inc.php  2011-09-16 08:22:44 UTC 
(rev 7622)
@@ -77,12 +77,12 @@
                                $msgbox_data = 
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
                        }
 
-                       foreach ($control_type_array as $control_type)
+                       foreach ($control_area_array as $control_area)
                        {
-                               $control_type_options = array
+                               $control_area_options = array
                                (
-                                       'id'    => $control_type->get_id(),
-                                       'name'  => $control_type->get_name()
+                                       'id'    => $control_area->get_id(),
+                                       'name'  => $control_area->get_name()
                                         
                                );
                        }
@@ -102,7 +102,7 @@
                                'value_id'                              => 
!empty($control) ? $control->get_id() : 0,
                                'img_go_home'                   => 
'rental/templates/base/images/32x32/actions/go-home.png',
                                'editable'                              => true,
-                               'control_item'                  => 
array('options' => $control_type_options),
+                               'control_item'                  => 
array('options' => $control_area_options),
                                'control_group'                 => 
array('options' => $control_group_options),
                        );
 

Deleted: trunk/controller/inc/control_item_list.php
===================================================================
--- trunk/controller/inc/control_item_list.php  2011-09-16 08:22:26 UTC (rev 
7621)
+++ trunk/controller/inc/control_item_list.php  2011-09-16 08:22:44 UTC (rev 
7622)
@@ -1,137 +0,0 @@
-<script type="text/javascript">
-       //Add listener resetting form: redirects browser to call index  again
-       YAHOO.util.Event.addListener(
-               'ctrl_reset_button',
-               'click',
-               function(e)
-               {
-               YAHOO.util.Event.stopEvent(e);
-       window.location = 'index.php?menuaction=rental.uiparty.index';
-               }
-       );
-
-       var formatPrice = function(elCell, oRecord, oColumn, oData) {
-               if (oData != undefined) {
-                       elCell.innerHTML = YAHOO.util.Number.format( oData,
-                       {
-                               suffix: " <?php echo 
isset($config->config_data['currency_suffix']) && 
$config->config_data['currency_suffix'] ? 
$config->config_data['currency_suffix'] : 'NOK'; ?>",
-                               thousandsSeparator: "<?php echo 
lang('currency_thousands_separator') ?>",
-                               decimalSeparator: "<?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] : 
','; ?>",
-                               decimalPlaces: <?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places']
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places']
 : 2; ?>
-                   });
-               }
-       }
-
-       var formatArea = function(elCell, oRecord, oColumn, oData) {
-               if (oData != undefined && oData != 0) {
-                       elCell.innerHTML = YAHOO.util.Number.format( oData,
-                       {
-                               suffix: " <?php echo 
isset($config->config_data['area_suffix']) && 
$config->config_data['area_suffix'] ? $config->config_data['area_suffix'] : 
'kvm'; ?>",
-                               thousandsSeparator: "<?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['thousands_separator'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['thousands_separator'] 
? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['thousands_separator'] 
: '.'; ?>",
-                               decimalSeparator: "<?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['decimal_separator'] : 
',';?>",
-                               decimalPlaces: <?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['area_decimal_places'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['area_decimal_places'] 
? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['area_decimal_places'] 
: 2; ?>
-                   });
-               }
-       }
-
-       var formatCount = function(elCell, oRecord, oColumn, oData) {
-               if (oData != undefined && oData != 0) {
-                       elCell.innerHTML = YAHOO.util.Number.format( oData,
-                       {
-                               suffix: " <?php echo lang('count_suffix') ?>",
-                               thousandsSeparator: "<?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['thousands_separator'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['thousands_separator'] 
? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['thousands_separator'] 
: '.'; ?>",
-                               decimalPlaces: <?php echo 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['count_decimal_places'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['count_decimal_places'] 
? 
$GLOBALS['phpgw_info']['user']['preferences']['rental']['count_decimal_places'] 
: 0; ?>
-                   });
-               }
-       }
-
-       var formatBoolean = function(elCell, oRecord, oColumn, oData) {
-               if (oData != undefined && oData != 0) {
-                       if(oData == true){
-                               elCell.innerHTML = "<?php echo lang('yes')?>";
-                       }
-               }else{
-                       elCell.innerHTML = "<?php echo lang('no')?>";
-               }
-       }
-
-       // Defining columns for datatable
-       var columnDefs = [
-               {
-                       key: "agresso_id",
-                       label: "<?php echo lang('agresso_id') ?>",
-                 sortable: false
-               },
-               {
-                       key: "title",
-                       label: "<?php echo lang('name') ?>",
-                 sortable: true
-               },
-               {
-                       key: "is_area",
-                       label: "<?php echo lang('title') ?>",
-                 sortable: true
-               },
-               {
-                       key: "price",
-                       label: "<?php echo lang('price') ?>",
-                       formatter: formatPrice,
-                       sortable: true
-               },
-               {
-                       key: "id",
-                       hidden: true
-               },
-               {
-                       key: "ajax",
-                       hidden: true
-               },
-               {
-                       key: "labels",
-                       hidden: true
-               },
-               {
-                       key: "actions",
-                       hidden: true
-               }];
-
-       <?php
-       if ($extra_cols) {
-               echo rental_uicommon::get_extra_column_defs('columnDefs', 
$extra_cols);
-       }
-       ?>
-       <?php
-       if ($editors) {
-               echo rental_uicommon::get_column_editors('columnDefs', 
$editors);
-       }
-       ?>
-
-       // Initiating the data source
-       setDataSource(
-               
'index.php?menuaction=rental.uiprice_item.query&amp;phpgw_return_as=json<?php 
echo $url_add_on; ?>&amp;editable=<?php echo $editable ? "true" : "false"; ?>',
-               columnDefs,
-               '',
-               [],
-               '<?php echo $list_id ?>_container',
-               '<?php echo $list_id ?>_paginator',
-               '<?php echo $list_id ?>',
-               new Array(<?php
-                       if(isset($related)){
-                                       $tot_related = count($related);
-                                       $count_related = 0;
-                                       foreach($related as $r){
-                                               $count_related++;
-                                               echo "\"".$r."\"";
-                                               if($count_related < 
$tot_related){
-                                                       echo ",";
-                                               }
-                                       }
-                               }
-               ?>),
-               '<?php echo $editor_action ?>',
-               true
-       );
-</script>
-
-<div id="<?php echo $list_id ?>_paginator" class="paginator"></div>
-<div id="<?php echo $list_id ?>_container" class="datatable_container"></div>




reply via email to

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