fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16208] more on eventplanner


From: sigurdne
Subject: [Fmsystem-commits] [16208] more on eventplanner
Date: Mon, 30 Jan 2017 10:08:10 -0500 (EST)

Revision: 16208
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16208
Author:   sigurdne
Date:     2017-01-30 10:08:10 -0500 (Mon, 30 Jan 2017)
Log Message:
-----------
more on eventplanner

Modified Paths:
--------------
    trunk/eventplanner/inc/class.uievents.inc.php
    trunk/eventplanner/setup/default_records.inc.php
    trunk/eventplanner/setup/tables_update.inc.php
    trunk/eventplanner/templates/base/customer.xsl
    trunk/eventplanner/templates/base/events.xsl
    trunk/eventplanner/templates/base/report.xsl
    trunk/eventplanner/templates/base/vendor.xsl
    trunk/eventplannerfrontend/inc/class.hook_helper.inc.php
    trunk/eventplannerfrontend/setup/default_records.inc.php
    trunk/eventplannerfrontend/setup/setup.inc.php
    trunk/eventplannerfrontend/setup/tables_update.inc.php
    trunk/eventplannerfrontend/templates/base/application.xsl
    trunk/eventplannerfrontend/templates/base/booking.xsl
    trunk/eventplannerfrontend/templates/base/customer.xsl
    trunk/eventplannerfrontend/templates/base/events.xsl
    trunk/eventplannerfrontend/templates/base/metasettings.xsl
    trunk/eventplannerfrontend/templates/base/vendor.xsl
    trunk/phpgwapi/inc/auth/class.auth_customsso.inc.php
    trunk/phpgwapi/inc/class.acl.inc.php
    trunk/phpgwapi/inc/class.locations.inc.php
    trunk/phpgwapi/inc/class.socommon.inc.php

Added Paths:
-----------
    trunk/eventplanner/inc/model/class.events.inc.php
    trunk/eventplannerfrontend/inc/class.uicustomer_report.inc.php
    trunk/eventplannerfrontend/templates/base/report.xsl

Removed Paths:
-------------
    trunk/eventplannerfrontend/templates/base/vendor_report.xsl

Modified: trunk/eventplanner/inc/class.uievents.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uievents.inc.php       2017-01-30 13:50:48 UTC 
(rev 16207)
+++ trunk/eventplanner/inc/class.uievents.inc.php       2017-01-30 15:08:10 UTC 
(rev 16208)
@@ -29,7 +29,7 @@
        phpgw::import_class('phpgwapi.uicommon');
        phpgw::import_class('phpgwapi.datetime');
 
-       include_class('eventplanner', 'application', 'inc/model/');
+       include_class('eventplanner', 'events', 'inc/model/');
 
        class eventplanner_uievents extends phpgwapi_uicommon
        {
@@ -50,12 +50,12 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' . 
lang('events');
                        $this->bo = createObject('eventplanner.boevents');
                        $this->cats = & $this->bo->cats;
-                       $this->fields = eventplanner_application::get_fields();
+                       $this->fields = eventplanner_events::get_fields();
                        unset($this->fields['modified']);
                        unset($this->fields['created']);
                        unset($this->fields['contact_email']);
                        unset($this->fields['case_officer_name']);
-                       $this->permissions = 
eventplanner_application::get_instance()->get_permission_array();
+                       $this->permissions = 
eventplanner_events::get_instance()->get_permission_array();
                        $this->currentapp = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        self::set_active_menu("{$this->currentapp}::events");
                }
