fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15962] more on helpdesk


From: sigurdne
Subject: [Fmsystem-commits] [15962] more on helpdesk
Date: Tue, 8 Nov 2016 15:42:28 +0000 (UTC)

Revision: 15962
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15962
Author:   sigurdne
Date:     2016-11-08 15:42:28 +0000 (Tue, 08 Nov 2016)
Log Message:
-----------
more on helpdesk

Modified Paths:
--------------
    trunk/helpdesk/inc/class.menu.inc.php
    trunk/helpdesk/inc/class.sogeneric.inc.php
    trunk/helpdesk/setup/phpgw_no.lang
    trunk/helpdesk/setup/setup.inc.php
    trunk/helpdesk/setup/tables_current.inc.php
    trunk/helpdesk/setup/tables_update.inc.php
    trunk/helpdesk/templates/base/tts.xsl

Added Paths:
-----------
    trunk/helpdesk/inc/class.uilookup.inc.php

Modified: trunk/helpdesk/inc/class.menu.inc.php
===================================================================
--- trunk/helpdesk/inc/class.menu.inc.php       2016-11-08 00:01:38 UTC (rev 
15961)
+++ trunk/helpdesk/inc/class.menu.inc.php       2016-11-08 15:42:28 UTC (rev 
15962)
@@ -137,7 +137,7 @@
 
                        $menus['navigation'] = array();
 
-/*
+
                        if ( $acl->check('.ticket',PHPGW_ACL_READ, 'helpdesk') )
                        {
                                $menus['navigation']['helpdesk'] = array
@@ -147,7 +147,17 @@
                                                'image'         => 
array('helpdesk', 'helpdesk')
                                        );
                        }
-*/
+                       if ( $acl->check('.ticket',PHPGW_ACL_PRIVATE, 
'helpdesk') ) //manage
+                       {
+                               $menus['navigation']['response_template'] = 
array
+                                       (
+                                       'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'helpdesk.uigeneric.index',
+                                               'type' => 'response_template')),
+                                       'text' => lang('response template'),
+                                       'image' => array('helpdesk', 'helpdesk')
+                               );
+                       }
+
                        $GLOBALS['phpgw_info']['flags']['currentapp'] = 
$incoming_app;
                        return $menus;
                }

