fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16701] more on helpdesk


From: sigurdne
Subject: [Fmsystem-commits] [16701] more on helpdesk
Date: Fri, 5 May 2017 10:26:46 -0400 (EDT)

Revision: 16701
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16701
Author:   sigurdne
Date:     2017-05-05 10:26:46 -0400 (Fri, 05 May 2017)
Log Message:
-----------
more on helpdesk

Modified Paths:
--------------
    trunk/eventplanner/inc/model/class.application.inc.php
    trunk/helpdesk/inc/class.botts.inc.php
    trunk/helpdesk/inc/class.sotts.inc.php
    trunk/helpdesk/inc/class.uitts.inc.php
    trunk/helpdesk/inc/custom/default/ticket_LRS_pre_commit_validate.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

Modified: trunk/eventplanner/inc/model/class.application.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.application.inc.php      2017-05-05 
12:38:02 UTC (rev 16700)
+++ trunk/eventplanner/inc/model/class.application.inc.php      2017-05-05 
14:26:46 UTC (rev 16701)
@@ -179,6 +179,7 @@
                                        'type' => 'string',
                                        'label' => 'application description',
                                        'sortable' => false,
+                                       'required' => true,
                                        ),
                                'summary' => array('action'=> PHPGW_ACL_ADD | 
PHPGW_ACL_EDIT,
                                        'type' => 'html',
@@ -234,7 +235,9 @@
                                        ),
                                'types' => array(
                                        'action'=> PHPGW_ACL_ADD | 
PHPGW_ACL_EDIT,
-                                       'type' => 'int', 'required' => true,
+                                       'type' => 'int',
+                                       'label' => 'program type',
+                                       'required' => true,
                                        'manytomany' => array(
                                                'table' => 
'eventplanner_application_type_relation',
                                                'key' => 'application_id',

Modified: trunk/helpdesk/inc/class.botts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.botts.inc.php      2017-05-05 12:38:02 UTC (rev 
16700)
+++ trunk/helpdesk/inc/class.botts.inc.php      2017-05-05 14:26:46 UTC (rev 
16701)
@@ -834,7 +834,18 @@
                                $body .= '<tr><td>'. 
lang('Group').'</td><td>:&nbsp;'. $group_name ."</td></tr>";
                        }
 
-                       $body .= '<tr><td>'. lang('Opened 
By').'</td><td>:&nbsp;'. $ticket['user_name'] ."</td></tr>";
+                       if($ticket['reverse_id'])
+                       {
+                               $user_name = $ticket['reverse_name'];
+                               $body .= '<tr><td>'. lang('Owned 
By').'</td><td>:&nbsp;'. $ticket['user_name'] ."</td></tr>";
+                       }
+                       else
+                       {
+                               $user_name = $ticket['user_name'];
+                       }
+
+                       $body .= '<tr><td>'. lang('Opened 
By').'</td><td>:&nbsp;'. $user_name ."</td></tr>";
+
                        if($timestampclosed)
                        {
                                $body .= '<tr><td>'. lang('Date 
Closed').'</td><td>:&nbsp;'.$timestampclosed."</td></tr>";
@@ -886,9 +897,10 @@
                                        </tr>
                                </thead>
 HTML;
-                               $table_content .= 
"<tr><td>{$i}</td><td>{$entry_date}</td><td>{$ticket['user_name']}</td><td>{$ticket['details']}</td></tr>";
 
+                               $table_content .= 
"<tr><td>{$i}</td><td>{$entry_date}</td><td>{$user_name}</td><td>{$ticket['details']}</td></tr>";
 
+
                                $additional_notes = 
$this->read_additional_notes($id);
 
                                foreach ($additional_notes as $value)
@@ -937,7 +949,8 @@
                        if( 
(isset($GLOBALS['phpgw']->preferences->data['helpdesk']['tts_notify_me'])
                                        && 
($GLOBALS['phpgw']->preferences->data['helpdesk']['tts_notify_me'] == 1)
                                )
-                               || 
($this->config->config_data['ownernotification'] && $ticket['user_id']))
+                               || 
($this->config->config_data['ownernotification'] && $ticket['user_id'])
+                               || $ticket['reverse_id'])
                        {
                                // add owner to recipients
                                $members[$ticket['user_id']] = 
$GLOBALS['phpgw']->accounts->id2name($ticket['user_id']);
@@ -964,7 +977,7 @@
                        foreach($members as $account_id => $account_name)
                        {
                                $prefs = 
$this->bocommon->create_preferences('helpdesk',$account_id);
-                               if(!isset($prefs['tts_notify_me'])      || 
$prefs['tts_notify_me'] == 1)
+                               if(!isset($prefs['tts_notify_me'])      || 
$prefs['tts_notify_me'] == 1 || $ticket['reverse_id'])
                                {
                                        /**
                                         * Calculate email from username

Modified: trunk/helpdesk/inc/class.sotts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.sotts.inc.php      2017-05-05 12:38:02 UTC (rev 
16700)
+++ trunk/helpdesk/inc/class.sotts.inc.php      2017-05-05 14:26:46 UTC (rev 
16701)
@@ -266,7 +266,7 @@
                                {
                                        if($value)
                                        {
-                                               $filtermethod .= "{$or} 
phpgw_helpdesk_tickets.status = '{$value}'";                                    
+                                               $filtermethod .= "{$or} 
phpgw_helpdesk_tickets.status = '{$value}'";
                                                $or = ' OR';
                                        }
                                }
@@ -508,9 +508,10 @@
 
                        if ($this->db->next_record())
                        {
-                               $ticket['assignedto']           = 
$this->db->f('assignedto');
-                               $ticket['user_id']                      = 
$this->db->f('user_id');
-                               $ticket['group_id']                     = 
$this->db->f('group_id');
+                               $ticket['assignedto']           = 
(int)$this->db->f('assignedto');
+                               $ticket['user_id']                      = 
(int)$this->db->f('user_id');
+                               $ticket['group_id']                     = 
(int)$this->db->f('group_id');
+                               $ticket['reverse_id']           = 
(int)$this->db->f('reverse_id');
                                $ticket['status']                       = 
$this->db->f('status');
                                $ticket['cat_id']                       = 
$this->db->f('cat_id');
                                $ticket['subject']                      = 
$this->db->f('subject', true);
@@ -541,9 +542,12 @@
                                $ticket['billable_hours']       = 
$this->db->f('billable_hours');
                                $ticket['modified_date'] = 
$this->db->f('modified_date');
 
-                               $user_id=(int)$this->db->f('user_id');
+                               if($ticket['reverse_id'])
+                               {
+                                       $ticket['reverse_name'] = 
$GLOBALS['phpgw']->accounts->get($ticket['reverse_id'])->__toString();
+                               }
 
-                               $ticket['user_name']    = 
$GLOBALS['phpgw']->accounts->get($user_id)->__toString();
+                               $ticket['user_name']    = 
$GLOBALS['phpgw']->accounts->get($ticket['user_id'])->__toString();
                                if ($ticket['assignedto'] > 0)
                                {
                                        $ticket['assignedto_name']      = 
$GLOBALS['phpgw']->accounts->get($ticket['assignedto'])->__toString();
@@ -554,7 +558,7 @@
                                        $ticket['attributes'] = 
$values['attributes'];
                                        foreach ($ticket['attributes'] as 
&$attr)
                                        {
-                                               $attr['value'] = 
$this->db->f($attr['column_name']);
+                                               $attr['value'] = 
$this->db->f($attr['column_name'], true);
                                        }
                                }
                        }
@@ -594,8 +598,15 @@
                                }
                        }
 
+                       if(!empty($ticket['reverse_id']))
+                       {
+                               $ticket['assignedto'] = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       }
+                       $ticket['user_id']      = !empty($ticket['reverse_id']) 
? $ticket['reverse_id'] : $GLOBALS['phpgw_info']['user']['account_id'];
+
                        $value_set['priority'] = isset($ticket['priority']) ? 
$ticket['priority'] : 0;
-                       $value_set['user_id'] = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $value_set['user_id'] =  $ticket['user_id'];
+                       $value_set['reverse_id'] = 
$GLOBALS['phpgw_info']['user']['account_id']; //The originator for the reversed 
ticket
                        $value_set['assignedto'] = $ticket['assignedto'];
                        $value_set['group_id'] = $ticket['group_id'];
                        $value_set['subject'] = 
$this->db->db_addslashes($ticket['subject']);
@@ -1133,7 +1144,7 @@
                                throw new Exception("phpgwapi_locations::get_id 
('helpdesk', '.ticket') returned 0");
                        }
 
-                       $this->db->transaction_begin(); 
+                       $this->db->transaction_begin();
 
                        $this->db->query("DELETE FROM fm_action_pending WHERE 
location_id = {$location_id} AND item_id = {$id}",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM phpgw_interlink WHERE 
location1_id = {$location_id} AND location1_item_id = {$id}",__LINE__,__FILE__);

Modified: trunk/helpdesk/inc/class.uitts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.uitts.inc.php      2017-05-05 12:38:02 UTC (rev 
16700)
+++ trunk/helpdesk/inc/class.uitts.inc.php      2017-05-05 14:26:46 UTC (rev 
16701)
@@ -1801,7 +1801,7 @@
                                        'value_id' => '', //not from 
historytable
                                        'value_count' => 1,
                                        'value_date' => 
$GLOBALS['phpgw']->common->show_date($ticket['timestamp']),
-                                       'value_user' => $ticket['user_name'],
+                                       'value_user' => $ticket['reverse_id']? 
$ticket['reverse_name'] : $ticket['user_name'],
                                        'value_note' => $ticket['details'],
                                        'value_publish' => 
$ticket['publish_note']
                                )
@@ -1839,7 +1839,8 @@
                                'data' => json_encode($additional_notes),
                                'config' => array(
                                        array('disableFilter' => true),
-                                       array('disablePagination' => true)
+                                       array('disablePagination' => true),
+                                       array('order' => 
json_encode(array(0,'asc')))
                                )
                        );
 
@@ -2030,6 +2031,7 @@
                                'lang_user_statustext' => lang('Select the user 
the selection belongs to. To do not use a user select NO USER'),
                                'select_user_name' => 'values[assignedto]',
                                'value_assignedto_id' => $ticket['assignedto'],
+                               'value_owned_by'                => 
$ticket['user_name'],
                                'user_list' => 
$this->_get_user_list($ticket['assignedto']),
                                'lang_no_group' => lang('No group'),
                                'group_list' => 
$this->bo->get_group_list($ticket['group_id']),

Modified: trunk/helpdesk/inc/custom/default/ticket_LRS_pre_commit_validate.php
===================================================================
--- trunk/helpdesk/inc/custom/default/ticket_LRS_pre_commit_validate.php        
2017-05-05 12:38:02 UTC (rev 16700)
+++ trunk/helpdesk/inc/custom/default/ticket_LRS_pre_commit_validate.php        
2017-05-05 14:26:46 UTC (rev 16701)
@@ -37,6 +37,12 @@
                        {
                                return;
                        }
+
+                       if(!empty($data['reverse_id']))
+                       {
+                               return true;
+                       }
+
                        $org_unit = (int)$values_attribute['1']['value'];
                        $sql = "SELECT arbeidssted FROM fm_org_unit WHERE id = 
{$org_unit}";
                        $this->db->query($sql);

Modified: trunk/helpdesk/setup/phpgw_no.lang
===================================================================
--- trunk/helpdesk/setup/phpgw_no.lang  2017-05-05 12:38:02 UTC (rev 16700)
+++ trunk/helpdesk/setup/phpgw_no.lang  2017-05-05 14:26:46 UTC (rev 16701)
@@ -200,4 +200,5 @@
 modified       helpdesk        no      Endret
 sent   helpdesk        no      Sendt
 generic        helpdesk        no      Generelt
-reverse        helpdesk        no      Revers tildeling
\ No newline at end of file
+reverse        helpdesk        no      Revers tildeling
+owned by       helpdesk        no      Eies av
\ No newline at end of file

Modified: trunk/helpdesk/setup/setup.inc.php
===================================================================
--- trunk/helpdesk/setup/setup.inc.php  2017-05-05 12:38:02 UTC (rev 16700)
+++ trunk/helpdesk/setup/setup.inc.php  2017-05-05 14:26:46 UTC (rev 16701)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['helpdesk']['name']                 = 'helpdesk';
-       $setup_info['helpdesk']['version']              = '0.9.18.004';
+       $setup_info['helpdesk']['version']              = '0.9.18.005';
        $setup_info['helpdesk']['app_order']    = 8;
        $setup_info['helpdesk']['enable']               = 1;
        $setup_info['helpdesk']['app_group']    = 'office';

Modified: trunk/helpdesk/setup/tables_current.inc.php
===================================================================
--- trunk/helpdesk/setup/tables_current.inc.php 2017-05-05 12:38:02 UTC (rev 
16700)
+++ trunk/helpdesk/setup/tables_current.inc.php 2017-05-05 14:26:46 UTC (rev 
16701)
@@ -35,6 +35,7 @@
                                'priority' => array('type' => 'int','precision' 
=> '2','nullable' => False),
                                'user_id' => array('type' => 'int','precision' 
=> '4','nullable' => True),
                                'assignedto' => array('type' => 
'int','precision' => '4','nullable' => True),
+                               'reverse_id' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'subject' => array('type' => 
'varchar','precision' => '255','nullable' => True),
                                'cat_id' => array('type' => 'int','precision' 
=> '4','nullable' => True),
                                'billable_hours' => array('type' => 
'decimal','precision' => '8','scale' => '2','nullable' => True),

Modified: trunk/helpdesk/setup/tables_update.inc.php
===================================================================
--- trunk/helpdesk/setup/tables_update.inc.php  2017-05-05 12:38:02 UTC (rev 
16700)
+++ trunk/helpdesk/setup/tables_update.inc.php  2017-05-05 14:26:46 UTC (rev 
16701)
@@ -216,4 +216,25 @@
                        $GLOBALS['setup_info']['helpdesk']['currentver'] = 
'0.9.18.004';
                        return $GLOBALS['setup_info']['helpdesk']['currentver'];
                }
+       }
+       /**
+       * Update helpdesk version from 0.9.18.004 to 0.9.18.005
+       */
+       $test[] = '0.9.18.004';
+
+       function helpdesk_upgrade0_9_18_004()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_helpdesk_tickets', 
'reverse_id', array(
+                       'type' => 'int',
+                       'precision' => '4',
+                       'nullable' => true
+               ));
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['helpdesk']['currentver'] = 
'0.9.18.005';
+                       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       2017-05-05 12:38:02 UTC (rev 
16700)
+++ trunk/helpdesk/templates/base/tts.xsl       2017-05-05 14:26:46 UTC (rev 
16701)
@@ -87,18 +87,18 @@
                                                                        
<xsl:call-template name="user_id_select"/>
                                                                </div>
                                                        </xsl:if>
-                                               <div class="pure-control-group">
-                                                       <xsl:variable 
name="lang_reverse">
-                                                               <xsl:value-of 
select="php:function('lang', 'reverse')"/>
-                                                       </xsl:variable>
-                                                       <label>
-                                                               <xsl:value-of 
select="$lang_reverse"/>
-                                                       </label>
-                                                       <input type="hidden" 
id="reverse_id" name="values[reverse_id]"  value="{value_reverse_id}"/>
-                                                       <input type="text" 
id="reverse_name" name="values[reverse_name]" value="{value_reverse_name}" 
class="pure-input-1-2">
-                                                       </input>
-                                                       <div 
id="reverse_container"/>
-                                               </div>
+                                                       <div 
class="pure-control-group">
+                                                               <xsl:variable 
name="lang_reverse">
+                                                                       
<xsl:value-of select="php:function('lang', 'reverse')"/>
+                                                               </xsl:variable>
+                                                               <label>
+                                                                       
<xsl:value-of select="$lang_reverse"/>
+                                                               </label>
+                                                               <input 
type="hidden" id="reverse_id" name="values[reverse_id]"  
value="{value_reverse_id}"/>
+                                                               <input 
type="text" id="reverse_name" name="values[reverse_name]" 
value="{value_reverse_name}" class="pure-input-1-2">
+                                                               </input>
+                                                               <div 
id="reverse_container"/>
+                                                       </div>
                                                        <!--xsl:call-template 
name="contact_form"/-->
                                                        <!--div 
class="pure-control-group">
                                                                <label>
@@ -262,9 +262,9 @@
 
                function response_lookup()
                {
-                       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});
+               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});
                }
 
                var my_groups = <xsl:value-of select="my_groups"/>;
@@ -277,10 +277,10 @@
 
                function open_print_view()
                {
-                       var oArgs = {menuaction:'helpdesk.uitts._print',id: 
$('#id').val()};
-                       var strURL = phpGWLink('index.php', oArgs);
-                       var win = window.open(strURL, '_blank');
-                       win.focus();
+               var oArgs = {menuaction:'helpdesk.uitts._print',id: 
$('#id').val()};
+               var strURL = phpGWLink('index.php', oArgs);
+               var win = window.open(strURL, '_blank');
+               win.focus();
                }
 
 
@@ -315,8 +315,13 @@
                                                </input>
                                                <input type="hidden" id="id" 
name="id" value="{id}">
                                                </input>
-
                                        </div>
+                                       <div class="pure-control-group">
+                                               <label>
+                                                       <xsl:value-of 
select="php:function('lang', 'owned by')"/>
+                                               </label>
+                                               <xsl:value-of 
select="value_owned_by"/>
+                                       </div>
                                        <xsl:for-each select="value_origin">
                                                <div class="pure-control-group">
                                                        <label>




reply via email to

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