fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16277] Stable: Merge 16268:16276 from trunk


From: sigurdne
Subject: [Fmsystem-commits] [16277] Stable: Merge 16268:16276 from trunk
Date: Wed, 8 Feb 2017 05:17:49 -0500 (EST)

Revision: 16277
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16277
Author:   sigurdne
Date:     2017-02-08 05:17:48 -0500 (Wed, 08 Feb 2017)
Log Message:
-----------
Stable: Merge 16268:16276 from trunk

Modified Paths:
--------------
    
branches/Version-2_0-branch/eventplannerfrontend/inc/custom/default/Altinn2_Bergen_kommune.php
    branches/Version-2_0-branch/helpdesk/inc/class.uitts.inc.php
    branches/Version-2_0-branch/property/inc/class.uitts.inc.php
    branches/Version-2_0-branch/rental/inc/class.socomposite.inc.php
    branches/Version-2_0-branch/rental/inc/class.uicomposite.inc.php
    branches/Version-2_0-branch/rental/inc/model/class.composite.inc.php
    branches/Version-2_0-branch/rental/setup/phpgw_no.lang
    branches/Version-2_0-branch/rental/setup/setup.inc.php
    branches/Version-2_0-branch/rental/setup/tables_current.inc.php
    branches/Version-2_0-branch/rental/setup/tables_update.inc.php
    branches/Version-2_0-branch/rental/templates/base/composite.xsl

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

Index: branches/Version-2_0-branch
===================================================================
--- branches/Version-2_0-branch 2017-02-08 10:15:27 UTC (rev 16276)
+++ branches/Version-2_0-branch 2017-02-08 10:17:48 UTC (rev 16277)

Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
 /branches/dev-syncromind:13653
 /branches/dev-syncromind-2:14933-16188
 /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,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767,15769-15787,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099,16101-16130,16132-16140,16142,16144-16212,16214-16219,16221,16223-16224,16226,16228-16229,16231,16233,16235,16237,16239-16240,16242,16244-16246,16248,16250-16251,16253-16255,16257-16259,16261,16263,16265,16267
\ No newline at end of property
+/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,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767,15769-15787,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099,16101-16130,16132-16140,16142,16144-16212,16214-16219,16221,16223-16224,16226,16228-16229,16231,16233,16235,16237,16239-16240,16242,16244-16246,16248,16250-16251,16253-16255,16257-16259,16261,16263,16265,16267,16269-16276
\ No newline at end of property
Modified: 
branches/Version-2_0-branch/eventplannerfrontend/inc/custom/default/Altinn2_Bergen_kommune.php
===================================================================
--- 
branches/Version-2_0-branch/eventplannerfrontend/inc/custom/default/Altinn2_Bergen_kommune.php
      2017-02-08 10:15:27 UTC (rev 16276)
+++ 
branches/Version-2_0-branch/eventplannerfrontend/inc/custom/default/Altinn2_Bergen_kommune.php
      2017-02-08 10:17:48 UTC (rev 16277)
@@ -130,89 +130,6 @@
                        }
                        $_SESSION['orgs'] = $orgs;
                        $_SESSION['org_id'] = $_org_id; // one of them..
-return;
 
