fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15960] more on helpdesk


From: sigurdne
Subject: [Fmsystem-commits] [15960] more on helpdesk
Date: Mon, 7 Nov 2016 15:36:20 +0000 (UTC)

Revision: 15960
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15960
Author:   sigurdne
Date:     2016-11-07 15:36:19 +0000 (Mon, 07 Nov 2016)
Log Message:
-----------
more on helpdesk

Modified Paths:
--------------
    trunk/helpdesk/inc/class.botts.inc.php
    trunk/helpdesk/inc/class.sotts.inc.php
    trunk/helpdesk/inc/class.uitts.inc.php
    trunk/helpdesk/inc/hook_settings.inc.php
    trunk/helpdesk/setup/phpgw_no.lang
    trunk/helpdesk/templates/base/tts.xsl
    trunk/property/inc/class.bocommon.inc.php
    trunk/property/inc/class.custom_fields.inc.php
    trunk/property/inc/class.uiresponsible.inc.php
    trunk/property/js/portico/notify.js

Modified: trunk/helpdesk/inc/class.botts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.botts.inc.php      2016-11-07 15:35:57 UTC (rev 
15959)
+++ trunk/helpdesk/inc/class.botts.inc.php      2016-11-07 15:36:19 UTC (rev 
15960)
@@ -338,7 +338,6 @@
                        static $account = array();
                        static $vendor_cache = array();
 
-                       $interlink = CreateObject('property.interlink');
                        $data['start_date'] = 
$this->bocommon->date_to_timestamp($data['start_date']);
                        $data['end_date'] = 
$this->bocommon->date_to_timestamp($data['end_date']);
 

Modified: trunk/helpdesk/inc/class.sotts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.sotts.inc.php      2016-11-07 15:35:57 UTC (rev 
15959)
+++ trunk/helpdesk/inc/class.sotts.inc.php      2016-11-07 15:36:19 UTC (rev 
15960)
@@ -63,6 +63,7 @@
                        $this->account          = 
(int)$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->historylog       = 
CreateObject('phpgwapi.historylog','helpdesk');
                        $this->db                       = & 
$GLOBALS['phpgw']->db;
+                       $this->db2                      = clone($this->db);
                        $this->like             = & $this->db->like;
                        $this->join             = & $this->db->join;
                        $this->left_join        = & $this->db->left_join;
@@ -346,7 +347,7 @@
 
                                if(!$allrows)
                                {
-                                       $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
+                                       $this->db2->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
                                }
                                else
                                {
@@ -358,40 +359,46 @@
                                        {
                                                $_fetch_single = false;
                                        }
-                                       $this->db->query($sql . 
$ordermethod,__LINE__,__FILE__, false, $_fetch_single );
+                                       $this->db2->query($sql . 
$ordermethod,__LINE__,__FILE__, false, $_fetch_single );
                                        unset($_fetch_single);
                                }
 
                                $i = 0;
