fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [12876] rental: fix copy contract


From: Sigurd Nes
Subject: [Fmsystem-commits] [12876] rental: fix copy contract
Date: Thu, 19 Mar 2015 14:38:53 +0000

Revision: 12876
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12876
Author:   sigurdne
Date:     2015-03-19 14:38:51 +0000 (Thu, 19 Mar 2015)
Log Message:
-----------
rental: fix copy contract

Modified Paths:
--------------
    trunk/controller/inc/class.socontrol.inc.php
    trunk/controller/setup/setup.inc.php
    trunk/controller/setup/tables_current.inc.php
    trunk/controller/setup/tables_update.inc.php
    trunk/property/inc/class.boentity.inc.php
    trunk/rental/inc/class.socontract.inc.php
    trunk/setup/index.php

Modified: trunk/controller/inc/class.socontrol.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol.inc.php        2015-03-19 06:56:16 UTC 
(rev 12875)
+++ trunk/controller/inc/class.socontrol.inc.php        2015-03-19 14:38:51 UTC 
(rev 12876)
@@ -833,8 +833,13 @@
                function register_control_to_component($data)
                {
                        $ret = 0;
-                       $assigned_to    = isset($data['assigned_to']) && 
$data['assigned_to'] ? $data['assigned_to'] : null;
+                       $assigned_to            = isset($data['assigned_to']) 
&& $data['assigned_to'] ? $data['assigned_to'] : null;
                        $start_date                     = 
isset($data['start_date']) && $data['start_date'] ? $data['start_date'] : null;
+                       $repeat_type            = isset($data['repeat_type']) 
&& $data['repeat_type'] ? $data['repeat_type'] : null;
+                       $repeat_interval        = 
isset($data['repeat_interval']) && $data['repeat_interval'] ? 
$data['repeat_interval'] : null;
+                       $controle_time          = isset($data['controle_time']) 
&& $data['controle_time'] ? $data['controle_time'] : null;
+                       $service_time           = isset($data['service_time']) 
&& $data['service_time'] ? $data['service_time'] : null;
+                       $duplicate                      = 
isset($data['duplicate']) && $data['duplicate'] ? $data['duplicate'] : null;
 
                        $delete_component = array();
                        $add_component = array();
@@ -867,7 +872,7 @@
                                        
                                        $this->db->query($sql, __LINE__, 
__FILE__);
                        
-                                       if(!$this->db->next_record())
+                                       if(!$this->db->next_record() || 
$duplicate)
                                        {
                                                $values_insert = array
                                                (
@@ -875,7 +880,11 @@
                                                        'location_id'           
=> $location_id,
                                                        'component_id'          
=> $component_id,
                                                        'assigned_to'           
=> $assigned_to,
-                                                       'start_date'            
=> $start_date
+                                                       'start_date'            
=> $start_date,
+                                                       'repeat_type'           
=> $repeat_type,
+                                                       'repeat_interval'       
=> $repeat_interval,
+                                                       'controle_time'         
=> $controle_time,
+                                                       'service_time'          
=> $service_time,
                                                );
 
                                                $this->db->query("INSERT INTO 
controller_control_component_list (" . implode(',',array_keys($values_insert)) 
. ') VALUES ('
@@ -945,7 +954,7 @@
                        $location_id = (int)$data['location_id'];
                        $component_id = (int)$data['component_id'];
 
-                       $sql = "SELECT controller_control_component_list.* , 
controller_control.title, repeat_type, repeat_interval, enabled"
+                       $sql = "SELECT controller_control_component_list.* , 
controller_control.title, enabled"
                        . "  FROM controller_control_component_list"
                        . " {$this->db->join} controller_control ON 
controller_control.id = controller_control_component_list.control_id WHERE 
location_id = {$location_id} AND component_id = {$component_id}";
                        $this->db->query($sql,__LINE__,__FILE__);
@@ -955,16 +964,18 @@
                        {
                                $controls[] = array
                                (
-                                       'id'                    => 
$this->db->f('id'),
-                                       'control_id'    => 
$this->db->f('control_id'),
-                                       'title'                 => 
$this->db->f('title',true),
-                                       'location_id'   => 
$this->db->f('location_id'),
-                                       'component_id'  => 
$this->db->f('component_id'),
-                                       'assigned_to'   => 
$this->db->f('assigned_to'),
-                                       'start_date'    => 
$this->db->f('start_date'),
-                                       'repeat_type'   => 
$this->db->f('repeat_type'),
+                                       'id'                            => 
$this->db->f('id'),
+                                       'control_id'            => 
$this->db->f('control_id'),
+                                       'title'                         => 
$this->db->f('title',true),
+                                       'location_id'           => 
$this->db->f('location_id'),
+                                       'component_id'          => 
$this->db->f('component_id'),
+                                       'assigned_to'           => 
$this->db->f('assigned_to'),
+                                       'start_date'            => 
$this->db->f('start_date'),
+                                       'repeat_type'           => 
$this->db->f('repeat_type'),
                                        'repeat_interval'       => 
$this->db->f('repeat_interval'),
-                                       'enabled'       => 
$this->db->f('enabled'),
+                                       'enabled'                       => 
$this->db->f('enabled'),
+                                       'service_time'          => 
(float)$this->db->f('service_time'),
+                                       'controle_time'         => 
(float)$this->db->f('controle_time'),
                                );
                        }
 

Modified: trunk/controller/setup/setup.inc.php
===================================================================
--- trunk/controller/setup/setup.inc.php        2015-03-19 06:56:16 UTC (rev 
12875)
+++ trunk/controller/setup/setup.inc.php        2015-03-19 14:38:51 UTC (rev 
12876)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['controller']['name'] = 'controller';
-       $setup_info['controller']['version'] = '0.1.49';
+       $setup_info['controller']['version'] = '0.1.50';
        $setup_info['controller']['app_order'] = 100;
        $setup_info['controller']['enable'] = 1;
        $setup_info['controller']['app_group']  = 'office';

Modified: trunk/controller/setup/tables_current.inc.php
===================================================================
--- trunk/controller/setup/tables_current.inc.php       2015-03-19 06:56:16 UTC 
(rev 12875)
+++ trunk/controller/setup/tables_current.inc.php       2015-03-19 14:38:51 UTC 
(rev 12876)
@@ -148,7 +148,11 @@
                                        'location_id'           => array('type' 
=> 'int', 'precision' => '4', 'nullable' => false),
                                        'component_id'          => array('type' 
=> 'int', 'precision' => '4', 'nullable' => false),
                                        'assigned_to'           => array('type' 
=> 'int', 'precision' => '4', 'nullable' => true),
-                                       'start_date'            => array('type' 
=> 'int', 'precision' => '4', 'nullable' => true),
+                                       'start_date'            => array('type' 
=> 'int', 'precision' => '', 'nullable' => true),
+                                       'repeat_type'           => array('type' 
=> 'int', 'precision' => '2', 'nullable' => true),
+                                       'repeat_interval'               => 
array('type' => 'int', 'precision' => '4', 'nullable' => true),
+                                       'service_time' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
+                                       'controle_time' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                ),
                        'pk' => array('id'),
                        'fk' => array(),

Modified: trunk/controller/setup/tables_update.inc.php
===================================================================
--- trunk/controller/setup/tables_update.inc.php        2015-03-19 06:56:16 UTC 
(rev 12875)
+++ trunk/controller/setup/tables_update.inc.php        2015-03-19 14:38:51 UTC 
(rev 12876)
@@ -991,3 +991,46 @@
                        return 
$GLOBALS['setup_info']['controller']['currentver'];
                }
        }
+
+       /**
+       * Assign responsible user to control at componant from date.
+       **/
+       $test[] = '0.1.49';
+       function controller_upgrade0_1_49()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('controller_control_component_list','repeat_type',array(
+                       'type' => 'int',
+                       'precision' => '2',
+                       'nullable' => true
+               ));
+
+                       
$GLOBALS['phpgw_setup']->oProc->AddColumn('controller_control_component_list','repeat_interval',array(
+                       'type' => 'int',
+                       'precision' => '4',
+                       'nullable' => true
+               ));
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('controller_control_component_list','service_time',array(
+                       'type' => 'decimal',
+                       'precision' => 20,
+                       'nullable' => true,
+                       'scale' => '2',
+                       'default' => '0.00'
+               ));
+
+                       
$GLOBALS['phpgw_setup']->oProc->AddColumn('controller_control_component_list','controle_time',array(
+                       'type' => 'decimal',
+                       'precision' => 20,
+                       'nullable' => true,
+                       'scale' => '2',
+                       'default' => '0.00'
+               ));
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['controller']['currentver'] = 
'0.1.50';
+                       return 
$GLOBALS['setup_info']['controller']['currentver'];
+               }
+       }