-                       $stage = phpgw::get_var('stage');
-                       $org_id = phpgw::get_var('org_id');
-
-                       if ($stage == 2 && $fodsels_nr && in_array($org_id, 
$orgs_validate))
-                       {
-                               try
-                               {
-                                       return 
createObject('booking.sfValidatorNorwegianOrganizationNumber')->clean($org_id);
-                               }
-                               catch (sfValidatorError $e)
-                               {
-                                       if ($this->debug)
-                                       {
-                                               echo $e->getMessage();
-                                               die();
-                                       }
-                                       return null;
-                               }
-                       }
-
-                       foreach ($orgs as $org)
-                       {
-                               $selected = '';
-                               if ($org_id == $org['id'])
-                               {
-                                       $selected = 'selected = "selected"';
-                               }
-
-                               $org_option .= <<<HTML
-                               <option 
value='{$org['id']}'{$selected}>{$org['name']}</option>
-
-HTML;
-                       }
-
-                       if ($orgs)
-                       {
-                               $action = 
$GLOBALS['phpgw']->link('/eventplannerfrontend/login.php', array('stage' => 2));
-                               $message = 'Velg organisasjon';
-
-                               $org_select = <<<HTML
-                                                       <p>
-                                                               <label 
for="org_id">Velg Organisasjon:</label>
-                                                               <select 
name="org_id" id="org_id">
-                                                                       
{$org_option}
-                                                               </select>
-                                                       </p>
-HTML;
-                       }
-                       else
-                       {
-                               $action = 
$GLOBALS['phpgw']->link('/eventplannerfrontend/index.php');
-                               $message = 'Ikke representant for noen 
organisasjon';
-                               $org_select = '';
-                       }
-
-                       $html = <<<HTML
-                       <!DOCTYPE html>
-                       <html>
-                               <head>
-                                       <title>Velg organisasjon</title>
-                                       <meta http-equiv="Content-Type" 
content="text/html; charset=utf-8">
-                               </head>
-                               <body>
-                                       <h2>{$message}</h2>
-                                       <form action="{$action}" method="post">
-                                               <fieldset>
-                                                       <legend>
-                                                               Organisasjon
-                                                       </legend>
-                                                       $org_select
-                                                       <p>
-                                                               <input 
type="submit" name="submit" value="Fortsett"  />
-                                                       </p>
-                                               </fieldset>
-                                       </form>
-                               </body>
-                       </html>
-HTML;
-
-                       echo $html;
-
-                       $GLOBALS['phpgw']->common->phpgw_exit();
                }
        }
\ No newline at end of file

