fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16178] more on eventplanner


From: sigurdne
Subject: [Fmsystem-commits] [16178] more on eventplanner
Date: Sat, 21 Jan 2017 11:44:36 -0500 (EST)

Revision: 16178
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16178
Author:   sigurdne
Date:     2017-01-21 11:44:36 -0500 (Sat, 21 Jan 2017)
Log Message:
-----------
more on eventplanner

Modified Paths:
--------------
    trunk/eventplanner/inc/class.menu.inc.php
    trunk/eventplanner/inc/model/class.vendor_report.inc.php
    trunk/eventplanner/setup/phpgw_no.lang
    trunk/eventplanner/templates/base/application_info.xsl
    trunk/eventplanner/templates/base/booking.xsl
    trunk/eventplanner/templates/base/vendor_report.xsl

Added Paths:
-----------
    trunk/eventplanner/inc/class.uievents.inc.php
    trunk/eventplanner/templates/base/events.xsl

Modified: trunk/eventplanner/inc/class.menu.inc.php
===================================================================
--- trunk/eventplanner/inc/class.menu.inc.php   2017-01-21 14:31:12 UTC (rev 
16177)
+++ trunk/eventplanner/inc/class.menu.inc.php   2017-01-21 16:44:36 UTC (rev 
16178)
@@ -157,10 +157,10 @@
                                        'text' => lang('application'),
                                        'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'eventplanner.uiapplication.index'))
                                ),
