fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16425] more on eventplanner


From: sigurdne
Subject: [Fmsystem-commits] [16425] more on eventplanner
Date: Sun, 12 Mar 2017 12:29:13 -0400 (EDT)

Revision: 16425
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16425
Author:   sigurdne
Date:     2017-03-12 12:29:12 -0400 (Sun, 12 Mar 2017)
Log Message:
-----------
more on eventplanner

Modified Paths:
--------------
    trunk/eventplanner/inc/class.bobooking.inc.php
    trunk/eventplanner/inc/class.sobooking.inc.php
    trunk/eventplanner/inc/class.uiapplication.inc.php
    trunk/eventplanner/inc/class.uicustomer.inc.php
    trunk/eventplanner/inc/class.uievents.inc.php
    trunk/eventplanner/inc/model/class.booking.inc.php
    trunk/eventplanner/setup/phpgw_no.lang
    trunk/eventplanner/templates/base/booking.xsl
    trunk/eventplanner/templates/base/customer.xsl
    trunk/eventplannerfrontend/templates/base/booking.xsl
    trunk/eventplannerfrontend/templates/base/customer.xsl
    trunk/phpgwapi/inc/class.socommon.inc.php

Modified: trunk/eventplanner/inc/class.bobooking.inc.php
===================================================================
--- trunk/eventplanner/inc/class.bobooking.inc.php      2017-03-11 04:41:03 UTC 
(rev 16424)
+++ trunk/eventplanner/inc/class.bobooking.inc.php      2017-03-12 16:29:12 UTC 
(rev 16425)
@@ -118,12 +118,22 @@
 
                                $bookings =  
eventplanner_sobooking::get_instance()->read($params);
 
+                               $existing_booking_ids = array();
+                               foreach ($bookings['results'] as $booking)
+                               {
+                                       $existing_booking_ids[] = 
$booking['id'];
+                               }
+
                                $number_of_active = 
(int)$bookings['total_records'];
                                $limit = (int)$application->num_granted_events;
 
-
+                               $error = false;
                                foreach ($ids as $id)
                                {
+                                       if(in_array($id, $existing_booking_ids) 
)
+                                       {
+                                               continue;
+                                       }
                                        if($limit > $number_of_active)
                                        {
                                                $_ids[] = $id;
@@ -131,11 +141,16 @@
                                        }
                                        else
                                        {
+                                               $error = true;
                                                $message = lang('maximum of 
granted events are reached');
                                                
phpgwapi_cache::message_set($message, 'error');
                                                break;
                                        }
                                }
+                               if($ids && !$_ids && !$error)
+                               {
+                                       return true;
+                               }
                        }
                        else if ($action == 'delete' && $ids)
                        {

Modified: trunk/eventplanner/inc/class.sobooking.inc.php
===================================================================
--- trunk/eventplanner/inc/class.sobooking.inc.php      2017-03-11 04:41:03 UTC 
(rev 16424)
+++ trunk/eventplanner/inc/class.sobooking.inc.php      2017-03-12 16:29:12 UTC 
(rev 16425)
@@ -152,6 +152,16 @@
                                        $where = 'AND';
                                        break;
 
+                               case 'disconnect':
+                                       $sql = "UPDATE eventplanner_booking SET"
+                                       . " customer_id = NULL,"
+                                       . " customer_contact_name = NULL,"
+                                       . " customer_contact_email = NULL,"
+                                       . " customer_contact_phone = NULL,"
+                                       . " location = NULL";
+                                       $where = 'WHERE';
+                                       break;
+
                                default:
                                        throw new Exception("action {$action} 
not supported");
                                        break;

Modified: trunk/eventplanner/inc/class.uiapplication.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uiapplication.inc.php  2017-03-11 04:41:03 UTC 
(rev 16424)
+++ trunk/eventplanner/inc/class.uiapplication.inc.php  2017-03-12 16:29:12 UTC 
(rev 16425)
@@ -346,6 +346,13 @@
                                        'type' => 'custom',
                                        'custom_code' => "
                                                                
onActionsClick('edit');"
+                               ),
+                               array(
+                                       'my_name' => 'disconnect',
+                                       'text' => lang('disconnect'),
+                                       'type' => 'custom',
+                                       'custom_code' => "
+                                                               
onActionsClick('disconnect');"
                                )
                        );
 