-                               while ($this->db->next_record())
+                               while ($this->db2->next_record())
                                {
                                        $tickets[]= array
                                        (
-                                               'id'                            
=> (int) $this->db->f('id'),
-                                               'subject'                       
=> $this->db->f('subject',true),
-                                               'user_id'                       
=> $this->db->f('user_id'),
-                                               'assignedto'            => 
$this->db->f('assignedto'),
-                                               'status'                        
=> $this->db->f('status'),
-                                               'priority'                      
=> $this->db->f('priority'),
-                                               'cat_id'                        
=> $this->db->f('cat_id'),
-                                               'group_id'                      
=> $this->db->f('group_id'),
-                                               'entry_date'            => 
$this->db->f('entry_date'),
-                                               'modified_date'         => 
$this->db->f('modified_date'),
-                                               'finnish_date'          => 
$this->db->f('finnish_date'),
-                                               'finnish_date2'         => 
$this->db->f('finnish_date2'),
-                                               'order_id'                      
=> $this->db->f('order_id'),
-                                               'vendor_id'                     
=> $this->db->f('vendor_id'),
-                                               'actual_cost'           => 
$this->db->f('actual_cost'),
-                                               'estimate'                      
=> $this->db->f('budget'),
-                                               'new_ticket'            => 
$this->db->f('view') ? false : true,
-                                               'billable_hours'        => 
$this->db->f('billable_hours'),
+                                               'id'                            
=> (int) $this->db2->f('id'),
+                                               'subject'                       
=> $this->db2->f('subject',true),
+                                               'user_id'                       
=> $this->db2->f('user_id'),
+                                               'assignedto'            => 
$this->db2->f('assignedto'),
+                                               'status'                        
=> $this->db2->f('status'),
+                                               'priority'                      
=> $this->db2->f('priority'),
+                                               'cat_id'                        
=> $this->db2->f('cat_id'),
+                                               'group_id'                      
=> $this->db2->f('group_id'),
+                                               'entry_date'            => 
$this->db2->f('entry_date'),
+                                               'modified_date'         => 
$this->db2->f('modified_date'),
+                                               'finnish_date'          => 
$this->db2->f('finnish_date'),
+                                               'finnish_date2'         => 
$this->db2->f('finnish_date2'),
+                                               'order_id'                      
=> $this->db2->f('order_id'),
+                                               'vendor_id'                     
=> $this->db2->f('vendor_id'),
+                                               'actual_cost'           => 
$this->db2->f('actual_cost'),
+                                               'estimate'                      
=> $this->db2->f('budget'),
+                                               'new_ticket'            => 
$this->db2->f('view') ? false : true,
+                                               'billable_hours'        => 
$this->db2->f('billable_hours'),
                                        );
                                        foreach ($custom_cols as $custom_col)
                                        {
-                                               if ($custom_value = 
$this->db->f($custom_col['column_name'], true))
+                                               if ($custom_value = 
$this->db2->f($custom_col['column_name'], true))
                                                {
-                                                       $custom_value = 
$this->custom->get_translated_value(array('value' => $custom_value,
-                                                               'attrib_id' => 
$custom_col['id'], 'datatype' => $custom_col['datatype']), $location_id);
+                                                       $custom_value = 
$this->custom->get_translated_value(array(
+                                                               'value' => 
$custom_value,
+                                                               'attrib_id' => 
$custom_col['id'],
+                                                               'datatype' => 
$custom_col['datatype'],
+                                                               
'get_single_function' => $custom_col['get_single_function'],
+                                                               
'get_single_function_input' => $custom_col['get_single_function_input']
+                                                               ),
+                                                               $location_id);
                                                }
                                                
$tickets[$i][$custom_col['column_name']] = $custom_value;
                                        }

Modified: trunk/helpdesk/inc/class.uitts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.uitts.inc.php      2016-11-07 15:35:57 UTC (rev 
15959)
+++ trunk/helpdesk/inc/class.uitts.inc.php      2016-11-07 15:36:19 UTC (rev 
15960)
@@ -61,6 +61,7 @@
                protected $_group_candidates = array();
                protected $_show_finnish_date = false;
                protected $_category_acl = false;
+               protected $lang_app_name;
                var $part_of_town_id;
                var $status;
                var $filter;
@@ -138,6 +139,14 @@
                        }
 
                        $this->_category_acl = 
