fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16052] Stable: Merge 16047:16051 from trunk


From: sigurdne
Subject: [Fmsystem-commits] [16052] Stable: Merge 16047:16051 from trunk
Date: Tue, 6 Dec 2016 14:58:33 +0000 (UTC)

Revision: 16052
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16052
Author:   sigurdne
Date:     2016-12-06 14:58:32 +0000 (Tue, 06 Dec 2016)
Log Message:
-----------
Stable: Merge 16047:16051 from trunk

Modified Paths:
--------------
    branches/Version-2_0-branch/eventplanner/inc/class.bocommon.inc.php
    branches/Version-2_0-branch/eventplanner/inc/class.bovendor_report.inc.php
    branches/Version-2_0-branch/eventplanner/inc/class.sovendor_report.inc.php
    branches/Version-2_0-branch/eventplanner/inc/class.uiapplication.inc.php
    branches/Version-2_0-branch/eventplanner/inc/class.uibooking.inc.php
    branches/Version-2_0-branch/eventplanner/inc/class.uicommon.inc.php
    branches/Version-2_0-branch/eventplanner/inc/class.uivendor_report.inc.php
    branches/Version-2_0-branch/eventplanner/inc/model/class.booking.inc.php
    branches/Version-2_0-branch/eventplanner/inc/model/class.customer.inc.php
    branches/Version-2_0-branch/eventplanner/inc/model/class.vendor.inc.php
    
branches/Version-2_0-branch/eventplanner/inc/model/class.vendor_report.inc.php
    branches/Version-2_0-branch/eventplanner/js/portico/application.edit.js
    branches/Version-2_0-branch/eventplanner/setup/phpgw_no.lang
    branches/Version-2_0-branch/eventplanner/setup/tables_current.inc.php
    branches/Version-2_0-branch/eventplanner/templates/base/application.xsl
    branches/Version-2_0-branch/eventplanner/templates/base/booking.xsl
    branches/Version-2_0-branch/eventplanner/templates/base/vendor_report.xsl
    branches/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php
    branches/Version-2_0-branch/property/inc/class.uitts.inc.php
    
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php
    branches/Version-2_0-branch/property/js/portico/project.edit.js
    branches/Version-2_0-branch/property/js/portico/tts.view.js
    branches/Version-2_0-branch/property/js/portico/workorder.edit.js

Added Paths:
-----------
    branches/Version-2_0-branch/eventplanner/js/portico/booking.edit.js
    branches/Version-2_0-branch/eventplanner/templates/base/application_info.xsl

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


Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14933-15891
/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
   + /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14933-15891
/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

Modified: branches/Version-2_0-branch/eventplanner/inc/class.bocommon.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.bocommon.inc.php 
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/inc/class.bocommon.inc.php 
2016-12-06 14:58:32 UTC (rev 16052)
@@ -86,7 +86,22 @@
                        {
                                if(($field_info['action'] & PHPGW_ACL_ADD) ||  
($field_info['action'] & PHPGW_ACL_EDIT))
                                {
-                                       $object->set_field( $field, 
phpgw::get_var($field, $field_info['type'] ) );
+                                       if($field_info['type'] == 'json')
+                                       {
+                                               $values = array();
+                                               $custom_fields = 
$object->get_custom_fields();
+                                               $values_attribute = 
phpgw::get_var('values_attribute');
+
+                                               foreach ($custom_fields as $key 
=> $custom_field)
+                                               {
+                                                       
$values[$custom_field['name']] = $values_attribute[$key]['value'];
+                                               }
+                                               $object->set_field( $field, 
$values);
+                                       }
+                                       else
+                                       {
+                                               $object->set_field( $field, 
phpgw::get_var($field, $field_info['type'] ) );
+                                       }
                                }
                        }
                        return $object;

Modified: 
branches/Version-2_0-branch/eventplanner/inc/class.bovendor_report.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.bovendor_report.inc.php  
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/inc/class.bovendor_report.inc.php  
2016-12-06 14:58:32 UTC (rev 16052)
@@ -85,16 +85,13 @@
                        }
 
                        $values =  
eventplanner_sovendor_report::get_instance()->read($params);
-                       $status_text = 
eventplanner_vendor_report::get_status_list();
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        foreach ($values['results'] as &$entry)
                        {
-                               $entry['status'] = 
$status_text[$entry['status']];
                                $entry['created'] = 
$GLOBALS['phpgw']->common->show_date($entry['created']);
                                $entry['modified'] = 
$GLOBALS['phpgw']->common->show_date($entry['modified']);
                                $entry['date_start'] = 
$GLOBALS['phpgw']->common->show_date($entry['date_start'], $dateformat);
                                $entry['date_end'] = 
$GLOBALS['phpgw']->common->show_date($entry['date_end'], $dateformat);
-                               $entry['case_officer_id'] = 
$entry['case_officer_id'] ? 
$GLOBALS['phpgw']->accounts->get($entry['case_officer_id'])->__toString() : '';
                        }
                        return $values;
                }

Modified: 
branches/Version-2_0-branch/eventplanner/inc/class.sovendor_report.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.sovendor_report.inc.php  
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/inc/class.sovendor_report.inc.php  
2016-12-06 14:58:32 UTC (rev 16052)
@@ -82,7 +82,6 @@
                protected function update( $object )
                {
                        $this->db->transaction_begin();
-                       $status_text = 
eventplanner_vendor_report::get_status_list();
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
 
                        $original = 
$this->read_single($object->get_id());//returned as array()

Modified: 
branches/Version-2_0-branch/eventplanner/inc/class.uiapplication.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uiapplication.inc.php    
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uiapplication.inc.php    
2016-12-06 14:58:32 UTC (rev 16052)
@@ -283,7 +283,7 @@
                                array('key' => 'from_', 'label' => 
lang('From'), 'sortable' => false, 'resizeable' => true),
                                array('key' => 'to_', 'label' => lang('To'), 
'sortable' => false, 'resizeable' => true),
                                array('key' => 'active', 'label' => 
lang('active'), 'sortable' => false, 'resizeable' => true),
-                               array('key' => 'where', 'label' => 
lang('where'), 'sortable' => false, 'resizeable' => true),
+                               array('key' => 'location', 'label' => 
lang('location'), 'sortable' => false, 'resizeable' => true),
                                array('key' => 'customer_name', 'label' => 
lang('who'), 'sortable' => true, 'resizeable' => true),
                                array('key' => 'comment', 'label' => 
lang('Note'), 'sortable' => false, 'resizeable' => true),
                                array('key' => 'application_id', 'hidden' => 
true),
@@ -329,7 +329,6 @@
                                        'filter_application_id' => $id,
                                        'filter_active' => 1,
                                        'phpgw_return_as' => 'json'))),
-//                             'requestUrl' => "''",
                                'tabletools' => $tabletools,
                                'ColumnDefs' => $dates_def,
                                'data' => json_encode(array()),
@@ -340,7 +339,7 @@
                        );
                        $GLOBALS['phpgw']->jqcal->add_listener('date_start');
                        $GLOBALS['phpgw']->jqcal->add_listener('date_end');