Modified: trunk/helpdesk/inc/class.sogeneric.inc.php
===================================================================
--- trunk/helpdesk/inc/class.sogeneric.inc.php  2016-11-08 00:01:38 UTC (rev 
15961)
+++ trunk/helpdesk/inc/class.sogeneric.inc.php  2016-11-08 15:42:28 UTC (rev 
15962)
@@ -53,9 +53,7 @@
 
                        switch ($type)
                        {
-//START HELPDESK - APP
                                case 'helpdesk_status':
-                                       // the helpdesk app
                                        $info = array
                                                (
                                                'table' => 
'phpgw_helpdesk_status',
@@ -114,9 +112,48 @@
                                                'menu_selection' => 
'admin::helpdesk::ticket_status'
                                        );
                                        break;
+                               case 'response_template':
+                                       $info = array
+                                               (
+                                               'table' => 
'phpgw_helpdesk_response_template',
+                                               'id' => array('name' => 'id', 
'type' => 'auto'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'content',
+                                                               'descr' => 
lang('content'),
+                                                               'type' => 'text'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'public',
+                                                               'descr' => 
lang('public'),
+                                                               'type' => 
'checkbox'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('response 
template'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.ticket',
+                                               'menu_selection' => 
'helpdesk::response_template',
+                                               'default' => array
+                                                       (
+                                                       'user_id' => 
array('add' => '$this->account'),
+                                                       'entry_date' => 
array('add' => 'time()'),
+                                                       'modified_date' => 
array('edit' => 'time()'),
+                                               ),
+                                               'check_grant' => true
+                                       );
 
-//END HELPDESK - APP
-
+                                       break;
                                default:
                                        $message = lang('ERROR: illegal type 
%1', $type);
                                        phpgwapi_cache::message_set($message, 
'error');

Added: trunk/helpdesk/inc/class.uilookup.inc.php
===================================================================
--- trunk/helpdesk/inc/class.uilookup.inc.php                           (rev 0)
+++ trunk/helpdesk/inc/class.uilookup.inc.php   2016-11-08 15:42:28 UTC (rev 
15962)
@@ -0,0 +1,165 @@
+<?php
+       /**
+        * phpGroupWare - property: a Facilities Management System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2003,2004,2005,2006,2007 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/bbb_/ekstern/
+        * @package property
+        * @subpackage core
+        * @version $Id: class.uilookup.inc.php 15854 2016-10-19 11:39:12Z 
sigurdne $
+        */
+       /**
+        * Description
+        * @package property
+        */
+       phpgw::import_class('phpgwapi.uicommon_jquery');
+       phpgw::import_class('phpgwapi.jquery');
+
+       class helpdesk_uilookup extends phpgwapi_uicommon_jquery
+       {
+
+               var $grants;
+               var $cat_id;
+               var $start;
+               var $query;
+               var $sort;
+               var $order;
+               var $filter;
+               var $part_of_town_id;
+               var $district_id;
+               var $sub;
+               var $currentapp;
+               var $public_functions = array
+                       (
+                       'phpgw_user' => true,
+                       'external_project' => true,
+                       'ecodimb' => true,
+                       'order_template' => true,
+                       'response_template' => true,
+                       'custom' => true
+               );
+
+               function __construct()
+               {
+                       parent::__construct();
+
+                       $GLOBALS['phpgw_info']['flags']['noframework'] = true;
+                       $GLOBALS['phpgw_info']['flags']['headonly'] = true;
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+               }
+
+               public function query()
+               {
+
+               }
+
+
+               function response_template()
+               {
+                       if (phpgw::get_var('phpgw_return_as') == 'json')
+                       {
+                               $search = phpgw::get_var('search');
+                               $order = phpgw::get_var('order');
+                               $draw = phpgw::get_var('draw', 'int');
+                               $columns = phpgw::get_var('columns');
+
+                               $params = array(
+                                       'start' => phpgw::get_var('start', 
'int', 'REQUEST', 0),
+                                       'results' => phpgw::get_var('length', 
'int', 'REQUEST', 0),
+                                       'query' => $search['value'],
+                                       'order' => 
$columns[$order[0]['column']]['data'],
+                                       'sort' => $order[0]['dir'],
+                                       'dir' => $order[0]['dir'],
+                                       'allrows' => phpgw::get_var('length', 
'int') == -1,
+                                       'filter' => ''
+                               );
+
+                               $values = array();
+                               $bo = CreateObject('helpdesk.bogeneric');
+                               $bo->get_location_info('response_template');
+                               $values = $bo->read($params);
+
+                               $result_data = array
+                                       (
+                                       'results' => $values,
+                                       'total_records' => $bo->total_records,
+                                       'draw' => $draw
+                               );
+                               return $this->jquery_results($result_data);
+                       }
+
+                       $action = 'var temp = 
parent.document.getElementById("new_note").value;' . "\r\n";
+                       $action .= 'if(temp){temp = temp + "\n";}' . "\r\n";
+                       $action .= 
'parent.document.getElementById("new_note").value = temp + aData["content"];' . 
"\r\n";
+                       $action .= 
'parent.JqueryPortico.onPopupClose("close");' . "\r";
+
+                       $data = array(
+                               'left_click_action' => $action,
+                               'datatable_name' => '',
+                               'form' => array(
+                                       'toolbar' => array(
+                                               'item' => array()
+                                       )
+                               ),
+                               'datatable' => array(
+                                       'source' => self::link(array(
+                                               'menuaction' => 
'helpdesk.uilookup.response_template',
+                                               'query' => $this->query,
+                                               'filter' => $this->filter,
+                                               'cat_id' => $this->cat_id,
+                                               'type' => 'response_template',
+                                               'phpgw_return_as' => 'json'
+                                       )),
+                                       'allrows' => true,
+                                       'editor_action' => '',
+                                       'field' => array()
+                               )
+                       );
+
+                       $uicols = array(
+                               'input_type' => array('text', 'text', 'text'),
+                               'name' => array('id', 'name', 'content'),
+                               'formatter' => array('', '', ''),
+                               'descr' => array(lang('ID'), lang('name'), 
lang('content'))
+                       );
+
+                       $count_uicols_name = count($uicols['name']);
+
+                       for ($k = 0; $k < $count_uicols_name; $k++)
+                       {
+                               $params = array(
+                                       'key' => $uicols['name'][$k],
+                                       'label' => $uicols['descr'][$k],
+                                       'sortable' => $uicols['sortable'][$k],
+                                       'hidden' => false
+                               );
+
+                               array_push($data['datatable']['field'], 
$params);
+                       }
+
+                       $appname = lang('template');
+                       $function_msg = lang('list response template');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
+
+                       self::render_template_xsl('datatable_jquery', $data);
+               }
+       }
\ No newline at end of file

Modified: trunk/helpdesk/setup/phpgw_no.lang
===================================================================
--- trunk/helpdesk/setup/phpgw_no.lang  2016-11-08 00:01:38 UTC (rev 15961)
+++ trunk/helpdesk/setup/phpgw_no.lang  2016-11-08 15:42:28 UTC (rev 15962)
@@ -176,4 +176,7 @@
 do you really want to change the priority to %1        helpdesk        no      
Vil du virkelig endre prioritet til %1
 please enter a title!  helpdesk        no      Angi et emne
 ticket has been updated        helpdesk        no      Melding er oppdatert
-picture        helpdesk        no      Bilde
\ No newline at end of file
+picture        helpdesk        no      Bilde
+response template      helpdesk        no      Standardtekster
+inbox  helpdesk        no      Innboks
+standard text  helpdesk        no      Standardtekst
\ No newline at end of file

Modified: trunk/helpdesk/setup/setup.inc.php
===================================================================
--- trunk/helpdesk/setup/setup.inc.php  2016-11-08 00:01:38 UTC (rev 15961)
+++ trunk/helpdesk/setup/setup.inc.php  2016-11-08 15:42:28 UTC (rev 15962)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['helpdesk']['name']                 = 'helpdesk';
-       $setup_info['helpdesk']['version']              = '0.9.18.001';
+       $setup_info['helpdesk']['version']              = '0.9.18.002';
        $setup_info['helpdesk']['app_order']    = 8;
        $setup_info['helpdesk']['enable']               = 1;
        $setup_info['helpdesk']['app_group']    = 'office';
@@ -48,6 +48,7 @@
                'phpgw_helpdesk_status',
                'phpgw_helpdesk_tickets',
                'phpgw_helpdesk_views',
+               'phpgw_helpdesk_response_template'
        );
 
        /* The hooks this app includes, needed for hooks registration */

Modified: trunk/helpdesk/setup/tables_current.inc.php
===================================================================
--- trunk/helpdesk/setup/tables_current.inc.php 2016-11-08 00:01:38 UTC (rev 
15961)
+++ trunk/helpdesk/setup/tables_current.inc.php 2016-11-08 15:42:28 UTC (rev 
15962)
@@ -86,5 +86,20 @@
                        'ix' => array(),
                        'fk' => array(),
                        'uc' => array()
-               )
+               ),
+               'phpgw_helpdesk_response_template' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'auto', 'precision' => 
4, 'nullable' => False),
+                               'name' => array('type' => 'varchar', 
'precision' => 255, 'nullable' => False),
+                               'content' => array('type' => 'text', 'nullable' 
=> True),
+                               'public' => array('type' => 'int', 'precision' 
=> 2, 'nullable' => True),
+                               'user_id' => array('type' => 'int', 'precision' 
=> 4, 'nullable' => True),
+                               'entry_date' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                               'modified_date' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
        );