@@ -63,7 +63,7 @@
                private function get_status_options( $selected = 0 )
                {
                        $status_options = array();
-                       $status_list = 
eventplanner_application::get_status_list();
+                       $status_list = eventplanner_events::get_status_list();
 
                        foreach ($status_list as $_key => $_value)
                        {
@@ -270,7 +270,7 @@
                public function query()
                {
                        $params = $this->bo->build_default_read_params();
-                       $params['filters']['status'] = 
eventplanner_application::STATUS_APPROVED;
+                       $params['filters']['status'] = 
eventplanner_events::STATUS_APPROVED;
                        $values = $this->bo->read($params);
                        array_walk($values["results"], array($this, 
"_add_links"), 
"{$this->called_class_arr[0]}.{$this->called_class_arr[1]}.edit");
 

Added: trunk/eventplanner/inc/model/class.events.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.events.inc.php                           
(rev 0)
+++ trunk/eventplanner/inc/model/class.events.inc.php   2017-01-30 15:08:10 UTC 
(rev 16208)
@@ -0,0 +1,54 @@
+<?php
+       /**
+        * phpGroupWare - eventplanner: a part of a Facilities Management 
System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2016 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare is free software; you can redistribute it and/or modify
+        * it under the terms of the GNU General Public License as published by
+        * the Free Software Foundation; either version 2 of the License, or
+        * (at your option) any later version.
+        *
+        * phpGroupWare is distributed in the hope that it will be useful,
+        * but WITHOUT ANY WARRANTY; without even the implied warranty of
+        * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+        * GNU General Public License for more details.
+        *
+        * You should have received a copy of the GNU General Public License
+        * along with phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
+        * @package eventplanner
+        * @subpackage application
+        * @version $Id: $
+        */
+
+       include_class('eventplanner', 'application', 'inc/model/');
+
+       class eventplanner_events extends eventplanner_application
+       {
+
+               const acl_location = '.events';
+
+               protected $field_of_responsibility_name = '.events';
+
+               public function __construct( int $id = null )
+               {
+                       parent::__construct((int)$id);
+                       $this->field_of_responsibility_name = 
self::acl_location;
+               }
+
+               /**
+                * Implementing classes must return an instance of itself.
+                *
+                * @return the class instance.
+                */
+               public static function get_instance()
+               {
+                       return new eventplanner_events();
+               }
+       }

Modified: trunk/eventplanner/setup/default_records.inc.php
===================================================================
--- trunk/eventplanner/setup/default_records.inc.php    2017-01-30 13:50:48 UTC 
(rev 16207)
+++ trunk/eventplanner/setup/default_records.inc.php    2017-01-30 15:08:10 UTC 
(rev 16208)
@@ -17,7 +17,7 @@
        $GLOBALS['phpgw']->locations->add('.', 'Tom', 'eventplanner');
        $GLOBALS['phpgw']->locations->add('.admin', 'admin', 'eventplanner');
        $GLOBALS['phpgw']->locations->add('.application', 'application', 
'eventplanner', $allow_grant = true, $custom_tbl = '', $c_function = true);
-       $GLOBALS['phpgw']->locations->add('.resource', 'resource', 
'eventplanner', $allow_grant = true, $custom_tbl = '', $c_function = true);
+       $GLOBALS['phpgw']->locations->add('.events', 'events', 'eventplanner', 
$allow_grant = true, $custom_tbl = '', $c_function = true);
        $GLOBALS['phpgw']->locations->add('.customer', 'customer', 
'eventplanner', $allow_grant = true, $custom_tbl = '', $c_function = true);
        $GLOBALS['phpgw']->locations->add('.vendor', 'vendor', 'eventplanner', 
$allow_grant = true, $custom_tbl = '', $c_function = true);
        $GLOBALS['phpgw']->locations->add('.booking', 'booking', 
'eventplanner', $allow_grant = true, $custom_tbl = '', $c_function = true);

Modified: trunk/eventplanner/setup/tables_update.inc.php
===================================================================
--- trunk/eventplanner/setup/tables_update.inc.php      2017-01-30 13:50:48 UTC 
(rev 16207)
+++ trunk/eventplanner/setup/tables_update.inc.php      2017-01-30 15:08:10 UTC 
(rev 16208)
@@ -142,6 +142,11 @@
                
$GLOBALS['phpgw_setup']->oProc->AlterColumn('eventplanner_booking_customer_report',
 'owner_id', array(
                        'type' => 'int', 'precision' => 4, 'nullable' => 
false));
 
+
+               $GLOBALS['phpgw']->locations->delete('eventplanner', 
'.resource');
+               $GLOBALS['phpgw']->locations->add('.events', 'events', 
'eventplanner', $allow_grant = true);
+
+
                if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
                {
                        $GLOBALS['setup_info']['eventplanner']['currentver'] = 
'0.9.18.005';

Modified: trunk/eventplanner/templates/base/customer.xsl
===================================================================
--- trunk/eventplanner/templates/base/customer.xsl      2017-01-30 13:50:48 UTC 
(rev 16207)
+++ trunk/eventplanner/templates/base/customer.xsl      2017-01-30 15:08:10 UTC 
(rev 16208)
@@ -24,7 +24,7 @@
                <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', 'please enter a 
valid organization number', 'please enter a valid account number')"/>;
                </script>

Modified: trunk/eventplanner/templates/base/events.xsl
===================================================================
--- trunk/eventplanner/templates/base/events.xsl        2017-01-30 13:50:48 UTC 
(rev 16207)
+++ trunk/eventplanner/templates/base/events.xsl        2017-01-30 15:08:10 UTC 
(rev 16208)
@@ -25,7 +25,7 @@
                <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')"/>;
                </script>

Modified: trunk/eventplanner/templates/base/report.xsl
===================================================================
--- trunk/eventplanner/templates/base/report.xsl        2017-01-30 13:50:48 UTC 
(rev 16207)
+++ trunk/eventplanner/templates/base/report.xsl        2017-01-30 15:08:10 UTC 
(rev 16208)
@@ -25,7 +25,7 @@
                <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')"/>;
                </script>

Modified: trunk/eventplanner/templates/base/vendor.xsl
===================================================================
--- trunk/eventplanner/templates/base/vendor.xsl        2017-01-30 13:50:48 UTC 
(rev 16207)
+++ trunk/eventplanner/templates/base/vendor.xsl        2017-01-30 15:08:10 UTC 
(rev 16208)
@@ -24,7 +24,7 @@
                <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', 'please enter a 
valid organization number', 'please enter a valid account number')"/>;
                </script>

Modified: trunk/eventplannerfrontend/inc/class.hook_helper.inc.php
===================================================================
--- trunk/eventplannerfrontend/inc/class.hook_helper.inc.php    2017-01-30 
13:50:48 UTC (rev 16207)
+++ trunk/eventplannerfrontend/inc/class.hook_helper.inc.php    2017-01-30 
15:08:10 UTC (rev 16208)
@@ -202,6 +202,12 @@
                        $account_id = 
(int)$GLOBALS['hook_values']['account_id'];
                        $headers = getallheaders();
                        $ssn = $headers['uid'];
+
+                       if(!$ssn)
+                       {
+                               return;
+                       }
+
                        $auth   = createObject('phpgwapi.auth');
                        $ssn_hash = $auth->create_hash($ssn);
                        $hash_safe = 
$GLOBALS['phpgw']->db->db_addslashes($ssn_hash); // just to be safe :)

Added: trunk/eventplannerfrontend/inc/class.uicustomer_report.inc.php
===================================================================
--- trunk/eventplannerfrontend/inc/class.uicustomer_report.inc.php              
                (rev 0)
+++ trunk/eventplannerfrontend/inc/class.uicustomer_report.inc.php      
2017-01-30 15:08:10 UTC (rev 16208)
@@ -0,0 +1,22 @@
+<?php
+       phpgw::import_class('eventplanner.uicustomer_report');
+
+       class eventplannerfrontend_uicustomer_report extends 
eventplanner_uicustomer_report
+       {
+
+               public function __construct()
+               {
+                       $GLOBALS['phpgw']->translation->add_app('eventplanner');
+                       parent::__construct();
+               }
+
+               public function query()
+               {
+                       $params = $this->bo->build_default_read_params();
+                       $values = $this->bo->read($params);
+                       array_walk($values["results"], array($this, 
"_add_links"), "eventplannerfrontend.uicustomer_report.edit");
+
+                       return $this->jquery_results($values);
+               }
+
+       }

Modified: trunk/eventplannerfrontend/setup/default_records.inc.php
===================================================================
--- trunk/eventplannerfrontend/setup/default_records.inc.php    2017-01-30 
13:50:48 UTC (rev 16207)
+++ trunk/eventplannerfrontend/setup/default_records.inc.php    2017-01-30 
15:08:10 UTC (rev 16208)
@@ -2,7 +2,7 @@
        $GLOBALS['phpgw']->locations->add('.', 'Tom', 'eventplannerfrontend');
        $GLOBALS['phpgw']->locations->add('.admin', 'admin', 
'eventplannerfrontend');
        $GLOBALS['phpgw']->locations->add('.application', 'application', 
'eventplannerfrontend', $allow_grant = true, $custom_tbl = '', $c_function = 
true);
-       $GLOBALS['phpgw']->locations->add('.resource', 'resource', 
'eventplannerfrontend', $allow_grant = true, $custom_tbl = '', $c_function = 
true);
+       $GLOBALS['phpgw']->locations->add('.events', 'events', 
'eventplannerfrontend', $allow_grant = true, $custom_tbl = '', $c_function = 
true);
        $GLOBALS['phpgw']->locations->add('.customer', 'customer', 
'eventplannerfrontend', $allow_grant = true, $custom_tbl = '', $c_function = 
true);
        $GLOBALS['phpgw']->locations->add('.vendor', 'vendor', 
'eventplannerfrontend', $allow_grant = true, $custom_tbl = '', $c_function = 
true);
        $GLOBALS['phpgw']->locations->add('.booking', 'booking', 
'eventplannerfrontend', $allow_grant = true, $custom_tbl = '', $c_function = 
true);

Modified: trunk/eventplannerfrontend/setup/setup.inc.php
===================================================================
--- trunk/eventplannerfrontend/setup/setup.inc.php      2017-01-30 13:50:48 UTC 
(rev 16207)
+++ trunk/eventplannerfrontend/setup/setup.inc.php      2017-01-30 15:08:10 UTC 
(rev 16208)
@@ -11,7 +11,7 @@
         * @version $Id: setup.inc.php 14728 2016-02-11 22:28:46Z sigurdne $
         */
        $setup_info['eventplannerfrontend']['name'] = 'eventplannerfrontend';
-       $setup_info['eventplannerfrontend']['version'] = '0.1.1';
+       $setup_info['eventplannerfrontend']['version'] = '0.1.2';
        $setup_info['eventplannerfrontend']['app_order'] = 9;
        $setup_info['eventplannerfrontend']['enable'] = 1;
        $setup_info['eventplannerfrontend']['app_group'] = 'office';

Modified: trunk/eventplannerfrontend/setup/tables_update.inc.php
===================================================================
--- trunk/eventplannerfrontend/setup/tables_update.inc.php      2017-01-30 
13:50:48 UTC (rev 16207)
+++ trunk/eventplannerfrontend/setup/tables_update.inc.php      2017-01-30 
15:08:10 UTC (rev 16208)
@@ -1 +1,17 @@
 <?php
+
+       $test[] = '0.1.1';
+
+       function eventplannerfrontend_upgrade0_1_1()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw']->locations->delete('eventplannerfrontend', 
'.resource');
+               $GLOBALS['phpgw']->locations->add('.events', 'events', 
'eventplannerfrontend', $allow_grant = true);
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       
$GLOBALS['setup_info']['eventplannerfrontend']['currentver'] = '0.1.2';
+               }
+               return 
$GLOBALS['setup_info']['eventplannerfrontend']['currentver'];
+       }

Modified: trunk/eventplannerfrontend/templates/base/application.xsl
===================================================================
--- trunk/eventplannerfrontend/templates/base/application.xsl   2017-01-30 
13:50:48 UTC (rev 16207)
+++ trunk/eventplannerfrontend/templates/base/application.xsl   2017-01-30 
15:08:10 UTC (rev 16208)
@@ -18,7 +18,7 @@
 
 <!-- add / edit  -->
 <xsl:template xmlns:php="http://php.net/xsl"; match="edit">
-       <div class="content">
+       <div id="content" class="content">
                <style type="text/css">
                        #floating-box {
                        position: relative;

Modified: trunk/eventplannerfrontend/templates/base/booking.xsl
===================================================================
--- trunk/eventplannerfrontend/templates/base/booking.xsl       2017-01-30 
13:50:48 UTC (rev 16207)
+++ trunk/eventplannerfrontend/templates/base/booking.xsl       2017-01-30 
15:08:10 UTC (rev 16208)
@@ -34,7 +34,7 @@
                <xsl:value-of select="mode"/>
        </xsl:variable>
 
-       <div class="content">
+       <div id="content" class="content">
                <script type="text/javascript">
                        var lang = <xsl:value-of 
select="php:function('js_lang', 'Name or company is required', 'customer')"/>;
                </script>

Modified: trunk/eventplannerfrontend/templates/base/customer.xsl
===================================================================
--- trunk/eventplannerfrontend/templates/base/customer.xsl      2017-01-30 
13:50:48 UTC (rev 16207)
+++ trunk/eventplannerfrontend/templates/base/customer.xsl      2017-01-30 
15:08:10 UTC (rev 16208)
@@ -24,7 +24,7 @@
                <xsl:value-of select="mode"/>
        </xsl:variable>
 
-       <div>
+       <div id="content" class="content">
                <script type="text/javascript">
                        var lang = <xsl:value-of 
select="php:function('js_lang', 'Name or company is required', 'please enter a 
valid organization number', 'please enter a valid account number')"/>;
                </script>

Modified: trunk/eventplannerfrontend/templates/base/events.xsl
===================================================================
--- trunk/eventplannerfrontend/templates/base/events.xsl        2017-01-30 
13:50:48 UTC (rev 16207)
+++ trunk/eventplannerfrontend/templates/base/events.xsl        2017-01-30 
15:08:10 UTC (rev 16208)
@@ -25,7 +25,7 @@
                <xsl:value-of select="mode"/>
        </xsl:variable>
 
-       <div>
+       <div id="content" class="content">
                <script type="text/javascript">
                        var lang = <xsl:value-of 
select="php:function('js_lang', 'Name or company is required')"/>;
                </script>

Modified: trunk/eventplannerfrontend/templates/base/metasettings.xsl
===================================================================
--- trunk/eventplannerfrontend/templates/base/metasettings.xsl  2017-01-30 
13:50:48 UTC (rev 16207)
+++ trunk/eventplannerfrontend/templates/base/metasettings.xsl  2017-01-30 
15:08:10 UTC (rev 16208)
@@ -1,5 +1,5 @@
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
-       <div id="content">
+       <div id="content" class="content">
                <xsl:call-template name="msgbox"/>
                <form action="" method="POST" id='form' class="pure-form 
pure-form-aligned" name="form">
                        <div id="tab-content">

Added: trunk/eventplannerfrontend/templates/base/report.xsl
===================================================================
--- trunk/eventplannerfrontend/templates/base/report.xsl                        
        (rev 0)
+++ trunk/eventplannerfrontend/templates/base/report.xsl        2017-01-30 
15:08:10 UTC (rev 16208)
@@ -0,0 +1,143 @@
+
+<!-- $Id: price_item.xsl 12604 2015-01-15 17:06:11Z nelson224 $ -->
+<xsl:template match="data">
+       <xsl:choose>
+               <xsl:when test="edit">
+                       <xsl:apply-templates select="edit" />
+               </xsl:when>
+               <xsl:when test="view">
+                       <xsl:apply-templates select="view" />
+               </xsl:when>
+       </xsl:choose>
+
+</xsl:template>
+
+<!-- add / edit  -->
+<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"/>
+       </xsl:variable>
+       <xsl:variable name="mode">
+               <xsl:value-of select="mode"/>
+       </xsl:variable>
+
+       <div id="content" class="content">
+               <script type="text/javascript">
+                       var lang = <xsl:value-of 
select="php:function('js_lang', 'Name or company is required')"/>;
+               </script>
+               <form id="form" name="form" method="post" 
action="{$form_action}" class="pure-form pure-form-aligned">
+                       <div id="tab-content">
+                               <xsl:value-of disable-output-escaping="yes" 
select="tabs"/>
+                               <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="report/id > 0">
+                                               <div class="pure-control-group">
+                                                       <label>
+                                                               <xsl:value-of 
select="php:function('lang', 'report')"/>
+                                                       </label>
+                                                       <input type="hidden" 
name="id" value="{report/id}"/>
+                                                       <xsl:value-of 
select="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', '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:apply-templates 
select="attributes_group/attributes"/-->
+                                               <xsl:call-template 
name="attributes_values"/>
+
+                                       </fieldset>
+                               </div>
+                       </div>
+                       <div class="proplist-col">
+                               <input type="submit" class="pure-button 
pure-button-primary" name="save">
+                                       <xsl:attribute name="value">
+                                               <xsl:value-of 
select="php:function('lang', 'save')"/>
+                                       </xsl:attribute>
+                               </input>
+                               <xsl:variable name="cancel_url">
+                                       <xsl:value-of select="cancel_url"/>
+                               </xsl:variable>
+                               <input type="button" class="pure-button 
pure-button-primary" name="cancel" onClick="window.location = '{cancel_url}';">
+                                       <xsl:attribute name="value">
+                                               <xsl:value-of 
select="php:function('lang', 'cancel')"/>
+                                       </xsl:attribute>
+                               </input>
+                       </div>
+               </form>
+       </div>
+</xsl:template>
+
+<xsl:template match="options">
+       <option value="{id}">
+               <xsl:if test="selected != 0">
+                       <xsl:attribute name="selected" value="selected"/>
+               </xsl:if>
+               <xsl:value-of disable-output-escaping="yes" select="name"/>
+       </option>
+</xsl:template>
+
+
+<xsl:template xmlns:php="http://php.net/xsl"; match="view">
+       <div>
+               <form id="form" name="form" method="post" action="" 
class="pure-form pure-form-aligned">
+                       <div id="tab-content">
+                               <xsl:value-of disable-output-escaping="yes" 
select="tabs"/>
+                               <div id="showing">
+
+                               </div>
+                       </div>
+                       <div class="proplist-col">
+                               <xsl:variable name="cancel_url">
+                                       <xsl:value-of select="cancel_url"/>
+                               </xsl:variable>
+                               <input type="button" class="pure-button 
pure-button-primary" name="cancel" value="{lang_cancel}" 
onMouseout="window.status='';return true;" onClick="window.location = 
'{cancel_url}';"/>
+                       </div>
+               </form>
+       </div>
+</xsl:template>

Modified: trunk/eventplannerfrontend/templates/base/vendor.xsl
===================================================================
--- trunk/eventplannerfrontend/templates/base/vendor.xsl        2017-01-30 
13:50:48 UTC (rev 16207)
+++ trunk/eventplannerfrontend/templates/base/vendor.xsl        2017-01-30 
15:08:10 UTC (rev 16208)
@@ -24,7 +24,7 @@
                <xsl:value-of select="mode"/>
        </xsl:variable>
 
-       <div>
+       <div id="content" class="content">
                <script type="text/javascript">
                        var lang = <xsl:value-of 
select="php:function('js_lang', 'Name or company is required', 'please enter a 
valid organization number', 'please enter a valid account number')"/>;
                </script>

Deleted: trunk/eventplannerfrontend/templates/base/vendor_report.xsl
===================================================================
--- trunk/eventplannerfrontend/templates/base/vendor_report.xsl 2017-01-30 
13:50:48 UTC (rev 16207)
+++ trunk/eventplannerfrontend/templates/base/vendor_report.xsl 2017-01-30 
15:08:10 UTC (rev 16208)
@@ -1,143 +0,0 @@
-
-<!-- $Id: price_item.xsl 12604 2015-01-15 17:06:11Z nelson224 $ -->
-<xsl:template match="data">
-       <xsl:choose>
-               <xsl:when test="edit">
-                       <xsl:apply-templates select="edit" />
-               </xsl:when>
-               <xsl:when test="view">
-                       <xsl:apply-templates select="view" />
-               </xsl:when>
-       </xsl:choose>
-
-</xsl:template>
-
-<!-- add / edit  -->
-<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"/>
-       </xsl:variable>
-       <xsl:variable name="mode">
-               <xsl:value-of select="mode"/>
-       </xsl:variable>
-
-       <div>
-               <script type="text/javascript">
-                       var lang = <xsl:value-of 
select="php:function('js_lang', 'Name or company is required')"/>;
-               </script>
-               <form id="form" name="form" method="post" 
action="{$form_action}" class="pure-form pure-form-aligned">
-                       <div id="tab-content">
-                               <xsl:value-of disable-output-escaping="yes" 
select="tabs"/>
-                               <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', '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:apply-templates 
select="attributes_group/attributes"/-->
-                                               <xsl:call-template 
name="attributes_values"/>
-
-                                       </fieldset>
-                               </div>
-                       </div>
-                       <div class="proplist-col">
-                               <input type="submit" class="pure-button 
pure-button-primary" name="save">
-                                       <xsl:attribute name="value">
-                                               <xsl:value-of 
select="php:function('lang', 'save')"/>
-                                       </xsl:attribute>
-                               </input>
-                               <xsl:variable name="cancel_url">
-                                       <xsl:value-of select="cancel_url"/>
-                               </xsl:variable>
-                               <input type="button" class="pure-button 
pure-button-primary" name="cancel" onClick="window.location = '{cancel_url}';">
-                                       <xsl:attribute name="value">
-                                               <xsl:value-of 
select="php:function('lang', 'cancel')"/>
-                                       </xsl:attribute>
-                               </input>
-                       </div>
-               </form>
-       </div>
-</xsl:template>
-
-<xsl:template match="options">
-       <option value="{id}">
-               <xsl:if test="selected != 0">
-                       <xsl:attribute name="selected" value="selected"/>
-               </xsl:if>
-               <xsl:value-of disable-output-escaping="yes" select="name"/>
-       </option>
-</xsl:template>
-
-
-<xsl:template xmlns:php="http://php.net/xsl"; match="view">
-       <div>
-               <form id="form" name="form" method="post" action="" 
class="pure-form pure-form-aligned">
-                       <div id="tab-content">
-                               <xsl:value-of disable-output-escaping="yes" 
select="tabs"/>
-                               <div id="showing">
-
-                               </div>
-                       </div>
-                       <div class="proplist-col">
-                               <xsl:variable name="cancel_url">
-                                       <xsl:value-of select="cancel_url"/>
-                               </xsl:variable>
-                               <input type="button" class="pure-button 
pure-button-primary" name="cancel" value="{lang_cancel}" 
onMouseout="window.status='';return true;" onClick="window.location = 
'{cancel_url}';"/>
-                       </div>
-               </form>
-       </div>
-</xsl:template>

Modified: trunk/phpgwapi/inc/auth/class.auth_customsso.inc.php
===================================================================
--- trunk/phpgwapi/inc/auth/class.auth_customsso.inc.php        2017-01-30 
13:50:48 UTC (rev 16207)
+++ trunk/phpgwapi/inc/auth/class.auth_customsso.inc.php        2017-01-30 
15:08:10 UTC (rev 16208)
@@ -78,6 +78,11 @@
 
                        $ssn = $headers['uid'];
 
+                       if(!$ssn)
+                       {
+                               return;
+                       }
+
                        $ssn_hash = $this->create_hash($ssn);
                        $hash_safe = 
$GLOBALS['phpgw']->db->db_addslashes($ssn_hash); // just to be safe :)
                        $sql = "SELECT account_lid FROM phpgw_accounts"

Modified: trunk/phpgwapi/inc/class.acl.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.acl.inc.php        2017-01-30 13:50:48 UTC (rev 
16207)
+++ trunk/phpgwapi/inc/class.acl.inc.php        2017-01-30 15:08:10 UTC (rev 
16208)
@@ -1106,6 +1106,11 @@
 
                        $ret = !!$this->_db->affected_rows();
 
+                       if(!is_object($GLOBALS['phpgw']->accounts))
+                       {
+                               $GLOBALS['phpgw']->accounts = 
createObject('phpgwapi.accounts');
+                       }
+
                        if ( $ret )
                        {
                                foreach ($locations as $location_id)
@@ -1321,6 +1326,11 @@
                */
                public function get_grants($app = '', $location = '')
                {
+                       if ( !$app )
+                       {
+                               $app = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       }
+
                        $grant_rights = phpgwapi_cache::session_get('phpgwapi', 
"get_grants_{$app}_{$location}");
                        if ( !is_null($grant_rights) )
                        {
@@ -1357,6 +1367,11 @@
                */
                public function get_grants2($app = '', $location = '')
                {
+                       if ( !$app )
+                       {
+                               $app = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       }
+
                        $grant_rights = phpgwapi_cache::session_get('phpgwapi', 
"get_grants2_{$app}_{$location}");
                        if ( !is_null($grant_rights) )
                        {

Modified: trunk/phpgwapi/inc/class.locations.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.locations.inc.php  2017-01-30 13:50:48 UTC (rev 
16207)
+++ trunk/phpgwapi/inc/class.locations.inc.php  2017-01-30 15:08:10 UTC (rev 
16208)
@@ -49,6 +49,8 @@
                */
                protected $_like = 'LIKE';
 
+               protected $global_lock = false;
+
                /**
                * Constructor
                *
@@ -153,7 +155,14 @@
 
                        $tbl = $this->_db->f('c_attrib_table');
 
-                       $this->_db->transaction_begin();
+                       if ( $this->_db->get_transaction() )
+                       {
+                               $this->global_lock = true;
+                       }
+                       else
+                       {
+                               $this->_db->transaction_begin();
+                       }
 
                        // if there is a table and the user wants it dropped we 
drop it
                        if ( $tbl && $drop_table )
@@ -167,6 +176,11 @@
                                $oProc->DropTable($tbl);
                        }
 
+                       if(!is_object($GLOBALS['phpgw']->acl))
+                       {
+                               $GLOBALS['phpgw']->acl = 
createObject('phpgwapi.acl');
+                       }
+
                        $GLOBALS['phpgw']->acl->delete_repository($appname, 
$location);
 
                        $sql = 'DELETE FROM phpgw_locations'
@@ -173,7 +187,10 @@
                                . " WHERE app_id = {$app} AND name = 
'{$location}'";
                        $this->_db->query($sql, __LINE__, __FILE__);
 
-                       $this->_db->transaction_commit();
+                       if ( !$this->global_lock )
+                       {
+                               $this->_db->transaction_commit();
+                       }
 
                        return true;
                }

Modified: trunk/phpgwapi/inc/class.socommon.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.socommon.inc.php   2017-01-30 13:50:48 UTC (rev 
16207)
+++ trunk/phpgwapi/inc/class.socommon.inc.php   2017-01-30 15:08:10 UTC (rev 
16208)
@@ -40,6 +40,9 @@
                protected $fields = array();
                protected static $so;
                protected $table_name;
+               protected $use_acl = false;
+               protected $currentapp;
+               protected $acl;
 
                public function __construct( $table_name, $fields )
                {
@@ -53,7 +56,8 @@
                        $this->fields = $fields;
                        $this->table_name = $table_name;
                        $this->dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
+                       $this->currentapp = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->acl = & $GLOBALS['phpgw']->acl;
                }
 
                /**
@@ -235,7 +239,7 @@
                                }
                        }
 
-                       $base_sql = "SELECT $cols FROM $this->table_name $joins 
WHERE $condition $order ";
+                       $base_sql = "SELECT DISTINCT $cols FROM 
$this->table_name $joins WHERE $condition $order ";
                        if ($results > -1)
                        {
                                $this->db->limit_query($base_sql, $start, 
__LINE__, __FILE__, $results);
@@ -504,9 +508,67 @@
                                        $clauses[] = strtr(join((array)$val, ' 
AND '), array('%%table%%' => $this->table_name));
                                }
                        }
+
+                       $clause = $this->get_acl_condition();
+
+                       if($clause)
+                       {
+                               $clauses[] = $clause;
+                       }
+
                        return join(' AND ', $clauses);
                }
 
+               function get_acl_condition( )
+               {
+                       $clause = '';
+
+                       if($this->use_acl && $this->currentapp && 
$this->acl_location)
+                       {
+                               $paranthesis = false;
+
+                               $grants = 
$this->acl->get_grants2($this->currentapp, $this->acl_location);
+                               $public_user_list = array();
+                               if (is_array($grants['accounts']) && 
$grants['accounts'])
+                               {
+                                       foreach($grants['accounts'] as $user => 
$_right)
+                                       {
+                                               $public_user_list[] = $user;
+                                       }
+                                       unset($user);
+                                       reset($public_user_list);
+                                       $clause .= 
"({$this->table_name}.owner_id IN(" . implode(',', $public_user_list) . ")";
+                                       $paranthesis = true;
+                               }
+
+                               $public_group_list = array();
+                               if (is_array($grants['groups']) && 
$grants['groups'])
+                               {
+                                       foreach($grants['groups'] as $user => 
$_right)
+                                       {
+                                               $public_group_list[] = $user;
+                                       }
+                                       unset($user);
+                                       reset($public_group_list);
+                                       $where = $public_user_list ? 'OR' : 
'AND';
+                                       if(!$paranthesis)
+                                       {
+                                               $clause .='(';
+                                       }
+                                       $clause .= " $where 
phpgw_group_map.group_id IN(" . implode(',', $public_group_list) . ")";
+
+                                       $paranthesis = true;
+                               }
+
+                               if($paranthesis)
+                               {
+                                       $clause .=')';
+                               }
+                       }
+
+                       return $clause;
+               }
+
                protected function build_join_table_alias( $field, array 
$params )
                {
                        return 
"{$params['join']['table']}_{$params['join']['column']}_{$field}";
@@ -545,6 +607,12 @@
                                        $cols[] = "{$value_expression} AS 
{$field}";
                                }
                        }
+
+                       if($this->use_acl && $this->currentapp && 
$this->acl_location)
+                       {
+                               $joins[] = " JOIN phpgw_accounts ON 
({$this->table_name}.owner_id = phpgw_accounts.account_id)";
+                               $joins[] = " JOIN phpgw_group_map ON 
(phpgw_accounts.account_id = phpgw_group_map.account_id)";
+                       }
                        return array($cols, $joins);
                }
 




reply via email to

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