-                       $GLOBALS['phpgw']->jqcal2->add_listener('from_', 
'datetime', '', array(
+                       $GLOBALS['phpgw']->jqcal2->add_listener('from_', 
'datetime', $application->date_start, array(
                                        'min_date' => date('Y/m/d', 
$application->date_start),
                                        'max_date' => date('Y/m/d', 
$application->date_end)
                                )

Modified: branches/Version-2_0-branch/eventplanner/inc/class.uibooking.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uibooking.inc.php        
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uibooking.inc.php        
2016-12-06 14:58:32 UTC (rev 16052)
@@ -176,6 +176,11 @@
                                'link' => '#first_tab',
                                'function' => "set_tab('first_tab')"
                        );
+                       $tabs['reports'] = array(
+                               'label' => lang('reports'),
+                               'link' => '#reports',
+                               'function' => "set_tab('reports')"
+                       );
 
                        $bocommon = CreateObject('property.bocommon');
 
@@ -204,6 +209,71 @@
                                )
                        );
 
+                       $vendor_report_def = array(
+                               array('key' => 'id', 'label' => lang('id'), 
'sortable' => true, 'resizeable' => true,'formatter' => 
'JqueryPortico.formatLink'),
+                               array('key' => 'created', 'label' => 
lang('Date'), 'sortable' => true, 'resizeable' => true),
+                       );
+
+                       $vendor_report = array();
+
+                       $tabletools = array(
+                               array(
+                                       'my_name' => 'add',
+                                       'text' => lang('add'),
+                                       'type' => 'custom',
+                                       'className' => 'add',
+                                       'custom_code' => "
+                                                               
add_report('vendor');"
+                               )
+                       );
+
+                       $datatable_def[] = array(
+                               'container' => 'datatable-container_1',
+                               'requestUrl' => 
json_encode(self::link(array('menuaction' => 
'eventplanner.uivendor_report.query',
+                                       'filter_booking_id' => $id,
+                                       'filter_active' => 1,
+                                       'phpgw_return_as' => 'json'))),
+                               'ColumnDefs' => $vendor_report_def,
+                               'data' => json_encode($vendor_report),
+                               'tabletools' => $tabletools,
+                               'config' => array(
+                                       array('disableFilter' => true),
+                                       array('disablePagination' => true)
+                               )
+                       );
+
+                       $customer_report_def = array(
+                               array('key' => 'id', 'label' => lang('id'), 
'sortable' => true, 'resizeable' => true,'formatter' => 
'JqueryPortico.formatLink'),
+                               array('key' => 'created', 'label' => 
lang('Date'), 'sortable' => true, 'resizeable' => true),
+                       );
+
+                       $customer_report = array();
+                       $tabletools = array(
+                               array(
+                                       'my_name' => 'add',
+                                       'text' => lang('add'),
+                                       'type' => 'custom',
+                                       'className' => 'add',
+                                       'custom_code' => "
+                                                               
add_report('vendor');"
+                               )
+                       );
+                       $datatable_def[] = array(
+                               'container' => 'datatable-container_2',
+//                             'requestUrl' => 
json_encode(self::link(array('menuaction' => 
'eventplanner.uicustomer_report.query',
+//                                     'filter_booking_id' => $id,
+//                                     'filter_active' => 1,
+//                                     'phpgw_return_as' => 'json'))),
+                               'requestUrl' => "''",
+                               'ColumnDefs' => $customer_report_def,
+                               'data' => json_encode($customer_report),
+                               'tabletools' => $tabletools,
+                               'config' => array(
+                                       array('disableFilter' => true),
+                                       array('disablePagination' => true)
+                               )
+                       );
+
                        $application = 
createObject('eventplanner.boapplication')->read_single($booking->application_id);
 
 //                     $GLOBALS['phpgw']->jqcal2->add_listener('from_', 
'datetime', $booking->from_, array(

Modified: branches/Version-2_0-branch/eventplanner/inc/class.uicommon.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uicommon.inc.php 
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uicommon.inc.php 
2016-12-06 14:58:32 UTC (rev 16052)
@@ -53,7 +53,7 @@
                {
                        parent::__construct();
                        $called_class = get_called_class();
-                       $this->called_class_arr = explode('_', $called_class);
+                       $this->called_class_arr = explode('_', $called_class, 
2);
                }
 
 

Modified: 
branches/Version-2_0-branch/eventplanner/inc/class.uivendor_report.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/class.uivendor_report.inc.php  
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/inc/class.uivendor_report.inc.php  
2016-12-06 14:58:32 UTC (rev 16052)
@@ -59,22 +59,7 @@
                        $this->custom_fields = 
eventplanner_vendor_report::get_instance()->get_custom_fields();
                }
 
-               private function get_status_options( $selected = 0 )
-               {
-                       $status_options = array();
-                       $status_list = 
eventplanner_vendor_report::get_status_list();
 
-                       foreach ($status_list as $_key => $_value)
-                       {
-                               $status_options[] = array(
-                                       'id' => $_key,
-                                       'name' => $_value,
-                                       'selected' => $_key == $selected ? 1 : 0
-                               );
-                       }
-                       return $status_options;
-               }
-
                private function _get_filters()
                {
                        $combos = array();
@@ -88,35 +73,6 @@
                                'requestGenerator' => 'requestWithVendorFilter'
                        );
 
-                       $status_options = $this->get_status_options();
-                       array_unshift($status_options, array('id' => '','name' 
=> lang('all')));
-
-                       $combos[] = array(
-                               'type' => 'filter',
-                               'name' => 'filter_status',
-                               'extra' => '',
-                               'text' => lang('status'),
-                               'list' => $status_options
-                       );
-
-                       $categories = 
$this->cats->formatted_xslt_list(array('format' => 'filter',
-                                       'selected' => $this->cat_id, 'globals' 
=> true, 'use_acl' => $this->_category_acl));
-                       $default_value = array('cat_id' => '', 'name' => 
lang('no category'));
-                       array_unshift($categories['cat_list'], $default_value);
-
-                       $_categories = array();
-                       foreach ($categories['cat_list'] as $_category)
-                       {
-                               $_categories[] = array('id' => 
$_category['cat_id'], 'name' => $_category['name']);
-                       }
-
-                       $combos[] = array('type' => 'filter',
-                               'name' => 'filter_category_id',
-                               'extra' => '',
-                               'text' => lang('category'),
-                               'list' => $_categories
-                       );
-
                        return $combos;
 
                }
@@ -150,7 +106,7 @@
                                                'phpgw_return_as' => 'json'
                                        )),
                                        'allrows' => true,
-                                       'new_item' => 
self::link(array('menuaction' => 'eventplanner.uivendor_report.add')),
+       //                              'new_item' => 
self::link(array('menuaction' => 'eventplanner.uivendor_report.add')),
                                        'editor_action' => '',
                                        'field' => parent::_get_fields()
                                )
@@ -223,7 +179,28 @@
                                $vendor_report = $this->bo->read_single($id);
                        }
 
