fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15776] Syncromind: merge 15771:15775 from trunk


From: sigurdne
Subject: [Fmsystem-commits] [15776] Syncromind: merge 15771:15775 from trunk
Date: Sat, 1 Oct 2016 15:45:47 +0000 (UTC)

Revision: 15776
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15776
Author:   sigurdne
Date:     2016-10-01 15:45:46 +0000 (Sat, 01 Oct 2016)
Log Message:
-----------
Syncromind: merge 15771:15775 from trunk

Modified Paths:
--------------
    branches/dev-syncromind-2/phpgwapi/inc/class.socommon.inc.php
    branches/dev-syncromind-2/property/inc/class.sogeneric.inc.php
    branches/dev-syncromind-2/rental/inc/class.menu.inc.php
    branches/dev-syncromind-2/rental/inc/class.socomposite.inc.php
    branches/dev-syncromind-2/rental/inc/class.socontract_price_item.inc.php
    branches/dev-syncromind-2/rental/inc/class.soprice_item.inc.php
    branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php
    branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php
    branches/dev-syncromind-2/rental/inc/class.uicontract.inc.php
    branches/dev-syncromind-2/rental/inc/class.uiprice_item.inc.php
    branches/dev-syncromind-2/rental/inc/model/class.agresso_gl07.inc.php
    branches/dev-syncromind-2/rental/inc/model/class.composite.inc.php
    branches/dev-syncromind-2/rental/inc/model/class.contract.inc.php
    branches/dev-syncromind-2/rental/inc/model/class.model.inc.php
    branches/dev-syncromind-2/rental/setup/default_records.inc.php
    branches/dev-syncromind-2/rental/setup/phpgw_no.lang
    branches/dev-syncromind-2/rental/setup/setup.inc.php
    branches/dev-syncromind-2/rental/setup/tables_current.inc.php
    branches/dev-syncromind-2/rental/setup/tables_update.inc.php
    branches/dev-syncromind-2/rental/templates/base/application.xsl
    branches/dev-syncromind-2/rental/templates/base/composite.xsl
    branches/dev-syncromind-2/rental/templates/base/css/base.css

Added Paths:
-----------
    branches/dev-syncromind-2/phpgwapi/inc/model/
    branches/dev-syncromind-2/rental/inc/class.bogeneric.inc.php
    branches/dev-syncromind-2/rental/inc/class.sogeneric.inc.php
    branches/dev-syncromind-2/rental/inc/class.uigeneric.inc.php

Property Changed:
----------------
    branches/dev-syncromind-2/


Property changes on: branches/dev-syncromind-2
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14934-14935,15165-15215,15218-15220,15222-15304,15306-15337,15339,15341-15398,15400-15421,15423-15474,15476-15607,15609,15611,15613-15652,15654-15732,15734,15736-15746,15750-15770
   + /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14934-14935,15165-15215,15218-15220,15222-15304,15306-15337,15339,15341-15398,15400-15421,15423-15474,15476-15607,15609,15611,15613-15652,15654-15732,15734,15736-15746,15750-15770,15772-15775

Modified: branches/dev-syncromind-2/phpgwapi/inc/class.socommon.inc.php
===================================================================
--- branches/dev-syncromind-2/phpgwapi/inc/class.socommon.inc.php       
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/phpgwapi/inc/class.socommon.inc.php       
2016-10-01 15:45:46 UTC (rev 15776)
@@ -352,7 +352,7 @@
                        {
                                foreach ($this->fields as $field => $params)
                                {
-                                       if ($params['manytomany'])
+                                       if (!empty($params['manytomany']))
                                        {
                                                $table = 
$params['manytomany']['table'];
                                                $key = 
$params['manytomany']['key'];

Modified: branches/dev-syncromind-2/property/inc/class.sogeneric.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.sogeneric.inc.php      
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/property/inc/class.sogeneric.inc.php      
2016-10-01 15:45:46 UTC (rev 15776)
@@ -2533,107 +2533,6 @@
                                        break;
 
 // END CONTROLLER TABLES
-// START RENTAL TABLES
-                               case 'location_factor':
-                                       $info = array
-                                               (
-                                               'table' => 
'rental_location_factor',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array(
-                                                       array(
-                                                               'name' => 
'part_of_town_id',
-                                                               'descr' => 
lang('location'),
-                                                               'type' => 
'select',
-                                                               'nullable' => 
false,
-                                                               'filter' => 
true,
-                                                               'values_def' => 
array(
-                                                                       
'valueset' => false,
-                                                                       
'get_single_value' => 'property.sogeneric.get_name',
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'method_input' => array('type' => 'part_of_town', 'selected' => 
'##part_of_town_id##')
-                                                               )
-                                                       ),
-                                                       array(
-                                                               'name' => 
'factor',
-                                                               'descr' => 
lang('factor'),
-                                                               'type' => 
'numeric',
-                                                               'nullable' => 
false,
-                                                               'size' => 4,
-                                                               'sortable' => 
true
-                                                       ),
-                                                       array(
-                                                               'name' => 
'remark',
-                                                               'descr' => 
lang('remark'),
-                                                               'type' => 'text'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit unit'),
-                                               'add_msg' => lang('add unit'),
-                                               'name' => lang('unit'),
-                                               'acl_app' => 'rental',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::rental::location_factor',
-                                               'default' => array(
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               )
-                                       );
-                                       break;
-                               case 'composite_standard':
-                                       $info = array
-                                               (
-                                               'table' => 
'rental_composite_standard',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'factor',
-                                                               'descr' => 
lang('factor'),
-                                                               'type' => 
'numeric',
-                                                               'nullable' => 
false,
-                                                               'size' => 4,
-                                                               'sortable' => 
true
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit unit'),
-                                               'add_msg' => lang('add unit'),
-                                               'name' => lang('unit'),
-                                               'acl_app' => 'rental',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::rental::composite_standard'
-                                       );
-                                       break;
-                               case 'responsibility_unit':
-                                       $info = array
-                                               (
-                                               'table' => 
'rental_contract_responsibility_unit',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                               ),
-                                               'edit_msg' => lang('edit unit'),
-                                               'add_msg' => lang('add unit'),
-                                               'name' => lang('unit'),
-                                               'acl_app' => 'rental',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::rental::responsibility_unit'
-                                       );
-                                       break;
-// END RENTAL TABLES
 
                                default:
                                        $message = lang('ERROR: illegal type 
%1', $type);

Copied: branches/dev-syncromind-2/rental/inc/class.bogeneric.inc.php (from rev 
15775, trunk/rental/inc/class.bogeneric.inc.php)
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.bogeneric.inc.php                
                (rev 0)
+++ branches/dev-syncromind-2/rental/inc/class.bogeneric.inc.php        
2016-10-01 15:45:46 UTC (rev 15776)
@@ -0,0 +1,37 @@
+<?php
+/**
+        * phpGroupWare - rental: a part of a Facilities Management System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2016 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare is free software; you can redistribute it and/or modify
+        * it under the terms of the GNU General Public License as published by
+        * the Free Software Foundation; either version 2 of the License, or
+        * (at your option) any later version.
+        *
+        * phpGroupWare is distributed in the hope that it will be useful,
+        * but WITHOUT ANY WARRANTY; without even the implied warranty of
+        * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+        * GNU General Public License for more details.
+        *
+        * You should have received a copy of the GNU General Public License
+        * along with phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/ and Nordlandssykehuset
+        * @package rental
+        * @subpackage application
+        * @version $Id: $
+        */
+       phpgw::import_class('property.bogeneric');
+
+       class rental_bogeneric extends property_bogeneric
+       {
+               public function __construct()
+               {
+                       parent::__construct();
+               }
+       }
\ No newline at end of file

Modified: branches/dev-syncromind-2/rental/inc/class.menu.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.menu.inc.php     2016-10-01 
15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/inc/class.menu.inc.php     2016-10-01 
15:45:46 UTC (rev 15776)
@@ -175,22 +175,28 @@
                                        'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'preferences.uiadmin_acl.list_acl',
                                                'acl_app' => 'rental'))
                                ),
+                               'composite_type' => array
+                                       (
+                                       'text' => lang('composite type'),
+                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'rental.uigeneric.index',
+                                               'type' => 'composite_type', 
'admin' => true))
+                               ),
                                'composite_standard' => array
                                        (
                                        'text' => lang('composite standard'),
-                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index',
+                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'rental.uigeneric.index',
                                                'type' => 'composite_standard', 
'admin' => true))
                                ),
                                'location_factor' => array
                                        (
                                        'text' => lang('location factor'),
-                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index',
+                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'rental.uigeneric.index',
                                                'type' => 'location_factor', 
'admin' => true))
                                ),
                                'responsibility_unit' => array
                                        (
                                        'text' => lang('responsibility'),
-                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index',
+                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'rental.uigeneric.index',
                                                'type' => 
'responsibility_unit', 'admin' => true))
                                ),
                                'import' => array