Modified: branches/Version-2_0-branch/helpdesk/inc/class.uitts.inc.php
===================================================================
--- branches/Version-2_0-branch/helpdesk/inc/class.uitts.inc.php        
2017-02-08 10:15:27 UTC (rev 16276)
+++ branches/Version-2_0-branch/helpdesk/inc/class.uitts.inc.php        
2017-02-08 10:17:48 UTC (rev 16277)
@@ -713,13 +713,6 @@
                                'form' => array(
                                        'toolbar' => array(
                                                'item' => array(
-                                                       array(
-                                                               'type' => 
'link',
-                                                               'value' => 
lang('columns'),
-                                                               'href' => '#',
-                                                               'class' => '',
-                                                               'onclick' => 
"JqueryPortico.openPopup({menuaction:'helpdesk.uitts.columns'}, 
{closeAction:'reload'})"
-                                                       ),
                                                        array
                                                                (
                                                                'type' => 
'date-picker',
@@ -745,6 +738,7 @@
                                        'download' => 
self::link(array('menuaction' => 'helpdesk.uitts.download',
                                                'export' => true, 'allrows' => 
true)),
                                        'allrows' => true,
+                                       "columns" => array('onclick' => 
"JqueryPortico.openPopup({menuaction:'helpdesk.uitts.columns'}, 
{closeAction:'reload'})"),
                                        'new_item' => 
self::link(array('menuaction' => 'helpdesk.uitts.add')),
                                        'editor_action' => 
self::link(array('menuaction' => 'helpdesk.uitts.edit_survey_title')),
                                        'field' => $this->_get_fields(),

Modified: branches/Version-2_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uitts.inc.php        
2017-02-08 10:15:27 UTC (rev 16276)
+++ branches/Version-2_0-branch/property/inc/class.uitts.inc.php        
2017-02-08 10:17:48 UTC (rev 16277)
@@ -732,6 +732,7 @@
                                'list' => $values_combo_box[3]
                        );
 
+                       $values_combo_box[5] = array(); //reported by
                        if(!$this->simple)
                        {
                                $values_combo_box[0] = 
$this->cats->formatted_xslt_list(array('format' => 'filter',
@@ -811,17 +812,18 @@
                                );
 
                                $values_combo_box[5] = 
$this->bo->get_reported_by($this->reported_by);
-                               array_unshift($values_combo_box[5], array('id' 
=> $GLOBALS['phpgw_info']['user']['account_id'],
-                                       'name' => lang('my submitted 
tickets')));
-                               array_unshift($values_combo_box[5], array('id' 
=> '', 'name' => lang('reported by')));
-                               $combos[] = array('type' => 'filter',
-                                       'name' => 'reported_by',
-                                       'extra' => '',
-                                       'text' => lang('reported by'),
-                                       'list' => $values_combo_box[5]
-                               );
                        }
 
+                       array_unshift($values_combo_box[5], array('id' => 
$GLOBALS['phpgw_info']['user']['account_id'],
+                               'name' => lang('my submitted tickets')));
+                       array_unshift($values_combo_box[5], array('id' => '', 
'name' => lang('reported by')));
+                       $combos[] = array('type' => 'filter',
+                               'name' => 'reported_by',
+                               'extra' => '',
+                               'text' => lang('reported by'),
+                               'list' => $values_combo_box[5]
+                       );
+
                        if($order_read)
                        {
                                $combos[] = array('type' => 'filter',

Modified: branches/Version-2_0-branch/rental/inc/class.socomposite.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/class.socomposite.inc.php    
2017-02-08 10:15:27 UTC (rev 16276)
+++ branches/Version-2_0-branch/rental/inc/class.socomposite.inc.php    
2017-02-08 10:17:48 UTC (rev 16277)
@@ -65,14 +65,20 @@
                        switch ($filters['is_active'])
                        {
                                case "active":
-                                       $filter_clauses[] = 
"rental_composite.is_active = TRUE";
+                                       $filter_clauses[] = 
"rental_composite.status_id = 1";
                                        break;
                                case "non_active":
-                                       $filter_clauses[] = 
"rental_composite.is_active = FALSE";
+                                       $filter_clauses[] = 
"rental_composite.status_id = 2";
                                        break;
                                case "both":
                                        break;
                        }
+
+                       if ((int)$filters['status_id'] > 0)
+                       {
+                               $filter_clauses[] = "rental_composite.status_id 
= " . (int) $filters['status_id'];
+                       }
+
                        $special_query = false; //specify if the query should 
use distinct on rental_composite.id (used for selecting composites that has an 
active or inactive contract)
                        $ts_query = strtotime(date('Y-m-d')); // timestamp for 
query (today)
                        $availability_date_from = $ts_query;
@@ -236,7 +242,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.composite_type_id,
+                                         rental_composite.furnish_type_id, 
rental_composite.standard_id,rental_composite.composite_type_id,rental_composite.status_id,
                                          rental_composite.part_of_town_id, 
rental_composite.custom_price_factor, rental_composite.custom_price, 
rental_composite.price_type_id,";
                                $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, ";
@@ -318,6 +324,7 @@
                                
$composite->set_custom_price_factor($this->unmarshal($this->db->f('custom_price_factor',
 true), 'float'));
                                
$composite->set_price_type_id($this->unmarshal($this->db->f('price_type_id'), 
'int'));
                                
$composite->set_custom_price($this->unmarshal($this->db->f('custom_price'), 
'float'));
+                               
$composite->set_status_id($this->unmarshal($this->db->f('status_id'), 'int'));
                        }
                        // Location code
                        $location_code = 
$this->unmarshal($this->db->f('location_code', true), 'string');
@@ -457,7 +464,7 @@
                                'house_number = \'' . 
$composite->get_custom_house_number() . '\'',
                                'postcode = \'' . 
$composite->get_custom_postcode() . '\'',
                                'place = \'' . $composite->get_custom_place() . 
'\'',
-                               'is_active = \'' . ($composite->is_active() ? 
'true' : 'false') . '\'',
+//                             'is_active = \'' . ($composite->is_active() ? 
'true' : 'false') . '\'',
                                'object_type_id = ' . 
$composite->get_object_type_id(),
                                'area = ' . 
$this->marshal($composite->get_area(), 'float'),
                                'furnish_type_id = ' . 
$composite->get_furnish_type_id(),
@@ -466,6 +473,7 @@
                                'part_of_town_id = ' . 
$composite->get_part_of_town_id(),
                                'custom_price_factor = \'' . 
$composite->get_custom_price_factor() . '\'',
                                'price_type_id = ' . 
$composite->get_price_type_id(),
+                               'status_id = ' . $composite->get_status_id(),
                                'custom_price = \'' . 
$composite->get_custom_price() . '\''
                        );
 
@@ -486,7 +494,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','composite_type_id', 
'part_of_town_id', 'custom_price_factor','price_type_id', 'custom_price');
+                               'standard_id','composite_type_id', 
'part_of_town_id', 'custom_price_factor','price_type_id', 'status_id', 
'custom_price');
                        $values = array(
                                "'" . $composite->get_name() . "'",
                                "'" . $composite->get_description() . "'",
@@ -504,6 +512,7 @@
                                $composite->get_part_of_town_id(),
                                "'" . $composite->get_custom_price_factor() . 
"'",
                                $composite->get_price_type_id(),
+                               $composite->get_status_id(),
                                "'" . $composite->get_custom_price() . "'"
                        );
 

Modified: branches/Version-2_0-branch/rental/inc/class.uicomposite.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/class.uicomposite.inc.php    
2017-02-08 10:15:27 UTC (rev 16276)
+++ branches/Version-2_0-branch/rental/inc/class.uicomposite.inc.php    
2017-02-08 10:17:48 UTC (rev 16277)
@@ -40,6 +40,22 @@
                        $this->config->read();
                }
 
+               private function get_status_options( $selected = 0 )
+               {
+                       $status_options = array();
+                       $status_list = rental_composite::get_status_list();
+
+                       foreach ($status_list as $_key => $_value)
+                       {
+                               $status_options[] = array(
+                                       'id' => $_key,
+                                       'name' => $_value,
+                                       'selected' => $_key == $selected ? 1 : 0
+                               );
+                       }
+                       return $status_options;
+               }
+
                public function get_filters()
                {
                        $filters = array();
@@ -82,6 +98,19 @@
                                );
                        }
 
+                       $status_options = $this->get_status_options();
+
+                       array_unshift($status_options, array('id'=> 'all', 
'name' => lang('all')));
+
+
+                       $filters[] = array
+                                       (
+                                       'type' => 'filter',
+                                       'name' => 'status_id',
+                                       'text' => lang('status'),
+                                       'list' => $status_options
+                               );
+
                        $districts_arr = 
execMethod('property.sogeneric.get_list', array('type' => 'district'));
                        $districts = array();
                        array_unshift($districts, array('id' => '', 'name' => 
lang('select')));
@@ -96,7 +125,7 @@
                                'text' => lang('district'),
                                'list' => $districts
                        );