isset($this->bo->config->config_data['acl_at_tts_category']) ? 
$this->bo->config->config_data['acl_at_tts_category'] : false;
+                       if (!empty($this->bo->config->config_data['app_name']))
+                       {
+                               $this->lang_app_name = 
$this->bo->config->config_data['app_name'];
+                       }
+                       else
+                       {
+                               $this->lang_app_name = lang('helpdesk');
+                       }
                }
 
                /**
@@ -454,8 +463,13 @@
 
                        $uicols['name'][] = 'id';
                        $uicols['descr'][] = lang('id');
-                       $uicols['name'][] = 'priority';
-                       $uicols['descr'][] = lang('priority');
+
+                        
if(empty($this->bo->config->config_data['disable_priority']))
+                        {
+                               $uicols['name'][] = 'priority';
+                               $uicols['descr'][] = lang('priority');
+                       }
+
                        $uicols['name'][] = 'subject';
                        $uicols['descr'][] = lang('subject');
                        $uicols['name'][] = 'entry_date';
@@ -666,6 +680,20 @@
                                return $this->query();
                        }
 
+                       if 
(!empty($GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['refreshinterval'])
 && 
(int)$GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['refreshinterval']
 > 0)
+                       {
+                               $refreshinterval = (int) 
$GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['refreshinterval'] * 
1000;
+
+                       $js =<<<JS
+                               setInterval( function () {
+                                       var api = oTable.api();
+                                       api.ajax.reload();
+                       }, {$refreshinterval} );
+JS;
+
+                               $GLOBALS['phpgw']->js->add_code('', $js, true);
+                       }
+
                        phpgwapi_jquery::load_widget('numberformat');
                        self::add_javascript('phpgwapi', 'jquery', 
'editable/jquery.jeditable.js');
                        self::add_javascript('phpgwapi', 'jquery', 
'editable/jquery.dataTables.editable.js');
@@ -677,7 +705,7 @@
                        
$GLOBALS['phpgw']->jqcal->add_listener('filter_start_date');
                        
$GLOBALS['phpgw']->jqcal->add_listener('filter_end_date');
 
-                       $appname = lang('helpdesk');
+                       $appname = $this->lang_app_name;
                        $function_msg = lang('list ticket');
 
                        $data = array(
@@ -886,7 +914,7 @@
                                $data['datatable']['group_buttons'] = false;
                        }
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('helpdesk') . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
$this->lang_app_name . ': ' . $function_msg;
 
                        self::render_template_xsl('datatable_jquery', $data);
                }
@@ -1290,7 +1318,7 @@
                        phpgwapi_jquery::formvalidator_generate(array('date', 
'security','file'));
                        phpgwapi_jquery::load_widget('autocomplete');
                        $this->_insert_custom_js();
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('helpdesk') . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
$this->lang_app_name . ': ' . $function_msg;
                        $GLOBALS['phpgw']->xslttpl->add_file(array('tts', 
'files', 'attributes_form'));
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('add' => $data));
                }
@@ -1941,7 +1969,7 @@
                        //_debug_array($data);die();
 
                        $function_msg = lang('view ticket detail');
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('helpdesk') . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
$this->lang_app_name . ': ' . $function_msg;
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('view' => $data));
                }
 

Modified: trunk/helpdesk/inc/hook_settings.inc.php
===================================================================
--- trunk/helpdesk/inc/hook_settings.inc.php    2016-11-07 15:35:57 UTC (rev 
15959)
+++ trunk/helpdesk/inc/hook_settings.inc.php    2016-11-07 15:36:19 UTC (rev 
15960)
@@ -27,6 +27,8 @@
         * @version $Id: hook_settings.inc.php 14969 2016-05-04 08:19:06Z 
sigurdne $
         */
 
+       create_input_box('Refresh TTS every (seconds)', 'refreshinterval', 'The 
intervall for Helpdesk refresh - cheking for new tickets');
+
        $yes_and_no = array(
                'yes' => 'Yes',
                'no' => 'No'

Modified: trunk/helpdesk/setup/phpgw_no.lang
===================================================================
--- trunk/helpdesk/setup/phpgw_no.lang  2016-11-07 15:35:57 UTC (rev 15959)
+++ trunk/helpdesk/setup/phpgw_no.lang  2016-11-07 15:36:19 UTC (rev 15960)
@@ -15,7 +15,7 @@
 processing...  helpdesk        no      Behandler data
 descr  helpdesk        no      Beskrivelse
 bookmarks      helpdesk        no      Bokmerker
-user   helpdesk        no      Bruker
+user   helpdesk        no      Innmelder
 part of town   helpdesk        no      Bydel
 building part  helpdesk        no      Bygningsdel
 date   helpdesk        no      Dato

Modified: trunk/helpdesk/templates/base/tts.xsl
===================================================================
--- trunk/helpdesk/templates/base/tts.xsl       2016-11-07 15:35:57 UTC (rev 
15959)
+++ trunk/helpdesk/templates/base/tts.xsl       2016-11-07 15:36:19 UTC (rev 
15960)
@@ -221,14 +221,14 @@
                        <input type="hidden" id="save" name="values[save]" 
value=""/>
                        <input type="hidden" id="apply" name="values[apply]" 
value=""/>
                        <input type="hidden" id="cancel" name="values[cancel]" 
value=""/>
-                       <input class="pure-button pure-button-primary" 
type="button" name="save" value="{lang_send}" 
onClick="confirm_session('save');">
+                       <!--input class="pure-button pure-button-primary" 
type="button" name="save" value="{lang_send}" 
onClick="confirm_session('save');">
                                <xsl:attribute name="title">
                                        <xsl:value-of 
select="php:function('lang', 'Save the entry and return to list')"/>
                                </xsl:attribute>
-                       </input>
-                       <input class="pure-button pure-button-primary" 
type="button" name="apply" value="{lang_save}" 
onClick="confirm_session('apply');">
+                       </input-->
+                       <input class="pure-button pure-button-primary" 
type="button" name="apply" value="{lang_send}" 
onClick="confirm_session('apply');">
                                <xsl:attribute name="title">
-                                       <xsl:value-of 
select="php:function('lang', 'save the ticket')"/>
+                                       <xsl:value-of select="lang_send"/>
                                </xsl:attribute>
                        </input>
                        <input class="pure-button pure-button-primary" 
type="button" name="cancel" value="{lang_cancel}" 
onClick="confirm_session('cancel');">

Modified: trunk/property/inc/class.bocommon.inc.php
===================================================================
--- trunk/property/inc/class.bocommon.inc.php   2016-11-07 15:35:57 UTC (rev 
15959)
+++ trunk/property/inc/class.bocommon.inc.php   2016-11-07 15:36:19 UTC (rev 
15960)
@@ -632,7 +632,8 @@
 
                        $contact['field'] = $field;
                        $contact['contact_link'] = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uilookup.addressbook',
-                               'column' => $field));
+                               'column' => $field,
+                               'clear_state' => 1));
                        $contact['lang_contact'] = lang('contact');
                        $contact['lang_select_contact_help'] = lang('click this 
link to select');
                        //_debug_array($contact);

Modified: trunk/property/inc/class.custom_fields.inc.php
===================================================================
--- trunk/property/inc/class.custom_fields.inc.php      2016-11-07 15:35:57 UTC 
(rev 15959)
+++ trunk/property/inc/class.custom_fields.inc.php      2016-11-07 15:36:19 UTC 
(rev 15960)
@@ -169,7 +169,8 @@
 
                                        $insert_record_values[] = 
$attributes['name'];
                                        $lookup_link = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uilookup.addressbook',
-                                               'column' => 
$attributes['name']));
+                                               'column' => $attributes['name'],
+                                               'clear_state'=> 1));
 
                                        $lookup_functions[$m]['name'] = 