Modified: trunk/property/inc/class.boentity.inc.php
===================================================================
--- trunk/property/inc/class.boentity.inc.php   2015-03-19 06:56:16 UTC (rev 
12875)
+++ trunk/property/inc/class.boentity.inc.php   2015-03-19 14:38:51 UTC (rev 
12876)
@@ -959,6 +959,7 @@
                                                'repeat_interval'               
=> $repeat_interval,
                                                'controle_time'                 
=> $controle_time,
                                                'service_time'                  
=> $service_time,
+                                               'duplicate'                     
        => true
                                        );
                                        _debug_array($values);
                                        if($add = 
$so_control->register_control_to_component($values))

Modified: trunk/rental/inc/class.socontract.inc.php
===================================================================
--- trunk/rental/inc/class.socontract.inc.php   2015-03-19 06:56:16 UTC (rev 
12875)
+++ trunk/rental/inc/class.socontract.inc.php   2015-03-19 14:38:51 UTC (rev 
12876)
@@ -1035,7 +1035,7 @@
        //queries for selecting composites, parties and price items for the 
contract to be copied
        $q_composites = "SELECT composite_id FROM rental_contract_composite 
WHERE contract_id={$old_contract_id}";
        $q_parties = "SELECT party_id, is_payer FROM rental_contract_party 