-                               'resource' => array(
-                                       'text' => lang('resource'),
-                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
"eventplanner.uiresource.index")),
-                                       'image' => array('resource', 'navbar'),
+                               'events' => array(
+                                       'text' => lang('events'),
+                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
"eventplanner.uievents.index")),
+                                       'image' => array('events', 'navbar'),
                                ),
                                'customer' => array(
                                        'text' => lang('customer'),

Added: trunk/eventplanner/inc/class.uievents.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uievents.inc.php                               
(rev 0)
+++ trunk/eventplanner/inc/class.uievents.inc.php       2017-01-21 16:44:36 UTC 
(rev 16178)
@@ -0,0 +1,272 @@
+<?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 events
+        * @version $Id: $
+        */
+       phpgw::import_class('phpgwapi.uicommon');
+       phpgw::import_class('phpgwapi.datetime');
+
+       include_class('eventplanner', 'application', 'inc/model/');
+
+       class eventplanner_uievents extends phpgwapi_uicommon
+       {
+               public $public_functions = array(
+                       'index' => true,
+                       'query' => true,
+                       'edit' => true,
+               );
+
+               protected
+                       $fields,
+                       $permissions;
+
+               public function __construct()
+               {
+                       parent::__construct();
+                       self::set_active_menu('eventplanner::uievents');
+                       $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' . 
lang('events');
+                       $this->bo = createObject('eventplanner.boapplication');
+                       $this->cats = & $this->bo->cats;
+                       $this->fields = eventplanner_application::get_fields();
+                       $this->permissions = 
eventplanner_application::get_instance()->get_permission_array();
+               }
+
+               private function get_status_options( $selected = 0 )
+               {
+                       $status_options = array();
+                       $status_list = 
eventplanner_application::get_status_list();
+
+                       foreach ($status_list as $_key => $_value)
+                       {
+                               $status_options[] = array(
+                                       'id' => $_key,
+                                       'name' => $_value,
+                                       'selected' => $_key == $selected ? 1 : 0
+                               );
+                       }
+                       return $status_options;
+               }
+
+               private function _get_filters()
+               {
+                       $combos = array();
+                       $combos[] = array(
+                               'type' => 'autocomplete',
+                               'name' => 'vendor',
+                               'app' => 'eventplanner',
+                               'ui' => 'vendor',
+                               'label_attr' => 'name',
+                               'text' => lang('vendor') . ':',
+                               'requestGenerator' => 'requestWithVendorFilter'
+                       );
+
+                       $categories = 
$this->cats->formatted_xslt_list(array('format' => 'filter',
+                                       'selected' => $this->cat_id, 'globals' 
=> true, 'use_acl' => $this->_category_acl));
+                       $default_value = array('cat_id' => '', 'name' => 
lang('no category'));
+                       array_unshift($categories['cat_list'], $default_value);
+
+                       $_categories = array();
+                       foreach ($categories['cat_list'] as $_category)
+                       {
+                               $_categories[] = array('id' => 
$_category['cat_id'], 'name' => $_category['name']);
+                       }
+
+                       $combos[] = array('type' => 'filter',
+                               'name' => 'filter_category_id',
+                               'extra' => '',
+                               'text' => lang('category'),
+                               'list' => $_categories
+                       );
+
+                       return $combos;
+
+               }
+               public function index()
+               {
+                       if (empty($this->permissions[PHPGW_ACL_READ]))
+                       {
+                               phpgw::no_access();
+                       }
+
+                       if (phpgw::get_var('phpgw_return_as') == 'json')
+                       {
+                               return $this->query();
+                       }
+
+                       phpgwapi_jquery::load_widget('autocomplete');
+
+                       $function_msg = lang('application');
+
+                       $data = array(
+                               'datatable_name' => $function_msg,
+                               'form' => array(
+                                       'toolbar' => array(
+                                               'item' => array(
+                                               )
+                                       )
+                               ),
+                               'datatable' => array(
+                                       'source' => self::link(array(
+                                               'menuaction' => 
'eventplanner.uievents.index',
+                                               'phpgw_return_as' => 'json'
+                                       )),
+                                       'allrows' => true,
+                                       'editor_action' => '',
+                                       'field' => parent::_get_fields()
+                               )
+                       );
+
+                       $filters = $this->_get_filters();
+
+                       foreach ($filters as $filter)
+                       {
+                               array_unshift($data['form']['toolbar']['item'], 
$filter);
+                       }
+
+                       $parameters = array(
+                               'parameter' => array(
+                                       array(
+                                               'name' => 'id',
+                                               'source' => 'id'
+                                       )
+                               )
+                       );
+
+                       $data['datatable']['actions'][] = array
+                               (
+                               'my_name' => 'view',
+                               'text' => lang('show'),
+                               'action' => 
$GLOBALS['phpgw']->link('/index.php', array
+                                       (
+                                       'menuaction' => 
'eventplanner.uiapplication.view'
+                               )),
+                               'parameters' => json_encode($parameters)
+                       );
+
+                       self::add_javascript('eventplanner', 'portico', 
'application.index.js');
+                       phpgwapi_jquery::load_widget('numberformat');
+
+                       self::render_template_xsl('datatable_jquery', $data);
+               }
+
+
+               public function edit( )
+               {
+                       $active_tab = !empty($values['active_tab']) ? 
$values['active_tab'] : phpgw::get_var('active_tab', 'string', 'REQUEST', 
'first_tab');
+                       $GLOBALS['phpgw_info']['flags']['app_header'] .= '::' . 
lang('show');
+                       if (empty($this->permissions[PHPGW_ACL_READ]))
+                       {
+                               phpgw::no_access();
+                       }
+
+                       $id =  phpgw::get_var('id', 'int');
+                       $application = $this->bo->read_single($id);
+
+                       $tabs = array();
+                       $tabs['first_tab'] = array(
+                               'label' => lang('event'),
+                               'link' => '#first_tab',
+                               'function' => "set_tab('first_tab')"
+                       );
+
+
+                       $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' => 'customer_name', 'label' => 
lang('who'), '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_0',
+                               'requestUrl' => 
json_encode(self::link(array('menuaction' => 'eventplanner.uibooking.query',
+                                       'filter_application_id' => $id,
+                       //              'filter_active' => 1,
+                                       'phpgw_return_as' => 'json'))),
+                               'ColumnDefs' => $dates_def,
+                               'data' => json_encode(array()),
+                               'config' => array(
+                                       array('disableFilter' => true),
+                                       array('disablePagination' => true)
+                               )
+                       );
+
+                       $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;
+                                               }
+                                       }
+                               }
+                       }
+
+                       $category = 
$this->cats->return_single($application->category_id);
+
+                       $data = array(
+                               'datatable_def' => $datatable_def,
+                               'cancel_url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'eventplanner.uievents.index',)),
+                               'application' => $application,
+                               'category_name' => $category[0]['name'],
+                               'status_list' => array('options' => 
$this->get_status_options($application->status)),
+                               'application_type_list' => 
$application_type_list,
+                               'tabs' => 
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
+                               'value_active_tab' => $active_tab
+                       );
+                       self::render_template_xsl(array('events', 
'application_info', 'datatable_inline'), array('edit' => $data));
+               }
+
+               
+               public function save()
+               {
+                       //Nothing to do here
+                       return false;
+               }
+
+
+               public function query()
+               {
+                       $params = $this->bo->build_default_read_params();
+                       $params['filters']['status'] = 
eventplanner_application::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");
+
+                       return $this->jquery_results($values);
+               }
+       }
\ No newline at end of file