-                       $custom_values = $vendor_report->json_representation;
+                       $booking_id = $vendor_report->booking_id ? 
$vendor_report->booking_id : phpgw::get_var('booking_id', 'int');
+                       $booking = 
createObject('eventplanner.bobooking')->read_single($booking_id);
+
+                       $application = 
createObject('eventplanner.boapplication')->read_single($booking->application_id);
+                       $application_type_list = 
execMethod('eventplanner.bogeneric.get_list', array('type' => 
'application_type'));
+                       $types = (array)$application->types;
+                       if($types)
+                       {
+                               foreach ($application_type_list as 
&$application_type)
+                               {
+                                       foreach ($types as $type)
+                                       {
+                                               if((!empty($type['type_id']) && 
$type['type_id'] == $application_type['id']) || ($type == 
$application_type['id']))
+                                               {
+                                                       
$application_type['selected'] = 1;
+                                                       break;
+                                               }
+                                       }
+                               }
+                       }
+
+                       $custom_values = $vendor_report->json_representation ? 
$vendor_report->json_representation : array();
                        $custom_fields = 
createObject('booking.custom_fields','eventplanner');
                        $fields = $this->custom_fields;
                        foreach ($fields as $attrib_id => &$attrib)
@@ -259,8 +236,10 @@
                                'form_action' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'eventplanner.uivendor_report.save')),
                                'cancel_url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'eventplanner.uivendor_report.index',)),
                                'vendor_report' => $vendor_report,
-                               'status_list' => array('options' => 
$this->get_status_options($vendor_report->status)),
-                               'vendor_report_type_list' => 
$vendor_report_type_list,
+                               'booking'               => $booking,
+                               'application'   => $application,
+                               'application_type_list' => 
$application_type_list,
+                               'booking_url' => self::link(array('menuaction' 
=> 'eventplanner.uibooking.edit', 'id' => $booking->id, 'active_tab' => 
'reports')),
                                'mode' => $mode,
                                'tabs' => 
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
                                'value_active_tab' => $active_tab,
@@ -269,7 +248,7 @@
                        phpgwapi_jquery::formvalidator_generate(array('date', 
'security', 'file'));
                        phpgwapi_jquery::load_widget('autocomplete');
                        self::add_javascript('eventplanner', 'portico', 
'vendor_report.edit.js');
-                       self::render_template_xsl(array('vendor_report', 
'datatable_inline', 'attributes_form'), array($mode => $data));
+                       
self::render_template_xsl(array('vendor_report','application_info', 
'datatable_inline', 'attributes_form'), array($mode => $data));
                }
 
                

Modified: 
branches/Version-2_0-branch/eventplanner/inc/model/class.booking.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/model/class.booking.inc.php    
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/inc/model/class.booking.inc.php    
2016-12-06 14:58:32 UTC (rev 16052)
@@ -54,6 +54,7 @@
                        $customer_contact_name,
                        $customer_contact_email,
                        $customer_contact_phone,
+                       $location,
                        $comments,
                        $created,
                        $secret;