WHERE contract_id={$old_contract_id}";
-       $q_price_items = "SELECT price_item_id, title, area, count, agresso_id, 
is_area, price, total_price, is_one_time FROM rental_contract_price_item WHERE 
contract_id={$old_contract_id}";
+       $q_price_items = "SELECT price_item_id, title, area, count, agresso_id, 
is_area, price, total_price, is_one_time FROM rental_contract_price_item WHERE 
contract_id={$old_contract_id} AND is_one_time = false";
        $success_composites = true;
        $success_parties = true;
        $success_price_items = true;

Modified: trunk/setup/index.php
===================================================================
--- trunk/setup/index.php       2015-03-19 06:56:16 UTC (rev 12875)
+++ trunk/setup/index.php       2015-03-19 14:38:51 UTC (rev 12876)
@@ -202,7 +202,7 @@
        {
                case 1:
                        $setup_tpl->set_var('sudo_user',lang('sudo user'));
-                       $setup_tpl->set_var('sudo_password',lang('sudo 
password'));
+                       $setup_tpl->set_var('sudo_password',lang('password for 
%1', getenv('APACHE_RUN_USER')));
                        $setup_tpl->set_var('svnwarn',lang('will try to perform 
a svn status -u'));
                        $setup_tpl->set_var('check_for_svn_update',lang('check 
update'));
                        $_svn_message = '';
@@ -231,7 +231,7 @@
                        $setup_tpl->set_var('sudo_user',lang('sudo user'));
                        $setup_tpl->set_var('value_sudo_user', 
phpgw::get_var('sudo_user'));
                        $setup_tpl->set_var('value_sudo_password', 
phpgw::get_var('sudo_password'));
-                       $setup_tpl->set_var('sudo_password',lang('sudo 
password'));
+                       $setup_tpl->set_var('sudo_password',lang('password for 
%1', getenv('APACHE_RUN_USER')));
                        $setup_tpl->set_var('perform_svn_update',lang('perform 
svn update'));
                        $setup_tpl->set_var('sudo_user',lang('sudo user'));
                        $setup_tpl->set_var('sudo_password',lang('sudo 
password'));




reply via email to

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