Modified: trunk/helpdesk/setup/tables_update.inc.php
===================================================================
--- trunk/helpdesk/setup/tables_update.inc.php  2016-11-08 00:01:38 UTC (rev 
15961)
+++ trunk/helpdesk/setup/tables_update.inc.php  2016-11-08 15:42:28 UTC (rev 
15962)
@@ -31,3 +31,37 @@
                        return $GLOBALS['setup_info']['helpdesk']['currentver'];
                }
        }
+
+       /**
+       * Update helpdesk version from 0.9.18.001 to 0.9.18.002
+       */
+       $test[] = '0.9.18.001';
+
+       function helpdesk_upgrade0_9_18_001()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'phpgw_helpdesk_response_template', array(
+                               'fd' => array(
+                               'id' => array('type' => 'auto', 'precision' => 
4, 'nullable' => False),
+                               'name' => array('type' => 'varchar', 
'precision' => 255, 'nullable' => False),
+                               'content' => array('type' => 'text', 'nullable' 
=> True),
+                               'public' => array('type' => 'int', 'precision' 
=> 2, 'nullable' => True),
+                               'user_id' => array('type' => 'int', 'precision' 
=> 4, 'nullable' => True),
+                               'entry_date' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                               'modified_date' => array('type' => 'int', 
'precision' => 8, 'nullable' => True, 'default' => 'current_timestamp'),
+                               ),
+                               'pk' => array('id'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['helpdesk']['currentver'] = 
'0.9.18.002';
+                       return $GLOBALS['setup_info']['helpdesk']['currentver'];
+               }
+       }       
\ No newline at end of file