@@ -155,7 +156,7 @@
                                'customer_contact_name' => array(
                                        'action'=> PHPGW_ACL_ADD | 
PHPGW_ACL_EDIT,
                                        'type' => 'string',
-                                       'required' => true,
+                                       'required' => false,
                                        'query' => true,
                                        'label' => 'customer contact name',
                                        'history' => true,
@@ -163,7 +164,7 @@
                                'customer_contact_email' => array(
                                        'action'=> PHPGW_ACL_READ | 
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
                                        'type' => 'string',
-                                       'required' => true,
+                                       'required' => false,
                                        'query' => true,
                                        'sf_validator' => 
createObject('booking.sfValidatorEmail', array(), array('invalid' => '%field% 
is invalid')),
                                        'label' => 'customer contact email',
@@ -172,11 +173,19 @@
                                'customer_contact_phone' => array(
                                        'action'=> PHPGW_ACL_ADD | 
PHPGW_ACL_EDIT,
                                        'type' => 'string',
-                                       'required' => true,
+                                       'required' => false,
                                        'query' => true,
                                        'label' => 'customer contact phone',
                                        'history' => true,
                                        ),
+                               'location' => array(
+                                       'action'=> PHPGW_ACL_ADD | 
PHPGW_ACL_EDIT,
+                                       'type' => 'string',
+                                       'required' => false,
+                                       'query' => true,
+                                       'label' => 'location',
+                                       'history' => true,
+                                       ),
                                'comments' => array(
                                        'action'=> PHPGW_ACL_ADD | 
PHPGW_ACL_EDIT,
                                        'type' => 'string',

Modified: 
branches/Version-2_0-branch/eventplanner/inc/model/class.customer.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/model/class.customer.inc.php   
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/inc/model/class.customer.inc.php   
2016-12-06 14:58:32 UTC (rev 16052)
@@ -125,7 +125,7 @@
                                        'sortable' => false,
                                        ),
                                'name' => array(
-                                       'action'=> PHPGW_ACL_ADD | 
PHPGW_ACL_EDIT,
+                                       'action'=> PHPGW_ACL_READ | 
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
                                        'type' => 'string',
                                        'label' => 'name',
                                        'required' => true,

Modified: 
branches/Version-2_0-branch/eventplanner/inc/model/class.vendor.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/inc/model/class.vendor.inc.php     
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/inc/model/class.vendor.inc.php     
2016-12-06 14:58:32 UTC (rev 16052)
@@ -125,7 +125,7 @@
                                        'sortable' => false,
                                        ),
                                'name' => array(
-                                       'action'=> PHPGW_ACL_ADD | 
PHPGW_ACL_EDIT,
+                                       'action'=> PHPGW_ACL_READ | 
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
                                        'type' => 'string',
                                        'label' => 'name',
                                        'required' => true,

Modified: 
branches/Version-2_0-branch/eventplanner/inc/model/class.vendor_report.inc.php
===================================================================
--- 
branches/Version-2_0-branch/eventplanner/inc/model/class.vendor_report.inc.php  
    2016-12-06 14:54:00 UTC (rev 16051)
+++ 
branches/Version-2_0-branch/eventplanner/inc/model/class.vendor_report.inc.php  
    2016-12-06 14:58:32 UTC (rev 16052)
@@ -26,7 +26,6 @@
         * @subpackage vendor_report
         * @version $Id: $
         */
-
        phpgw::import_class('eventplanner.bovendor_report');
 
        include_class('phpgwapi', 'model', 'inc/model/');
@@ -34,19 +33,15 @@
        class eventplanner_vendor_report extends phpgwapi_model
        {
 
-               const STATUS_REGISTERED = 1;
-               const STATUS_PENDING = 2;
-               const STATUS_REJECTED = 3;
-               const STATUS_APPROVED = 4;
                const acl_location = '.vendor_report';
 
                protected
                        $id,
+                       $booking_id,
+                       $booking_location,
                        $created,
                        $json_representation;
-
                static $custom_fields = array();
-
                protected $field_of_responsibility_name = '.vendor_report';
 
                public function __construct( int $id = null )
@@ -65,16 +60,6 @@
                        return new eventplanner_vendor_report();
                }
 
-               public static function get_status_list()
-               {
-                       return array(
-                               self::STATUS_REGISTERED => lang('registered'),
-                               self::STATUS_PENDING    => lang('pending'),
-                               self::STATUS_REJECTED => lang('rejected'),
-                               self::STATUS_APPROVED   => lang('approved')
-                       );
-               }
-
                public function set_custom_fields()
                {
                        $this->custom_fields = 
$GLOBALS['phpgw']->custom_fields->find('eventplanner', self::acl_location, 0, 
'', 'ASC', 'attrib_sort', true, true);
@@ -82,7 +67,7 @@
 
                public function get_custom_fields()
                {
-                       if(! $this->custom_fields)
+                       if (!$this->custom_fields)
                        {
                                $this->set_custom_fields();
                        }
@@ -91,43 +76,58 @@
 
                public function get_organized_fields()
                {
-                       if(! $this->custom_fields)
+                       if (!$this->custom_fields)
                        {
                                $this->custom_fields = 
createObject('booking.custom_fields', 
'eventplanner')->get_organized_fields(self::acl_location);
                        }
                        return $this->custom_fields;
                }
 
-
-               public static function get_fields($debug = true)
+               public static function get_fields( $debug = true )
                {
-                        $fields = array(
-                               'id' => array('action'=> PHPGW_ACL_READ,
+                       $fields = array(
+                               'id' => array('action' => PHPGW_ACL_READ,
                                        'type' => 'int',
                                        'label' => 'id',
-                                       'sortable'=> true,
+                                       'sortable' => true,
                                        'formatter' => 
'JqueryPortico.formatLink',
-                                       ),
-                               'created' => array('action'=> PHPGW_ACL_READ | 
PHPGW_ACL_ADD,
+                               ),
+                               'booking_id' => array('action' => PHPGW_ACL_ADD 
| PHPGW_ACL_EDIT,
+                                       'type' => 'int',
+                                       'label' => 'booking',
+                                       'sortable' => true,
+                                       'required' => true,
+                               ),
+                               'booking_location' => array('action' => 
PHPGW_ACL_READ,
+                                       'type' => 'string',
+                                       'query' => true,
+                                       'label' => 'location',
+                                       'join' => array(
+                                               'table' => 
'eventplanner_booking',
+                                               'fkey' => 'booking_id',
+                                               'key' => 'id',
+                                               'column' => 'location'
+                                       )
+                               ),
+                               'created' => array('action' => PHPGW_ACL_READ | 
PHPGW_ACL_ADD,
                                        'type' => 'date',
                                        'label' => 'created',
                                        'sortable' => true,
-                                       ),
-                               'json_representation' => array('action'=> 
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
-                                       'type' => 'jsonb',
+                               ),
+                               'json_representation' => array('action' => 
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+                                       'type' => 'json',
                                        'sortable' => false,
-                                       ),
+                               ),
                        );
 
-                       if($debug)
+                       if ($debug)
                        {
                                foreach ($fields as $field => $field_info)
                                {
-                                       
if(!property_exists('eventplanner_vendor_report', $field))
+                                       if 
(!property_exists('eventplanner_vendor_report', $field))
                                        {
-                                          
phpgwapi_cache::message_set('$'."{$field},", 'error');
+                                               phpgwapi_cache::message_set('$' 
. "{$field},", 'error');
                                        }
-
                                }
                        }
                        return $fields;
@@ -150,7 +150,7 @@
                        $entity->modified = time();
                        $entity->active = (int)$entity->active;
 
-                       if(!$entity->get_id())
+                       if (!$entity->get_id())
                        {
                                $entity->created = time();
                                $entity->owner_id = 
$GLOBALS['phpgw_info']['user']['account_id'];
@@ -174,8 +174,8 @@
                        return 
eventplanner_bovendor_report::get_instance()->store($this);
                }
 
-               public function read_single($id)
+               public function read_single( $id )
                {
                        return 
eventplanner_bovendor_report::get_instance()->read_single($id, true);
                }
-       }
+       }
\ No newline at end of file

Modified: 
branches/Version-2_0-branch/eventplanner/js/portico/application.edit.js
===================================================================
--- branches/Version-2_0-branch/eventplanner/js/portico/application.edit.js     
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/js/portico/application.edit.js     
2016-12-06 14:58:32 UTC (rev 16052)
@@ -93,7 +93,7 @@
                padding: '0 5px 5px 5px',
                width: $("#submitbox").width() + 'px',
                "background - color": '#FFF',
-               display: "block",
+               display: "block"
        });
 
        var offset = $("#submitbox").offset();

Copied: branches/Version-2_0-branch/eventplanner/js/portico/booking.edit.js 
(from rev 16051, trunk/eventplanner/js/portico/booking.edit.js)
===================================================================
--- branches/Version-2_0-branch/eventplanner/js/portico/booking.edit.js         
                (rev 0)
+++ branches/Version-2_0-branch/eventplanner/js/portico/booking.edit.js 
2016-12-06 14:58:32 UTC (rev 16052)
@@ -0,0 +1,189 @@
+var lang;
+var oArgs = {menuaction: 'eventplanner.uicustomer.index', organization_number: 
true};
+var strURL = phpGWLink('index.php', oArgs, true);
+JqueryPortico.autocompleteHelper(strURL, 'customer_name', 'customer_id', 
'customer_container', 'name');
+
+$(window).on('load', function ()
+{
+       customer_id = $('#customer_id').val();
+       if (customer_id)
+       {
+               customer_id_selection = customer_id;
+       }
+       $("#customer_name").on("autocompleteselect", function (event, ui)
+       {
+               var customer_id = ui.item.value;
+               if (customer_id != customer_id_selection)
+               {
+                       populateCustomerContact(customer_id);
+               }
+       });
+});
+
+function populateCustomerContact(customer_id)
+{
+       customer_id = customer_id || $('#customer_id').val();
+
+       if (!customer_id)
+       {
+               return;
+       }
+       oArgs = {
+               menuaction: 'eventplanner.uicustomer.get',
+               id: customer_id
+       };
+
+       var requestUrl = phpGWLink('index.php', oArgs, true);
+       var data = {};
+
+       JqueryPortico.execute_ajax(requestUrl,
+               function (result)
+               {
+                       $("#customer_contact_name").val(result.contact_name);
+                       $("#customer_contact_email").val(result.contact_email);
+                       $("#customer_contact_phone").val(result.contact_phone);
+
+                       var location = result.address_1;
+                       if (result.address_2)
+                       {
+                               location += "\n" + result.address_2;
+                       }
+                       location += "\n" + result.zip_code;
+                       location += ' ' + result.city;
+                       $("#location").val(location);
+
+               }, data, "POST", "json"
+               );
+}
+
+function set_tab(tab)
+{
+       $("#active_tab").val(tab);
+       if (tab === 'reports')
+       {
+               $("#floating-box").hide();
+               $("#submit_group_bottom").hide();
+       }
+       else
+       {
+               $("#floating-box").show();
+               $("#submit_group_bottom").show();
+       }
+}
+
+add_report = function (type)
+{
+       var oArgs;
+       var win;
+       var booking_id = $("#booking_id").val();
+       if (type === 'vendor')
+       {
+               oArgs = {
+                       menuaction: 'eventplanner.uivendor_report.add',
+                       booking_id: booking_id
+               };
+
+               var requestUrl = phpGWLink('index.php', oArgs);
+               win = window.open(requestUrl, '_blank');
+               win.focus();
+
+       }
+       else if (type === 'customer')
+       {
+               oArgs = {
+                       menuaction: 'eventplanner.uicustomer_report.add',
+                       booking_id: booking_id
+               };
+
+               var requestUrl = phpGWLink('index.php', oArgs);
+               win = window.open(requestUrl, '_blank');
+               win.focus();
+
+       }
+
+};
+validate_submit = function ()
+{
+//     var active_tab = $("#active_tab").val();
+       conf = {
+               validateOnBlur: false,
+               scrollToTopOnError: true,
+               errorMessagePosition: 'top'
+       };
+
+       var test = $('form').isValid(false, conf);
+       if (!test)
+       {
+               return;
+       }
+
+       document.form.submit();
+
+};
+
+
+$(document).ready(function ()
+{
+
+       $("#submitbox").css({
+               position: 'absolute',
+               right: '10px',
+               border: '1px solid #B5076D',
+               padding: '0 5px 5px 5px',
+               width: $("#submitbox").width() + 'px',
+               "background - color": '#FFF',
+               display: "block"
+       });
+       var tab = $("#active_tab").val();
+       if (tab === 'reports')
+       {
+               $("#floating-box").hide();
+               $("#submit_group_bottom").hide();
+       }
+       else
+       {
+               $("#floating-box").show();
+               $("#submit_group_bottom").show();
+       }
+
+       var offset = $("#submitbox").offset();
+       var topPadding = 180;
+
+       if ($("#center_content").length === 1)
+       {
+               $("#center_content").scroll(function ()
+               {
+                       if ($("#center_content").scrollTop() > offset.top)
+                       {
+                               $("#submitbox").stop().animate({
+                                       marginTop: 
$("#center_content").scrollTop() - offset.top + topPadding
+                               }, 100);
+                       }
+                       else
+                       {
+                               $("#submitbox").stop().animate({
+                                       marginTop: 0
+                               }, 100);
+                       }
+               });
+       }
+       else
+       {
+               $(window).scroll(function ()
+               {
+                       if ($(window).scrollTop() > offset.top)
+                       {
+                               $("#submitbox").stop().animate({
+                                       marginTop: $(window).scrollTop() - 
offset.top + topPadding
+                               }, 100);
+                       }
+                       else
+                       {
+                               $("#submitbox").stop().animate({
+                                       marginTop: 0
+                               }, 100);
+                       }
+                       ;
+               });
+       }
+});
\ No newline at end of file

Modified: branches/Version-2_0-branch/eventplanner/setup/phpgw_no.lang
===================================================================
--- branches/Version-2_0-branch/eventplanner/setup/phpgw_no.lang        
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/setup/phpgw_no.lang        
2016-12-06 14:58:32 UTC (rev 16052)
@@ -67,4 +67,8 @@
 from   eventplanner    no      Fra
 select all     eventplanner    no      Velg alle
 enable eventplanner    no      Aktiver
-disable        eventplanner    no      Deaktiver
\ No newline at end of file
+disable        eventplanner    no      Deaktiver
+reports        eventplanner    no      Rapporter
+location       eventplanner    no      Lokalisering
+who    eventplanner    no      Hvem
+note   eventplanner    no      Merknad
\ No newline at end of file

Modified: branches/Version-2_0-branch/eventplanner/setup/tables_current.inc.php
===================================================================
--- branches/Version-2_0-branch/eventplanner/setup/tables_current.inc.php       
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/setup/tables_current.inc.php       
2016-12-06 14:58:32 UTC (rev 16052)
@@ -269,9 +269,10 @@
                                'completed' => array('type' => 'int', 
'precision' => 4, 'nullable' => False,'default' => '0'),
                                'cost' => array('type' => 'decimal', 
'precision' => 20, 'scale' => 2, 'nullable' => True,'default' => '0.00'),
                                'application_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
-                               'customer_contact_name' => array('type' => 
'text', 'nullable' => False),
-                               'customer_contact_email' => array('type' => 
'text', 'nullable' => False),
-                               'customer_contact_phone' => array('type' => 
'text', 'nullable' => False),
+                               'customer_contact_name' => array('type' => 
'text', 'nullable' => True),
+                               'customer_contact_email' => array('type' => 
'text', 'nullable' => True),
+                               'customer_contact_phone' => array('type' => 
'text', 'nullable' => True),
+                               'where' => array('type' => 'text', 'nullable' 
=> True),
                                'reminder' => array('type' => 'int', 
'precision' => 4, 'nullable' => False, 'default' => '0'),
                                'secret' => array('type' => 'text', 'nullable' 
=> False),
                                'sms_total' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),

Modified: 
branches/Version-2_0-branch/eventplanner/templates/base/application.xsl
===================================================================
--- branches/Version-2_0-branch/eventplanner/templates/base/application.xsl     
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/templates/base/application.xsl     
2016-12-06 14:58:32 UTC (rev 16052)
@@ -26,7 +26,8 @@
                        }
                        #submitbox {
                        display: none;
-                       }       </style>
+                       }
+               </style>
                <xsl:variable name="date_format">
                        <xsl:value-of select="php:function('get_phpgw_info', 
'user|preferences|common|dateformat')" />
                </xsl:variable>
