fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14897] Merge 14885:14896 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [14897] Merge 14885:14896 from trunk
Date: Wed, 06 Apr 2016 13:42:03 +0000

Revision: 14897
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14897
Author:   sigurdne
Date:     2016-04-06 13:42:03 +0000 (Wed, 06 Apr 2016)
Log Message:
-----------
Merge 14885:14896 from trunk

Modified Paths:
--------------
    branches/Version-2_0-branch/activitycalendar/inc/class.soactivity.inc.php
    
branches/Version-2_0-branch/activitycalendar/inc/class.soorganization.inc.php
    
branches/Version-2_0-branch/booking/inc/class.bocompleted_reservation_export.inc.php
    
branches/Version-2_0-branch/booking/inc/class.socompleted_reservation_export.inc.php
    branches/Version-2_0-branch/booking/inc/class.uiapplication.inc.php
    branches/Version-2_0-branch/booking/inc/class.uicommon.inc.php
    
branches/Version-2_0-branch/booking/inc/class.uicompleted_reservation.inc.php
    
branches/Version-2_0-branch/booking/inc/class.uicompleted_reservation_export.inc.php
    
branches/Version-2_0-branch/booking/inc/class.uicompleted_reservation_export_file.inc.php
    branches/Version-2_0-branch/booking/inc/class.uiseason.inc.php
    branches/Version-2_0-branch/booking/js/booking/completed_reservation.js
    
branches/Version-2_0-branch/booking/templates/base/completed_reservation_export_form.xsl
    branches/Version-2_0-branch/bookingfrontend/inc/class.uisearch.inc.php
    branches/Version-2_0-branch/controller/inc/class.socontrol.inc.php
    branches/Version-2_0-branch/phpgwapi/inc/class.sessions.inc.php
    branches/Version-2_0-branch/phpgwapi/templates/base/datatable_jquery.xsl
    branches/Version-2_0-branch/property/inc/class.boadmin_location.inc.php
    branches/Version-2_0-branch/property/inc/class.bocommon.inc.php
    branches/Version-2_0-branch/property/inc/class.soXport.inc.php
    branches/Version-2_0-branch/property/inc/class.sobudget.inc.php
    branches/Version-2_0-branch/property/inc/class.socommon.inc.php
    branches/Version-2_0-branch/property/inc/class.soentity.inc.php
    branches/Version-2_0-branch/property/inc/class.sogeneric.inc.php
    branches/Version-2_0-branch/property/inc/class.soinvestment.inc.php
    branches/Version-2_0-branch/property/inc/class.soinvoice.inc.php
    branches/Version-2_0-branch/property/inc/class.solocation.inc.php
    branches/Version-2_0-branch/property/inc/class.sotenant_claim.inc.php
    branches/Version-2_0-branch/property/inc/class.sotts.inc.php
    branches/Version-2_0-branch/property/inc/class.soworkorder.inc.php
    branches/Version-2_0-branch/property/inc/class.uitts.inc.php
    branches/Version-2_0-branch/property/inc/cron/default/update_googlemap.php
    branches/Version-2_0-branch/property/setup/default_records.inc.php
    branches/Version-2_0-branch/property/setup/setup.inc.php
    branches/Version-2_0-branch/property/setup/tables_current.inc.php
    branches/Version-2_0-branch/property/setup/tables_update.inc.php
    branches/Version-2_0-branch/rental/inc/class.socomposite.inc.php

Added Paths:
-----------
    
branches/Version-2_0-branch/booking/js/booking/completed_reservation_export.js

Property Changed:
----------------
    branches/Version-2_0-branch/
    branches/Version-2_0-branch/booking/
    branches/Version-2_0-branch/bookingfrontend/


Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884
   + /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896