Modified: trunk/helpdesk/templates/base/tts.xsl
===================================================================
--- trunk/helpdesk/templates/base/tts.xsl       2016-11-08 00:01:38 UTC (rev 
15961)
+++ trunk/helpdesk/templates/base/tts.xsl       2016-11-08 15:42:28 UTC (rev 
15962)
@@ -246,50 +246,14 @@
        <script type="text/javascript">
                self.name="first_Window";
                <xsl:value-of select="lookup_functions"/>
-               function generate_order()
-               {
-               Window1=window.open('<xsl:value-of 
select="order_link"/>','','left=50,top=100');
-               }
 
-               function generate_request()
-               {
-               Window1=window.open('<xsl:value-of 
select="request_link"/>','','left=50,top=100');
-               }
-
-               function template_lookup()
-               {
-               var oArgs = 
{menuaction:'property.uilookup.order_template',type:'order_template'};
-               var strURL = phpGWLink('index.php', oArgs);
-               TINY.box.show({iframe:strURL, 
boxid:"frameless",width:750,height:450,fixed:false,maskid:"darkmask",maskopacity:40,
 mask:true, animate:true, close: true});
-               }
-
                function response_lookup()
                {
-               var oArgs = 
{menuaction:'property.uilookup.response_template',type:'response_template'};
-               var strURL = phpGWLink('index.php', oArgs);
-               TINY.box.show({iframe:strURL, 
boxid:"frameless",width:750,height:450,fixed:false,maskid:"darkmask",maskopacity:40,
 mask:true, animate:true, close: true});
+                       var oArgs = 
{menuaction:'helpdesk.uilookup.response_template',type:'response_template'};
+                       var strURL = phpGWLink('index.php', oArgs);
+                       TINY.box.show({iframe:strURL, 
boxid:"frameless",width:750,height:450,fixed:false,maskid:"darkmask",maskopacity:40,
 mask:true, animate:true, close: true});
                }
 
-               function preview_html(id)
-               {
-
-               var on_behalf_of_assigned = 
document.getElementById("on_behalf_of_assigned").checked ? 1 : 0;
-
-               var oArgs = {menuaction:'property.uitts.view',id:id, 
preview_html:true, on_behalf_of_assigned: on_behalf_of_assigned};
-               var strURL = phpGWLink('index.php', oArgs);
-               
Window1=window.open(strURL,'Search',"left=50,top=100,width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");
-
-               }
-
-               function preview_pdf(id)
-               {
-               var on_behalf_of_assigned = 
document.getElementById("on_behalf_of_assigned").checked ? 1 : 0;
-
-               var oArgs = {menuaction:'property.uitts.view',id:id, 
preview_pdf:true, on_behalf_of_assigned: on_behalf_of_assigned};
-               var strURL = phpGWLink('index.php', oArgs);
-               
Window1=window.open(strURL,'Search',"left=50,top=100,width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");
-               }
-
                var my_groups = <xsl:value-of select="my_groups"/>;
 
                var base_java_url = <xsl:value-of select="base_java_url"/>;
@@ -521,10 +485,24 @@
                                        </xsl:choose>
                                        <xsl:apply-templates 
select="custom_attributes/attributes"/>
                                        <div class="pure-control-group">
-                                               <label>
-                                                       <xsl:value-of 
select="php:function('lang', 'new note')"/>
-                                               </label>
-                                               <textarea cols="{textareacols}" 
rows="{textarearows}" name="values[note]">
+                                               <xsl:choose>
+                                                       <xsl:when test="simple 
!='1'">
+                                                               <label>
+                                                                       <a 
href="javascript:response_lookup()">
+                                                                               
<xsl:attribute name="title">
+                                                                               
        <xsl:value-of select="php:function('lang', 'standard text')"/>
+                                                                               
</xsl:attribute>
+                                                                               
<xsl:value-of select="php:function('lang', 'standard text')"/>
+                                                                       </a>
+                                                               </label>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <label>
+                                                                       
<xsl:value-of select="php:function('lang', 'new note')"/>
+                                                               </label>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
+                                               <textarea cols="{textareacols}" 
rows="{textarearows}" id="new_note" name="values[note]">
                                                        <xsl:attribute 
name="title">
                                                                <xsl:value-of 
select="php:function('lang', 'add new comments')"/>
                                                        </xsl:attribute>




reply via email to

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