@@ -434,7 +435,7 @@
                                                                <label>
                                                                        
<xsl:value-of select="php:function('lang', 'stage')"/>
                                                                </label>
-                                                               <input 
type="text" id="stage_width" name="stage_width" 
value="{application/stage_width}">
+                                                               <input 
type="text" id="stage_width" name="stage_width" 
value="{application/stage_width}" size="2">
                                                                        
<xsl:attribute name="title">
                                                                                
<xsl:value-of select="php:function('lang', 'width')"/>
                                                                        
</xsl:attribute>
@@ -446,7 +447,7 @@
                                                                        
</xsl:attribute>
                                                                </input>
                                                                <xsl:text> X 
</xsl:text>
-                                                               <input 
type="text" id="stage_depth" name="stage_depth" 
value="{application/stage_depth}">
+                                                               <input 
type="text" id="stage_depth" name="stage_depth" 
value="{application/stage_depth}" size="2">
                                                                        
<xsl:attribute name="data-validation">
                                                                                
<xsl:text>number</xsl:text>
                                                                        
</xsl:attribute>
@@ -458,7 +459,7 @@
                                                                        
</xsl:attribute>
                                                                </input>
                                                                <xsl:text> M 
</xsl:text>
-                                                               <input 
id="stage_size" type="text" disabled="disabled"/>
+                                                               <input 
id="stage_size" type="text" disabled="disabled" size="3"/>
                                                        </div>
                                                        <div 
class="pure-control-group">
                                                                <label>
@@ -482,7 +483,7 @@
                                                                <label>
                                                                        
<xsl:value-of select="php:function('lang', 'audience limit')"/>
                                                                </label>