Modified: 
branches/Version-2_0-branch/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-2_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2016-04-06 13:42:03 UTC (rev 14897)
@@ -556,15 +556,15 @@
 
                function get_district_from_name( $name )
                {
-                       $this->db->query("SELECT part_of_town_id FROM 
fm_part_of_town where name like UPPER('%{$name}%') ", __LINE__, __FILE__);
+                       $this->db->query("SELECT id FROM fm_part_of_town where 
name like UPPER('%{$name}%') ", __LINE__, __FILE__);
                        $this->db->next_record();
-                       return $this->db->f('part_of_town_id');
+                       return $this->db->f('id');
                }
 
                function get_district_from_id( $d_id )
                {
                        $d_id = (int)$d_id;
-                       $this->db->query("SELECT name FROM fm_part_of_town 
where part_of_town_id={$d_id}", __LINE__, __FILE__);
+                       $this->db->query("SELECT name FROM fm_part_of_town 
where id={$d_id}", __LINE__, __FILE__);
                        $this->db->next_record();
                        return $this->db->f('name', true);
                }
@@ -574,7 +574,7 @@
                        $values = array();
                        if ($district_id != null)
                        {
-                               $sql = "SELECT district_id, name FROM 
fm_part_of_town where part_of_town_id in ($district_id)";
+                               $sql = "SELECT district_id, name FROM 
fm_part_of_town where id in ($district_id)";
                                $this->db->query($sql, __LINE__, __FILE__);
                                while ($this->db->next_record())
                                {
@@ -588,7 +588,7 @@
 
                function get_districts()
                {
-                       $this->db->query("SELECT part_of_town_id, name FROM 
fm_part_of_town district_id ", __LINE__, __FILE__);
+                       $this->db->query("SELECT id, name FROM 
fm_part_of_town", __LINE__, __FILE__);
                        $district = array();
                        while ($this->db->next_record())
                        {
@@ -598,7 +598,7 @@
                                        continue;
                                }
                                $district[] = array(
-                                       'part_of_town_id' => 
$this->db->f('part_of_town_id'),
+                                       'part_of_town_id' => $this->db->f('id'),
                                        'name' => stripslashes($name)
                                );
                        }

Modified: 
branches/Version-2_0-branch/activitycalendar/inc/class.soorganization.inc.php
===================================================================
--- 
branches/Version-2_0-branch/activitycalendar/inc/class.soorganization.inc.php   
    2016-04-06 13:39:16 UTC (rev 14896)
+++ 
branches/Version-2_0-branch/activitycalendar/inc/class.soorganization.inc.php   
    2016-04-06 13:42:03 UTC (rev 14897)
@@ -471,10 +471,10 @@
 
                function get_district_from_name( $name )
                {
-                       $this->db->query("SELECT part_of_town_id FROM 
fm_part_of_town where name like UPPER('%{$name}%') ", __LINE__, __FILE__);
+                       $this->db->query("SELECT id FROM fm_part_of_town where 
name like UPPER('%{$name}%') ", __LINE__, __FILE__);
                        $this->db->next_record();
 
-                       $result = $this->db->f('part_of_town_id');
+                       $result = $this->db->f('id');
 
                        return $result;
                }
@@ -484,7 +484,7 @@
                        if ($district_id)
                        {
                                $district_id = (int)$district_id;
-                               $q1 = "SELECT fm_district.descr FROM 
fm_part_of_town,fm_district WHERE 
fm_part_of_town.part_of_town_id={$district_id} AND fm_district.id = 
fm_part_of_town.district_id";
+                               $q1 = "SELECT fm_district.descr FROM 
fm_part_of_town,fm_district WHERE fm_part_of_town.id={$district_id} AND 
fm_district.id = fm_part_of_town.district_id";
                                //var_dump($q1);
                                $this->db->query($q1, __LINE__, __FILE__);
                                $this->db->next_record();


Property changes on: branches/Version-2_0-branch/booking
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/stavangerkommune/booking:9468-12740,12743-12875,12986
/trunk/booking:14721-14732,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14871
   + /branches/stavangerkommune/booking:9468-12740,12743-12875,12986
/trunk/booking:14721-14732,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14871,14886-14896

Modified: 
branches/Version-2_0-branch/booking/inc/class.bocompleted_reservation_export.inc.php
===================================================================
--- 
branches/Version-2_0-branch/booking/inc/class.bocompleted_reservation_export.inc.php
        2016-04-06 13:39:16 UTC (rev 14896)
+++ 
branches/Version-2_0-branch/booking/inc/class.bocompleted_reservation_export.inc.php
        2016-04-06 13:42:03 UTC (rev 14897)
@@ -1,5 +1,6 @@
 <?php
        phpgw::import_class('booking.bocommon');
+       phpgw::import_class('phpgwapi.datetime');
 
        class booking_bocompleted_reservation_export extends booking_bocommon
        {
@@ -21,7 +22,8 @@
                        //'filter' is removed nor do we want it to, so we build 
that filter manually here:
                        if ($filter_to = phpgw::get_var('filter_to', 'string', 
'REQUEST', null))
                        {
-                               $where_clauses[] = "%%table%%" . sprintf(".to_ 
<= '%s 23:59:59'", $GLOBALS['phpgw']->db->db_addslashes($filter_to));
+                               $to_date = date('Y-m-d', 
phpgwapi_datetime::date_to_timestamp($filter_to));
+                               $where_clauses[] = "%%table%%" . sprintf(".to_ 
<= '%s 23:59:59'", $GLOBALS['phpgw']->db->db_addslashes($to_date));
                        }
 
                        if (count($where_clauses) > O)

Modified: 
branches/Version-2_0-branch/booking/inc/class.socompleted_reservation_export.inc.php
===================================================================
--- 
branches/Version-2_0-branch/booking/inc/class.socompleted_reservation_export.inc.php
        2016-04-06 13:39:16 UTC (rev 14896)
+++ 
branches/Version-2_0-branch/booking/inc/class.socompleted_reservation_export.inc.php
        2016-04-06 13:42:03 UTC (rev 14897)
@@ -1,6 +1,7 @@
 <?php
        phpgw::import_class('booking.socommon');
        phpgw::import_class('booking.sopermission');
+       phpgw::import_class('phpgwapi.datetime');
 
        class booking_socompleted_reservation_export extends booking_socommon
        {
@@ -64,9 +65,10 @@
 
                protected function _get_search_to_date( &$entity )
                {
-                       $to_date = (isset($entity['to_']) && 
!empty($entity['to_']) ? $entity['to_'] : date('Y-m-d'));
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       $to_date = isset($entity['to_']) && $entity['to_'] ? 
$entity['to_'] : date($dateformat);
 
-                       $to_date = date('Y-m-d', strtotime($to_date));
+                       $to_date = date('Y-m-d', 
phpgwapi_datetime::date_to_timestamp($to_date));
 
                        if (strtotime($to_date) > strtotime('tomorrow'))
                        {

Modified: branches/Version-2_0-branch/booking/inc/class.uiapplication.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.uiapplication.inc.php 
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/booking/inc/class.uiapplication.inc.php 
2016-04-06 13:42:03 UTC (rev 14897)
@@ -311,7 +311,7 @@
                                'datatable' => array(
                                        'source' => 
self::link(array('menuaction' => 'booking.uiapplication.index',
                                                'phpgw_return_as' => 'json')),
-                                       'sorted_by' => array('key' => 
'created', 'dir' => 'asc'),
+                                       'sorted_by' => array('key' => 4, 'dir' 
=> 'asc'),//created
                                        'field' => array(
                                                array(
                                                        'key' => 'id',

Modified: branches/Version-2_0-branch/booking/inc/class.uicommon.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.uicommon.inc.php      
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/booking/inc/class.uicommon.inc.php      
2016-04-06 13:42:03 UTC (rev 14897)
@@ -257,9 +257,13 @@
                        $this->store_flash_msgs();
 
                        if ($GLOBALS['phpgw_info']['flags']['currentapp'] == 
'bookingfrontend')
+                       {
                                
$GLOBALS['phpgw']->redirect_link('/bookingfrontend/', $link_data);
+                       }
                        else
+                       {
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
$link_data);
+                       }
                }
 
                public function create_error_stack( $errors = array() )

Modified: 
branches/Version-2_0-branch/booking/inc/class.uicompleted_reservation.inc.php
===================================================================
--- 
branches/Version-2_0-branch/booking/inc/class.uicompleted_reservation.inc.php   
    2016-04-06 13:39:16 UTC (rev 14896)
+++ 
branches/Version-2_0-branch/booking/inc/class.uicompleted_reservation.inc.php   
    2016-04-06 13:42:03 UTC (rev 14897)
@@ -4,6 +4,7 @@
 
        phpgw::import_class('booking.uidocument_building');
        phpgw::import_class('booking.uipermission_building');
+       phpgw::import_class('phpgwapi.datetime');
 
 //     phpgw::import_class('phpgwapi.uicommon_jquery');
 
@@ -129,6 +130,7 @@
                        self::add_javascript('booking', 'booking', 
'completed_reservation.js');
 
                        $data = array(
+                               'datatable_name' => lang('booking') . ': ' . 
lang('Completed'),
                                'form' => array(
                                        'toolbar' => array(
                                                'item' => array(
@@ -163,16 +165,17 @@
                                        'list_actions' => array(
                                                'item' => array(
                                                        array(
-                                                               'type' => 
'submit',
+                                                               'type' => 
'button',
                                                                'name' => 
'export',
                                                                'value' => 
lang('Export') . '...',
+                                                               'onClick' => 
"export_completed_reservations();"
                                                        ),
                                                )
                                        ),
                                ),
                                'datatable' => array(
                                        'source' => $this->link_to('index', 
array('phpgw_return_as' => 'json')),
-                                       'sorted_by' => array('key' => 'id', 
'dir' => 'desc'),
+                                       'sorted_by' => array('key' => 0, 'dir' 
=> 'desc'),//id
                                        'field' => array(
                                                array(
                                                        'key' => 'id',
@@ -322,12 +325,12 @@
                        }
 
                        $filter_to = phpgw::get_var('to', 'string', 'REQUEST', 
null);
+                       $to_date = $filter_to ? $filter_to : 
phpgw::get_var('filter_to', 'string', 'REQUEST', null);
 
-                       if ($filter_to)
+                       if ($to_date)
                        {
-                               $filter_to2 = split("/", $filter_to);
-                               $filter_to = $filter_to2[1] . "/" . 
$filter_to2[0] . "/" . $filter_to2[2];
-                               $filters['where'][] = "%%table%%" . 
sprintf(".to_ <= '%s 23:59:59'", 
$GLOBALS['phpgw']->db->db_addslashes($filter_to));
+                               $filter_to2 = date('Y-m-d', 
phpgwapi_datetime::date_to_timestamp($to_date));
+                               $filters['where'][] = "%%table%%" . 
sprintf(".to_ <= '%s 23:59:59'", 
$GLOBALS['phpgw']->db->db_addslashes($filter_to2));
                        }
 
                        if 
(!isset($GLOBALS['phpgw_info']['user']['apps']['admin']) && // admin users 
should have access to all buildings

Modified: 
branches/Version-2_0-branch/booking/inc/class.uicompleted_reservation_export.inc.php
===================================================================
--- 
branches/Version-2_0-branch/booking/inc/class.uicompleted_reservation_export.inc.php
        2016-04-06 13:39:16 UTC (rev 14896)
+++ 
branches/Version-2_0-branch/booking/inc/class.uicompleted_reservation_export.inc.php
        2016-04-06 13:42:03 UTC (rev 14897)
@@ -102,8 +102,10 @@
                        $GLOBALS['phpgw']->jqcal->add_listener('filter_to');
                        phpgwapi_jquery::load_widget('datepicker');
 
+                       self::add_javascript('booking', 'booking', 
'completed_reservation_export.js');
 
                        $data = array(
+                               'datatable_name' => lang('booking') . ': ' . 
lang('Exported Files'),
                                'form' => array(
                                        'toolbar' => array(
                                                'item' => array(
@@ -128,7 +130,7 @@
                                ),
                                'datatable' => array(
                                        'source' => $this->link_to('index', 
array('phpgw_return_as' => 'json')),
-                                       'sorted_by' => array('key' => 'id', 
'dir' => 'desc'),
+                                       'sorted_by' => array('key' => 0, 'dir' 
=> 'desc'),//id
                                        'field' => array(
                                                array(
                                                        'key' => 'id',
@@ -193,9 +195,11 @@
                                $data['form']['list_actions'] = array(
                                        'item' => array(
                                                array(
-                                                       'type' => 'submit',
+                                                       'type' => 'button',
                                                        'name' => 
'generate_files',
                                                        'value' => 
lang('Generate files') . '...',
+                                                       'onClick' => 
"generatefiles();"
+
                                                ),
                                        )
                                );
@@ -204,8 +208,6 @@
                        $filters_to = strtotime(extract_values($_GET, 
array("filter_to")));
                        $data['filters'] = date("Y-m-d", $filters_to);
 
-
-//                     $this->render_template('datatable', $data);
                        self::render_template_xsl('datatable_jquery', $data);
                }
 
@@ -249,7 +251,9 @@
                                        $_sort = array('created_on', 'id');
                                        break;
                                default:
-                                       $_sort = $sort;
+                                       $_sort = array('created_on', 'id');
+//                                     $_sort = $sort;
+                                       $dir = 'DESC';
                                        break;
                        }
 
@@ -398,7 +402,6 @@
                {
                        //Values passed in from the "Export"-action in 
uicompleted_reservation.index
                        $export = extract_values($_GET, $this->fields);
-
                        $errors = array();
                        if ($_SERVER['REQUEST_METHOD'] == 'POST')
                        {
@@ -429,10 +432,15 @@
                                $export['to_'] = date('Y-m-d');
                        }
 
+                       //$this->flash_form_errors($errors);
+
+                       foreach ($errors as $key => $value)
+                       {
+                               phpgwapi_cache::message_set($value, 'error');
+                       }
+
                        $this->pre_validate($export);
 
-                       $this->flash_form_errors($errors);
-
                        $cancel_params = array('ui' => 'completed_reservation');
                        if ($export_key = $this->get_export_key())
                        {
@@ -440,8 +448,9 @@
                        }
 
                        $export['cancel_link'] = $this->link_to('index', 
$cancel_params);
+                       phpgwapi_jquery::load_widget('autocomplete');
 
-                       
$this->render_template('completed_reservation_export_form', array('new_form' => 
true,
+                       
self::render_template_xsl('completed_reservation_export_form', array('new_form' 
=> true,
                                'export' => $export));
                }
        }
\ No newline at end of file

Modified: 
branches/Version-2_0-branch/booking/inc/class.uicompleted_reservation_export_file.inc.php
===================================================================
--- 
branches/Version-2_0-branch/booking/inc/class.uicompleted_reservation_export_file.inc.php
   2016-04-06 13:39:16 UTC (rev 14896)
+++ 
branches/Version-2_0-branch/booking/inc/class.uicompleted_reservation_export_file.inc.php
   2016-04-06 13:42:03 UTC (rev 14897)
@@ -73,9 +73,10 @@
                        }
 
                        $data = array(
+                               'datatable_name' => lang('booking') . ': ' . 
lang('Generated Files'),
                                'datatable' => array(
                                        'source' => $this->link_to('index', 
array('phpgw_return_as' => 'json')),
-                                       'sorted_by' => array('key' => 'id', 
'dir' => 'desc'),
+                                       'sorted_by' => array('key' => 0, 'dir' 
=> 'desc'),
                                        'field' => array(
                                                array(
                                                        'key' => 'id',

Modified: branches/Version-2_0-branch/booking/inc/class.uiseason.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.uiseason.inc.php      
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/booking/inc/class.uiseason.inc.php      
2016-04-06 13:42:03 UTC (rev 14897)
@@ -63,7 +63,7 @@
                                ),
                                'datatable' => array(
                                        'source' => 
self::link(array('menuaction' => 'booking.uiseason.index', 'phpgw_return_as' => 
'json')),
-                                       'sorted_by' => array('key' => 'to_', 
'dir' => 'desc'),
+                                       'sorted_by' => array('key' => 5, 'dir' 
=> 'desc'),//to_
                                        'field' => array(
                                                array(
                                                        'key' => 'name',

Modified: 
branches/Version-2_0-branch/booking/js/booking/completed_reservation.js
===================================================================
--- branches/Version-2_0-branch/booking/js/booking/completed_reservation.js     
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/booking/js/booking/completed_reservation.js     
2016-04-06 13:42:03 UTC (rev 14897)
@@ -15,4 +15,18 @@
 function requestWithBuildingFilter(sQuery)
 {
        return 'query=' + sQuery + (seasonFilterBuildingId ? 
'&filter_building_id=' + seasonFilterBuildingId : '');
+}
+
+function export_completed_reservations()
+{
+       var oArgs = {
+               menuaction:'booking.uicompleted_reservation_export.add',
+               building_id:$('#filter_building_id').val(),
+               building_name: $('#filter_building_name').val(),
+               season_id:$('#filter_season_id').val(),
+               season_name:$('#filter_season_name').val(),
+               to_: $('#filter_to').val()
+       };
+       var requestUrl = phpGWLink('index.php', oArgs);
+       window.open(requestUrl, '_self');
 }
\ No newline at end of file

Copied: 
branches/Version-2_0-branch/booking/js/booking/completed_reservation_export.js 
(from rev 14896, trunk/booking/js/booking/completed_reservation_export.js)
===================================================================
--- 
branches/Version-2_0-branch/booking/js/booking/completed_reservation_export.js  
                            (rev 0)
+++ 
branches/Version-2_0-branch/booking/js/booking/completed_reservation_export.js  
    2016-04-06 13:42:03 UTC (rev 14897)
@@ -0,0 +1,11 @@
+
+
+function generatefiles()
+{
+       var oArgs = {menuaction:'booking.uicompleted_reservation_export.index'};
+       var requestUrl = phpGWLink('index.php', oArgs);
+       $('#list_actions_form').prop("action", requestUrl);
+       $('#list_actions_form').append('<input type="hidden" name="filter_to" 
value="' + $('#filter_to').val() + '"/>');
+       $('#list_actions_form').append('<input type="hidden" 
name="generate_files" value="1"/>');
+       $('#list_actions_form').submit();
+}
\ No newline at end of file

Modified: 
branches/Version-2_0-branch/booking/templates/base/completed_reservation_export_form.xsl
===================================================================
--- 
branches/Version-2_0-branch/booking/templates/base/completed_reservation_export_form.xsl
    2016-04-06 13:39:16 UTC (rev 14896)
+++ 
branches/Version-2_0-branch/booking/templates/base/completed_reservation_export_form.xsl
    2016-04-06 13:42:03 UTC (rev 14897)
@@ -24,7 +24,7 @@
                </dl>
 
                <xsl:call-template name="msgbox"/>
-               <xsl:call-template name="yui_booking_i18n"/>
+               <!--xsl:call-template name="yui_booking_i18n"/-->
 
                <form action="" method="POST">
                        <dl class="form-col">


Property changes on: branches/Version-2_0-branch/bookingfrontend
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/stavangerkommune/bookingfrontend:9468-12740,12986
/trunk/bookingfrontend:14721-14732,14770-14783,14794-14808,14824-14825,14838
   + /branches/stavangerkommune/bookingfrontend:9468-12740,12986
/trunk/bookingfrontend:14721-14732,14770-14783,14794-14808,14824-14825,14838,14886-14894

Modified: branches/Version-2_0-branch/bookingfrontend/inc/class.uisearch.inc.php
===================================================================
--- branches/Version-2_0-branch/bookingfrontend/inc/class.uisearch.inc.php      
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/bookingfrontend/inc/class.uisearch.inc.php      
2016-04-06 13:42:03 UTC (rev 14897)
@@ -105,7 +105,8 @@
                        }
 //_debug_array($filter_tree);
 //die();
-                       $params['part_of_towns'] = 
execMethod('property.sogeneric.get_list', array('type' => 'part_of_town'));
+//                     $params['part_of_towns'] = 
execMethod('property.sogeneric.get_list', array('type' => 'part_of_town'));
+                       $params['part_of_towns'] = 
execMethod('property.solocation.get_booking_part_of_towns');
 
                        foreach ($params['part_of_towns'] as &$part_of_town)
                        {

Modified: branches/Version-2_0-branch/controller/inc/class.socontrol.inc.php
===================================================================
--- branches/Version-2_0-branch/controller/inc/class.socontrol.inc.php  
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/controller/inc/class.socontrol.inc.php  
2016-04-06 13:42:03 UTC (rev 14897)
@@ -1276,7 +1276,7 @@
                                $sql = "SELECT DISTINCT control_id"
                                        . " FROM 
controller_control_location_list {$this->join} fm_locations ON 
controller_control_location_list.location_code = fm_locations.location_code"
                                        . " {$this->join} fm_location1 ON 
fm_locations.loc1 = fm_location1.loc1"
-                                       . " {$this->join} fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id"
+                                       . " {$this->join} fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.id"
                                        . " WHERE district_id =" . 
(int)$filters['district_id'];
 
                                $db = & $GLOBALS['phpgw']->db;
@@ -1291,7 +1291,7 @@
                                $sql = "SELECT DISTINCT control_id"
                                        . " FROM 
controller_control_component_list {$this->join} fm_bim_item ON 
controller_control_component_list.location_id = fm_bim_item.location_id AND 
controller_control_component_list.component_id = fm_bim_item.id"
                                        . " {$this->join} fm_location1 ON 
fm_bim_item.loc1 = fm_location1.loc1"
-                                       . " {$this->join} fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id"
+                                       . " {$this->join} fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.id"
                                        . " WHERE district_id =" . 
(int)$filters['district_id'];
 
                                $db->query($sql, __LINE__, __FILE__);

Modified: branches/Version-2_0-branch/phpgwapi/inc/class.sessions.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.sessions.inc.php     
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.sessions.inc.php     
2016-04-06 13:42:03 UTC (rev 14897)
@@ -6,7 +6,8 @@
        * @author Dan Kuykendall <address@hidden>
        * @author Joseph Engo <address@hidden>
        * @author Ralf Becker <address@hidden>
-       * @copyright Copyright (C) 2000-2008 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2000-2016 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.fsf.org/licenses/lgpl.html GNU Lesser General 
Public License
        * @package phpgroupware
        * @subpackage phpgwapi
@@ -278,7 +279,7 @@
                        if ( 
isset($GLOBALS['phpgw_info']['server']['usecookies'])
                                && 
$GLOBALS['phpgw_info']['server']['usecookies'] )
                        {
-                               $this->phpgw_setcookie(session_name(), 
$this->_sessionid);
+//                             $this->phpgw_setcookie(session_name(), 
$this->_sessionid);// already sendt with session_start()
                                $this->phpgw_setcookie('domain', 
$this->_account_domain);
                        }
 
@@ -830,20 +831,15 @@
                */
                public function phpgw_setcookie($cookiename, $cookievalue='', 
$cookietime=0)
                {
-/*                     $secure = phpgw::get_var('HTTPS', 'bool', 'SERVER');
-
-                       if( isset( 
$GLOBALS['phpgw_info']['server']['webserver_url'] ) )
-                       {
-                               $webserver_url = 
$GLOBALS['phpgw_info']['server']['webserver_url'] . '/';
-                       }
-                       else
-                       {
-                               $webserver_url = '/';
-                       }
-*/
-//                     setcookie($cookiename, $cookievalue, $cookietime, 
parse_url($webserver_url, PHP_URL_PATH),
-//                                     $this->_cookie_domain, $secure, true);
-                       setcookie($cookiename, $cookievalue, $cookietime);
+                       $cookie_params = session_get_cookie_params();
+                       setcookie($cookiename,
+                               $cookievalue,
+                               $cookietime,
+                               $cookie_params['path'],
+                               $cookie_params['domain'],
+                               !!$cookie_params['secure'],
+                               !!$cookie_params['httponly']
+                       );
                }
 
 
@@ -905,13 +901,19 @@
                 */
                public function read_session($sessionid)
                {
+/*
                        if($sessionid)
                        {
                                session_id($sessionid);
                        }
-
+*/
                        session_start();
 
+                       if(!session_id() == $sessionid)
+                       {
+                               return array();
+                       }
+
                        if ( isset($_SESSION['phpgw_session']) && 
is_array($_SESSION['phpgw_session']) )
                        {
                                return $_SESSION['phpgw_session'];
@@ -954,15 +956,14 @@
                 */
                public function register_session($login, $user_ip, $now, 
$session_flags)
                {
-                       if ( $this->_sessionid )
+                       if ( $this->_sessionid != session_id())
                        {
-                               session_id($this->_sessionid);
+                               throw new Exception("sessions::sessionid is 
tampered");
                        }
 
                        if ( !strlen(session_id()) )
                        {
                                throw new 
Exception("sessions::register_session() - No value for session_id()");
-//                             session_start();
                        }
 
                        $_SESSION['phpgw_session'] = array
@@ -1134,6 +1135,10 @@
                        $this->_sessionid = $sessionid;
 
                        $session = $this->read_session($sessionid);
+                       if(!$session)
+                       {
+                               return false;
+                       }
                        $this->_session_flags = $session['session_flags'];
 
                        $lid_data = explode('#', $session['session_lid']);

Modified: 
branches/Version-2_0-branch/phpgwapi/templates/base/datatable_jquery.xsl
===================================================================
--- branches/Version-2_0-branch/phpgwapi/templates/base/datatable_jquery.xsl    
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/phpgwapi/templates/base/datatable_jquery.xsl    
2016-04-06 13:42:03 UTC (rev 14897)
@@ -334,7 +334,7 @@
 <xsl:template match="form/list_actions">
        <form id="list_actions_form" method="POST">
                <!-- Form action is set by javascript listener -->
-               <div id="list_actions" class='yui-skin-sam'>
+               <div id="list_actions">
                        <table cellpadding="0" cellspacing="0">
                                <tr>
                                        <xsl:for-each select="item">
@@ -578,6 +578,11 @@
                var oTable = null;
                $(document).ready(function() {
                var ajax_url = '<xsl:value-of select="source"/>';
+               var order_def = [];
+               <xsl:if test="sorted_by/key">
+                       order_def.push([<xsl:value-of select="sorted_by/key"/>, 
'<xsl:value-of select="sorted_by/dir"/>']);
+               </xsl:if>
+
                var download_url = '<xsl:value-of select="download"/>';
                var exclude_colvis = [];
                var editor_cols = [];
@@ -831,6 +836,7 @@
                                        group_buttons = true;
                                }
 
+                               var isChrome = 
/Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
        ]]>
                                if($(document).width() &lt; 1000)
                                {
@@ -839,6 +845,11 @@
                                $.fn.dataTable.Buttons.swfPath = 
"phpgwapi/js/DataTables/extensions/Buttons/swf/flashExport.swf";
 
 
+                               if(isChrome == true)
+                               {
+                                       group_buttons = false;
+                               }
+
                                if(group_buttons === true)
                                {
                                        JqueryPortico.buttons = [
@@ -880,14 +891,16 @@
                                }
                        }
 
-                       var order_def = [];
-                       for(i=0;i < JqueryPortico.columns.length;i++)
+                       if(order_def.length == 0)
                        {
-                               if (JqueryPortico.columns[i]['orderable'] === 
true && typeof(JqueryPortico.columns[i]['dir']) != 'undefined')
+                               for(i=0;i < JqueryPortico.columns.length;i++)
                                {
-                                       var dir = 
JqueryPortico.columns[i]['dir'] || "desc";
-                                       order_def.push([i, dir]);
-                                       break;
+                                       if 
(JqueryPortico.columns[i]['orderable'] === true && 
typeof(JqueryPortico.columns[i]['dir']) != 'undefined')
+                                       {
+                                               var dir = 
JqueryPortico.columns[i]['dir'] || "desc";
+                                               order_def.push([i, dir]);
+                                               break;
+                                       }
                                }
                        }
 
@@ -913,7 +926,7 @@
                         * Find and assign actions to filters
                         */
                        var oControls = 
$('.dtable_custom_controls:first').find(':input[name]');
-
+//console.log(oControls);
                        oTable = $('#datatable-container').dataTable({
                                paginate:               disablePagination ? 
false : true,
                                processing:             true,
@@ -970,8 +983,8 @@
                                                        params = {}
                                                }
                                        }
-                                       console.log(oData);
-                                       console.log(params);
+                               //      console.log(oData);
+                               //      console.log(params);
                                        oControls.each(function() {
                                                var oControl = $(this);
                                                $.each(params, function(index, 
value) {
@@ -1010,7 +1023,21 @@
                                                        
active_filters_html.push(i);
                                                }
                                        }
+//                                     console.log(oControls);
+                                       oControls.each(function()
+                                       {
+                                               if ( $(this).attr('name') )
+                                               {
+                                                       value = 
$(this).val().replace('"', '"');
+                                                       aoData[ 
$(this).attr('name') ] = value;
+                                               }
 
+//                                             if(value && value !=0 )
+//                                             {
+//                                                     
active_filters_html.push($(this).attr('name'));
+//                                             }
+                                       });
+
                                        if(active_filters_html.length > 0)
                                        {
                                                
$('#active_filters').html("Aktive filter: " + active_filters_html.join(', '));

Modified: 
branches/Version-2_0-branch/property/inc/class.boadmin_location.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.boadmin_location.inc.php     
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/inc/class.boadmin_location.inc.php     
2016-04-06 13:42:03 UTC (rev 14897)
@@ -183,9 +183,17 @@
 
                function get_attrib_group_list( $type_id, $selected )
                {
-                       $location = ".location.{$type_id}";
-                       $group_list = $this->read_attrib_group($location, true);
+                       $params = array(
+                               'start' => 0,
+                               'query' => '',
+                               'sort' => 'ASC',
+                               'order' => 'group_sort',
+                               'allrows' => true,
+                               'type_id' => $type_id
+                       );
 
+                       $group_list = $this->read_attrib_group($params);
+
                        foreach ($group_list as &$group)
                        {
                                if ($group['id'] == $selected)

Modified: branches/Version-2_0-branch/property/inc/class.bocommon.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.bocommon.inc.php     
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/inc/class.bocommon.inc.php     
2016-04-06 13:42:03 UTC (rev 14897)
@@ -1195,7 +1195,7 @@
                                $cols.= ",fm_location1.loc1_name";
                                $joinmethod .= " {$this->join}  fm_location1 ON 
({$_location_table}.loc1 = fm_location1.loc1))";
                                $paranthesis .='(';
-                               $joinmethod .= " {$this->join}  fm_part_of_town 
ON (fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id))";
+                               $joinmethod .= " {$this->join}  fm_part_of_town 
ON (fm_location1.part_of_town_id = fm_part_of_town.id))";
                                $paranthesis .='(';
                                $joinmethod .= " {$this->join}  fm_owner ON 
(fm_location1.owner_id = fm_owner.id))";
                                $paranthesis .='(';

Modified: branches/Version-2_0-branch/property/inc/class.soXport.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.soXport.inc.php      
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/inc/class.soXport.inc.php      
2016-04-06 13:42:03 UTC (rev 14897)
@@ -126,7 +126,7 @@
                {
                        $this->db->query("SELECT 
$meter_table.maaler_nr,$meter_table.loc1,$meter_table.loc2,$meter_table.loc3,fm_part_of_town.district_id
 "
                                . " FROM $meter_table $this->join fm_location1 
ON $meter_table.loc1 = fm_location1.loc1 $this->join "
-                               . " fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id WHERE 
$meter_table.ext_system_id='$anleggsnr'");
+                               . " fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.id WHERE 
$meter_table.ext_system_id='$anleggsnr'");
 
                        $this->db->next_record();
 
@@ -154,7 +154,7 @@
                                . " 
substring(fm_gab_location.gab_id,18,3)='$sekjonnr' AND"
                                . " fm_gab_location.loc1=fm_location1.loc1 AND"
                                . " fm_location1.owner_id=fm_owner.id AND"
-                               . " fm_location1.part_of_town_id = 
fm_part_of_town.part_of_town_id ";
+                               . " fm_location1.part_of_town_id = 
fm_part_of_town.id ";
                        //      . "      and (fm_owner.category=0 or 
fm_owner.category=2)";
 
                        $GLOBALS['phpgw']->db->query($sql, __LINE__, __FILE__);
@@ -569,7 +569,7 @@
 
                function select_underbilag( $bilagsnr )
                {
-                       $sql = "SELECT fm_ecobilag.* 
,fm_part_of_town.district_id FROM (fm_location1 $this->join fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id) $this->join 
fm_ecobilag ON fm_location1.loc1 = fm_ecobilag.loc1 WHERE bilagsnr='$bilagsnr'";
+                       $sql = "SELECT fm_ecobilag.* 
,fm_part_of_town.district_id FROM (fm_location1 $this->join fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.id) $this->join fm_ecobilag ON 
fm_location1.loc1 = fm_ecobilag.loc1 WHERE bilagsnr='$bilagsnr'";
 
                        $this->db->query($sql, __LINE__, __FILE__);
                        $i = 0;

Modified: branches/Version-2_0-branch/property/inc/class.sobudget.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sobudget.inc.php     
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/inc/class.sobudget.inc.php     
2016-04-06 13:42:03 UTC (rev 14897)
@@ -652,7 +652,7 @@
                                . " {$this->join} fm_b_account ON 
fm_workorder.account_id = fm_b_account.id"
                                . " {$this->join} fm_project ON  
fm_workorder.project_id = fm_project.id"
                                . " {$_join_district}"
-                               . " {$this->join} fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id"
+                               . " {$this->join} fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.id"
                                . " {$filtermethod_order}{$filtermethod} 
{$querymethod} {$where} {$filtermethod_direction}"
                                . " ORDER BY fm_workorder.id ASC";
 
@@ -788,7 +788,7 @@
                                . " FROM fm_tts_tickets"
                                . " {$this->join} fm_b_account ON 
fm_tts_tickets.b_account_id = fm_b_account.id "
                                . " {$this->join} fm_location1 ON 
fm_tts_tickets.loc1 = fm_location1.loc1 "
-                               . " {$this->join} fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id $filtermethod 
$filtermethod2 $querymethod  {$where} {$filtermethod_direction} GROUP BY 
fm_b_account.{$b_account_field},district_id,fm_tts_tickets.ecodimb";
+                               . " {$this->join} fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.id $filtermethod $filtermethod2 
$querymethod  {$where} {$filtermethod_direction} GROUP BY 
fm_b_account.{$b_account_field},district_id,fm_tts_tickets.ecodimb";
 
                        //_debug_array($sql);die();
                        $this->db->query($sql . $ordermethod, __LINE__, 
__FILE__);
@@ -814,7 +814,7 @@
                                . " FROM fm_tts_tickets"
                                . " {$this->join} fm_b_account ON 
fm_tts_tickets.b_account_id = fm_b_account.id "
                                . " {$this->join} fm_location1 ON 
fm_tts_tickets.loc1 = fm_location1.loc1 "
-                               . " {$this->join} fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id {$filtermethod} 
{$querymethod} {$where} {$filtermethod_direction} GROUP BY 
fm_b_account.{$b_account_field},district_id,fm_tts_tickets.ecodimb";
+                               . " {$this->join} fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.id {$filtermethod} 
{$querymethod} {$where} {$filtermethod_direction} GROUP BY 
fm_b_account.{$b_account_field},district_id,fm_tts_tickets.ecodimb";
 
 
                        $sql = str_replace('budget', 'actual_cost', $sql);

Modified: branches/Version-2_0-branch/property/inc/class.socommon.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.socommon.inc.php     
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/inc/class.socommon.inc.php     
2016-04-06 13:42:03 UTC (rev 14897)
@@ -210,13 +210,13 @@
                        {
                                $filter = "WHERE district_id = '$district_id'";
                        }
-                       $this->db->query("SELECT name, part_of_town_id, 
district_id FROM fm_part_of_town $filter ORDER BY name ", __LINE__, __FILE__);
+                       $this->db->query("SELECT name, id, district_id FROM 
fm_part_of_town $filter ORDER BY name ", __LINE__, __FILE__);
 
                        while ($this->db->next_record())
                        {
                                $part_of_town[] = array
                                        (
-                                       'id' => $this->db->f('part_of_town_id'),
+                                       'id' => $this->db->f('id'),
                                        'name' => $this->db->f('name', true),
                                        'district_id' => 
$this->db->f('district_id')
                                );

Modified: branches/Version-2_0-branch/property/inc/class.soentity.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.soentity.inc.php     
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/inc/class.soentity.inc.php     
2016-04-06 13:42:03 UTC (rev 14897)
@@ -560,7 +560,7 @@
                        }
                        else if ($part_of_town_id > 0 && 
$category['location_level'])
                        {
-                               $filtermethod .= " $where 
fm_part_of_town.part_of_town_id='$part_of_town_id' ";
+                               $filtermethod .= " $where 
fm_part_of_town.id='$part_of_town_id' ";
                                $where = 'AND';
                        }
 
@@ -783,7 +783,7 @@
                        if (isset($category['location_level']) && 
$category['location_level'] > 0)
                        {
                                $sql .= "{$this->join} fm_location1 ON 
(fm_bim_item.loc1 = fm_location1.loc1)";
-                               $sql .= "{$this->join} fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id)";
+                               $sql .= "{$this->join} fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.id)";
                                $sql .= "{$this->join} fm_owner ON 
(fm_location1.owner_id = fm_owner.id)";
                                $sql .= "{$this->join} fm_locations ON 
(fm_bim_item.location_code = fm_locations.location_code)";
 
@@ -1533,7 +1533,7 @@
                        }
                        else if ($part_of_town_id > 0 && 
$category['location_level'])
                        {
-                               $filtermethod .= " $where  
fm_part_of_town.part_of_town_id='$part_of_town_id' ";
+                               $filtermethod .= " $where  
fm_part_of_town.id='$part_of_town_id' ";
                                $where = 'AND';
                        }
 

Modified: branches/Version-2_0-branch/property/inc/class.sogeneric.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sogeneric.inc.php    
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/inc/class.sogeneric.inc.php    
2016-04-06 13:42:03 UTC (rev 14897)
@@ -402,7 +402,7 @@
                                        $info = array
                                                (
                                                'table' => 'fm_part_of_town',
-                                               'id' => array('name' => 
'part_of_town_id', 'type' => 'int', 'descr' => lang('id')),
+                                               'id' => array('name' => 'id', 
'type' => 'int', 'descr' => lang('id')),
                                                'fields' => array
                                                        (
                                                        array

Modified: branches/Version-2_0-branch/property/inc/class.soinvestment.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.soinvestment.inc.php 
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/inc/class.soinvestment.inc.php 
2016-04-06 13:42:03 UTC (rev 14897)
@@ -99,7 +99,7 @@
 
                        if ($part_of_town_id)
                        {
-                               $filtermethod = "and 
fm_part_of_town.part_of_town_id ='$part_of_town_id'";
+                               $filtermethod = "and fm_part_of_town.id 
='$part_of_town_id'";
                        }
 
                        if ($filter == 'investment')
@@ -119,7 +119,7 @@
                                        . " FROM (((fm_investment $this->join 
fm_investment_value ON ( fm_investment.entity_id = 
fm_investment_value.entity_id) AND "
                                        . " (fm_investment.invest_id = 
fm_investment_value.invest_id )) "
                                        . " $this->join fm_location1 ON 
(fm_investment.loc1 = fm_location1.loc1)) "
-                                       . " $this->join fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id)) "
+                                       . " $this->join fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.id)) "
                                        . " WHERE ( current_index = '1'  or 
(this_index = NULL and index_count= '1'))  AND entity_type ='$cat_id' 
$filtermethod ";
                        }
                        else
@@ -132,7 +132,7 @@
                                        . " fm_investment_value ON 
(fm_investment_value.entity_id = fm_investment.entity_id) AND "
                                        . " (fm_investment_value.invest_id = 
fm_investment.invest_id)) "
                                        . " $this->join fm_location1 ON 
(fm_investment.loc1 = fm_location1.loc1)) "
-                                       . " $this->join fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id)) "
+                                       . " $this->join fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.id)) "
                                        . " WHERE ( current_index = '1'  or 
(this_index = NULL and index_count= '1'))  AND entity_type ='$cat_id' 
$filtermethod ";
                        }
                        if ($sql)

Modified: branches/Version-2_0-branch/property/inc/class.soinvoice.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.soinvoice.inc.php    
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/inc/class.soinvoice.inc.php    
2016-04-06 13:42:03 UTC (rev 14897)
@@ -137,7 +137,7 @@
                        {
                                $filtermethod .= " $where  
district_id='$district_id' ";
                                $join_tables = " $this->join fm_location1 ON 
fm_ecobilagoverf.loc1 = fm_location1.loc1"
-                                       . " $this->join fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id)";
+                                       . " $this->join fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.id)";
                                $where = 'AND';
                        }
 
@@ -720,7 +720,7 @@
 
                        $sql = "SELECT district_id,periode,sum(godkjentbelop) 
as consume {$select_account_class}"
                                . " FROM  fm_ecobilagoverf {$this->join} 
fm_location1 ON (fm_ecobilagoverf.loc1 = fm_location1.loc1) "
-                               . " {$this->join} fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id) "
+                               . " {$this->join} fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.id) "
                                . " {$this->join} fm_b_account ON 
(fm_ecobilagoverf.spbudact_code = fm_b_account.id) "
                                . " WHERE (periode >='{$start_periode}' AND 
periode <= '{$end_periode}' {$filtermethod})"
                                . " GROUP BY district_id,periode 
$group_account_class"
@@ -746,7 +746,7 @@
 
                        $sql = "SELECT district_id,periode,sum(godkjentbelop) 
as consume {$select_account_class}"
                                . " FROM  fm_ecobilag {$this->join} 
fm_location1 ON (fm_ecobilag.loc1 = fm_location1.loc1) "
-                               . " {$this->join} fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id) "
+                               . " {$this->join} fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.id) "
                                . " {$this->join} fm_b_account ON 
(fm_ecobilag.spbudact_code = fm_b_account.id) "
                                . " WHERE (1=1 {$filtermethod})"
                                . " GROUP BY district_id,periode 
$group_account_class"

Modified: branches/Version-2_0-branch/property/inc/class.solocation.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.solocation.inc.php   
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/inc/class.solocation.inc.php   
2016-04-06 13:42:03 UTC (rev 14897)
@@ -238,7 +238,7 @@
                                $status[] = array
                                        (
                                        'id' => $this->db->f('id'),
-                                       'name' => 
stripslashes($this->db->f('value'))
+                                       'name' => $this->db->f('value',true)
                                );
                        }
 
@@ -249,26 +249,27 @@
                {
                        $this->db->query("SELECT id,descr FROM 
fm_owner_category  ORDER BY descr ");
 
-                       $i = 0;
+                       $owner_type = array();
                        while ($this->db->next_record())
                        {
-                               $owner_type[$i]['id'] = $this->db->f('id');
-                               $owner_type[$i]['name'] = 
stripslashes($this->db->f('descr'));
-                               $i++;
+                               $owner_type[] = array(
+                                       'id' => $this->db->f('id'),
+                                       'name' => $this->db->f('descr',true)
+                               );
                        }
                        return $owner_type;
                }
 
                function get_owner_list()
                {
-//                     $this->db->query("SELECT fm_owner.* 
,fm_owner_category.descr as category FROM fm_owner $this->join 
fm_owner_category on fm_owner.category=fm_owner_category.id  ORDER BY descr ");
                        $this->db->query("SELECT *  FROM fm_owner ORDER BY 
org_name ");
-                       $i = 0;
+                       $owners = array();
                        while ($this->db->next_record())
                        {
-                               $owners[$i]['id'] = $this->db->f('id');
-                               $owners[$i]['name'] = 
stripslashes($this->db->f('org_name')); // . ' ['. $this->db->f('category') . 
']';
-                               $i++;
+                               $owners[] = array(
+                                       'id' => $this->db->f('id'),
+                                       'name' => $this->db->f('org_name',true)
+                               );
                        }
                        return $owners;
                }
@@ -410,7 +411,7 @@
                                }
 
                                //                      $paranthesis .='(';
-                               //                      $joinmethod .= " 
{$this->join} fm_part_of_town ON (fm_location1.part_of_town_id = 
fm_part_of_town.part_of_town_id))";
+                               //                      $joinmethod .= " 
{$this->join} fm_part_of_town ON (fm_location1.part_of_town_id = 
fm_part_of_town.id))";
 
                                $config = 
$this->soadmin_location->read_config('');
 
@@ -759,7 +760,7 @@
 
                        if ($part_of_town_id > 0)
                        {
-                               $filtermethod .= " $where 
fm_part_of_town.part_of_town_id='$part_of_town_id' ";
+                               $filtermethod .= " $where 
fm_part_of_town.id='$part_of_town_id' ";
                                $where = 'AND';
                        }
 
@@ -1710,7 +1711,7 @@
                                $uicols['input_type'][] = 'text';
                                $groupmethod .= " ,fm_part_of_town.name";
                                $cols.=", fm_part_of_town.name as part_of_town";
-                               $filtermethod .= " $where 
fm_part_of_town.part_of_town_id = {$part_of_town_id}";
+                               $filtermethod .= " $where fm_part_of_town.id = 
{$part_of_town_id}";
                                $where = 'AND';
                        }
 
@@ -1733,7 +1734,7 @@
 
                        $this->uicols = $uicols;
 
-                       $joinmethod = "{$this->join} fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id))";
+                       $joinmethod = "{$this->join} fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.id))";
                        $paranthesis .='(';
                        $joinmethod .= " {$this->join} fm_owner ON 
(fm_location1.owner_id = fm_owner.id))";
                        $paranthesis .='(';
@@ -1943,8 +1944,8 @@
 
                                if ($part_of_town_id)
                                {
-                                       $join_method = "{$this->join} 
fm_part_of_town ON fm_part_of_town.part_of_town_id = 
fm_location1.part_of_town_id";
-                                       $filtermethod = 'AND 
fm_part_of_town.part_of_town_id =' . (int)$part_of_town_id;
+                                       $join_method = "{$this->join} 
fm_part_of_town ON fm_part_of_town.id = fm_location1.part_of_town_id";
+                                       $filtermethod = 'AND fm_part_of_town.id 
=' . (int)$part_of_town_id;
                                }
                        }
                        else
@@ -1980,7 +1981,7 @@
                                $values[] = array
                                        (
                                        'id' => $id,
-                                       'name' => $this->db->f('name')
+                                       'name' => $this->db->f('name',true)
                                );
                        }
                        return $values;
@@ -2013,4 +2014,23 @@
                        }
                        return $values;
                }
+
+               public function get_booking_part_of_towns( )
+               {
+                       $values = array();
+                       $sql = "SELECT DISTINCT fm_part_of_town.id, 
fm_part_of_town.name FROM"
+                       . " bb_building {$this->join} fm_locations ON 
bb_building.location_code = fm_locations.location_code"
+                       . " {$this->join} fm_location1 ON fm_locations.loc1 = 
fm_location1.loc1"
+                       . " {$this->join} fm_part_of_town ON 
fm_location1.part_of_town_id = fm_part_of_town.id ORDER BY name ASC";
+                       $this->db->query($sql, __LINE__, __FILE__);
+                       while ($this->db->next_record())
+                       {
+                               $values[] = array(
+                                       'id' => $this->db->f('id'),
+                                       'name' => $this->db->f('name',true)
+                               );
+                       }
+                       return $values;
+
+               }
        }
\ No newline at end of file

Modified: branches/Version-2_0-branch/property/inc/class.sotenant_claim.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sotenant_claim.inc.php       
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/inc/class.sotenant_claim.inc.php       
2016-04-06 13:42:03 UTC (rev 14897)
@@ -121,7 +121,7 @@
                                . " $this->join fm_tenant on 
fm_tenant_claim.tenant_id=fm_tenant.id"
                                . " $this->join fm_project ON fm_project.id = 
fm_tenant_claim.project_id"
                                . " $this->join fm_location1 ON 
fm_project.loc1=fm_location1.loc1"
-                               . " $this->join fm_part_of_town ON 
fm_location1.part_of_town_id=fm_part_of_town.part_of_town_id"
+                               . " $this->join fm_part_of_town ON 
fm_location1.part_of_town_id=fm_part_of_town.id"
                                . " $filtermethod $querymethod";
 
                        $this->db->query($sql, __LINE__, __FILE__);

Modified: branches/Version-2_0-branch/property/inc/class.sotts.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sotts.inc.php        
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/inc/class.sotts.inc.php        
2016-04-06 13:42:03 UTC (rev 14897)
@@ -114,7 +114,7 @@
                {
                        $start = isset($data['start']) && $data['start'] ? 
(int)$data['start'] : 0;
                        $status_id = isset($data['status_id']) && 
$data['status_id'] ? $data['status_id'] : 'O'; //O='Open'
-                       $user_id = isset($data['user_id']) && $data['user_id'] 
? (int)$data['user_id'] : 0;
+                       $user_id = isset($data['user_id']) && $data['user_id'] 
? abs((int)$data['user_id']) : 0;
                        $reported_by = isset($data['reported_by']) && 
$data['reported_by'] ? (int)$data['reported_by'] : 0;
                        $query = isset($data['query']) ? $data['query'] : '';
                        $sort = isset($data['sort']) && $data['sort'] ? 
$data['sort'] : 'DESC';
@@ -383,7 +383,7 @@
 
                        if ($part_of_town_id > 0)
                        {
-                               $filtermethod .= " $where 
fm_part_of_town.part_of_town_id= " . (int)$part_of_town_id;
+                               $filtermethod .= " $where fm_part_of_town.id= " 
. (int)$part_of_town_id;
                                $where = 'AND';
                        }
 
@@ -542,13 +542,13 @@
 
                        $union_budget = "SELECT {$return_fields_union}, 0 as 
actual_cost ,SUM(fm_tts_budget.amount) as budget FROM fm_tts_tickets"
                                . " {$this->left_join} fm_location1 ON 
fm_tts_tickets.loc1=fm_location1.loc1"
-                               . " {$this->left_join} fm_part_of_town ON 
fm_location1.part_of_town_id=fm_part_of_town.part_of_town_id"
+                               . " {$this->left_join} fm_part_of_town ON 
fm_location1.part_of_town_id=fm_part_of_town.id"
                                . " {$this->left_join} fm_district ON 
fm_district.id = fm_part_of_town.district_id"
                                . " {$order_join}{$date_budget_join}"
                                . " LEFT OUTER JOIN fm_tts_views ON 
(fm_tts_tickets.id = fm_tts_views.id AND 
fm_tts_views.account_id='{$this->account}')";
                        $union_cost = "SELECT 
{$return_fields_union},SUM(fm_tts_payments.amount) as actual_cost, 0 as budget 
FROM fm_tts_tickets"
                                . " {$this->left_join} fm_location1 ON 
fm_tts_tickets.loc1=fm_location1.loc1"
-                               . " {$this->left_join} fm_part_of_town ON 
fm_location1.part_of_town_id=fm_part_of_town.part_of_town_id"
+                               . " {$this->left_join} fm_part_of_town ON 
fm_location1.part_of_town_id=fm_part_of_town.id"
                                . " {$this->left_join} fm_district ON 
fm_district.id = fm_part_of_town.district_id"
                                . " {$order_join}{$date_cost_join}"
                                . " LEFT OUTER JOIN fm_tts_views ON 
(fm_tts_tickets.id = fm_tts_views.id AND 
fm_tts_views.account_id='{$this->account}')";
@@ -564,7 +564,7 @@
 
                        $sql = "SELECT DISTINCT {$return_fields_plain} FROM 
fm_tts_tickets"
                                . " {$this->left_join} fm_location1 ON 
fm_tts_tickets.loc1=fm_location1.loc1"
-                               . " {$this->left_join} fm_part_of_town ON 
fm_location1.part_of_town_id=fm_part_of_town.part_of_town_id"
+                               . " {$this->left_join} fm_part_of_town ON 
fm_location1.part_of_town_id=fm_part_of_town.id"
                                . " {$this->left_join} fm_district ON 
fm_district.id = fm_part_of_town.district_id"
                                . " 
{$order_join}{$date_cost_join}{$date_budget_join}"
                                . " LEFT OUTER JOIN fm_tts_views ON 
(fm_tts_tickets.id = fm_tts_views.id AND 
fm_tts_views.account_id='{$this->account}')";
@@ -602,7 +602,7 @@
 
                        $sql_cnt = "SELECT DISTINCT budget,actual_cost, 
fm_tts_tickets.id FROM fm_tts_tickets"
                                . " {$this->left_join} fm_location1 ON 
fm_tts_tickets.loc1=fm_location1.loc1"
-                               . " {$this->left_join} fm_part_of_town ON 
fm_location1.part_of_town_id=fm_part_of_town.part_of_town_id"
+                               . " {$this->left_join} fm_part_of_town ON 
fm_location1.part_of_town_id=fm_part_of_town.id"
                                . " {$this->left_join} fm_district ON 
fm_district.id = fm_part_of_town.district_id"
                                . " 
{$order_join}{$date_cost_join}{$date_budget_join}"
                                . " LEFT OUTER JOIN fm_tts_views ON 
(fm_tts_tickets.id = fm_tts_views.id AND 
fm_tts_views.account_id='{$this->account}')";

Modified: branches/Version-2_0-branch/property/inc/class.soworkorder.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.soworkorder.inc.php  
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/inc/class.soworkorder.inc.php  
2016-04-06 13:42:03 UTC (rev 14897)
@@ -2993,4 +2993,4 @@
                        }
                        return $this->db->transaction_commit();
                }
-       }
\ No newline at end of file
+       }

Modified: branches/Version-2_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uitts.inc.php        
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/inc/class.uitts.inc.php        
2016-04-06 13:42:03 UTC (rev 14897)
@@ -681,8 +681,11 @@
                                );
 
                                $values_combo_box[4] = 
$this->bocommon->get_user_list_right2('filter', PHPGW_ACL_EDIT, $this->user_id, 
$this->acl_location);
-                               array_unshift($values_combo_box[4], array('id' 
=> $GLOBALS['phpgw_info']['user']['account_id'],
-                                       'name' => lang('my assigned tickets')));
+                               array_unshift($values_combo_box[4], array(
+                                       'id' => -1 * 
$GLOBALS['phpgw_info']['user']['account_id'],
+                                       'name' => lang('my assigned tickets'),
+                                       'selected'      => (int)$this->user_id 
<= 0 ? 1 : 0));
+
                                array_unshift($values_combo_box[4], array('id' 
=> '', 'name' => lang('assigned to')));
                                $combos[] = array('type' => 'filter',
                                        'name' => 'user_id',

Modified: 
branches/Version-2_0-branch/property/inc/cron/default/update_googlemap.php
===================================================================
--- branches/Version-2_0-branch/property/inc/cron/default/update_googlemap.php  
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/inc/cron/default/update_googlemap.php  
2016-04-06 13:42:03 UTC (rev 14897)
@@ -53,7 +53,7 @@
                        $area = "Bergen";
                        $sql = "SELECT 
fm_location4.location_code,fm_location4.loc1,fm_location4.loc2,fm_location4.loc3,fm_location4.loc4,"
                                . " fm_location1.loc1_name,fm_tenant.id as 
tenant_id,fm_tenant.last_name,fm_tenant.first_name,fm_tenant.contact_phone,fm_streetaddress.descr
 as 
street_name,street_number,fm_location4.street_id,fm_location4.etasje,fm_location4.antallrom,fm_location4.boareal"
-                               . " FROM ((((((( fm_location4 JOIN fm_location3 
ON (fm_location4.loc3 = fm_location3.loc3) AND (fm_location4.loc2 = 
fm_location3.loc2) AND (fm_location4.loc1 = fm_location3.loc1)) JOIN 
fm_location2 ON (fm_location3.loc2 = fm_location2.loc2) AND (fm_location3.loc1 
= fm_location2.loc1)) JOIN fm_location1 ON (fm_location2.loc1 = 
fm_location1.loc1)) JOIN fm_owner ON ( fm_location1.owner_id=fm_owner.id)) JOIN 
fm_part_of_town ON ( 
fm_location1.part_of_town_id=fm_part_of_town.part_of_town_id)) JOIN 
fm_streetaddress ON ( fm_location4.street_id=fm_streetaddress.id)) JOIN 
fm_tenant ON ( fm_location4.tenant_id=fm_tenant.id)) WHERE 
(fm_location4.category !=99 OR fm_location4.category IS NULL) AND 
driftsstatus_id > 0 ";
+                               . " FROM ((((((( fm_location4 JOIN fm_location3 
ON (fm_location4.loc3 = fm_location3.loc3) AND (fm_location4.loc2 = 
fm_location3.loc2) AND (fm_location4.loc1 = fm_location3.loc1)) JOIN 
fm_location2 ON (fm_location3.loc2 = fm_location2.loc2) AND (fm_location3.loc1 
= fm_location2.loc1)) JOIN fm_location1 ON (fm_location2.loc1 = 
fm_location1.loc1)) JOIN fm_owner ON ( fm_location1.owner_id=fm_owner.id)) JOIN 
fm_part_of_town ON ( fm_location1.part_of_town_id=fm_part_of_town.id)) JOIN 
fm_streetaddress ON ( fm_location4.street_id=fm_streetaddress.id)) JOIN 
fm_tenant ON ( fm_location4.tenant_id=fm_tenant.id)) WHERE 
(fm_location4.category !=99 OR fm_location4.category IS NULL) AND 
driftsstatus_id > 0 ";
 
                        $this->db->query($sql, __LINE__, __FILE__);
 

Modified: branches/Version-2_0-branch/property/setup/default_records.inc.php
===================================================================
--- branches/Version-2_0-branch/property/setup/default_records.inc.php  
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/setup/default_records.inc.php  
2016-04-06 13:42:03 UTC (rev 14897)
@@ -321,7 +321,7 @@
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_config 
(location_type, column_name, input_text, lookup_form, f_key, ref_to_category, 
query_value, reference_table, reference_id, datatype, precision_, scale, 
default_value, nullable) VALUES (4, 'tenant_id', NULL, 1, 1, NULL, 0, 
'fm_tenant', 'id', 'int', 4, NULL, NULL, 'True')");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_config 
(location_type, column_name, input_text, lookup_form, f_key, ref_to_category, 
query_value, reference_table, reference_id, datatype, precision_, scale, 
default_value, nullable) VALUES (4, 'street_id', NULL, 1, 1, NULL, 1, 
'fm_streetaddress', 'id', 'int', 4, NULL, NULL, 'True')");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_config 
(location_type, column_name, input_text, lookup_form, f_key, ref_to_category, 
query_value, reference_table, reference_id, datatype, precision_, scale, 
default_value, nullable) VALUES (1, 'owner_id', NULL, NULL, 1, 1, NULL, 
'fm_owner', 'id', 'int', 4, NULL, NULL, 'True')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_config 
(location_type, column_name, input_text, lookup_form, f_key, ref_to_category, 
query_value, reference_table, reference_id, datatype, precision_, scale, 
default_value, nullable) VALUES (1, 'part_of_town_id', NULL, NULL, 1, NULL, 
NULL, 'fm_part_of_town', 'part_of_town_id', 'int', 4, NULL, NULL, 'True')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_config 
(location_type, column_name, input_text, lookup_form, f_key, ref_to_category, 
query_value, reference_table, reference_id, datatype, precision_, scale, 
default_value, nullable) VALUES (1, 'part_of_town_id', NULL, NULL, 1, NULL, 
NULL, 'fm_part_of_town', 'id', 'int', 4, NULL, NULL, 'True')");
 
 #
 # Dumping data for table fm_tenant_category

Modified: branches/Version-2_0-branch/property/setup/setup.inc.php
===================================================================
--- branches/Version-2_0-branch/property/setup/setup.inc.php    2016-04-06 
13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/setup/setup.inc.php    2016-04-06 
13:42:03 UTC (rev 14897)
@@ -11,7 +11,7 @@
         * @version $Id$
        */
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.695';
+       $setup_info['property']['version']              = '0.9.17.696';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: branches/Version-2_0-branch/property/setup/tables_current.inc.php
===================================================================
--- branches/Version-2_0-branch/property/setup/tables_current.inc.php   
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/setup/tables_current.inc.php   
2016-04-06 13:42:03 UTC (rev 14897)
@@ -13,11 +13,11 @@
        $phpgw_baseline = array(
                'fm_part_of_town' => array(
                        'fd' => array(
-                               'part_of_town_id' => array('type' => 'auto', 
'precision' => '2', 'nullable' => False),
+                               'id' => array('type' => 'auto', 'precision' => 
'2', 'nullable' => False),
                                'name' => array('type' => 'varchar', 
'precision' => '20', 'nullable' => True),
                                'district_id' => array('type' => 'int', 
'precision' => '2', 'nullable' => True)
                        ),
-                       'pk' => array('part_of_town_id'),
+                       'pk' => array('id'),
                        'fk' => array(),
                        'ix' => array(),
                        'uc' => array()

Modified: branches/Version-2_0-branch/property/setup/tables_update.inc.php
===================================================================
--- branches/Version-2_0-branch/property/setup/tables_update.inc.php    
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/property/setup/tables_update.inc.php    
2016-04-06 13:42:03 UTC (rev 14897)
@@ -8816,3 +8816,25 @@
                        return $GLOBALS['setup_info']['property']['currentver'];
                }
        }
+
+       /**
+       * Update property version from 0.9.17.695 to 0.9.17.696
+       * Alter name of part of town id.
+       */
+       $test[] = '0.9.17.695';
+
+       function property_upgrade0_9_17_695()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM fm_cache");
+               $GLOBALS['phpgw_setup']->oProc->query("UPDATE 
fm_location_config SET reference_id = 'id' WHERE column_name = 
'part_of_town_id'");
+
+               $GLOBALS['phpgw_setup']->oProc->RenameColumn('fm_part_of_town', 
'part_of_town_id', 'id');
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.696';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }

Modified: branches/Version-2_0-branch/rental/inc/class.socomposite.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/class.socomposite.inc.php    
2016-04-06 13:39:16 UTC (rev 14896)
+++ branches/Version-2_0-branch/rental/inc/class.socomposite.inc.php    
2016-04-06 13:42:03 UTC (rev 14897)
@@ -167,7 +167,7 @@
                        {
                                $joins .= "     {$this->join} fm_locations ON 
(rental_unit.location_code = fm_locations.location_code)";
                                $joins .= "     {$this->join} fm_location1 ON 
(fm_location1.loc1 = fm_locations.loc1)";
-                               $joins .= "     {$this->join} fm_part_of_town 
ON (fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id)";
+                               $joins .= "     {$this->join} fm_part_of_town 
ON (fm_location1.part_of_town_id = fm_part_of_town.id)";
 
                                $filter_clauses[] = 
"fm_part_of_town.district_id =" . (int)$filters['district_id'];
                        }




reply via email to

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