'lookup_' . $attributes['name'] . '()';
                                        $lookup_functions[$m]['action'] = 
'TINY.box.show({iframe:"' . $lookup_link . '", 
boxid:"frameless",width:750,height:450,fixed:false,maskid:"darkmask",maskopacity:40,
 mask:true, animate:true, close: true});';
@@ -751,10 +752,16 @@
                                        break;
                                case 'custom2':
                                case 'custom3':
+                                       $ret = $data['value'];
                                        if ($data['value'] && 
$data['get_single_function'])
                                        {
-                                               if 
(!$data['get_single_function_input'])
+
+                                               if 
($data['get_single_function_input'] && 
is_array($data['get_single_function_input']))
                                                {
+                                                       
$data['get_single_function_input'] = 
array_merge(array('id'=>$data['value']),$data['get_single_function_input']);
+                                               }
+                                               else
+                                               {
                                                        
$data['get_single_function_input'] = $data['value'];
                                                }
                                                $_compare_key = 
$this->_get_compare_key($data['get_single_function'], 
$data['get_single_function_input']);

Modified: trunk/property/inc/class.uiresponsible.inc.php
===================================================================
--- trunk/property/inc/class.uiresponsible.inc.php      2016-11-07 15:35:57 UTC 
(rev 15959)
+++ trunk/property/inc/class.uiresponsible.inc.php      2016-11-07 15:36:19 UTC 
(rev 15960)
@@ -1212,7 +1212,7 @@
 
                        $msgbox_data = (isset($receipt) ? 
$GLOBALS['phpgw']->common->msgbox_data($receipt) : '');
 
-                       $lookup_link_contact = 
"menuaction:'property.uilookup.addressbook', column:'contact'";
+                       $lookup_link_contact = 
"menuaction:'property.uilookup.addressbook', column:'contact', clear_state:1";
                        $lookup_link_responsibility = 
"menuaction:'property.uiresponsible.index', location:'{$this->location}', 
lookup:1";
 
                        $lookup_function = "\n"

Modified: trunk/property/js/portico/notify.js
===================================================================
--- trunk/property/js/portico/notify.js 2016-11-07 15:35:57 UTC (rev 15959)
+++ trunk/property/js/portico/notify.js 2016-11-07 15:36:19 UTC (rev 15960)
@@ -20,7 +20,7 @@
                alert(notify_lang_alert);
                return;
        }
-       var oArgs = {menuaction: 'property.uilookup.addressbook', column: 
'notify_contact'};
+       var oArgs = {menuaction: 'property.uilookup.addressbook', column: 
'notify_contact', clear_state:1};
        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});
 };




reply via email to

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