Modified: branches/dev-syncromind-2/rental/inc/class.socomposite.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.socomposite.inc.php      
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/inc/class.socomposite.inc.php      
2016-10-01 15:45:46 UTC (rev 15776)
@@ -184,6 +184,11 @@
                                $filter_clauses[] = "application_id = 
{$this->marshal($filters['application_id'], 'int')}";
                        }
 
+                       if (isset($filters['composite_type_id']))
+                       {
+                               $filter_clauses[] = 
"rental_composite.composite_type_id = 
{$this->marshal($filters['composite_type_id'], 'int')}";
+                       }
+
                        if (isset($filters[$this->get_id_field_name()]))
                        {
                                $filter_clauses[] = "rental_composite.id = 
{$this->marshal($filters[$this->get_id_field_name()], 'int')}";
@@ -231,7 +236,7 @@
                                        rental_composite.has_custom_address, 
rental_composite.address_1, rental_composite.house_number,
                                          rental_composite.address_2, 
rental_composite.postcode, rental_composite.place,
                                          rental_composite.is_active, 
rental_composite.area, rental_composite.description,
-                                         rental_composite.furnish_type_id, 
rental_composite.standard_id,
+                                         rental_composite.furnish_type_id, 
rental_composite.standard_id,rental_composite.composite_type_id,
                                          rental_composite.part_of_town_id, 
rental_composite.custom_prize_factor,";
                                $cols .= "rental_contract.id AS contract_id, 
rental_contract.date_start, rental_contract.date_end, 
rental_contract.old_contract_id, ";
                                $cols .= "rental_application.id AS 
application_id, rental_application.date_start AS application_date_start, 
rental_application.date_end AS application_date_end, ";
@@ -308,6 +313,7 @@
                                
$composite->set_area($this->unmarshal($this->db->f('area', true), 'float'));
                                
$composite->set_furnish_type_id($this->unmarshal($this->db->f('furnish_type_id'),
 'int'));
                                
$composite->set_standard_id($this->unmarshal($this->db->f('standard_id'), 
'int'));
+                               
$composite->set_composite_type_id($this->unmarshal($this->db->f('composite_type_id'),
 'int'));
                                
$composite->set_part_of_town_id($this->unmarshal($this->db->f('part_of_town_id'),
 'int'));
                                
$composite->set_custom_prize_factor($this->unmarshal($this->db->f('custom_prize_factor',
 true), 'float'));
                        }
@@ -452,6 +458,7 @@
                                'area = ' . 
$this->marshal($composite->get_area(), 'float'),
                                'furnish_type_id = ' . 
$composite->get_furnish_type_id(),
                                'standard_id = ' . 
$composite->get_standard_id(),
+                               'composite_type_id = ' . 
$composite->get_composite_type_id(),
                                'part_of_town_id = ' . 
$composite->get_part_of_town_id(),
                                'custom_prize_factor = \'' . 
$composite->get_custom_prize_factor() . '\''
                        );
@@ -473,7 +480,7 @@
                        // Build a db-friendly array of the composite object
                        $cols = array('name', 'description', 
'has_custom_address', 'address_1', 'address_2',
                                'house_number', 'postcode', 'place', 
'object_type_id', 'area', 'furnish_type_id',
-                               'standard_id', 'part_of_town_id', 
'custom_prize_factor');
+                               'standard_id','composite_type_id', 
'part_of_town_id', 'custom_prize_factor');
                        $values = array(
                                "'" . $composite->get_name() . "'",
                                "'" . $composite->get_description() . "'",
@@ -487,6 +494,7 @@
                                $this->marshal($composite->get_area(), 'float'),
                                $composite->get_furnish_type_id(),
                                $composite->get_standard_id(),
+                               $composite->get_composite_type_id(),
                                $composite->get_part_of_town_id(),
                                $composite->get_custom_prize_factor()
                        );

Modified: 
branches/dev-syncromind-2/rental/inc/class.socontract_price_item.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.socontract_price_item.inc.php    
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/inc/class.socontract_price_item.inc.php    
2016-10-01 15:45:46 UTC (rev 15776)
@@ -305,14 +305,14 @@
                        $custom_factor = 
$composite_obj->get_custom_prize_factor();
                        $custom_factor = $custom_factor ? (float)$custom_factor 
: 1;
 