-                                                               <input 
type="text" id="audience_limit" name="audience_limit" 
value="{application/audience_limit}">
+                                                               <input 
type="text" id="audience_limit" name="audience_limit" 
value="{application/audience_limit}"  size="5">
                                                                        
<xsl:attribute name="data-validation">
                                                                                
<xsl:text>required</xsl:text>
                                                                        
</xsl:attribute>
@@ -494,7 +495,6 @@
                                                                        
</xsl:attribute>
                                                                </input>
                                                        </div>
-
                                                </fieldset>
                                                <fieldset>
                                                        <legend>

Copied: 
branches/Version-2_0-branch/eventplanner/templates/base/application_info.xsl 
(from rev 16051, trunk/eventplanner/templates/base/application_info.xsl)
===================================================================
--- 
branches/Version-2_0-branch/eventplanner/templates/base/application_info.xsl    
                            (rev 0)
+++ 
branches/Version-2_0-branch/eventplanner/templates/base/application_info.xsl    
    2016-12-06 14:58:32 UTC (rev 16052)
@@ -0,0 +1,79 @@
+
+<xsl:template name="application_info" xmlns:php="http://php.net/xsl";>
+       <xsl:param name="application" />
+       <xsl:param name="application_type_list" />
+
+       <div class="pure-control-group">
+               <label>
+                       <xsl:value-of select="php:function('lang', 'vendor')"/>
+               </label>
+               <xsl:value-of select="application/vendor_name"/>
+       </div>
+       <div class="pure-control-group">
+               <label>
+                       <xsl:value-of select="php:function('lang', 
'application')"/>
+               </label>
+               <xsl:value-of select="application/title"/>
+       </div>
+
+       <div class="pure-control-group">
+               <label>
+                       <xsl:value-of select="php:function('lang', 'remark')"/>
+               </label>
+               <xsl:value-of select="application/remark"/>
+       </div>
+
+       <div class="pure-control-group">
+               <label>
+                       <xsl:value-of select="php:function('lang', 'contact 
name')"/>
+               </label>
+               <xsl:value-of select="application/contact_name"/>
+       </div>
+       <div class="pure-control-group">
+               <label>
+                       <xsl:value-of select="php:function('lang', 'contact 
email')"/>
+               </label>
+               <xsl:value-of select="application/contact_email"/>
+       </div>
+       <div class="pure-control-group">
+               <label>
+                       <xsl:value-of select="php:function('lang', 'contact 
phone')"/>
+               </label>
+               <xsl:value-of select="application/contact_phone"/>
+
+       </div>
+       <div class="pure-control-group">
+               <label>
+                       <xsl:value-of select="php:function('lang', 'type')"/>
+               </label>
+               <div class="pure-custom">
+                       <table class="pure-table pure-table-bordered" 
border="0" cellspacing="2" cellpadding="2">
+                               <thead>
+                                       <tr>
+                                               <th>
+                                                       <xsl:value-of 
select="php:function('lang', 'select')"/>
+                                               </th>
+                                               <th>
+                                                       <xsl:value-of 
select="php:function('lang', 'type')"/>
+                                               </th>
+                                       </tr>
+                               </thead>
+                               <tbody>
+                                       <xsl:for-each 
select="application_type_list">
+                                               <tr>
+                                                       <td>
+                                                               <xsl:if 
test="selected = 1">
+                                                                       
<xsl:text>X</xsl:text>
+                                                               </xsl:if>
+                                                       </td>
+                                                       <td>
+                                                               <xsl:value-of 
disable-output-escaping="yes" select="name"/>
+                                                       </td>
+                                               </tr>
+                                       </xsl:for-each>
+                               </tbody>
+                       </table>
+               </div>
+       </div>
+
+</xsl:template>

Modified: branches/Version-2_0-branch/eventplanner/templates/base/booking.xsl
===================================================================
--- branches/Version-2_0-branch/eventplanner/templates/base/booking.xsl 
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/templates/base/booking.xsl 
2016-12-06 14:58:32 UTC (rev 16052)
@@ -14,6 +14,15 @@
 
 <!-- add / edit  -->
 <xsl:template xmlns:php="http://php.net/xsl"; match="edit">
+       <style type="text/css">
+               #floating-box {
+               position: relative;
+               z-index: 1000;
+               }
+               #submitbox {
+               display: none;
+               }
+       </style>
        <xsl:variable name="date_format">
                <xsl:value-of select="php:function('get_phpgw_info', 
'user|preferences|common|dateformat')" />
                <xsl:text> H:i</xsl:text>
@@ -25,13 +34,46 @@
                <xsl:value-of select="mode"/>
        </xsl:variable>
 
-       <div>
+       <div class="content">
                <script type="text/javascript">
                        var lang = <xsl:value-of 
select="php:function('js_lang', 'Name or company is required', 'customer')"/>;
                </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="floating-box">
+                                       <div id="submitbox">
+                                               <table width="200px">
+                                                       <tbody>
+                                                               <tr>
+                                                                       <td 
width="200px">
+                                                                               
<xsl:variable name="lang_save">
+                                                                               
        <xsl:value-of select="php:function('lang', 'save')"/>
+                                                                               
</xsl:variable>
+                                                                               
<input type="button" class="pure-button pure-button-primary" name="save" 
id="save_button" onClick="validate_submit();">
+                                                                               
        <xsl:attribute name="value">
+                                                                               
                <xsl:value-of select="$lang_save"/>
+                                                                               
        </xsl:attribute>
+                                                                               
        <xsl:attribute name="title">
+                                                                               
                <xsl:value-of select="$lang_save"/>
+                                                                               
        </xsl:attribute>
+                                                                               
</input>
+                                                                       </td>
+                                                                       <td>
+                                                                               
<xsl:variable name="lang_cancel">
+                                                                               
        <xsl:value-of select="php:function('lang', 'cancel')"/>
+                                                                               
</xsl:variable>
+                                                                               
<input type="button" class="pure-button pure-button-primary" name="done" 
value="{$lang_cancel}" onClick="window.location = '{cancel_url}';">
+                                                                               
        <xsl:attribute name="title">
+                                                                               
                <xsl:value-of select="php:function('lang', 'Back to the ticket 
list')"/>
+                                                                               
        </xsl:attribute>
+                                                                               
</input>
+                                                                       </td>
+                                                               </tr>
+                                                       </tbody>
+                                               </table>
+                                       </div>
+                               </div>
                                <input type="hidden" id="active_tab" 
name="active_tab" value="{value_active_tab}"/>
                                <div id="first_tab">
                                        <xsl:if test="booking/id > 0">
@@ -39,7 +81,7 @@
                                                        <label>
                                                                <xsl:value-of 
select="php:function('lang', 'id')"/>
                                                        </label>
-                                                       <input type="hidden" 
name="id" value="{booking/id}"/>
+                                                       <input type="hidden" 
id="booking_id" name="id" value="{booking/id}"/>
                                                        <input type="hidden" 
name="application_id" value="{booking/application_id}"/>
                                                        <xsl:value-of 
select="booking/id"/>
                                                </div>
@@ -295,6 +337,17 @@
                                                
                                                <div class="pure-control-group">
                                                        <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'location')"/>