Modified: trunk/eventplanner/inc/class.uicustomer.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uicustomer.inc.php     2017-03-11 04:41:03 UTC 
(rev 16424)
+++ trunk/eventplanner/inc/class.uicustomer.inc.php     2017-03-12 16:29:12 UTC 
(rev 16425)
@@ -194,8 +194,11 @@
                        $tabs['first_tab'] = array(
                                'label' => lang('customer'),
                                'link' => '#first_tab',
-                               'function' => "set_tab('first_tab')"
                        );
+                       $tabs['booking'] = array(
+                               'label' => lang('booking'),
+                               'link' => '#booking',
+                       );
 
                        $bocommon = CreateObject('property.bocommon');
 
@@ -224,6 +227,31 @@
                                )
                        );
 
+                       $dates_def = array(
+                               array('key' => 'id', 'label' => lang('id'), 
'sortable' => true, 'resizeable' => true,'formatter' => 
'JqueryPortico.formatLink'),
+                               array('key' => 'from_', 'label' => 
lang('From'), 'sortable' => false, 'resizeable' => true),
+                               array('key' => 'to_', 'label' => lang('To'), 
'sortable' => false, 'resizeable' => true),
+                               array('key' => 'status', 'label' => 
lang('status'), 'sortable' => false, 'resizeable' => true),
+                               array('key' => 'vendor_name', 'label' => 
lang('vendor'), 'sortable' => true, 'resizeable' => true),
+                               array('key' => 'location', 'label' => 
lang('location'), 'sortable' => false, 'resizeable' => true),
+                               array('key' => 'comment', 'label' => 
lang('Note'), 'sortable' => false, 'resizeable' => true),
+                               array('key' => 'application_id', 'hidden' => 
true),
+                       );
+
+                       $datatable_def[] = array(
+                               'container' => 'datatable-container_1',
+                               'requestUrl' => 
json_encode(self::link(array('menuaction' => 
"{$this->currentapp}.uibooking.query_relaxed",
+                                       'filter_customer_id' => $id,
+                                       'filter_active' => 1,
+                                       'phpgw_return_as' => 'json'))),
+                               'ColumnDefs' => $dates_def,
+                               'data' => json_encode(array()),
+                               'config' => array(
+                                       array('disableFilter' => true),
+                                       array('disablePagination' => true)
+                               )
+                       );
+
                        $data = array(
                                'datatable_def' => $datatable_def,
                                'form_action' => self::link(array('menuaction' 
=> "{$this->currentapp}.uicustomer.save")),

Modified: trunk/eventplanner/inc/class.uievents.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uievents.inc.php       2017-03-11 04:41:03 UTC 
(rev 16424)
+++ trunk/eventplanner/inc/class.uievents.inc.php       2017-03-12 16:29:12 UTC 
(rev 16425)
@@ -195,8 +195,7 @@
                        $tabs = array();
                        $tabs['first_tab'] = array(
                                'label' => lang('event'),
-                               'link' => '#first_tab',
-                               'function' => "set_tab('first_tab')"
+                               'link' => '#first_tab'
                        );
 
 
@@ -211,7 +210,6 @@
                                array('key' => 'application_id', 'hidden' => 
true),
                        );
 
-                       
 
                        $datatable_def[] = array(
                                'container' => 'datatable-container_0',
@@ -259,7 +257,7 @@
                        self::render_template_xsl(array('events', 
'application_info', 'datatable_inline'), array('edit' => $data));
                }
 
