fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15253] Syncromind: merge 15221:15252 from trunk


From: sigurdne
Subject: [Fmsystem-commits] [15253] Syncromind: merge 15221:15252 from trunk
Date: Thu, 2 Jun 2016 13:34:46 +0000 (UTC)

Revision: 15253
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15253
Author:   sigurdne
Date:     2016-06-02 13:34:46 +0000 (Thu, 02 Jun 2016)
Log Message:
-----------
Syncromind: merge 15221:15252 from trunk

Modified Paths:
--------------
    branches/dev-syncromind-2/property/inc/class.bogeneric.inc.php
    branches/dev-syncromind-2/property/inc/class.soinvoice.inc.php
    branches/dev-syncromind-2/property/inc/class.solocation.inc.php
    branches/dev-syncromind-2/property/inc/class.soproject.inc.php
    branches/dev-syncromind-2/property/inc/class.uiadmin_entity.inc.php
    branches/dev-syncromind-2/property/inc/class.uiproject.inc.php
    branches/dev-syncromind-2/property/inc/class.uiworkorder.inc.php
    branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php
    branches/dev-syncromind-2/rental/inc/model/class.application.inc.php
    branches/dev-syncromind-2/rental/setup/phpgw_no.lang
    branches/dev-syncromind-2/rental/templates/base/application.xsl

Added Paths:
-----------
    branches/dev-syncromind-2/rental/js/rental/application.edit.js

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


Property changes on: branches/dev-syncromind-2
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14934-14935,15165-15215,15218-15220
   + /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14934-14935,15165-15215,15218-15220,15222-15252

Modified: branches/dev-syncromind-2/property/inc/class.bogeneric.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.bogeneric.inc.php      
2016-06-02 13:29:20 UTC (rev 15252)
+++ branches/dev-syncromind-2/property/inc/class.bogeneric.inc.php      
2016-06-02 13:34:46 UTC (rev 15253)
@@ -351,4 +351,20 @@
                {
                        return $this->so->edit_field($data);
                }
+
+               public function get_single_attrib_value( array $data )
+               {
+                       $ret = $id = $data['id'];
+                       $type = $data['type'];
+                       $attrib_name = $data['attrib_name'];
+                       $ret = $id;
+                       if($id = (int)$id)
+                       {
+                               $sogeneric = CreateObject('property.sogeneric', 
$type);
+                               $sogeneric_data = 
$sogeneric->read_single(array('id' => $id));
+                               $ret =  $sogeneric_data[$attrib_name];
+                       }
+                       return $ret;
+               }
+
        }
\ No newline at end of file

Modified: branches/dev-syncromind-2/property/inc/class.soinvoice.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.soinvoice.inc.php      
2016-06-02 13:29:20 UTC (rev 15252)
+++ branches/dev-syncromind-2/property/inc/class.soinvoice.inc.php      
2016-06-02 13:34:46 UTC (rev 15253)
@@ -553,6 +553,18 @@
                                case 'pmwrkord_code':
                                        $ordermethod = " ORDER BY $order $sort";
                                        break;
+                               case 'workorder_id':
+                                       $ordermethod = " ORDER BY pmwrkord_code 
$sort";
+                                       break;
+                               case 'voucher_id':
+                                       $ordermethod = " ORDER BY bilagsnr_ut 
$sort, bilagsnr $sort";
+                                       break;
+                               case 'amount':
+                                       $ordermethod = " ORDER BY belop $sort";
+                                       break;
+                               case 'period':
+                                       $ordermethod = " ORDER BY periode 
$sort";
+                                       break;
                                default:
                                        $ordermethod = " ORDER BY pmwrkord_code 
DESC";
                        }

Modified: branches/dev-syncromind-2/property/inc/class.solocation.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.solocation.inc.php     
2016-06-02 13:29:20 UTC (rev 15252)
+++ branches/dev-syncromind-2/property/inc/class.solocation.inc.php     
2016-06-02 13:34:46 UTC (rev 15253)
@@ -373,14 +373,12 @@
                                        $uicols['statustext'][] = 
$location_types[$i]['descr'];
                                        $uicols['exchange'][] = true;
                                        $uicols['align'][] = 'center';
-                                       $uicols['datatype'][] = 'link';
+                                       $uicols['datatype'][] = $i==($type_id 
-1 ) ? 'I' : 'link'; // correct the last one
                                        $uicols['formatter'][] = '';
                                        $cols .= 
",fm_location{$type_id}.loc{$location_types[$i]['id']}";
                                        $cols_return[] = 
"loc{$location_types[$i]['id']}";
                                }
 
-                               $uicols['datatype'][$type_id] = 'I'; // correct 
the last one
-
                                $list_info = $location_types[($type_id - 
1)]['list_info'];
 
                                for ($i = 1; $i < ($type_id + 1); $i++)

