fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16048] more on eventplanner


From: sigurdne
Subject: [Fmsystem-commits] [16048] more on eventplanner
Date: Mon, 5 Dec 2016 15:47:44 +0000 (UTC)

Revision: 16048
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16048
Author:   sigurdne
Date:     2016-12-05 15:47:43 +0000 (Mon, 05 Dec 2016)
Log Message:
-----------
more on eventplanner

Modified Paths:
--------------
    trunk/eventplanner/inc/class.bocommon.inc.php
    trunk/eventplanner/inc/class.uiapplication.inc.php
    trunk/eventplanner/inc/class.uibooking.inc.php
    trunk/eventplanner/inc/class.uicommon.inc.php
    trunk/eventplanner/inc/class.uivendor_report.inc.php
    trunk/eventplanner/inc/model/class.booking.inc.php
    trunk/eventplanner/inc/model/class.vendor_report.inc.php
    trunk/eventplanner/js/portico/application.edit.js
    trunk/eventplanner/setup/phpgw_no.lang
    trunk/eventplanner/setup/tables_current.inc.php
    trunk/eventplanner/templates/base/application.xsl
    trunk/eventplanner/templates/base/booking.xsl
    trunk/eventplanner/templates/base/vendor_report.xsl
    trunk/phpgwapi/inc/class.socommon.inc.php
    trunk/property/js/portico/project.edit.js
    trunk/property/js/portico/tts.view.js
    trunk/property/js/portico/workorder.edit.js

Added Paths:
-----------
    trunk/eventplanner/js/portico/booking.edit.js
    trunk/eventplanner/templates/base/application_info.xsl

Modified: trunk/eventplanner/inc/class.bocommon.inc.php
===================================================================
--- trunk/eventplanner/inc/class.bocommon.inc.php       2016-12-05 08:57:35 UTC 
(rev 16047)
+++ trunk/eventplanner/inc/class.bocommon.inc.php       2016-12-05 15:47:43 UTC 
(rev 16048)
@@ -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'] == 'jsonb')
+                                       {
+                                               $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: trunk/eventplanner/inc/class.uiapplication.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uiapplication.inc.php  2016-12-05 08:57:35 UTC 
(rev 16047)
+++ trunk/eventplanner/inc/class.uiapplication.inc.php  2016-12-05 15:47:43 UTC 
(rev 16048)
@@ -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()),

Modified: trunk/eventplanner/inc/class.uibooking.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uibooking.inc.php      2016-12-05 08:57:35 UTC 
(rev 16047)
+++ trunk/eventplanner/inc/class.uibooking.inc.php      2016-12-05 15:47:43 UTC 
(rev 16048)
@@ -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: trunk/eventplanner/inc/class.uicommon.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uicommon.inc.php       2016-12-05 08:57:35 UTC 
(rev 16047)
+++ trunk/eventplanner/inc/class.uicommon.inc.php       2016-12-05 15:47:43 UTC 
(rev 16048)
@@ -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: trunk/eventplanner/inc/class.uivendor_report.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uivendor_report.inc.php        2016-12-05 
08:57:35 UTC (rev 16047)
+++ trunk/eventplanner/inc/class.uivendor_report.inc.php        2016-12-05 
15:47:43 UTC (rev 16048)
@@ -223,7 +223,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 ? 
json_decode($vendor_report->json_representation, true) : array();
                        $custom_fields = 
createObject('booking.custom_fields','eventplanner');
                        $fields = $this->custom_fields;
                        foreach ($fields as $attrib_id => &$attrib)
@@ -259,8 +280,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 +292,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: trunk/eventplanner/inc/model/class.booking.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.booking.inc.php  2016-12-05 08:57:35 UTC 
(rev 16047)
+++ trunk/eventplanner/inc/model/class.booking.inc.php  2016-12-05 15:47:43 UTC 
(rev 16048)
@@ -54,6 +54,7 @@
                        $customer_contact_name,
                        $customer_contact_email,
                        $customer_contact_phone,
+                       $location,
                        $comments,
                        $created,
                        $secret;
@@ -177,6 +178,14 @@
                                        'label' => 'customer contact phone',
                                        'history' => true,
                                        ),
+                               'location' => array(
+                                       'action'=> PHPGW_ACL_ADD | 
PHPGW_ACL_EDIT,
+                                       'type' => 'string',
+                                       'required' => true,
+                                       'query' => true,
+                                       'label' => 'location',
+                                       'history' => true,
+                                       ),
                                'comments' => array(
                                        'action'=> PHPGW_ACL_ADD | 
PHPGW_ACL_EDIT,
                                        'type' => 'string',

Modified: trunk/eventplanner/inc/model/class.vendor_report.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.vendor_report.inc.php    2016-12-05 
08:57:35 UTC (rev 16047)
+++ trunk/eventplanner/inc/model/class.vendor_report.inc.php    2016-12-05 
15:47:43 UTC (rev 16048)
@@ -26,7 +26,6 @@
         * @subpackage vendor_report
         * @version $Id: $
         */
-
        phpgw::import_class('eventplanner.bovendor_report');
 
        include_class('phpgwapi', 'model', 'inc/model/');
@@ -42,11 +41,11 @@
 
                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 )
@@ -69,9 +68,9 @@
                {
                        return array(
                                self::STATUS_REGISTERED => lang('registered'),
-                               self::STATUS_PENDING    => lang('pending'),
+                               self::STATUS_PENDING => lang('pending'),
                                self::STATUS_REJECTED => lang('rejected'),
-                               self::STATUS_APPROVED   => lang('approved')
+                               self::STATUS_APPROVED => lang('approved')
                        );
                }
 