-               
+
                public function save()
                {
                        //Nothing to do here

Modified: trunk/eventplanner/inc/model/class.booking.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.booking.inc.php  2017-03-11 04:41:03 UTC 
(rev 16424)
+++ trunk/eventplanner/inc/model/class.booking.inc.php  2017-03-12 16:29:12 UTC 
(rev 16425)
@@ -50,6 +50,7 @@
                        $to_,
                        $application_id,
                        $application_name,
+                       $vendor_name,
                        $customer_id,
                        $customer_name,
                        $customer_contact_name,
@@ -57,6 +58,7 @@
                        $customer_contact_phone,
                        $location,
                        $comments,
+                       $comment,
                        $created,
                        $secret;
 
@@ -104,6 +106,7 @@
                                        ),
                                'active' => array('action'=> PHPGW_ACL_ADD | 
PHPGW_ACL_EDIT,
                                        'type' => 'int',
+                                       'public'        => true,
                                        'history'       => true
                                        ),
                                'completed' => array('action'=>  PHPGW_ACL_EDIT,
@@ -146,6 +149,17 @@
                                                'column' => 'title'
                                                )
                                        ),
+                               'vendor_name' => array('action'=>  
PHPGW_ACL_READ,
+                                       'type' => 'string',
+                                       'query' => true,
+                                       'label' => 'vendor',
+                                       'public'        => true,
+                                       'multiple_join' => array(
+                                               'statement' => 'LEFT JOIN 
eventplanner_application ON eventplanner_application.id = 
eventplanner_booking.application_id'
+                                                                               
. ' LEFT JOIN eventplanner_vendor ON eventplanner_application.vendor_id = 
eventplanner_vendor.id',
+                                               'column' => 
'eventplanner_vendor.name'
+                                               )
+                                       ),
                                'customer_id' => array('action'=> PHPGW_ACL_ADD 
| PHPGW_ACL_EDIT,
                                        'type' => 'int',
                                        'label' => 'customer',
@@ -209,6 +223,11 @@
                                                'column' => array('time', 
'author', 'comment', 'type'),
                                                'order' => array('sort' => 
'time', 'dir' => 'ASC')
                                        )),
+                               'comment' => array(
+                                       'action'=> PHPGW_ACL_ADD | 
PHPGW_ACL_EDIT,
+                                       'type' => 'string',
+                                       'related' => true,
+                                       ),
                                'created' => array('action'=> PHPGW_ACL_READ,
                                        'type' => 'date',
                                        'label' => 'created',

Modified: trunk/eventplanner/setup/phpgw_no.lang
===================================================================
--- trunk/eventplanner/setup/phpgw_no.lang      2017-03-11 04:41:03 UTC (rev 
16424)
+++ trunk/eventplanner/setup/phpgw_no.lang      2017-03-12 16:29:12 UTC (rev 
16425)
@@ -111,4 +111,5 @@
 read   eventplanner    no      Les
 permission     eventplanner    no      Rettighet
 maximum number of events       eventplanner    no      Maksimum antall 
arrangement
-number of users        eventplanner    no      Ca. antall brukere
\ No newline at end of file
+number of users        eventplanner    no      Ca. antall brukere
+disconnect     eventplanner    no      Kople fra
\ No newline at end of file

Modified: trunk/eventplanner/templates/base/booking.xsl
===================================================================
--- trunk/eventplanner/templates/base/booking.xsl       2017-03-11 04:41:03 UTC 
(rev 16424)
+++ trunk/eventplanner/templates/base/booking.xsl       2017-03-12 16:29:12 UTC 
(rev 16425)
@@ -336,7 +336,7 @@
                                                                <xsl:value-of 
select="booking/location"/>
                                                        </textarea>
                                                </div>
-                                               <div class="pure-control-group">
+                                               <!--div 
class="pure-control-group">
                                                        <label>
                                                                <xsl:value-of 
select="php:function('lang', 'remark')"/>
                                                        </label>
@@ -343,7 +343,7 @@
                                                        <textarea cols="47" 
rows="7" name="remark">
                                                                <xsl:value-of 
select="booking/remark"/>
                                                        </textarea>
-                                               </div>
+                                               </div-->
                                                <div class="pure-control-group">
                                                        <label>
                                                                <xsl:value-of 
select="php:function('lang', 'comment')"/>

Modified: trunk/eventplanner/templates/base/customer.xsl
===================================================================
--- trunk/eventplanner/templates/base/customer.xsl      2017-03-11 04:41:03 UTC 
(rev 16424)
+++ trunk/eventplanner/templates/base/customer.xsl      2017-03-12 16:29:12 UTC 
(rev 16425)
@@ -348,6 +348,28 @@
                                                </div>
                                        </fieldset>
                                </div>
+                               <div id="booking">
+                                       <fieldset>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'booking')"/>
+                                                       </label>
+                                                       <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="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">