Modified: branches/dev-syncromind-2/property/inc/class.soproject.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.soproject.inc.php      
2016-06-02 13:29:20 UTC (rev 15252)
+++ branches/dev-syncromind-2/property/inc/class.soproject.inc.php      
2016-06-02 13:34:46 UTC (rev 15253)
@@ -991,8 +991,34 @@
 
                function project_workorder_data( $data = array() )
                {
+                       $start = isset($data['start']) && $data['start'] ? 
$data['start'] : 0;
                        $project_id = (int)$data['project_id'];
                        $year = (int)$data['year'];
+                       $sort = isset($data['sort']) ? $data['sort'] : 'DESC';
+                       $order = isset($data['order']) ? $data['order'] : 
'fm_workorder';
+                       $results = (isset($data['results']) ? $data['results'] 
: 0);
+
+                       $ordermethod = 'ORDER BY fm_workorder.id DESC';
+
+                       if ($order)
+                       {
+                               switch ($order)
+                               {
+                                       case 'workorder_id':
+                                               $ordermethod = "ORDER BY 
fm_workorder.id {$sort}";
+                                               break;
+                                       case 'title':
+                                               $ordermethod = "ORDER BY 
fm_workorder.title {$sort}";
+                                               break;
+                                       case 'b_account_id':
+                                               $ordermethod = "ORDER BY 
fm_workorder.account_id {$sort}";
+                                               break;
+                                       case 'status':
+                                               $ordermethod = "ORDER BY 
fm_workorder_status.descr {$sort}";
+                                               break;
+                               }
+                       }
+
                        $values = array();
 
                        $filter_year = '';
@@ -1001,20 +1027,29 @@
                                $filter_year = "AND (fm_workorder_budget.year = 
{$year} OR fm_workorder_status.closed IS NULL)";
                        }
 