+                                                       </label>
+                                                       <textarea cols="47" 
rows="7" id="location" name="location">
+                                                               <xsl:attribute 
name="data-validation">
+                                                                       
<xsl:text>required</xsl:text>
+                                                               </xsl:attribute>
+                                                               <xsl:value-of 
select="booking/location"/>
+                                                       </textarea>
+                                               </div>
+                                               <div class="pure-control-group">
+                                                       <label>
                                                                <xsl:value-of 
select="php:function('lang', 'remark')"/>
                                                        </label>
                                                        <textarea cols="47" 
rows="7" name="remark">
@@ -329,9 +382,56 @@
                                                </div>
                                        </fieldset>
                                </div>
+                               <div id="reports">
+                                       <fieldset>
+                                               <legend>
+                                                       <xsl:value-of 
select="php:function('lang', 'vendor report')"/>
+                                               </legend>
+                                               <div class="pure-control-group">
+                                                       <div 
class="pure-custom">
+                                                               <xsl:for-each 
select="datatable_def">
+                                                                       <xsl:if 
test="container = 'datatable-container_1'">
+                                                                               
<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>
+
+                                       </fieldset>
+                                       <fieldset>
+                                               <legend>
+                                                       <xsl:value-of 
select="php:function('lang', 'customer report')"/>
+                                               </legend>
+                                               <div class="pure-control-group">
+                                                       <div 
class="pure-custom">
+                                                               <xsl:for-each 
select="datatable_def">
+                                                                       <xsl:if 
test="container = 'datatable-container_2'">
+                                                                               
<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>
+
+                                       </fieldset>
+
+                               </div>
                        </div>
-                       <div class="proplist-col">
-                               <input type="submit" class="pure-button 
pure-button-primary" name="save">
+                       <div id="submit_group_bottom">
+                               <input type="button" class="pure-button 
pure-button-primary" name="save" onClick="validate_submit();">
                                        <xsl:attribute name="value">
                                                <xsl:value-of 
select="php:function('lang', 'save')"/>
                                        </xsl:attribute>
@@ -347,6 +447,7 @@
                        </div>
                </form>
        </div>
+
 </xsl:template>
 
 <xsl:template match="options">

Modified: 
branches/Version-2_0-branch/eventplanner/templates/base/vendor_report.xsl
===================================================================
--- branches/Version-2_0-branch/eventplanner/templates/base/vendor_report.xsl   
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/eventplanner/templates/base/vendor_report.xsl   
2016-12-06 14:58:32 UTC (rev 16052)
@@ -16,6 +16,7 @@
 <xsl:template xmlns:php="http://php.net/xsl"; match="edit">
        <xsl:variable name="date_format">
                <xsl:value-of select="php:function('get_phpgw_info', 
'user|preferences|common|dateformat')" />
+               <xsl:text> H:i</xsl:text>
        </xsl:variable>
        <xsl:variable name="form_action">
                <xsl:value-of select="form_action"/>
@@ -33,16 +34,66 @@
                                <xsl:value-of disable-output-escaping="yes" 
select="tabs"/>
                                <input type="hidden" id="active_tab" 
name="active_tab" value="{value_active_tab}"/>
                                <div id="first_tab">
+                                       <xsl:if test="booking/id > 0">
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <a 
href="{booking_url}">
+                                                                       
<xsl:value-of select="php:function('lang', 'booking')"/>
+                                                               </a>
+                                                       </label>
+                                                       <input type="hidden" 
name="booking_id" value="{booking/id}"/>
+                                                       <xsl:value-of 
select="booking/id"/>
+                                               </div>
+                                       </xsl:if>
+                                       <xsl:if test="vendor_report/id > 0">
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'report')"/>
+                                                       </label>
+                                                       <input type="hidden" 
name="id" value="{vendor_report/id}"/>
+                                                       <xsl:value-of 
select="vendor_report/id"/>
+                                               </div>
+                                       </xsl:if>
+                                       <xsl:call-template 
name="application_info">
+                                               <xsl:with-param 
name="application" select ='application'/>
+                                               <xsl:with-param 
name="application_type_list" select ='application_type_list'/>
+                                       </xsl:call-template>
+                                       <div class="pure-control-group">
+                                               <xsl:variable name="lang_from">
+                                                       <xsl:value-of 
select="php:function('lang', 'from')"/>
+                                               </xsl:variable>
+                                               <label>
+                                                       <xsl:value-of 
select="$lang_from"/>
+                                               </label>
+                                               <xsl:value-of 
select="php:function('show_date', number(booking/from_), $date_format)"/>
+                                       </div>
+                                       <div class="pure-control-group">
+                                               <label>
+                                                       <xsl:value-of 
select="php:function('lang', 'timespan')"/>
+                                               </label>
+                                               <xsl:value-of 
select="application/timespan"/>
+                                       </div>
+
+                                       <div class="pure-control-group">
+                                               <label>
+                                                       <xsl:value-of 
select="php:function('lang', 'to')"/>
+                                               </label>
+                                               <xsl:value-of 
select="php:function('show_date', number(booking/to_), $date_format)"/>
+                                       </div>
+                                       <div class="pure-control-group">
+                                               <label>
+                                                       <xsl:value-of 
select="php:function('lang', 'customer')"/>
+                                               </label>
+                                               <xsl:value-of 
select="booking/customer_name"/>
+                                       </div>
+                                       <div class="pure-control-group">
+                                               <label>
+                                                       <xsl:value-of 
select="php:function('lang', 'location')"/>
+                                               </label>
+                                               <xsl:value-of 
select="booking/location"/>
+                                       </div>
+                       
                                        <fieldset>
-                                               <xsl:if test="vendor/id > 0">
-                                                       <div 
class="pure-control-group">
-                                                               <label>
-                                                                       
<xsl:value-of select="php:function('lang', 'id')"/>
-                                                               </label>
-                                                               <input 
type="hidden" name="id" value="{vendor/id}"/>
-                                                               <xsl:value-of 
select="vendor/id"/>
-                                                       </div>
-                                               </xsl:if>
                                                <!--xsl:apply-templates 
select="attributes_group/attributes"/-->
                                                <xsl:call-template 
name="attributes_values"/>
 

Modified: branches/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php     
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.socommon.inc.php     
2016-12-06 14:58:32 UTC (rev 16052)
@@ -112,6 +112,10 @@
                        {
                                return $this->db->db_addslashes($value);
                        }
+                       else if ($type == 'jsonb')
+                       {
+                               return "'" . json_encode($value) . "'";
+                       }
                        return "'" . $this->db->db_addslashes($value) . "'";
                }
 
@@ -569,7 +573,14 @@
                                        && empty($field_info['related'])
                                        && empty($field_info['manytomany']))
                                {
-                                       $value_set[$field] = $object->$field;
+                                       if($field_info['type'] == 'json')
+                                       {
+                                               $value_set[$field] = 
json_encode($object->$field);
+                                       }
+                                       else
+                                       {
+                                               $value_set[$field] = 
$object->$field;
+                                       }
                                }
                        }
                        