Modified: trunk/eventplannerfrontend/templates/base/booking.xsl
===================================================================
--- trunk/eventplannerfrontend/templates/base/booking.xsl       2017-03-11 
04:41:03 UTC (rev 16424)
+++ trunk/eventplannerfrontend/templates/base/booking.xsl       2017-03-12 
16:29:12 UTC (rev 16425)
@@ -336,7 +336,7 @@
                                                                <xsl:value-of 
select="booking/location"/>
                                                        </textarea>
                                                </div>
-                                               <div class="pure-control-group">
+                                               <!--div 
class="pure-control-group">
                                                        <label>
                                                                <xsl:value-of 
select="php:function('lang', 'remark')"/>
                                                        </label>
@@ -369,7 +369,7 @@
                                                                        
</xsl:if>
                                                                </xsl:for-each>
                                                        </div>
-                                               </div>
+                                               </div-->
                                        </fieldset>
                                </div>
                                <div id="reports">

Modified: trunk/eventplannerfrontend/templates/base/customer.xsl
===================================================================
--- trunk/eventplannerfrontend/templates/base/customer.xsl      2017-03-11 
04:41:03 UTC (rev 16424)
+++ trunk/eventplannerfrontend/templates/base/customer.xsl      2017-03-12 
16:29:12 UTC (rev 16425)
@@ -274,6 +274,29 @@
                                                </div>
                                        </fieldset>
                                </div>
+                               <div id="booking">
+                                       <fieldset>
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'booking')"/>
+                                                       </label>
+                                                       <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="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">

Modified: trunk/phpgwapi/inc/class.socommon.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.socommon.inc.php   2017-03-11 04:41:03 UTC (rev 
16424)
+++ trunk/phpgwapi/inc/class.socommon.inc.php   2017-03-12 16:29:12 UTC (rev 
16425)
@@ -643,8 +643,13 @@
 
                                        $join_table_alias = 
$this->build_join_table_alias($field, $params);
                                        $cols[] = 
"{$join_table_alias}.{$params['join']['column']} AS {$field}";
-                                       $joins[] = "LEFT JOIN 
{$params['join']['table']} AS {$join_table_alias} 
ON({$join_table_alias}.{$params['join']['key']}={$this->table_name}.{$params['join']['fkey']})";
+                                       $joins[] = " LEFT JOIN 
{$params['join']['table']} AS {$join_table_alias} 
ON({$join_table_alias}.{$params['join']['key']}={$this->table_name}.{$params['join']['fkey']})";
                                }
+                               else if (isset($params['multiple_join']) && 
$params['multiple_join'])
+                               {
+                                       $joins[] = " 
{$params['multiple_join']['statement']}";
+                                       $cols[] = 
"{$params['multiple_join']['column']} AS {$field}";
+                               }
                                else
                                {
                                        $value_expression = 
isset($params['expression']) ?




reply via email to

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