-                       $this->db->query("SELECT DISTINCT fm_workorder.id AS 
workorder_id, fm_workorder.title, fm_workorder.vendor_id, 
fm_workorder.addition,"
+                       $sql =  "SELECT DISTINCT fm_workorder.id AS 
workorder_id, fm_workorder.title, fm_workorder.vendor_id, 
fm_workorder.addition,"
                                . " fm_workorder_status.descr as status, 
fm_workorder_status.closed, fm_workorder.account_id AS b_account_id, 
fm_workorder.charge_tenant,"
                                . " fm_workorder.mail_recipients"
                                . " FROM fm_workorder"
                                . " {$this->join} fm_workorder_status ON 
fm_workorder.status = fm_workorder_status.id"
                                . " {$this->join} fm_workorder_budget ON 
fm_workorder.id = fm_workorder_budget.order_id"
+                               . " WHERE project_id={$project_id} 
{$filter_year} {$ordermethod}";
+
+                       $this->db->query("SELECT count(fm_workorder.id) AS cnt 
FROM fm_workorder"
+                               . " {$this->join} fm_workorder_status ON 
fm_workorder.status = fm_workorder_status.id"
+                               . " {$this->join} fm_workorder_budget ON 
fm_workorder.id = fm_workorder_budget.order_id"
                                . " WHERE project_id={$project_id} 
{$filter_year}", __LINE__, __FILE__);
+                               
+                       $this->db->next_record();
+                       $this->total_records = (int)$this->db->f('cnt');
 
+                       $this->db->limit_query($sql, $start, __LINE__, 
__FILE__, $results);
+
                        $_orders = array();
 
                        while ($this->db->next_record())
                        {
-                               $values[] = array
-                                       (
+                               $values[] = array(
                                        'workorder_id' => 
$this->db->f('workorder_id'),
                                        'title' => $this->db->f('title', true),
                                        'vendor_id' => 
$this->db->f('vendor_id'),

Modified: branches/dev-syncromind-2/property/inc/class.uiadmin_entity.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.uiadmin_entity.inc.php 
2016-06-02 13:29:20 UTC (rev 15252)
+++ branches/dev-syncromind-2/property/inc/class.uiadmin_entity.inc.php 
2016-06-02 13:34:46 UTC (rev 15253)
@@ -987,7 +987,7 @@
                                'form_action' => 
$GLOBALS['phpgw']->link('/index.php', $link_data),
                                'done_action' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiadmin_entity.category',
                                        'entity_id' => $entity_id, 'type' => 
$this->type)),
-                               'base_java_url' => 
json_encode(array('menuaction' => "property.uiadmin_entity.edit_category")),
+                               'base_java_url' => 
json_encode(array('menuaction' => 
"property.uiadmin_entity.get_template_attributes")),
                                'lang_save' => lang('save'),
                                'lang_done' => lang('done'),
                                'value_id' => $id,

Modified: branches/dev-syncromind-2/property/inc/class.uiproject.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.uiproject.inc.php      
2016-06-02 13:29:20 UTC (rev 15252)
+++ branches/dev-syncromind-2/property/inc/class.uiproject.inc.php      
2016-06-02 13:34:46 UTC (rev 15253)
@@ -1648,8 +1648,8 @@
 
                                $budget_def = array
                                        (
-                                       array('key' => 'year', 'label' => 
lang('year'), 'sortable' => false, 'value_footer' => lang('Sum')),
-                                       array('key' => 'entry_date', 'label' => 
lang('entry date'), 'sortable' => true),
+                                       array('key' => 'year', 'label' => 
lang('year'), 'sortable' => true, 'value_footer' => lang('Sum')),
+                                       array('key' => 'entry_date', 'label' => 
lang('entry date'), 'sortable' => false),
                                        array('key' => 'amount_in', 'label' => 
lang('amount in'), 'sortable' => false,
                                                'className' => 'right', 
'formatter' => 'JqueryPortico.FormatterAmount0', 'value_footer' => 
number_format($s_amount_in, 0, $this->decimal_separator, '.')),
                                        array('key' => 'from_project', 'label' 
=> lang('from project'), 'sortable' => true,
@@ -1665,7 +1665,7 @@
                        {
                                $budget_def = array
                                        (
-                                       array('key' => 'year', 'label' => 
lang('year'), 'sortable' => false, 'value_footer' => lang('Sum')),
+                                       array('key' => 'year', 'label' => 
lang('year'), 'sortable' => true, 'value_footer' => lang('Sum')),
                                        array('key' => 'month', 'label' => 
lang('month'), 'sortable' => false),
                                        array('key' => 'budget', 'label' => 
lang('budget'), 'sortable' => false, 'className' => 'right',
                                                'formatter' => 
'JqueryPortico.FormatterAmount0', 'value_footer' => number_format($s_budget, 0, 
$this->decimal_separator, '.')),
@@ -1714,18 +1714,18 @@
                                array('key' => 'title', 'label' => 
lang('title'), 'sortable' => true),
                                array('key' => 'b_account_id', 'label' => 
lang('Budget account'), 'sortable' => true,
                                        'className' => 'right'),
-                               array('key' => 'budget', 'label' => 
lang('budget'), 'sortable' => true, 'className' => 'right',
+                               array('key' => 'budget', 'label' => 
lang('budget'), 'sortable' => false, 'className' => 'right',
                                        'formatter' => 
'JqueryPortico.FormatterAmount0'),
-                               array('key' => 'cost', 'label' => lang('cost'), 
'sortable' => true, 'className' => 'right',
+                               array('key' => 'cost', 'label' => lang('cost'), 
'sortable' => false, 'className' => 'right',
                                        'formatter' => 
'JqueryPortico.FormatterAmount0'),
                                array('key' => 'addition_percentage', 'label' 
=> '%', 'sortable' => false, 'className' => 'right'),
-                               array('key' => 'obligation', 'label' => 
lang('sum orders'), 'sortable' => true,
+                               array('key' => 'obligation', 'label' => 
lang('sum orders'), 'sortable' => false,
                                        'className' => 'right', 'formatter' => 
'JqueryPortico.FormatterAmount0'),
-                               array('key' => 'actual_cost', 'label' => 
lang('actual cost'), 'sortable' => true,
+                               array('key' => 'actual_cost', 'label' => 
lang('actual cost'), 'sortable' => false,
                                        'className' => 'right', 'formatter' => 
'JqueryPortico.FormatterAmount0'),
-                               array('key' => 'diff', 'label' => 
lang('difference'), 'sortable' => true, 'className' => 'right',
+                               array('key' => 'diff', 'label' => 
lang('difference'), 'sortable' => false, 'className' => 'right',
                                        'formatter' => 
'JqueryPortico.FormatterAmount0'),
-                               array('key' => 'vendor_name', 'label' => 
lang('Vendor'), 'sortable' => true),
+                               array('key' => 'vendor_name', 'label' => 
lang('Vendor'), 'sortable' => false),
                                array('key' => 'status', 'label' => 
lang('Status'), 'sortable' => true),
                                array('key' => 'send_order', 'label' => 
lang('send workorder'), 'sortable' => false,
                                        'className' => 'center')
@@ -1740,7 +1740,7 @@
                                'ColumnDefs' => $orders_def,
                                'config' => array(
                                        array('disableFilter' => true),
-                                       array('disablePagination' => true)
+                       //              array('disablePagination' => true)
                                )
                        );
 
@@ -2176,8 +2176,18 @@
 
                        $year = phpgw::get_var('year', 'int');
                        $draw = phpgw::get_var('draw', 'int');
+                       $order = phpgw::get_var('order');
+                       $columns = phpgw::get_var('columns');
 
-                       $values = $this->bo->get_orders(array('project_id' => 
$project_id, 'year' => $year));
+                       $values = $this->bo->get_orders(array(
+                               'start' => phpgw::get_var('start', 'int', 
'REQUEST', 0),
+                               'project_id' => $project_id,
+                               'year' => $year,
+                               'order' => 
$columns[$order[0]['column']]['data'],
+                               'sort' => $order[0]['dir'],
+                               'results' => phpgw::get_var('length', 'int', 
'REQUEST', 0),
+                               )
+                       );
                        foreach ($values as & $_order_entry)
                        {
                                $_order_entry['send_order'] = '';
@@ -2188,7 +2198,7 @@
                                }
                        }
 
-                       $total_records = count($values);
+                       $total_records = $this->bo->so->total_records;
 
                        $result_data = array('results' => $values);
 
@@ -2196,20 +2206,6 @@
                        $result_data['draw'] = $draw;
 
                        return $this->jquery_results($result_data);
-
-                       /* if( phpgw::get_var('phpgw_return_as') == 'json' )
-                         {
-
-                         if(count($content))
-                         {
-                         return json_encode($content);
-                         }
-                         else
-                         {
-                         return "";
-                         }
-                         }
-                         return $content; */
                }
 
                public function get_vouchers()
@@ -2226,11 +2222,24 @@
 
                        $year = phpgw::get_var('year', 'int');
                        $draw = phpgw::get_var('draw', 'int');
+                       $order = phpgw::get_var('order');
+                       $columns = phpgw::get_var('columns');
 
                        $active_invoices = 
execMethod('property.soinvoice.read_invoice_sub_sum', array(
-                               'project_id' => $project_id, 'year' => $year));
+                               'project_id' => $project_id,
+                               'year' => $year,
+                               'order' => 
$columns[$order[0]['column']]['data'],
+                               'sort' => $order[0]['dir'],
+                               )
+                       );
                        $historical_invoices = 
execMethod('property.soinvoice.read_invoice_sub_sum', array(
-                               'project_id' => $project_id, 'year' => $year, 
'paid' => true));
+                               'project_id' => $project_id,
+                               'year' => $year,
+                               'paid' => true,
+                               'order' => 
$columns[$order[0]['column']]['data'],
+                               'sort' => $order[0]['dir'],
+                               )
+                       );
                        $invoices = array_merge($active_invoices, 
$historical_invoices);
 
                        foreach ($invoices as $entry)

Modified: branches/dev-syncromind-2/property/inc/class.uiworkorder.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.uiworkorder.inc.php    
2016-06-02 13:29:20 UTC (rev 15252)
+++ branches/dev-syncromind-2/property/inc/class.uiworkorder.inc.php    
2016-06-02 13:34:46 UTC (rev 15253)
@@ -1772,7 +1772,7 @@
                                array(
                                        'key' => 'voucher_id',
                                        'label' => lang('bilagsnr'),
-                                       'sortable' => false,
+                                       'sortable' => true,
                                        'value_footer' => lang('Sum')),
                                array(
                                        'key' => 'voucher_out_id',
@@ -1788,19 +1788,19 @@
                                array(
                                        'key' => 'amount',
                                        'label' => lang('amount'),
-                                       'sortable' => false,
+                                       'sortable' => true,
                                        'className' => 'right',
                                        'value_footer' => 
number_format($amount, 2, $this->decimal_separator, '.')),
                                array(
                                        'key' => 'approved_amount',
                                        'label' => lang('approved amount'),
-                                       'sortable' => false,
+                                       'sortable' => true,
                                        'className' => 'right',
                                        'value_footer' => 
number_format($approved_amount, 2, $this->decimal_separator, '.')),
                                array(
                                        'key' => 'period',
                                        'label' => lang('period'),
-                                       'sortable' => false),
+                                       'sortable' => true),
                                array(
                                        'key' => 'periodization',
                                        'label' => lang('periodization'),
@@ -1838,10 +1838,8 @@
                                'data' => json_encode($content_invoice),
                                'ColumnDefs' => $invoice_def,
                                'config' => array(
-                                       array(
-                                               'disableFilter' => true),
-                                       array(
-                                               'disablePagination' => true)
+                                       array('disableFilter' => true),
+//                                     array('disablePagination' => true)
                                )
                        );
 

Modified: branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php    
2016-06-02 13:29:20 UTC (rev 15252)
+++ branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php    
2016-06-02 13:34:46 UTC (rev 15253)
@@ -263,7 +263,10 @@
                        );
 
                        $tabs = array();
-                       $tabs['showing'] = array('label' => 
lang('application'), 'link' => '#showing');
+                       $tabs['application'] = array('label' => 
lang('application'), 'link' => '#application');
+                       $tabs['party'] = array('label' => lang('party'), 'link' 
=> '#party');
+                       $tabs['assignment'] = array('label' => 
lang('assignment'), 'link' => '#assignment');
+
                        $active_tab = 'showing';
 
 //                     $current_price_type_id = 
$application->get_price_type_id();
@@ -275,11 +278,35 @@
 //                                     'selected' => $selected);
 //                     }
 
+
+                       $composite_type = array();
+                       $composite_type[] = array('id' => 1, 'name' => 'Hybel');
+                       $composite_type[] = array('id' => 2, 'name' => 
'Leilighet');
+
+                       $payment_method = array();
+                       $payment_method[] = array('id' => 1, 'name' => 
'Faktura');
+                       $payment_method[] = array('id' => 2, 'name' => 'Trekk i 
lønn');
+                       $payment_method[] = array('id' => 3, 'name' => 'intern 
faktura');
+
+                       $bocommon = CreateObject('property.bocommon');
+
+                       $GLOBALS['phpgw']->jqcal->add_listener('date_start');
+                       $GLOBALS['phpgw']->jqcal->add_listener('date_end');
+
                        $data = array(
                                'form_action' => 
$GLOBALS['phpgw']->link('/index.php', $link_save),
                                'cancel_url' => 
$GLOBALS['phpgw']->link('/index.php', $link_index),
                                'lang_save' => lang('save'),
                                'lang_cancel' => lang('cancel'),
+                               'value_ecodimb' => $application->get_ecodimb(),
+                               'value_ecodimb_descr'   => 
ExecMethod('property.bogeneric.get_single_attrib_value', array('type' => 
'dimb', 'id' => $application->get_ecodimb(), 'attrib_name' => 'descr' )),
+                               'district_list'                 => 
array('options' => $bocommon->select_district_list('', 
$application->get_district_id())),
+                               'composite_type_list'           => 
array('options' => $bocommon->select_list( $application->get_composite_type(), 
$composite_type)),
+                               'value_date_start'      => 
$GLOBALS['phpgw']->common->show_date($application->get_start_date(),$this->dateFormat),
+                               'value_date_end'        => 
$GLOBALS['phpgw']->common->show_date($application->get_end_date(),$this->dateFormat),
+                               'value_cleaning'        => 
$application->get_cleaning(),
+                               'payment_method_list'           => 
array('options' => $bocommon->select_list( $application->get_payment_method(), 
$payment_method)),
+
 //                             'lang_current_price_type' => 
lang($application->get_price_type_title()),
 //                             'lang_adjustable_text' => 
$application->get_adjustable_text(),
 //                             'lang_standard_text' => 
$application->get_standard_text(),
@@ -298,10 +325,10 @@
 //                             'responsibility_id' => $responsibility_id,
                                'mode' => $mode,
                                'tabs' => 
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
-                               'validator' => 
phpgwapi_jquery::formvalidator_generate(array('location',
-                                       'date',
-                                       'security', 'file'))
                        );
+                       
phpgwapi_jquery::formvalidator_generate(array('date','security', 'file'));
+                       phpgwapi_jquery::load_widget('autocomplete');
+                       self::add_javascript('rental', 'rental', 
'application.edit.js');
 
                        self::render_template_xsl(array('application'), 
array($mode => $data));
                }

Modified: branches/dev-syncromind-2/rental/inc/model/class.application.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/model/class.application.inc.php        
2016-06-02 13:29:20 UTC (rev 15252)
+++ branches/dev-syncromind-2/rental/inc/model/class.application.inc.php        
2016-06-02 13:34:46 UTC (rev 15253)
@@ -31,6 +31,13 @@
        class rental_application extends rental_model
        {
 
+               protected $ecodimb;
+               protected $district_id;
+               protected $composite_type;
+               protected $start_date;
+               protected $end_date;
+               protected $cleaning;
+               protected $payment_method;
                protected $title;
                protected $description;
                protected $name;
@@ -43,7 +50,72 @@
                {
                        parent::__construct((int)$id);
                }
+               public function set_ecodimb( $ecodimb )
+               {
+                       $this->ecodimb = $ecodimb;
+               }
 
+               public function get_ecodimb()
+               {
+                       return $this->ecodimb;
+               }
+
+               public function set_district_id( $district_id )
+               {
+                       $this->district_id = $district_id;
+               }
+
+               public function get_district_id()
+               {
+                       return $this->district_id;
+               }
+               public function set_composite_type( $composite_type )
+               {
+                       $this->composite_type = $composite_type;
+               }
+
+               public function get_composite_type()
+               {
+                       return $this->composite_type;
+               }
+               public function set_start_date( $start_date )
+               {
+                       $this->start_date = $start_date;
+               }
+
+               public function get_start_date()
+               {
+                       return $this->start_date;
+               }
+               public function set_end_date( $end_date )
+               {
+                       $this->end_date = $end_date;
+               }
+               public function get_end_date()
+               {
+                       return $this->end_date;
+               }
+
+               public function set_cleaning( $cleaning )
+               {
+                       $this->cleaning = $cleaning;
+               }
+
+               public function get_cleaning()
+               {
+                       return (bool)$this->cleaning;
+               }
+
+               public function set_payment_method( $payment_method )
+               {
+                       $this->payment_method = $payment_method;
+               }
+
+               public function get_payment_method()
+               {
+                       return $this->payment_method;
+               }
+
                public function set_title( $title )
                {
                        $this->title = $title;

Copied: branches/dev-syncromind-2/rental/js/rental/application.edit.js (from 
rev 15252, trunk/rental/js/rental/application.edit.js)
===================================================================
--- branches/dev-syncromind-2/rental/js/rental/application.edit.js              
                (rev 0)
+++ branches/dev-syncromind-2/rental/js/rental/application.edit.js      
2016-06-02 13:34:46 UTC (rev 15253)
@@ -0,0 +1,26 @@
+
+var oArgs = {menuaction: 'property.uigeneric.index', type: 'dimb', type_id:0};
+var strURL = phpGWLink('index.php', oArgs, true);
+JqueryPortico.autocompleteHelper(strURL, 'ecodimb_name', 'ecodimb', 
'ecodimb_container', 'descr');
+
+$(document).ready(function ()
+{
+       $.formUtils.addValidator({
+               name: 'naming',
+               validatorFunction: function (value, $el, config, languaje, 
$form)
+               {
+                       var v = false;
+                       var firstname = $('#firstname').val();
+                       var lastname = $('#lastname').val();
+                       var company_name = $('#company_name').val();
+                       var department = $('#department').val();
+                       if ((firstname != "" && lastname != "") || 
(company_name != "" && department != ""))
+                       {
+                               v = true;
+                       }
+                       return v;
+               },
+               errorMessage: lang['Name or company is required'],
+               errorMessageKey: ''
+       });
+});

Modified: branches/dev-syncromind-2/rental/setup/phpgw_no.lang
===================================================================
--- branches/dev-syncromind-2/rental/setup/phpgw_no.lang        2016-06-02 
13:29:20 UTC (rev 15252)
+++ branches/dev-syncromind-2/rental/setup/phpgw_no.lang        2016-06-02 
13:34:46 UTC (rev 15253)
@@ -621,4 +621,8 @@
 credits        rental  no      Kreditering
 override adjustment start      rental  no      Overstyr sist regulert
 application    rental  no      søknad
-dimb   rental  no      Ansvarssted
\ No newline at end of file
+dimb   rental  no      Ansvarssted
+payment method rental  no      Betalingsmetode
+what   rental  no      Hva
+cleaning       rental  no      Rengjøring
+assignment     rental  no      Tildeling
\ No newline at end of file

Modified: branches/dev-syncromind-2/rental/templates/base/application.xsl
===================================================================
--- branches/dev-syncromind-2/rental/templates/base/application.xsl     
2016-06-02 13:29:20 UTC (rev 15252)
+++ branches/dev-syncromind-2/rental/templates/base/application.xsl     
2016-06-02 13:34:46 UTC (rev 15253)
@@ -23,120 +23,309 @@
                        <xsl:value-of select="form_action"/>
                </xsl:variable>
 
-               <xsl:value-of select="validator"/>
-
+               <script type="text/javascript">
+                       var lang = <xsl:value-of 
select="php:function('js_lang', 'Name or company is required')"/>;
+               </script>
                <form id="form" name="form" method="post" 
action="{$form_action}" class="pure-form pure-form-aligned">
                        <div id="tab-content">
                                <xsl:value-of disable-output-escaping="yes" 
select="tabs"/>
-                               <div id="showing">
-                                       <!--fieldset>
-                                               <input type="hidden" name="id" 
value="{price_item_id}"/>
+                               <div id="application">
+                                       <fieldset>
                                                <div class="pure-control-group">
+                                                       <xsl:variable 
name="lang_dimb">
+                                                               <xsl:value-of 
select="php:function('lang', 'dimb')"/>
+                                                       </xsl:variable>
                                                        <label>
-                                                               <xsl:value-of 
select="php:function('lang', 'title')"/>
+                                                               <xsl:value-of 
select="$lang_dimb"/>
                                                        </label>
-                                                       <input type="text" 
name="title" id="title" value="{value_title}">
+                                                       <input type="hidden" 
id="ecodimb" name="values[ecodimb]"  value="{value_ecodimb}"/>
+                                                       <input type="text" 
id="ecodimb_name" name="values[ecodimb_name]" value="{value_ecodimb_descr}">
                                                                <xsl:attribute 
name="data-validation">
                                                                        
<xsl:text>required</xsl:text>
                                                                </xsl:attribute>
-                                                       </input>                
                                        
+                                                               <xsl:attribute 
name="data-validation-error-msg">
+                                                                       
<xsl:value-of select="$lang_dimb"/>
+                                                               </xsl:attribute>
+                                                               <xsl:attribute 
name="placeholder">
+                                                                       
<xsl:value-of select="$lang_dimb"/>
+                                                               </xsl:attribute>
+                                                       </input>
+                                                       <div 
id="ecodimb_container"/>
                                                </div>
                                                <div class="pure-control-group">
+                                                       <xsl:variable 
name="lang_district">
+                                                               <xsl:value-of 
select="php:function('lang', 'district')"/>
+                                                       </xsl:variable>
                                                        <label>
-                                                               <xsl:value-of 
select="php:function('lang', 'field_of_responsibility')"/>
+                                                               <xsl:value-of 
select="$lang_district"/>
                                                        </label>
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="price_item_id = 0 or price_item_id = ''">
-                                                                       <input 
type="hidden" name="responsibility_id" id="responsibility_id" 
value="{responsibility_id}"/>
-                                                               </xsl:when>
-                                                       </xsl:choose>           
                                        
-                                                       <xsl:value-of 
select="value_field_of_responsibility"/>
+
+                                                       <select 
name="values[district_id]">
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="$lang_district"/>
+                                                               </xsl:attribute>
+                                                               <xsl:attribute 
name="data-validation">
+                                                                       
<xsl:text>required</xsl:text>
+                                                               </xsl:attribute>
+                                                               <xsl:attribute 
name="data-validation-error-msg">
+                                                                       
<xsl:value-of select="$lang_district"/>
+                                                               </xsl:attribute>
+                                                               <option 
value="">
+                                                                       
<xsl:value-of select="$lang_district"/>
+                                                               </option>
+                                                               
<xsl:apply-templates select="district_list/options"/>
+                                                       </select>
                                                </div>
                                                <div class="pure-control-group">
+                                                       <xsl:variable 
name="lang_composite_type">
+                                                               <xsl:value-of 
select="php:function('lang', 'what')"/>
+                                                       </xsl:variable>
                                                        <label>
-                                                               <xsl:value-of 
select="php:function('lang', 'agresso_id')"/>
+                                                               <xsl:value-of 
select="$lang_composite_type"/>
                                                        </label>
-                                                       <input type="text" 
name="agresso_id" id="agresso_id" value="{value_agresso_id}">
+
+                                                       <select 
name="values[composite_type_id]">
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="$lang_composite_type"/>
+                                                               </xsl:attribute>
                                                                <xsl:attribute 
name="data-validation">
                                                                        
<xsl:text>required</xsl:text>
                                                                </xsl:attribute>
+                                                               <xsl:attribute 
name="data-validation-error-msg">
+                                                                       
<xsl:value-of select="$lang_composite_type"/>
+                                                               </xsl:attribute>
+                                                               <option 
value="">
+                                                                       
<xsl:value-of select="$lang_composite_type"/>
+                                                               </option>
+                                                               
<xsl:apply-templates select="composite_type_list/options"/>
+                                                       </select>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <xsl:variable 
name="lang_date_start">
+                                                               <xsl:value-of 
select="php:function('lang', 'date_start')"/>
+                                                       </xsl:variable>
+                                                       <label>
+                                                               <xsl:value-of 
select="$lang_date_start"/>
+                                                       </label>
+                                                       <input type="text" 
id="date_start" name="date_start" size="10" value="{value_date_start}" 
readonly="readonly">
+                                                               <xsl:attribute 
name="data-validation">
+                                                                       
<xsl:text>required</xsl:text>
+                                                               </xsl:attribute>
+                                                               <xsl:attribute 
name="data-validation-error-msg">
+                                                                       
<xsl:value-of select="$lang_date_start"/>
+                                                               </xsl:attribute>
+
                                                        </input>
                                                </div>
                                                <div class="pure-control-group">
+                                                       <xsl:variable 
name="lang_date_end">
+                                                               <xsl:value-of 
select="php:function('lang', 'date_end')"/>
+                                                       </xsl:variable>
                                                        <label>
-                                                               <xsl:value-of 
select="php:function('lang', 'is_area')"/>
+                                                               <xsl:value-of 
select="$lang_date_end"/>
                                                        </label>
-                                                       <div 
class="pure-custom">
-                                                               <div>
-                                                                       <input 
type="radio" name="is_area" value="true">
-                                                                               
<xsl:if test="is_area = 1">
-                                                                               
        <xsl:attribute name="checked" value="checked"/>
-                                                                               
</xsl:if>
-                                                                       
</input> 
-                                                                       
<xsl:value-of select="php:function('lang', 'calculate_price_per_area')"/>
-                                                               </div>
-                                                               <div>
-                                                                       <input 
type="radio" name="is_area" value="false">
-                                                                               
<xsl:if test="is_area = 0">
-                                                                               
        <xsl:attribute name="checked" value="checked"/>
-                                                                               
</xsl:if>
-                                                                       </input>
-                                                                       
<xsl:value-of select="php:function('lang', 'calculate_price_apiece')"/>
-                                                               </div>
-                                                       </div>
+                                                       <input type="text" 
id="date_end" name="date_end" size="10" value="{value_date_end}" 
readonly="readonly">
+                                                               <xsl:attribute 
name="data-validation">
+                                                                       
<xsl:text>required</xsl:text>
+                                                               </xsl:attribute>
+                                                               <xsl:attribute 
name="data-validation-error-msg">
+                                                                       
<xsl:value-of select="$lang_date_end"/>
+                                                               </xsl:attribute>
+
+                                                       </input>
                                                </div>
                                                <div class="pure-control-group">
                                                        <label>
-                                                               <xsl:value-of 
select="php:function('lang', 'type')"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'cleaning')"/>
                                                        </label>
-                                                       <select 
id="price_type_id" name="price_type_id">
-                                                               
<xsl:apply-templates select="list_type/options"/>
+                                                       <input type="checkbox" 
name="values[cleaning]" id="cleaning">
+                                                               <xsl:if 
test="value_cleaning = 1">
+                                                                       
<xsl:attribute name="checked" value="checked"/>
+                                                               </xsl:if>
+                                                       </input>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <xsl:variable 
name="lang_payment_method">
+                                                               <xsl:value-of 
select="php:function('lang', 'payment method')"/>
+                                                       </xsl:variable>
+                                                       <label>
+                                                               <xsl:value-of 
select="$lang_payment_method"/>
+                                                       </label>
+                                                       <select 
name="values[payment_method]">
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="$lang_payment_method"/>
+                                                               </xsl:attribute>
+                                                               <xsl:attribute 
name="data-validation">
+                                                                       
<xsl:text>required</xsl:text>
+                                                               </xsl:attribute>
+                                                               <xsl:attribute 
name="data-validation-error-msg">
+                                                                       
<xsl:value-of select="$lang_payment_method"/>
+                                                               </xsl:attribute>
+                                                               <option 
value="">
+                                                                       
<xsl:value-of select="$lang_payment_method"/>
+                                                               </option>
+                                                               
<xsl:apply-templates select="payment_method_list/options"/>
                                                        </select>
                                                </div>
+                                       </fieldset>
+                               </div>
+                               <div id="party">
+                                       <fieldset>
                                                <div class="pure-control-group">
                                                        <label>
-                                                               <xsl:value-of 
select="php:function('lang', 'price')"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'identifier')"/>
                                                        </label>
-                                                       <input type="text" 
name="price" id="price" value="{value_price}"/>
+                                                       <input type="text" 
name="identifier" value="{value_identifier}">
+                                                               <xsl:attribute 
name="data-validation">
+                                                                       
<xsl:text>required</xsl:text>
+                                                               </xsl:attribute>
+                                                       </input>
+                                                       <input type="hidden" 
name="id" value="{party_id}"/>
                                                </div>
                                                <div class="pure-control-group">
                                                        <label>
-                                                               <xsl:value-of 
select="php:function('lang', 'is_inactive')"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'firstname')"/>
                                                        </label>
-                                                       <input type="checkbox" 
name="is_inactive" id="is_inactive">
-                                                               <xsl:if 
test="is_inactive = 1">
-                                                                       
<xsl:attribute name="checked" value="checked"/>
-                                                               </xsl:if>
-                                                               <xsl:if 
test="has_active_contract = 1">
-                                                                       
<xsl:attribute name="disabled" value="disabled"/>
-                                                               </xsl:if>
+                                                       <input type="text" 
id="firstname" name="firstname" value="{value_firstname}">
+                                                               <xsl:attribute 
name="data-validation">
+                                                                       
<xsl:text>naming</xsl:text>
+                                                               </xsl:attribute>
                                                        </input>
-                                                       <xsl:if 
test="has_active_contract = 1">
-                                                               <xsl:value-of 
select="lang_price_element_in_use"/>
-                                                       </xsl:if>               
                                                        
                                                </div>
                                                <div class="pure-control-group">
                                                        <label>
-                                                               <xsl:value-of 
select="php:function('lang', 'is_adjustable')"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'lastname')"/>
                                                        </label>
-                                                       <input type="checkbox" 
name="is_adjustable" id="is_adjustable">
-                                                               <xsl:if 
test="is_adjustable = 1">
-                                                                       
<xsl:attribute name="checked" value="checked"/>
-                                                               </xsl:if>
-                                                       </input>                
        
+                                                       <input type="text" 
id="lastname" name="lastname" value="{value_lastname}">
+                                                               <xsl:attribute 
name="data-validation">
+                                                                       
<xsl:text>naming</xsl:text>
+                                                               </xsl:attribute>
+
+                                                       </input>
                                                </div>
                                                <div class="pure-control-group">
                                                        <label>
-                                                               <xsl:value-of 
select="php:function('lang', 'is_standard')"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'job_title')"/>
                                                        </label>
-                                                       <input type="checkbox" 
name="is_standard" id="is_standard">
-                                                               <xsl:if 
test="is_standard = 1">
-                                                                       
<xsl:attribute name="checked" value="checked"/>
-                                                               </xsl:if>
-                                                       </input>                
        
+                                                       <input type="text" 
name="title" value="{value_job_title}"></input>
                                                </div>
-                                       </fieldset-->
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'company')"/>
+                                                       </label>
+                                                       <input type="text" 
id="company_name" name="company_name" value="{value_company}">
+                                                               <xsl:attribute 
name="data-validation">
+                                                                       
<xsl:text>naming</xsl:text>
+                                                               </xsl:attribute>
+
+                                                       </input>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'department')"/>
+                                                       </label>
+                                                       <input type="text" 
id="department" name="department" value="{value_department}">
+                                                               <xsl:attribute 
name="data-validation">
+                                                                       
<xsl:text>naming</xsl:text>
+                                                               </xsl:attribute>
+
+                                                       </input>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'address')"/>
+                                                       </label>
+                                                       <input type="text" 
name="address1" value="{value_address1}"></input>
+                                                       <input type="text" 
name="address2" value="{value_address2}"></input>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'postal_code_place')"/>
+                                                       </label>
+                                                       <input type="text" 
name="postal_code" value="{value_postal_code}"></input>
+                                                       <input type="text" 
name="place" value="{value_place}"></input>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'account_number')"/>
+                                                       </label>
+                                                       <input type="text" 
name="account_number" value="{value_account_number}"></input>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'phone')"/>
+                                                       </label>
+                                                       <input type="text" 
name="phone" value="{value_phone}"></input>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'mobile_phone')"/>
+                                                       </label>
+                                                       <input type="text" 
name="mobile_phone" value="{value_mobile_phone}"></input>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'fax')"/>
+                                                       </label>
+                                                       <input type="text" 
name="fax" value="{value_fax}"></input>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'email')"/>
+                                                       </label>
+                                                       <input type="text" 
name="email" id="email" value="{value_email}">
+                                                               <xsl:attribute 
name="data-validation">
+                                                                       
<xsl:text>required</xsl:text>
+                                                               </xsl:attribute>
+                                                       </input>
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="valid_email = 1">
+                                                                       
<xsl:text> </xsl:text>
+                                                                       <a 
href="{link_create_user}">
+                                                                               
<xsl:value-of select="php:function('lang', 'create_user_based_on_email_link')"/>
+                                                                       </a>
+                                                               </xsl:when>
+                                                       </xsl:choose>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'url')"/>
+                                                       </label>
+                                                       <input type="text" 
name="url" value="{value_url}"></input>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'unit_leader')"/>
+                                                       </label>
+                                                       <input type="text" 
id="unit_leader" name="unit_leader" value="{value_unit_leader}"></input>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'comment')"/>
+                                                       </label>
+                                                       <textarea cols="47" 
rows="7" name="comment">
+                                                               <xsl:value-of 
select="value_comment"/>
+                                                       </textarea>
+                                               </div>
+                                               <xsl:choose>
+                                                       <xsl:when 
test="use_fellesdata = 1">
+                                                               <div 
class="pure-control-group">
+                                                                       <label>
+                                                                               
<xsl:value-of select="php:function('lang', 'organization')"/>
+                                                                       </label>
+                                                                       <select 
id="org_enhet_id" name="org_enhet_id">
+                                                                               
<xsl:apply-templates select="list_organization/options"/>
+                                                                       
</select>
+                                                               </div>
+                                                       </xsl:when>
+                                               </xsl:choose>
+                                       </fieldset>
                                </div>