Modified: trunk/eventplanner/inc/model/class.vendor_report.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.vendor_report.inc.php    2017-01-21 
14:31:12 UTC (rev 16177)
+++ trunk/eventplanner/inc/model/class.vendor_report.inc.php    2017-01-21 
16:44:36 UTC (rev 16178)
@@ -149,8 +149,6 @@
                        if (!$entity->get_id())
                        {
                                $entity->created = time();
-                               $entity->owner_id = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                               $entity->status = 
eventplanner_vendor_report::STATUS_REGISTERED;
                                $entity->secret = self::generate_secret();
                        }
                }

Modified: trunk/eventplanner/setup/phpgw_no.lang
===================================================================
--- trunk/eventplanner/setup/phpgw_no.lang      2017-01-21 14:31:12 UTC (rev 
16177)
+++ trunk/eventplanner/setup/phpgw_no.lang      2017-01-21 16:44:36 UTC (rev 
16178)
@@ -94,4 +94,7 @@
 maximum of granted events are reached  eventplanner    no      Maksimalt 
antall arrangement er nådd
 did not validate       eventplanner    no      Feil med datasettet
 date is outside the scope      eventplanner    no      Dato ligger utenfor 
tillat tidsrom
-can not delete booking with customer   eventplanner    no      Kan ikke slette 
booking som er koplet med mottakersted
\ No newline at end of file
+can not delete booking with customer   eventplanner    no      Kan ikke slette 
booking som er koplet med mottakersted
+report eventplanner    no      Rapport
+events eventplanner    no      Arrangementer
+event  eventplanner    no      Arrangement
\ No newline at end of file

Modified: trunk/eventplanner/templates/base/application_info.xsl
===================================================================
--- trunk/eventplanner/templates/base/application_info.xsl      2017-01-21 
14:31:12 UTC (rev 16177)
+++ trunk/eventplanner/templates/base/application_info.xsl      2017-01-21 
16:44:36 UTC (rev 16178)
@@ -11,7 +11,7 @@
        </div>
        <div class="pure-control-group">
                <label>
-                       <xsl:value-of select="php:function('lang', 
'application')"/>
+                       <xsl:value-of select="php:function('lang', 'event')"/>
                </label>
                <xsl:value-of select="application/title"/>
        </div>
@@ -44,7 +44,7 @@
        </div>
        <div class="pure-control-group">
                <label>
-                       <xsl:value-of select="php:function('lang', 'type')"/>
+                       <xsl:value-of select="php:function('lang', 'program 
type')"/>
                </label>
                <div class="pure-custom">
                        <table class="pure-table pure-table-bordered" 
border="0" cellspacing="2" cellpadding="2">
@@ -51,10 +51,9 @@
                                <thead>
                                        <tr>
                                                <th>
-                                                       <xsl:value-of 
select="php:function('lang', 'select')"/>
                                                </th>
                                                <th>