@@ -82,7 +81,7 @@
 
                public function get_custom_fields()
                {
-                       if(! $this->custom_fields)
+                       if (!$this->custom_fields)
                        {
                                $this->set_custom_fields();
                        }
@@ -91,43 +90,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,
+                               ),
+                               'json_representation' => array('action' => 
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
                                        'type' => 'jsonb',
                                        '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 +164,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 +188,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: trunk/eventplanner/js/portico/application.edit.js
===================================================================
--- trunk/eventplanner/js/portico/application.edit.js   2016-12-05 08:57:35 UTC 
(rev 16047)
+++ trunk/eventplanner/js/portico/application.edit.js   2016-12-05 15:47:43 UTC 
(rev 16048)
@@ -93,7 +93,7 @@
                padding: '0 5px 5px 5px',
                width: $("#submitbox").width() + 'px',
                "background - color": '#FFF',
-               display: "block",
+               display: "block"
        });
 
        var offset = $("#submitbox").offset();

Added: trunk/eventplanner/js/portico/booking.edit.js
===================================================================
--- trunk/eventplanner/js/portico/booking.edit.js                               
(rev 0)
+++ trunk/eventplanner/js/portico/booking.edit.js       2016-12-05 15:47:43 UTC 
(rev 16048)
@@ -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: trunk/eventplanner/setup/phpgw_no.lang
===================================================================
--- trunk/eventplanner/setup/phpgw_no.lang      2016-12-05 08:57:35 UTC (rev 
16047)
+++ trunk/eventplanner/setup/phpgw_no.lang      2016-12-05 15:47:43 UTC (rev 
16048)
@@ -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: trunk/eventplanner/setup/tables_current.inc.php
===================================================================
--- trunk/eventplanner/setup/tables_current.inc.php     2016-12-05 08:57:35 UTC 
(rev 16047)
+++ trunk/eventplanner/setup/tables_current.inc.php     2016-12-05 15:47:43 UTC 
(rev 16048)
@@ -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: trunk/eventplanner/templates/base/application.xsl
===================================================================
--- trunk/eventplanner/templates/base/application.xsl   2016-12-05 08:57:35 UTC 
(rev 16047)
+++ trunk/eventplanner/templates/base/application.xsl   2016-12-05 15:47:43 UTC 
(rev 16048)
@@ -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>

Added: trunk/eventplanner/templates/base/application_info.xsl
===================================================================
--- trunk/eventplanner/templates/base/application_info.xsl                      
        (rev 0)
+++ trunk/eventplanner/templates/base/application_info.xsl      2016-12-05 
15:47:43 UTC (rev 16048)
@@ -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: trunk/eventplanner/templates/base/booking.xsl
===================================================================
--- trunk/eventplanner/templates/base/booking.xsl       2016-12-05 08:57:35 UTC 
(rev 16047)
+++ trunk/eventplanner/templates/base/booking.xsl       2016-12-05 15:47:43 UTC 
(rev 16048)
@@ -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: trunk/eventplanner/templates/base/vendor_report.xsl
===================================================================
--- trunk/eventplanner/templates/base/vendor_report.xsl 2016-12-05 08:57:35 UTC 
(rev 16047)
+++ trunk/eventplanner/templates/base/vendor_report.xsl 2016-12-05 15:47:43 UTC 
(rev 16048)
@@ -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: trunk/phpgwapi/inc/class.socommon.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.socommon.inc.php   2016-12-05 08:57:35 UTC (rev 
16047)
+++ trunk/phpgwapi/inc/class.socommon.inc.php   2016-12-05 15:47:43 UTC (rev 
16048)
@@ -569,7 +569,14 @@
                                        && empty($field_info['related'])
                                        && empty($field_info['manytomany']))
                                {
-                                       $value_set[$field] = $object->$field;
+                                       if($field_info['type'] == 'jsonb')
+                                       {
+                                               $value_set[$field] = 
json_encode($object->$field);
+                                       }
+                                       else
+                                       {
+                                               $value_set[$field] = 
$object->$field;
+                                       }
                                }
                        }
                        
@@ -620,7 +627,14 @@
                                        && empty($field_info['related'])
                                        && empty($field_info['manytomany']))
                                {
-                                       $value_set[$field] = $object->$field;
+                                       if($field_info['type'] == 'jsonb')
+                                       {
+                                               $value_set[$field] = 
json_encode($object->$field);
+                                       }
+                                       else
+                                       {
+                                               $value_set[$field] = 
$object->$field;
+                                       }
                                }
                        }
 

Modified: trunk/property/js/portico/project.edit.js
===================================================================
--- trunk/property/js/portico/project.edit.js   2016-12-05 08:57:35 UTC (rev 
16047)
+++ trunk/property/js/portico/project.edit.js   2016-12-05 15:47:43 UTC (rev 
16048)
@@ -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: trunk/property/js/portico/tts.view.js
===================================================================
--- trunk/property/js/portico/tts.view.js       2016-12-05 08:57:35 UTC (rev 
16047)
+++ trunk/property/js/portico/tts.view.js       2016-12-05 15:47:43 UTC (rev 
16048)
@@ -490,7 +490,7 @@
                padding: '0 10px 10px 10px',
                width: width + 'px',
                "background - color": '#FFF',
-               display: "block",
+               display: "block"
        });
 
        var offset = $("#submitbox").offset();

Modified: trunk/property/js/portico/workorder.edit.js
===================================================================
--- trunk/property/js/portico/workorder.edit.js 2016-12-05 08:57:35 UTC (rev 
16047)
+++ trunk/property/js/portico/workorder.edit.js 2016-12-05 15:47:43 UTC (rev 
16048)
@@ -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]