-
+/*
                        $active_option = array
                                (
                                array('id' => 'both', 'name' => lang('all')),
@@ -110,7 +139,7 @@
                                'text' => lang('availability'),
                                'list' => $active_option
                        );
-
+*/
                        $has_contract_option = array
                                (
                                array('id' => 'both', 'name' => lang('all')),
@@ -157,6 +186,7 @@
                        $result_objects = array();
                        $object_count = 0;
                        $district_id = phpgw::get_var('district_id', 'int');
+                       $status_id = phpgw::get_var('status_id', 'int');
 
                        //Retrieve a contract identifier and load corresponding 
contract
                        $contract_id = phpgw::get_var('contract_id');
@@ -184,8 +214,12 @@
                                        $object_count = 
rental_socomposite::get_instance()->get_count($search_for, $search_type, 
$filters);
                                        break;
                                case 'not_included_composites': // ... get all 
vacant and active composites not in contract
-                                       $filters = array('is_active' => 
phpgw::get_var('is_active'), 'is_vacant' => 
phpgw::get_var('occupancy'),//is_vacant seems to be unused
-                                               'not_in_contract' => 
phpgw::get_var('contract_id'),'has_contract' => 
phpgw::get_var('has_contract'),'furnished_status' => 
phpgw::get_var('furnished_status'));
+                                       $filters = array('is_active' => 
phpgw::get_var('is_active'),
+                                               'district_id' => $status_id,
+                                               'is_vacant' => 
phpgw::get_var('occupancy'),//is_vacant seems to be unused
+                                               'not_in_contract' => 
phpgw::get_var('contract_id'),
+                                               'has_contract' => 
phpgw::get_var('has_contract'),
+                                               'furnished_status' => 
phpgw::get_var('furnished_status'));
                                        $result_objects = 
rental_socomposite::get_instance()->get($start_index, $num_of_objects, 
$sort_field, $sort_ascending, $search_for, $search_type, $filters);
                                        $object_count = 
rental_socomposite::get_instance()->get_count($search_for, $search_type, 
$filters);
                                        break;
@@ -193,6 +227,7 @@
                                        phpgwapi_cache::session_set('rental', 
'composite_query', $search_for);
                                        phpgwapi_cache::session_set('rental', 
'composite_search_type', $search_type);
                                        phpgwapi_cache::session_set('rental', 
'composite_status', phpgw::get_var('is_active'));
+                                       phpgwapi_cache::session_set('rental', 
'composite_status_id', phpgw::get_var('status_id'));
                                        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(
@@ -203,6 +238,7 @@
                                                'availability_date_from' => 
phpgw::get_var('availability_date_from'),
                                                'availability_date_to' => 
phpgw::get_var('availability_date_to'),
                                                'district_id' => $district_id,
+                                               'status_id' => $status_id,
                                                'composite_type_id'     => 
phpgw::get_var('composite_type_id', 'int'),
                                                );
                                        if ($application_id > 0)
@@ -233,15 +269,19 @@
                        }
 
                        //Create an empty row set