+                               <div id="assignment">
+                                       <fieldset>
+                                       </fieldset>
+                               </div>
+
                        </div>
                        <div class="proplist-col">
                                <input type="submit" class="pure-button 
pure-button-primary" name="save" value="{lang_save}" 
onMouseout="window.status='';return true;"/>
@@ -258,48 +447,11 @@
 </xsl:template>
 
 
-<xsl:template name="top-toolbar">
-       <div class="toolbar-container">
-               <div class="pure-g">
-                       <div class="pure-u-1">
-                               <div> 
-                                       <xsl:value-of 
select="php:function('lang', 'manual_adjust_price_item_select')"/>
-                                       <select id="price_item_id" 
name="price_item_id">
-                                               <xsl:apply-templates 
select="list_type/options"/>
-                                       </select>
-                                       <xsl:value-of 
select="php:function('lang', 'price')"/>
-                                       <input type="text" 
id="ctrl_adjust_price_item_price" name="ctrl_adjust_price_item_price"/>
-                                       <xsl:variable name="lang_adjust_price">
-                                               <xsl:value-of 
select="php:function('lang', 'adjust_price')"/>
-                                       </xsl:variable>                 
-                                       <input type="button" class="pure-button 
pure-button-primary" name="adjust_price" value="{$lang_adjust_price}"  
onClick="onAdjust_price()"/>
-                               </div>
-                       </div>
-               </div>
-       </div>
+<xsl:template match="options">
+       <option value="{id}">
+               <xsl:if test="selected != 0">
+                       <xsl:attribute name="selected" value="selected"/>
+               </xsl:if>
+               <xsl:value-of disable-output-escaping="yes" select="name"/>
+       </option>
 </xsl:template>
-
-<xsl:template xmlns:php="http://php.net/xsl"; match="adjustment_price">
-       <xsl:call-template name="jquery_phpgw_i18n"/>
-       <h3>
-               <xsl:value-of select="php:function('lang', 
'manual_adjust_price_item')"/>
-       </h3>
-       <div>
-               <xsl:call-template name="top-toolbar" />
-               <br/>
-               <div id="showing">
-                       <xsl:for-each select="datatable_def">
-                               <xsl:if test="container = 
'datatable-container_0'">
-                                       <xsl:call-template name="table_setup">
-                                               <xsl:with-param 
name="container" select ='container'/>
-                                               <xsl:with-param 
name="requestUrl" select ='requestUrl' />
-                                               <xsl:with-param 
name="ColumnDefs" select ='ColumnDefs' />
-                                               <xsl:with-param 
name="tabletools" select ='tabletools' />
-                                               <xsl:with-param name="data" 
select ='data' />
-                                               <xsl:with-param name="config" 
select ='config' />
-                                       </xsl:call-template>
-                               </xsl:if>
-                       </xsl:for-each>
-               </div>
-       </div>
-</xsl:template>
\ No newline at end of file




reply via email to

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