@@ -620,7 +631,14 @@
                                        && empty($field_info['related'])
                                        && empty($field_info['manytomany']))
                                {
-                                       $value_set[$field] = $object->$field;
+                                       if($field_info['type'] == 'json')
+                                       {
+                                               $value_set[$field] = 
json_encode($object->$field);
+                                       }
+                                       else
+                                       {
+                                               $value_set[$field] = 
$object->$field;
+                                       }
                                }
                        }
 

Modified: branches/Version-2_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uitts.inc.php        
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/property/inc/class.uitts.inc.php        
2016-12-06 14:58:32 UTC (rev 16052)
@@ -3678,18 +3678,64 @@
                        {
                                $_budget_amount = 
$this->_get_budget_amount($id);
 
+
+                               try
+                               {
+                                       $check_purchase = 
$this->bo->check_purchase_right($ticket['ecodimb'], $_budget_amount, $id);
+
+                               }
+                               catch (Exception $ex)
+                               {
+                                       throw $ex;
+                               }
+
+
                                $purchase_grant_error = false;
-                               $check_purchase = 
$this->bo->check_purchase_right($ticket['ecodimb'], $_budget_amount, $id);
+
                                foreach ($check_purchase as $purchase_grant)
                                {
+//                                     if(!$purchase_grant['is_user'] && 
($purchase_grant['required'] && !$purchase_grant['approved']))
+//                                     {
+//                                             $purchase_grant_error = true;
+//                                             
phpgwapi_cache::message_set(lang('approval from %1 is required',
+//                                                             
$GLOBALS['phpgw']->accounts->get($purchase_grant['id'])->__toString()),
+//                                                             'error'
+//                                             );
+//                                     }
+
                                        if(!$purchase_grant['is_user'] && 
($purchase_grant['required'] && !$purchase_grant['approved']))
                                        {
                                                $purchase_grant_error = true;
-                                               
phpgwapi_cache::message_set(lang('approval from %1 is required',
-                                                               
$GLOBALS['phpgw']->accounts->get($purchase_grant['id'])->__toString()),
+                                               
phpgwapi_cache::message_set(lang('approval from %1 is required for order %2',
+                                                               
$GLOBALS['phpgw']->accounts->get($purchase_grant['id'])->__toString(), $id),
                                                                'error'
                                                );
                                        }
+                                       else if( $purchase_grant['is_user'] && 
( $purchase_grant['required'] && $purchase_grant['requested'] && 
!$purchase_grant['approved']))
+                                       {
+                                               $action_params = array(
+                                                       'appname' => 'property',
+                                                       'location' => '.ticket',
+                                                       'id' => $id,
+                                                       'responsible' => '',
+                                                       'responsible_type' => 
'user',
+                                                       'action' => 'approval',
+                                                       'remark' => '',
+                                                       'deadline' => ''
+                                               );
+
+                                               $_account_id = 
$purchase_grant['id'];//$this->account
+
+                                               $action_params['responsible'] = 
$_account_id;
+                                               
if(!execMethod('property.sopending_action.get_pending_action', $action_params))
+                                               {
+                                                       
execMethod('property.sopending_action.set_pending_action', $action_params);
+                                               }
+                                               
execMethod('property.sopending_action.close_pending_action', $action_params);
+                                               $historylog->add('OA', $id, 
$GLOBALS['phpgw']->accounts->get($_account_id)->__toString() . 
"::{$_budget_amount}");
+                                               $purchase_grant_error = false;
+                                       }
+
                                }
                        }
 

Modified: 
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php
===================================================================
--- 
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php
    2016-12-06 14:54:00 UTC (rev 16051)
+++ 
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php
    2016-12-06 14:58:32 UTC (rev 16052)
@@ -64,7 +64,7 @@
                        }
 
                        $purchase_grant_error = false;
-                       $check_purchase = 
CreateObject('property.botts')->check_purchase_right($data['ecodimb'], $price, 
$_ticket['order_id']);
+                       $check_purchase = 
CreateObject('property.botts')->check_purchase_right($_ticket['ecodimb'], 
$price, $_ticket['order_id']);
                        foreach ($check_purchase as $purchase_grant)
                        {
                                if(!$purchase_grant['is_user'] && 
($purchase_grant['required'] && !$purchase_grant['approved']))
@@ -75,6 +75,30 @@
                                                        'error'
                                        );
                                }
+                               else if( $purchase_grant['is_user'] && ( 
$purchase_grant['required'] && $purchase_grant['requested'] && 
!$purchase_grant['approved']))
+                               {
+                                       $action_params = array(
+                                               'appname' => 'property',
+                                               'location' => '.ticket',
+                                               'id' => $id,
+                                               'responsible' => '',
+                                               'responsible_type' => 'user',
+                                               'action' => 'approval',
+                                               'remark' => '',
+                                               'deadline' => ''
+                                       );
+
+                                       $_account_id = 
$purchase_grant['id'];//$this->account
+
+                                       $action_params['responsible'] = 
$_account_id;
+                                       
if(!execMethod('property.sopending_action.get_pending_action', $action_params))
+                                       {
+                                               
execMethod('property.sopending_action.set_pending_action', $action_params);
+                                       }
+                                       
execMethod('property.sopending_action.close_pending_action', $action_params);
+                                       $historylog->add('OA', $id, 
$GLOBALS['phpgw']->accounts->get($_account_id)->__toString() . "::{$price}");
+                                       $purchase_grant_error = false;
+                               }
                        }
                        if (!$this->debug && $purchase_grant_error)
                        {

Modified: branches/Version-2_0-branch/property/js/portico/project.edit.js
===================================================================
--- branches/Version-2_0-branch/property/js/portico/project.edit.js     
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/property/js/portico/project.edit.js     
2016-12-06 14:58:32 UTC (rev 16052)
@@ -184,7 +184,7 @@
                padding: '0 10px 10px 10px',
                width: $("#submitbox").width() + 'px',
                "background - color": '#FFF',
-               display: "block",
+               display: "block"
        });
 
        var offset = $("#submitbox").offset();

Modified: branches/Version-2_0-branch/property/js/portico/tts.view.js
===================================================================
--- branches/Version-2_0-branch/property/js/portico/tts.view.js 2016-12-06 
14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/property/js/portico/tts.view.js 2016-12-06 
14:58:32 UTC (rev 16052)
@@ -490,7 +490,7 @@
                padding: '0 10px 10px 10px',
                width: width + 'px',
                "background - color": '#FFF',
-               display: "block",
+               display: "block"
        });
 
        var offset = $("#submitbox").offset();

Modified: branches/Version-2_0-branch/property/js/portico/workorder.edit.js
===================================================================
--- branches/Version-2_0-branch/property/js/portico/workorder.edit.js   
2016-12-06 14:54:00 UTC (rev 16051)
+++ branches/Version-2_0-branch/property/js/portico/workorder.edit.js   
2016-12-06 14:58:32 UTC (rev 16052)
@@ -444,7 +444,7 @@
                padding: '0 10px 10px 10px',
                width: width + 'px',
                "background - color": '#FFF',
-               display: "block",
+               display: "block"
        });
 
        var offset = $("#submitbox").offset();




reply via email to

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