+
+                       $status_list = rental_composite::get_status_list();
                        $rows = array();
                        foreach ($result_objects as $result)
                        {
                                if (isset($result))
                                {
-                                       if (!$result->is_active())
-                                       {
-                                               $result->set_status('Ikke i 
drift');
-                                       }
+//                                     if (!$result->is_active())
+//                                     {
+//                                             $result->set_status('Ikke i 
drift');
+//                                     }
+
+                                       
$result->set_status($status_list[$result->get_status_id()]);
                                        $row = $result->serialize();
                                        $row['price_type'] = 
$price_types[$row['price_type_id']];
                                        $rows[] = $row;
@@ -1054,6 +1094,7 @@
                                'list_price_type' => array('options' => 
$price_type_options),
                                'value_composite_type_name' => 
$composite_type_name,
                                'list_composite_type' => array('options' => 
$composite_type_options),
+                               'list_status_id' => array('options' => 
$this->get_status_options($composite->get_status_id())),
                                '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']),
@@ -1127,6 +1168,7 @@
                                
$composite->set_custom_price_factor(phpgw::get_var('custom_price_factor', 
'float'));
                                
$composite->set_custom_price(phpgw::get_var('custom_price', 'float'));
                                
$composite->set_price_type_id(phpgw::get_var('price_type_id', 'int'));
+                               
$composite->set_status_id(phpgw::get_var('status_id', 'int'));
 
                                if 
(rental_socomposite::get_instance()->store($composite))
                                {

Modified: branches/Version-2_0-branch/rental/inc/model/class.composite.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/inc/model/class.composite.inc.php        
2017-02-08 10:15:27 UTC (rev 16276)
+++ branches/Version-2_0-branch/rental/inc/model/class.composite.inc.php        
2017-02-08 10:17:48 UTC (rev 16277)
@@ -9,10 +9,15 @@
         */
        class rental_composite extends rental_model
        {
+               const STATUS_ACTIVE = 1;
+               const STATUS_INACTIVE = 2;
+               const STATUS_EXPIRED = 3;
 
+
                protected $name;
                protected $description;
                protected $is_active;
+               protected $status_id;
                protected $has_custom_address;
                // These are custom fields that may be set on the composite
                protected $custom_address_1;
@@ -47,6 +52,15 @@
                        $this->contracts = array();
                }
 
+               public static function get_status_list()
+               {
+
+                       return array(
+                               self::STATUS_ACTIVE => lang('active'),
+                               self::STATUS_INACTIVE   => lang('inactive'),
+                               self::STATUS_EXPIRED => lang('expired'),
+                       );
+               }
                /**
                 * Adds a composite to the composite object. Note that this 
method is
                 * meant for populating the object and will not fetch anything 
from
@@ -185,7 +199,16 @@
                {
                        return $this->description;
                }
+               public function set_status_id( $status_id )
+               {
+                       $this->status_id = $status_id;
+               }
 
+               public function get_status_id()
+               {
+                       return $this->status_id;
+               }
+
                public function set_is_active( $is_active )
                {
                        $this->is_active = (bool)$is_active;
@@ -519,6 +542,7 @@
                                'id' => $this->get_id(),
                                'location_code' => $location_codes,
                                'description' => $this->get_description(),
+                               'status_id' => $this->get_status_id(),
                                'is_active' => $this->is_active(),
                                'name' => $this->get_name(),
                                'address' => $addresses,

Modified: branches/Version-2_0-branch/rental/setup/phpgw_no.lang
===================================================================
--- branches/Version-2_0-branch/rental/setup/phpgw_no.lang      2017-02-08 
10:15:27 UTC (rev 16276)
+++ branches/Version-2_0-branch/rental/setup/phpgw_no.lang      2017-02-08 
10:17:48 UTC (rev 16277)
@@ -664,4 +664,5 @@
 content        rental  no      Innhold
 select all     rental  no      Velg alle
 planned        rental  no      Planlagt
-email template rental  no      Standardtekster
\ No newline at end of file
+email template rental  no      Standardtekster
+expired        rental  no      Utgått
\ No newline at end of file

Modified: branches/Version-2_0-branch/rental/setup/setup.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/setup/setup.inc.php      2017-02-08 
10:15:27 UTC (rev 16276)
+++ branches/Version-2_0-branch/rental/setup/setup.inc.php      2017-02-08 
10:17:48 UTC (rev 16277)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['rental']['name'] = 'rental';  // Module identifier
-       $setup_info['rental']['version'] = '0.1.0.35'; // Current module version
+       $setup_info['rental']['version'] = '0.1.0.36'; // Current module version
        $setup_info['rental']['app_order'] = 51;  // (?)
        $setup_info['rental']['tables'] = array(
                'rental_party', // All contract participants, tenants etc.

Modified: branches/Version-2_0-branch/rental/setup/tables_current.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/setup/tables_current.inc.php     
2017-02-08 10:15:27 UTC (rev 16276)
+++ branches/Version-2_0-branch/rental/setup/tables_current.inc.php     
2017-02-08 10:17:48 UTC (rev 16277)
@@ -18,6 +18,7 @@
                                'name' => array('type' => 'varchar', 
'precision' => '255', 'nullable' => false),
                                'description' => array('type' => 'text'),
                                'is_active' => array('type' => 'bool', 
'nullable' => false, 'default' => 'true'),
+                               'status_id' =>  array('type' => 'int', 
'precision' => 2, 'nullable' => false,'default' => 1),
                                'address_1' => array('type' => 'varchar', 
'precision' => '255'),
                                'address_2' => array('type' => 'varchar', 
'precision' => '255'),
                                'house_number' => array('type' => 'varchar', 
'precision' => '255'),

Modified: branches/Version-2_0-branch/rental/setup/tables_update.inc.php
===================================================================
--- branches/Version-2_0-branch/rental/setup/tables_update.inc.php      
2017-02-08 10:15:27 UTC (rev 16276)
+++ branches/Version-2_0-branch/rental/setup/tables_update.inc.php      
2017-02-08 10:17:48 UTC (rev 16277)
@@ -932,3 +932,30 @@
 
 
 
+       $test[] = '0.1.0.35';
+       function rental_upgrade0_1_0_35()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->AddColumn('rental_composite', 
'status_id', array(
+                       'type' => 'int',
+                       'precision' => 2,
+                       'nullable' => true,
+                       'default' => 1
+               ));
+
+               $GLOBALS['phpgw_setup']->oProc->query("UPDATE rental_composite 
SET status_id = 2 WHERE is_active = FALSE", __LINE__, __FILE__);
+
+               $GLOBALS['phpgw_setup']->oProc->AlterColumn('rental_composite', 
'status_id', array(
+                       'type' => 'int',
+                       'precision' => 2,
+                       'nullable' => false,
+                       'default' => 1
+               ));
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['rental']['currentver'] = 
'0.1.0.36';
+                       return $GLOBALS['setup_info']['rental']['currentver'];
+               }
+       }

Modified: branches/Version-2_0-branch/rental/templates/base/composite.xsl
===================================================================
--- branches/Version-2_0-branch/rental/templates/base/composite.xsl     
2017-02-08 10:15:27 UTC (rev 16276)
+++ branches/Version-2_0-branch/rental/templates/base/composite.xsl     
2017-02-08 10:17:48 UTC (rev 16277)
@@ -178,7 +178,7 @@
                                                        </label>
                                                        <xsl:value-of 
select="value_area_net"/>
                                                </div>
-                                               <div class="pure-control-group">
+                                               <!--div 
class="pure-control-group">
                                                        <label>
                                                                <xsl:value-of 
select="php:function('lang', 'available ?')"/>
                                                        </label>
@@ -187,7 +187,18 @@
                                                                        
<xsl:attribute name="checked" value="checked"/>
                                                                </xsl:if>
                                                        </input>
+                                               </div-->
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'available ?')"/>
+                                                       </label>
+                                                       <xsl:if 
test="count(//list_status_id/options) > 0">
+                                                               <select 
id="status_id" name="status_id">
+                                                                       
<xsl:apply-templates select="list_status_id/options"/>
+                                                               </select>
+                                                       </xsl:if>
                                                </div>
+
                                        </div>
                                </div>
                                <xsl:choose>
@@ -456,7 +467,7 @@
                                                        </label>
                                                        <xsl:value-of 
select="value_area_net"/>
                                                </div>
-                                               <div class="pure-control-group">
+                                               <!--div 
class="pure-control-group">
                                                        <label>
                                                                <xsl:value-of 
select="php:function('lang', 'available ?')"/>
                                                        </label>
@@ -465,6 +476,16 @@
                                                                        
<xsl:attribute name="checked" value="checked"/>
                                                                </xsl:if>
                                                        </input>
+                                               </div-->
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'available ?')"/>
+                                                       </label>
+                                                       <xsl:for-each 
select="list_status_id/options">
+                                                               <xsl:if 
test="selected != 0">
+                                                                       
<xsl:value-of disable-output-escaping="yes" select="name"/>
+                                                               </xsl:if>
+                                                       </xsl:for-each>
                                                </div>
                                        </div>
                                </div>




reply via email to

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