-                       $location_info = ExecMethod('property.bogeneric.read', 
array(
+                       $location_info = ExecMethod('rental.bogeneric.read', 
array(
                                'location_info'=> array('type' => 
'location_factor'),
                                'custom_filter' => array('part_of_town_id = ' . 
(int)$composite_obj->get_part_of_town_id())
                                )
                        );
                        $location_factor = 
(float)abs($location_info[0]['factor']) > 0 ? 
(float)$location_info[0]['factor'] : 1;
 
-                       $standard_info = 
ExecMethod('property.bogeneric.read_single', array('type' => 
'composite_standard', 'id' => $composite_obj->get_standard_id()));
+                       $standard_info = 
ExecMethod('rental.bogeneric.read_single', array('type' => 
'composite_standard', 'id' => $composite_obj->get_standard_id()));
                        $standard_factor = (float)abs($standard_info['factor']) 
> 0 ? (float)$standard_info['factor'] : 1;
 
                        $factor = $location_factor * $standard_factor * 
$custom_factor;

Copied: branches/dev-syncromind-2/rental/inc/class.sogeneric.inc.php (from rev 
15775, trunk/rental/inc/class.sogeneric.inc.php)
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.sogeneric.inc.php                
                (rev 0)
+++ branches/dev-syncromind-2/rental/inc/class.sogeneric.inc.php        
2016-10-01 15:45:46 UTC (rev 15776)
@@ -0,0 +1,183 @@
+<?php
+/**
+        * phpGroupWare - rental: a part of a Facilities Management System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2016 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare is free software; you can redistribute it and/or modify
+        * it under the terms of the GNU General Public License as published by
+        * the Free Software Foundation; either version 2 of the License, or
+        * (at your option) any later version.
+        *
+        * phpGroupWare is distributed in the hope that it will be useful,
+        * but WITHOUT ANY WARRANTY; without even the implied warranty of
+        * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+        * GNU General Public License for more details.
+        *
+        * You should have received a copy of the GNU General Public License
+        * along with phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/ and Nordlandssykehuset
+        * @package rental
+        * @subpackage application
+        * @version $Id: $
+        */
+       phpgw::import_class('property.sogeneric_');
+
+       class rental_sogeneric extends property_sogeneric_
+       {
+               function __construct( $type = '', $type_id = 0 )
+               {
+                       parent::__construct($type, $type_id);
+               }
+
+               public function get_location_info( $type, $type_id )
+               {
+
+                       $type_id = (int)$type_id;
+                       $this->type = $type;
+                       $this->type_id = $type_id;
+                       $info = array();
+
+                       if (!$type)
+                       {
+                               return $info;
+                       }
+
+                       switch ($type)
+                       {
+// START RENTAL TABLES
+                               case 'location_factor':
+                                       $info = array
+                                               (
+                                               'table' => 
'rental_location_factor',
+                                               'id' => array('name' => 'id', 
'type' => 'auto'),
+                                               'fields' => array(
+                                                       array(
+                                                               'name' => 
'part_of_town_id',
+                                                               'descr' => 
lang('location'),
+                                                               'type' => 
'select',
+                                                               'nullable' => 
false,
+                                                               'filter' => 
true,
+                                                               'values_def' => 
array(
+                                                                       
'valueset' => false,
+                                                                       
'get_single_value' => 'property.sogeneric.get_name',
+                                                                       
'method' => 'property.bogeneric.get_list',
+                                                                       
'method_input' => array('type' => 'part_of_town', 'selected' => 
'##part_of_town_id##')
+                                                               )
+                                                       ),
+                                                       array(
+                                                               'name' => 
'factor',
+                                                               'descr' => 
lang('factor'),
+                                                               'type' => 
'numeric',
+                                                               'nullable' => 
false,
+                                                               'size' => 4,
+                                                               'sortable' => 
true
+                                                       ),
+                                                       array(
+                                                               'name' => 
'remark',
+                                                               'descr' => 
lang('remark'),
+                                                               'type' => 'text'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit unit'),
+                                               'add_msg' => lang('add unit'),
+                                               'name' => lang('unit'),
+                                               'acl_app' => 'rental',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::rental::location_factor',
+                                               'default' => array(
+                                                       'user_id' => 
array('add' => '$this->account'),
+                                                       'entry_date' => 
array('add' => 'time()'),
+                                                       'modified_date' => 
array('edit' => 'time()'),
+                                               )
+                                       );
+                                       break;
+                               case 'composite_standard':
+                                       $info = array
+                                               (
+                                               'table' => 
'rental_composite_standard',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'factor',
+                                                               'descr' => 
lang('factor'),
+                                                               'type' => 
'numeric',
+                                                               'nullable' => 
false,
+                                                               'size' => 4,
+                                                               'sortable' => 
true
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit unit'),
+                                               'add_msg' => lang('add unit'),
+                                               'name' => lang('unit'),
+                                               'acl_app' => 'rental',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::rental::composite_standard'
+                                       );
+                                       break;
+                               case 'responsibility_unit':
+                                       $info = array
+                                               (
+                                               'table' => 
'rental_contract_responsibility_unit',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                               ),
+                                               'edit_msg' => lang('edit unit'),
+                                               'add_msg' => lang('add unit'),
+                                               'name' => lang('unit'),
+                                               'acl_app' => 'rental',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::rental::responsibility_unit'
+                                       );
+                                       break;
+                               case 'composite_type':
+                                       $info = array
+                                               (
+                                               'table' => 
'rental_composite_type',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array(
+                                                       array(
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit type'),
+                                               'add_msg' => lang('add type'),
+                                               'name' => lang('type'),
+                                               'acl_app' => 'rental',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::rental::composite_type'
+                                       );
+                                       break;
+// END RENTAL TABLES
+
+                               default:
+                                       $message = lang('ERROR: illegal type 
%1', $type);
+                                       phpgwapi_cache::message_set($message, 
'error');
+                       }
+
+                       $this->location_info = $info;
+                       return $info;
+               }
+       }
\ No newline at end of file

Modified: branches/dev-syncromind-2/rental/inc/class.soprice_item.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.soprice_item.inc.php     
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/inc/class.soprice_item.inc.php     
2016-10-01 15:45:46 UTC (rev 15776)
@@ -389,13 +389,13 @@
                        {
                                $custom_factor = 
$composite_obj->get_custom_prize_factor();
                                $custom_factor = $custom_factor ? 
(float)$custom_factor : 1;
-                               $location_info = 
ExecMethod('property.bogeneric.read', array(
+                               $location_info = 
ExecMethod('rental.bogeneric.read', array(
                                        'location_info'=> array('type' => 
'location_factor'),
                                        'custom_filter' => 
array('part_of_town_id = ' . (int)$composite_obj->get_part_of_town_id())
                                        )
                                );
                                $location_factor = 
(float)abs($location_info[0]['factor']) > 0 ? 
(float)$location_info[0]['factor'] : 1;
-                               $standard_info = 
ExecMethod('property.bogeneric.read_single', array('type' => 
'composite_standard', 'id' => $composite_obj->get_standard_id()));
+                               $standard_info = 
ExecMethod('rental.bogeneric.read_single', array('type' => 
'composite_standard', 'id' => $composite_obj->get_standard_id()));
                                $standard_factor = 
(float)abs($standard_info['factor']) > 0 ? (float)$standard_info['factor'] : 1;
                        }
 

Modified: branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php    
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php    
2016-10-01 15:45:46 UTC (rev 15776)
@@ -50,6 +50,7 @@
                        $fields,
                        $composite_types,
                        $payment_methods;
+               private $bo;
 
                public function __construct()
                {
@@ -69,6 +70,27 @@
                        $this->fields = rental_application::get_fields();
                }
 
+               private function get_composite_type_options( $selected = 0 )
+               {
+                       $type_options = array();
+                       $type_list = execMethod('rental.bogeneric.get_list', 
array('type' => 'composite_type'));
+
+                       $type_options[] = array(
+                               'id' => '',
+                               'name' => lang('select')
+                       );
+
+                       foreach ($type_list as $type)
+                       {
+                               $type_options[] = array(
+                                       'id' => $type['id'],
+                                       'name' => $type['name'],
+                                       'selected' => $type['id'] == $selected 
? 1 : 0
+                               );
+                       }
+                       return $type_options;
+               }
+
                private function get_status_options( $selected = 0 )
                {
                        $status_options = array();
@@ -143,6 +165,12 @@
                                                                'text' => 
lang('status'),
                                                                'list' => 
$status_options
                                                        ),
+                                                       array(
+                                                               'type' => 
'filter',
+                                                               'name' => 
'filter_composite_type_id',
+                                                               'text' => 
lang('composite type'),
+                                                               'list' =>  
$this->get_composite_type_options()
+                                                       ),
                                                        array('type' => 
'autocomplete',
                                                                'name' => 
'ecodimb',
                                                                'app' => 
'property',
@@ -284,10 +312,10 @@
 
                        $bocommon = CreateObject('property.bocommon');
 
-                       $GLOBALS['phpgw']->jqcal->add_listener('date_start');
-                       $GLOBALS['phpgw']->jqcal->add_listener('date_end');
-                       
$GLOBALS['phpgw']->jqcal->add_listener('assign_date_start');
-                       
$GLOBALS['phpgw']->jqcal->add_listener('assign_date_end');
+                       
$GLOBALS['phpgw']->jqcal->add_listener('date_start','datetime');
+                       
$GLOBALS['phpgw']->jqcal->add_listener('date_end','datetime');
+                       
$GLOBALS['phpgw']->jqcal->add_listener('assign_date_start','datetime');
+                       
$GLOBALS['phpgw']->jqcal->add_listener('assign_date_end','datetime');
 
                        $accounts = 
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_EDIT, 
$this->acl_location, 'rental');
                        $executive_officer_options[] = array('id' => '', 'name' 
=> lang('nobody'), 'selected' => 0);
@@ -324,11 +352,20 @@
                                )
                        );
 
+                       if(!$application->assign_date_start && 
$application->date_start)
+                       {
+                               $application->assign_date_start = 
$application->date_start;
+                       }
+                       if(!$application->assign_date_end && 
$application->date_end)
+                       {
+                               $application->assign_date_end = 
$application->date_end;
+                       }
+
                        $data = array(
                                'datatable_def' => $datatable_def,
                                'form_action' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'rental.uiapplication.save')),
                                'cancel_url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'rental.uiapplication.index',)),
-                               'application' => $application,//->toArray(),
+                               'application' => $application,
                                'list_executive_officer' => array('options' => 
$executive_officer_options),
                                'step'          => $step,
                                'value_ecodimb_descr' => 
ExecMethod('property.bogeneric.get_single_attrib_value', array(
@@ -337,7 +374,7 @@
                                        'attrib_name' => 'descr')
                                ),
                                'district_list' => array('options' => 
$bocommon->select_district_list('', $application->district_id)),
-                               'composite_type_list' => array('options' => 
$bocommon->select_list($application->composite_type_id, $composite_types)),
+                               'composite_type_list' => array('options' => 
$this->get_composite_type_options($application->composite_type_id)),
                                'payment_method_list' => array('options' => 
$bocommon->select_list($application->payment_method, $payment_methods)),
                                'status_list' => array('options' => 
$this->get_status_options($application->status)),
                                'mode' => $mode,
@@ -358,11 +395,15 @@
                        $editable = phpgw::get_var('editable', 'bool');
                        $type = 'all_composites';
 
-//                     $filters = rental_uicomposite::get_filters();
                        $filters = ExecMethod('rental.uicomposite.get_filters');
 
-                       foreach ($filters as $k1 => $filter)
+                       foreach ($filters as $k1 => &$filter)
                        {
+                               if ($filter['name'] == 'district_id')
+                               {
+                                       unset($filters[$k1]);
+                                       continue;
+                               }
                                if ($filter['name'] == 'has_contract')
                                {
                                        foreach ($filter['list'] as $k2 => 
$option)
@@ -631,7 +672,7 @@
                        foreach ($applications['results'] as $key => 
&$application)
                        {
                                        $application['status'] = 
$status_text[$application['status']];
-                                       $application['composite_type'] = 
$this->composite_types[$application['composite_type']];
+                                       $application['composite_type'] = 
$this->composite_types[$application['composite_type_id']];
 
                                        $application['entry_date'] = 
$GLOBALS['phpgw']->common->show_date($application['entry_date']);
                                        $application['assign_date_start'] = 
$GLOBALS['phpgw']->common->show_date($application['assign_date_start'], 
$dateformat);

Modified: branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php      
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php      
2016-10-01 15:45:46 UTC (rev 15776)
@@ -196,10 +196,16 @@
                                        phpgwapi_cache::session_set('rental', 
'composite_status', phpgw::get_var('is_active'));
                                        phpgwapi_cache::session_set('rental', 
'composite_status_contract', phpgw::get_var('has_contract'));
                                        phpgwapi_cache::session_set('rental', 
'composite_furnished_status', phpgw::get_var('furnished_status'));
-                                       $filters = array('furnished_status' => 
phpgw::get_var('furnished_status'),
-                                               'is_active' => 
phpgw::get_var('is_active'), 'is_vacant' => phpgw::get_var('occupancy'),
-                                               'has_contract' => 
phpgw::get_var('has_contract'), 'availability_date_from' => 
phpgw::get_var('availability_date_from'),
-                                               'availability_date_to' => 
phpgw::get_var('availability_date_to'), 'district_id' => $district_id);
+                                       $filters = array(
+                                               'furnished_status' => 
phpgw::get_var('furnished_status'),
+                                               'is_active' => 
phpgw::get_var('is_active'),
+                                               'is_vacant' => 
phpgw::get_var('occupancy'),
+                                               'has_contract' => 
phpgw::get_var('has_contract'),
+                                               'availability_date_from' => 
phpgw::get_var('availability_date_from'),
+                                               'availability_date_to' => 
phpgw::get_var('availability_date_to'),
+                                               'district_id' => $district_id,
+                                               'composite_type_id'     => 
phpgw::get_var('composite_type_id', 'int'),
+                                               );
                                        if ($application_id > 0)
                                        {
                                                $filters['application_id'] = 
$application_id;
@@ -966,6 +972,20 @@
                                $composite_standard_options[] = array('id' => 
$composite_standard['id'], 'name' => $composite_standard['name'],
                                        'selected' => $selected);
                        }
+                       $composite_type_name = '';
+                       $cur_type_id = $composite->get_composite_type_id();
+                       $composite_type_arr = 
$composite->get_types($cur_type_id);
+                       $composite_type_options = array();
+                       foreach ($composite_type_arr as $composite_type)
+                       {
+                               $selected = ($composite_type['selected']) ? 1 : 
0;
+                               if ($selected)
+                               {
+                                       $composite_type_name = 
$composite_type['name'];
+                               }
+                               $composite_type_options[] = array('id' => 
$composite_type['id'], 'name' => $composite_type['name'],
+                                       'selected' => $selected);
+                       }
 
                        $furnish_type_name = '';
                        $furnish_types_arr = $composite->get_furnish_types();
@@ -1001,6 +1021,8 @@
                                'value_name' => $composite->get_name(),
                                'value_composite_standard_name' => 
$composite_standard_name,
                                'list_composite_standard' => array('options' => 
$composite_standard_options),
+                               'value_composite_type_name' => 
$composite_type_name,
+                               'list_composite_type' => array('options' => 
$composite_type_options),
                                'value_furnish_type_name' => $furnish_type_name,
                                'list_furnish_type' => array('options' => 
$furnish_types_options),
                                'contract_furnished_status'     =>      
!empty($this->config->config_data['contract_furnished_status']),
@@ -1069,6 +1091,7 @@
                                
$composite->set_description(phpgw::get_var('description'));
                                
$composite->set_furnish_type_id(phpgw::get_var('furnish_type_id'));
                                
$composite->set_standard_id(phpgw::get_var('composite_standard_id', 'int'));
+                               
$composite->set_composite_type_id(phpgw::get_var('composite_type_id', 'int'));
                                
$composite->set_part_of_town_id(phpgw::get_var('part_of_town_id', 'int'));
                                
$composite->set_custom_prize_factor(phpgw::get_var('custom_prize_factor', 
'float'));
 

Modified: branches/dev-syncromind-2/rental/inc/class.uicontract.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uicontract.inc.php       
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/inc/class.uicontract.inc.php       
2016-10-01 15:45:46 UTC (rev 15776)
@@ -576,7 +576,7 @@
                                        "
                                );
 /*
-                               $sogeneric = CreateObject('property.sogeneric', 
'composite_standard');
+                               $sogeneric = CreateObject('rental.sogeneric', 
'composite_standard');
                                $composite_standards = 
$sogeneric->read(array('allrows' => true));
                                foreach ($composite_standards as 
$composite_standard)
                                {

Copied: branches/dev-syncromind-2/rental/inc/class.uigeneric.inc.php (from rev 
15775, trunk/rental/inc/class.uigeneric.inc.php)
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uigeneric.inc.php                
                (rev 0)
+++ branches/dev-syncromind-2/rental/inc/class.uigeneric.inc.php        
2016-10-01 15:45:46 UTC (rev 15776)
@@ -0,0 +1,37 @@
+<?php
+/**
+        * phpGroupWare - rental: a part of a Facilities Management System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2016 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare is free software; you can redistribute it and/or modify
+        * it under the terms of the GNU General Public License as published by
+        * the Free Software Foundation; either version 2 of the License, or
+        * (at your option) any later version.
+        *
+        * phpGroupWare is distributed in the hope that it will be useful,
+        * but WITHOUT ANY WARRANTY; without even the implied warranty of
+        * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+        * GNU General Public License for more details.
+        *
+        * You should have received a copy of the GNU General Public License
+        * along with phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/ and Nordlandssykehuset
+        * @package rental
+        * @subpackage application
+        * @version $Id: $
+        */
+       phpgw::import_class('property.uigeneric');
+
+       class rental_uigeneric extends property_uigeneric
+       {
+               public function __construct()
+               {
+                       parent::__construct();
+               }
+       }
\ No newline at end of file

Modified: branches/dev-syncromind-2/rental/inc/class.uiprice_item.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uiprice_item.inc.php     
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/inc/class.uiprice_item.inc.php     
2016-10-01 15:45:46 UTC (rev 15776)
@@ -550,7 +550,7 @@
                  $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'rental.uicontract.add_price_item', 'price_item_id' => $value['id'], 
'contract_id' => $contract_id)));
                  $value['labels'][] = lang('add');
 
-                 $sogeneric                    = 
CreateObject('property.sogeneric','composite_standard');
+                 $sogeneric                    = 
CreateObject('rental.sogeneric','composite_standard');
                  $composite_standards = $sogeneric->read(array('allrows' => 
true));
                  foreach($composite_standards as $composite_standard)
                  {

Modified: branches/dev-syncromind-2/rental/inc/model/class.agresso_gl07.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/model/class.agresso_gl07.inc.php       
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/inc/model/class.agresso_gl07.inc.php       
2016-10-01 15:45:46 UTC (rev 15776)
@@ -61,7 +61,7 @@
                          static $responsibility_check = array();
                          if(!$responsibility_arr)
                          {
-                         $responsibility_arr = 
execMethod('property.bogeneric.get_list',array('type' => 
'responsibility_unit'));
+                         $responsibility_arr = 
execMethod('rental.bogeneric.get_list',array('type' => 'responsibility_unit'));
                          foreach ($responsibility_arr as $responsibility_entry)
                          {
                          $responsibility_check[$responsibility_entry['id']] = 
true;

Modified: branches/dev-syncromind-2/rental/inc/model/class.composite.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/model/class.composite.inc.php  
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/inc/model/class.composite.inc.php  
2016-10-01 15:45:46 UTC (rev 15776)
@@ -25,6 +25,7 @@
                protected $status;
                protected $furnish_type_id;
                protected $standard_id;
+               protected $composite_type_id;
                protected $units;
                protected $contracts;
                protected $part_of_town_id;
@@ -354,7 +355,6 @@
 
                public function set_standard_id( $standard_id )
                {
-//                     _debug_array($standard_id);die();
                        $this->standard_id = (int)$standard_id;
                }
 
@@ -362,14 +362,23 @@
                {
                        return (int)$this->standard_id;
                }
+               public function set_composite_type_id( $composite_type_id )
+               {
+                       $this->composite_type_id = (int)$composite_type_id;
+               }
 
+               public function get_composite_type_id()
+               {
+                       return (int)$this->composite_type_id;
+               }
+
                /**
                 * Fetch composite standards on the form array(array('id' => 1, 
'name' => 'some text', 'selected' => 1|0))
                 * @return array
                 */
                public function get_standards( $selected )
                {
-                       if ($composite_standards = 
execMethod('property.bogeneric.get_list', array('type' => 'composite_standard',
+                       if ($composite_standards = 
execMethod('rental.bogeneric.get_list', array('type' => 'composite_standard',
                                'selected' => $selected)))
                        {
                                array_unshift($composite_standards, array('id' 
=> '', 'name' => lang('none')));
@@ -377,6 +386,20 @@
                        return $composite_standards;
                }
 
+               /**
+                * Fetch composite types on the form array(array('id' => 1, 
'name' => 'some text', 'selected' => 1|0))
+                * @return array
+                */
+               public function get_types( $selected )
+               {
+                       if ($composite_types = 
execMethod('rental.bogeneric.get_list', array('type' => 'composite_type',
+                               'selected' => $selected)))
+                       {
+                               array_unshift($composite_types, array('id' => 
'', 'name' => lang('none')));
+                       }
+                       return $composite_types;
+               }
+
                public function set_area( $area )
                {
                        $this->area = $area;
@@ -484,6 +507,7 @@
                                'contracts' => $contract_dates,
                                'furnished_status' => $this->get_furnish_type(),
                                'standard_id' =>  $this->get_standard_id(),
+                               'composite_type_id' =>  
$this->get_composite_type_id(),
                                'part_of_town_id' =>  
$this->get_part_of_town_id(),
                                'custom_prize_factor' =>  
$this->get_custom_prize_factor(),
                        );

Modified: branches/dev-syncromind-2/rental/inc/model/class.contract.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/model/class.contract.inc.php   
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/inc/model/class.contract.inc.php   
2016-10-01 15:45:46 UTC (rev 15776)
@@ -1187,7 +1187,7 @@
                 */
                public function get_responsibility_arr( $selected )
                {
-                       if ($responsibility_arr = 
execMethod('property.bogeneric.get_list', array('type' => 'responsibility_unit',
+                       if ($responsibility_arr = 
execMethod('rental.bogeneric.get_list', array('type' => 'responsibility_unit',
                                'selected' => $selected)))
                        {
                                array_unshift($responsibility_arr, array('id' 
=> '', 'name' => lang('none')));

Modified: branches/dev-syncromind-2/rental/inc/model/class.model.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/model/class.model.inc.php      
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/inc/model/class.model.inc.php      
2016-10-01 15:45:46 UTC (rev 15776)
@@ -234,11 +234,12 @@
                        return $rental_item_arr;
                }
 
+       
                function validate( )
                {
                        $errors = array();
                        $this->preValidate( $this );
-                       $this->_validate( $this, $errors);
+                       $this->_validate( $this, array(), $errors);
                        $this->doValidate( $this, $errors);
                        foreach ($errors as $key => $message)
                        {
@@ -263,9 +264,12 @@
 
                }
 
-               private function _validate( $entity, array &$errors )
+               private function _validate( $entity, array $fields, array 
&$errors )
                {
-                       $fields = $this->get_fields();
+                       if(!$fields)
+                       {
+                               $fields = $this->get_fields();
+                       }
                        foreach ($fields as $field => $params)
                        {
                                if (!is_array($params))
@@ -289,7 +293,8 @@
                                                foreach ($value as $key => 
$sub_entity)
                                                {
                                                        $this->_validate(
-                                                               
(array)$sub_entity, (array)$params['manytomany']['column'], $errors, 
sprintf('%s%s[%s]', $field_prefix, empty($field_prefix) ? $field : 
"[{$field}]", (is_string($key) ? $key : $sub_entity_count))
+//                                                             
(array)$sub_entity, (array)$params['manytomany']['column'], $errors, 
sprintf('%s%s[%s]', $field_prefix, empty($field_prefix) ? $field : 
"[{$field}]", (is_string($key) ? $key : $sub_entity_count))
+                                                               
(array)$sub_entity, (array)$params['manytomany']['column'], $errors
                                                        );
                                                        $sub_entity_count++;
                                                }

Modified: branches/dev-syncromind-2/rental/setup/default_records.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/setup/default_records.inc.php      
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/setup/default_records.inc.php      
2016-10-01 15:45:46 UTC (rev 15776)
@@ -275,3 +275,7 @@
                array('day' => "*/1"), 'rental_run_adjustments', 
'rental.soadjustment.run_adjustments', null
        );
 
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
rental_composite_type"
+                       . " (id, name) VALUES (1, 'Type 1' )", __LINE__, 
__FILE__);
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
rental_composite_type"
+                       . " (id, name) VALUES (2, 'Type 2' )", __LINE__, 
__FILE__);

Modified: branches/dev-syncromind-2/rental/setup/phpgw_no.lang
===================================================================
--- branches/dev-syncromind-2/rental/setup/phpgw_no.lang        2016-10-01 
15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/setup/phpgw_no.lang        2016-10-01 
15:45:46 UTC (rev 15776)
@@ -635,4 +635,6 @@
 approved       rental  no      Godkjent
 location       rental  no      Lokalisering
 custom prize factor    rental  no      Prisfaktor
-standard       rental  no      Standard
\ No newline at end of file
+standard       rental  no      Standard
+composite type rental  no      Leieobjekt type
+type   rental  no      Type
\ No newline at end of file

Modified: branches/dev-syncromind-2/rental/setup/setup.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/setup/setup.inc.php        2016-10-01 
15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/setup/setup.inc.php        2016-10-01 
15:45:46 UTC (rev 15776)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['rental']['name'] = 'rental';  // Module identifier
-       $setup_info['rental']['version'] = '0.1.0.28'; // Current module version
+       $setup_info['rental']['version'] = '0.1.0.29'; // Current module version
        $setup_info['rental']['app_order'] = 51;  // (?)
        $setup_info['rental']['tables'] = array(
                'rental_party', // All contract participants, tenants etc.
@@ -9,6 +9,7 @@
                'rental_contract_party', // Connection between tenants and 
contracts
                'rental_composite', // Rental object, an aggregation of rental 
units
                'rental_location_factor', // for location based prizing
+               'rental_composite_type', // classification
                'rental_composite_standard', // Optional standard classes
                'rental_contract_price_item', // Price items from the price 
book tied to a contract
                'rental_contract_responsibility_unit', // optional list of 
candidates

Modified: branches/dev-syncromind-2/rental/setup/tables_current.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/setup/tables_current.inc.php       
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/setup/tables_current.inc.php       
2016-10-01 15:45:46 UTC (rev 15776)
@@ -26,6 +26,7 @@
                                'has_custom_address' => array('type' => 'bool', 
'nullable' => false, 'default' => 'false'),
                                'object_type_id' => array('type' => 'int', 
'precision' => 2, 'nullable' => true,
                                        'default' => null),
+                               'composite_type_id' => array('type' => 'int', 
'precision' => 2, 'nullable' => true,'default' => 1),
                                'area' => array('type' => 'decimal', 
'precision' => '20', 'scale' => '2', 'nullable' => true),
                                'furnish_type_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => true),
                                'standard_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => true),
@@ -63,6 +64,16 @@
                        'ix' => array(),
                        'uc' => array()
                ),
+               'rental_composite_type' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'int', 'precision' => 
4, 'nullable' => false),
+                               'name' => array('type' => 'varchar', 
'precision' => '255', 'nullable' => false),
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
                'rental_unit' => array(
                        'fd' => array(
                                'id' => array('type' => 'auto', 'nullable' => 
false),

Modified: branches/dev-syncromind-2/rental/setup/tables_update.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/setup/tables_update.inc.php        
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/setup/tables_update.inc.php        
2016-10-01 15:45:46 UTC (rev 15776)
@@ -657,3 +657,41 @@
                }
        }
 
+       $test[] = '0.1.0.28';
+       function rental_upgrade0_1_0_28()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->AddColumn('rental_composite', 
'composite_type_id', array(
+                       'type' => 'int',
+                       'precision' => '2',
+                       'nullable' => true,
+                       ));
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'rental_composite_type', array(
+                               'fd' => array(
+                                       'id' => array('type' => 'int', 
'precision' => 4, 'nullable' => false),
+                                       'name' => array('type' => 'varchar', 
'precision' => '255', 'nullable' => false),
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
rental_composite_type"
+                       . " (id, name) VALUES (1, 'Type 1' )", __LINE__, 
__FILE__);
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
rental_composite_type"
+                       . " (id, name) VALUES (2, 'Type 2' )", __LINE__, 
__FILE__);
+
+               $GLOBALS['phpgw_setup']->oProc->query("UPDATE rental_composite 
SET composite_type_id = 1", __LINE__, __FILE__);
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['rental']['currentver'] = 
'0.1.0.29';
+                       return $GLOBALS['setup_info']['rental']['currentver'];
+               }
+       }
+

Modified: branches/dev-syncromind-2/rental/templates/base/application.xsl
===================================================================
--- branches/dev-syncromind-2/rental/templates/base/application.xsl     
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/templates/base/application.xsl     
2016-10-01 15:45:46 UTC (rev 15776)
@@ -10,7 +10,6 @@
                </xsl:when>
                <xsl:when test="adjustment_price">
                        <xsl:apply-templates select="adjustment_price" />
-
                </xsl:when>
        </xsl:choose>
 
@@ -20,6 +19,7 @@
 <xsl:template xmlns:php="http://php.net/xsl"; match="edit">
        <xsl:variable name="date_format">
                <xsl:value-of select="php:function('get_phpgw_info', 
'user|preferences|common|dateformat')" />
+               <xsl:text> H:m</xsl:text>
        </xsl:variable>
 
        <div>
@@ -36,7 +36,7 @@
                                <input type="hidden" id="active_tab" 
name="active_tab" value="{value_active_tab}"/>
                                <div id="application">
                                        <fieldset>
-                                               <xsl:if test="application/id != 
''">
+                                               <xsl:if test="application/id > 
0">
                                                        <div 
class="pure-control-group">
                                                                <label>
                                                                        
<xsl:value-of select="php:function('lang', 'id')"/>
@@ -74,7 +74,7 @@
                                                                <xsl:value-of 
select="$lang_district"/>
                                                        </label>
 
-                                                       <select 
name="district_id">
+                                                       <select 
id="district_id" name="district_id">
                                                                <xsl:attribute 
name="title">
                                                                        
<xsl:value-of select="$lang_district"/>
                                                                </xsl:attribute>
@@ -98,7 +98,7 @@
                                                                <xsl:value-of 
select="$lang_composite_type"/>
                                                        </label>
 
-                                                       <select 
name="composite_type_id">
+                                                       <select 
id="composite_type_id" name="composite_type_id">
                                                                <xsl:attribute 
name="title">
                                                                        
<xsl:value-of select="$lang_composite_type"/>
                                                                </xsl:attribute>
@@ -108,9 +108,6 @@
                                                                <xsl:attribute 
name="data-validation-error-msg">
                                                                        
<xsl:value-of select="$lang_composite_type"/>
                                                                </xsl:attribute>
-                                                               <option 
value="">
-                                                                       
<xsl:value-of select="$lang_composite_type"/>
-                                                               </option>
                                                                
<xsl:apply-templates select="composite_type_list/options"/>
                                                        </select>
                                                </div>
@@ -121,7 +118,7 @@
                                                        <label>
                                                                <xsl:value-of 
select="$lang_date_start"/>
                                                        </label>
-                                                       <input type="text" 
id="date_start" name="date_start" size="10" readonly="readonly">
+                                                       <input type="text" 
id="date_start" name="date_start" readonly="readonly" size="16">
                                                                <xsl:if 
test="application/date_start != 0 and application/date_start != ''">
                                                                        
<xsl:attribute name="value">
                                                                                
<xsl:value-of select="php:function('date', $date_format, 
number(application/date_start))"/>
@@ -143,7 +140,7 @@
                                                        <label>
                                                                <xsl:value-of 
select="$lang_date_end"/>
                                                        </label>
-                                                       <input type="text" 
id="date_end" name="date_end" size="10" readonly="readonly">
+                                                       <input type="text" 
id="date_end" name="date_end" size="16" readonly="readonly">
                                                                <xsl:if 
test="application/date_end != 0 and application/date_end != ''">
                                                                        
<xsl:attribute name="value">
                                                                                
<xsl:value-of select="php:function('date', $date_format, 
number(application/date_end))"/>
@@ -338,7 +335,7 @@
                                                                <label>
                                                                        
<xsl:value-of select="$lang_date_start"/>
                                                                </label>
-                                                               <input 
type="text" id="assign_date_start" name="assign_date_start" size="10" 
readonly="readonly">
+                                                               <input 
type="text" id="assign_date_start" name="assign_date_start" size="16" 
readonly="readonly">
                                                                        <xsl:if 
test="application/assign_date_start != 0 and application/assign_date_start != 
''">
                                                                                
<xsl:attribute name="value">
                                                                                
        <xsl:value-of select="php:function('date', $date_format, 
number(application/assign_date_start))"/>
@@ -352,6 +349,9 @@
                                                                        
</xsl:attribute-->
 
                                                                </input>
+                                                               <xsl:text>  [ 
</xsl:text>
+                                                               <xsl:value-of 
select="php:function('date', $date_format, number(application/date_start))"/>
+                                                               <xsl:text> 
]</xsl:text>
                                                        </div>
                                                        <div 
class="pure-control-group">
                                                                <xsl:variable 
name="lang_date_end">
@@ -360,7 +360,7 @@
                                                                <label>
                                                                        
<xsl:value-of select="$lang_date_end"/>
                                                                </label>
-                                                               <input 
type="text" id="assign_date_end" name="assign_date_end" size="10" 
readonly="readonly">
+                                                               <input 
type="text" id="assign_date_end" name="assign_date_end" size="16" 
readonly="readonly">
                                                                        <xsl:if 
test="application/assign_date_end != 0 and application/assign_date_end != ''">
                                                                                
<xsl:attribute name="value">
                                                                                
        <xsl:value-of select="php:function('date', $date_format, 
number(application/assign_date_end))"/>
@@ -374,6 +374,9 @@
                                                                        
</xsl:attribute-->
 
                                                                </input>
+                                                               <xsl:text>  [ 
</xsl:text>
+                                                               <xsl:value-of 
select="php:function('date', $date_format, number(application/date_end))"/>
+                                                               <xsl:text> 
]</xsl:text>
                                                        </div>
                                                        <div 
class="pure-control-group">
                                                                <xsl:variable 
name="lang_status">
@@ -452,6 +455,8 @@
                                                                        
schedule.params.length = $('#cboNObjects').val();
                                                                        
schedule.params.search = $('#txtSearchSchedule').val();
                                                                        
schedule.params.start = 0;
+                                                                       
schedule.params.district_id = $('#district_id').val();
+                                                                       
schedule.params.composite_type_id = $('#composite_type_id').val();
                                                                        
schedule.params.availability_date_from = "";
                                                                        
schedule.params.availability_date_to = "";
                                                                
@@ -495,24 +500,30 @@
                                                                                
$("#cal_container #datepicker").datepicker("setDate", parseISO8601(state));
                                                                        }
                                                                        
schedule.toolbar = <xsl:value-of select="schedule/toolbar" />;
-                                                                       
+       
                                                                        
$('#date_start').datepicker("option", "onSelect", function (a, e) {
                                                                                
console.log(a);
                                                                                
var adstart_date = a.substr(6,4) + "-" + a.substr(3,2) + "-" + a.substr(0,2);
-                                                                               
schedule.params.availability_date_from = adstart_date;
-                                                                               
schedule.rental.availability_from = new Date(adstart_date);
-                                                                               
schedule.date = parseISO8601(adstart_date);
-                                                                               
$("#cal_container #datepicker").datepicker( "option", "minDate", adstart_date );
-                                                                               
schedule.updateSchedule(schedule.date);
+                                                                               
if(a)
+                                                                               
{
+                                                                               
        schedule.params.availability_date_from = adstart_date;
+                                                                               
        schedule.rental.availability_from = new Date(adstart_date);
+                                                                               
        schedule.date = parseISO8601(adstart_date);
+                                                                               
        $("#cal_container #datepicker").datepicker( "option", "minDate", 
adstart_date );
+                                                                               
        schedule.updateSchedule(schedule.date);
+                                                                               
}
                                                                        });
 
                                                                        
$('#date_end').datepicker("option", "onSelect", function (a, e) {
                                                                                
console.log(a);
-                                                                               
var adstart_end = a.substr(6,4) + "-" + a.substr(3,2) + "-" + a.substr(0,2);
-                                                                               
schedule.params.availability_date_to = adstart_end;
-                                                                               
schedule.rental.availability_to = new Date(adend_date);
-                                                                               
$("#cal_container #datepicker").datepicker( "option", "maxDate", adstart_end );
-                                                                               
schedule.updateSchedule(schedule.date);
+                                                                               
if(a)
+                                                                               
{
+                                                                               
        var adstart_end = a.substr(6,4) + "-" + a.substr(3,2) + "-" + 
a.substr(0,2);
+                                                                               
        schedule.params.availability_date_to = adstart_end;
+                                                                               
        schedule.rental.availability_to = new Date(adend_date);
+                                                                               
        $("#cal_container #datepicker").datepicker( "option", "maxDate", 
adstart_end );
+                                                                               
        schedule.updateSchedule(schedule.date);
+                                                                               
}
                                                                        });
 
                                                                        
composites.rental = {};

Modified: branches/dev-syncromind-2/rental/templates/base/composite.xsl
===================================================================
--- branches/dev-syncromind-2/rental/templates/base/composite.xsl       
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/templates/base/composite.xsl       
2016-10-01 15:45:46 UTC (rev 15776)
@@ -97,6 +97,16 @@
                                                        </div>
                                                        <div 
class="pure-control-group">
                                                                <label>
+                                                                       
<xsl:value-of select="php:function('lang', 'composite type')"/>
+                                                               </label>
+                                                               <xsl:if 
test="count(//list_composite_type/options) > 0">
+                                                                       <select 
id="composite_type_id" name="composite_type_id">
+                                                                               
<xsl:apply-templates select="list_composite_type/options"/>
+                                                                       
</select>
+                                                               </xsl:if>
+                                                       </div>
+                                                       <div 
class="pure-control-group">
+                                                               <label>
                                                                        
<xsl:value-of select="php:function('lang', 'furnish_type')"/>
                                                                </label>
                                                                <select 
id="furnish_type_id" name="furnish_type_id">
@@ -399,6 +409,12 @@
                                                </div>
                                                <div class="pure-control-group">
                                                        <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'composite type')"/>
+                                                       </label>
+                                                       <xsl:value-of 
select="value_composite_type_name"/>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
                                                                <xsl:value-of 
select="php:function('lang', 'furnish_type')"/>
                                                        </label>
                                                        <xsl:value-of 
select="value_furnish_type_name"/>

Modified: branches/dev-syncromind-2/rental/templates/base/css/base.css
===================================================================
--- branches/dev-syncromind-2/rental/templates/base/css/base.css        
2016-10-01 15:42:51 UTC (rev 15775)
+++ branches/dev-syncromind-2/rental/templates/base/css/base.css        
2016-10-01 15:45:46 UTC (rev 15776)
@@ -495,7 +495,7 @@
 }
 
 #date_start, #date_end{
-       width: 90px;    
+/*     width: 90px;    */
 }
 
 input.email, input.url, #unit_leader{




reply via email to

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