-                                                       <xsl:value-of 
select="php:function('lang', 'type')"/>
+                                                       <xsl:value-of 
select="php:function('lang', 'program type')"/>
                                                </th>
                                        </tr>
                                </thead>
@@ -74,6 +73,13 @@
                                </tbody>
                        </table>
                </div>
+               <div class="pure-control-group">
+                       <label>
+                               <xsl:value-of select="php:function('lang', 
'event timespan')"/>
+                       </label>
+                       <xsl:value-of select="application/timespan"/>
+               </div>
+
        </div>
 
 </xsl:template>

Modified: trunk/eventplanner/templates/base/booking.xsl
===================================================================
--- trunk/eventplanner/templates/base/booking.xsl       2017-01-21 14:31:12 UTC 
(rev 16177)
+++ trunk/eventplanner/templates/base/booking.xsl       2017-01-21 16:44:36 UTC 
(rev 16178)
@@ -134,7 +134,7 @@
                                                </div>
                                                <div class="pure-control-group">
                                                        <label>
-                                                               <xsl:value-of 
select="php:function('lang', 'type')"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'program type')"/>
                                                        </label>
                                                        <div 
class="pure-custom">
                                                                <table 
class="pure-table pure-table-bordered" border="0" cellspacing="2" 
cellpadding="2">
@@ -144,7 +144,7 @@
                                                                                
                <xsl:value-of select="php:function('lang', 'select')"/>
                                                                                
        </th>
                                                                                
        <th>
-                                                                               
                <xsl:value-of select="php:function('lang', 'type')"/>
+                                                                               
                <xsl:value-of select="php:function('lang', 'program type')"/>
                                                                                
        </th>
                                                                                
</tr>
                                                                        </thead>
@@ -166,10 +166,6 @@
                                                        </div>
 
                                                </div>
-
-
-
-
                                        </fieldset>
 
                                        <fieldset>

Added: trunk/eventplanner/templates/base/events.xsl
===================================================================
--- trunk/eventplanner/templates/base/events.xsl                                
(rev 0)
+++ trunk/eventplanner/templates/base/events.xsl        2017-01-21 16:44:36 UTC 
(rev 16178)
@@ -0,0 +1,138 @@
+
+<!-- $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">
+                                               <label>
+                                                       <xsl:value-of 
select="php:function('lang', 'category')"/>
+                                               </label>
+                                               <xsl:value-of 
select="category_name"/>
+                                       </div>
+
+                                       
+                                       <div class="pure-control-group">
+                                               <label>
+                                                       <xsl:value-of 
select="php:function('lang', 'event dates')"/>
+                                               </label>
+                                               <div class="pure-custom">
+                                                       <xsl:for-each 
select="datatable_def">
+                                                               <xsl:if 
test="container = 'datatable-container_0'">
+                                                                       
<xsl:call-template name="table_setup">
+                                                                               
<xsl:with-param name="container" select ='container'/>
+                                                                               
<xsl:with-param name="requestUrl" select ='requestUrl'/>
+                                                                               
<xsl:with-param name="ColumnDefs" select ='ColumnDefs'/>
+                                                                               
<xsl:with-param name="tabletools" select ='tabletools'/>
+                                                                               
<xsl:with-param name="data" select ='data'/>
+                                                                               
<xsl:with-param name="config" select ='config'/>
+                                                                       
</xsl:call-template>
+                                                               </xsl:if>
+                                                       </xsl:for-each>
+                                               </div>
+                                       </div>
+
+                               </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/eventplanner/templates/base/vendor_report.xsl
===================================================================
--- trunk/eventplanner/templates/base/vendor_report.xsl 2017-01-21 14:31:12 UTC 
(rev 16177)
+++ trunk/eventplanner/templates/base/vendor_report.xsl 2017-01-21 16:44:36 UTC 
(rev 16178)
@@ -67,12 +67,6 @@
                                                </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', 'event timespan')"/>
-                                               </label>
-                                               <xsl:value-of 
select="application/timespan"/>
-                                       </div>
 
                                        <div class="pure-control-group">
                                                <label>




reply via email to

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