fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15551] More on helpdesk


From: sigurdne
Subject: [Fmsystem-commits] [15551] More on helpdesk
Date: Wed, 31 Aug 2016 12:32:38 +0000 (UTC)

Revision: 15551
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15551
Author:   sigurdne
Date:     2016-08-31 12:32:37 +0000 (Wed, 31 Aug 2016)
Log Message:
-----------
More on helpdesk

Modified Paths:
--------------
    trunk/helpdesk/inc/class.uitts.inc.php
    trunk/helpdesk/inc/custom/default/ticket_LRS_pre_commit_validate.php
    trunk/helpdesk/inc/hook_settings.inc.php

Modified: trunk/helpdesk/inc/class.uitts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.uitts.inc.php      2016-08-30 17:13:11 UTC (rev 
15550)
+++ trunk/helpdesk/inc/class.uitts.inc.php      2016-08-31 12:32:37 UTC (rev 
15551)
@@ -57,6 +57,7 @@
                 * @var boolean $_simple use simplified interface
                 */
                protected $_simple = false;
+               protected $_group_candidates = array();
                protected $_show_finnish_date = false;
                protected $_category_acl = false;
                var $part_of_town_id;
@@ -105,9 +106,19 @@
                        $this->p_num                            = 
$this->bo->p_num;
                        $user_groups =  
$GLOBALS['phpgw']->accounts->membership($this->account);
                        $simple_group = 
isset($this->bo->config->config_data['fmttssimple_group']) ? 
$this->bo->config->config_data['fmttssimple_group'] : array();
+                       if 
(isset($this->bo->config->config_data['fmtts_assign_group_candidates']) && 
is_array($this->bo->config->config_data['fmtts_assign_group_candidates']))
+                       {
+                               foreach 
($this->bo->config->config_data['fmtts_assign_group_candidates'] as 
$group_candidate)
+                               {
+                                       if ($group_candidate)
+                                       {
+                                               $this->_group_candidates[] = 
$group_candidate;
+                                       }
+                               }
+                       }
                        foreach ( $user_groups as $group => $dummy)
                        {
-                               if ( in_array($group, $simple_group))
+                               if ( in_array($group, $simple_group) && 
!in_array($group, $this->_group_candidates))
                                {
                                        $this->_simple = true;
                                        break;
@@ -1904,22 +1915,11 @@
 
                private function _get_user_list($selected)
                {
-                       if 
(isset($this->bo->config->config_data['fmtts_assign_group_candidates']) && 
is_array($this->bo->config->config_data['fmtts_assign_group_candidates']))
-                       {
-                               foreach 
($this->bo->config->config_data['fmtts_assign_group_candidates'] as 
$group_candidate)
-                               {
-                                       if ($group_candidate)
-                                       {
-                                               $_candidates[] = 
$group_candidate;
-                                       }
-                               }
-                       }
-
                        $xsl_rootdir = PHPGW_SERVER_ROOT . 
"/property/templates/{$GLOBALS['phpgw_info']['server']['template_set']}";
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_select'), $xsl_rootdir);
 
-                       $users = 
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_EDIT, 
$this->acl_location, 'helpdesk', $_candidates);
+                       $users = 
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_EDIT, 
$this->acl_location, 'helpdesk', $this->_group_candidates);
                        $user_list = array();
                        $selected_found = false;
                        foreach ($users as $user)

Modified: trunk/helpdesk/inc/custom/default/ticket_LRS_pre_commit_validate.php
===================================================================
--- trunk/helpdesk/inc/custom/default/ticket_LRS_pre_commit_validate.php        
2016-08-30 17:13:11 UTC (rev 15550)
+++ trunk/helpdesk/inc/custom/default/ticket_LRS_pre_commit_validate.php        
2016-08-31 12:32:37 UTC (rev 15551)
@@ -57,6 +57,22 @@
                        {
                                $data['assignedto'] = 
isset($GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['assigntodefault'])
 ? $GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['assigntodefault'] 
: '';
                        }
+
+                       $current_prefs_user = 
$this->bocommon->create_preferences('helpdesk',$GLOBALS['phpgw_info']['user']['account_id']);
+                       if(empty($current_prefs_user['email']))
+                       {
+                               $GLOBALS['phpgw']->preferences->add('helpdesk', 
'email', "{$GLOBALS['phpgw_info']['user']['account_lid'address@hidden");
+                               
$GLOBALS['phpgw']->preferences->save_repository();
+                       }
+
+                       $assigned_prefs = createObject('phpgwapi.preferences', 
(int)$data['assignedto']);
+                       $assigned_prefs_data = $assigned_prefs->read();
+                       if(empty($assigned_prefs_data['helpdesk']['email']))
+                       {
+                               $assigned_prefs->add('helpdesk', 'email', 
"address@hidden");
+                               $assigned_prefs->save_repository();
+                       }
+
                        return true;
                }
        }

Modified: trunk/helpdesk/inc/hook_settings.inc.php
===================================================================
--- trunk/helpdesk/inc/hook_settings.inc.php    2016-08-30 17:13:11 UTC (rev 
15550)
+++ trunk/helpdesk/inc/hook_settings.inc.php    2016-08-31 12:32:37 UTC (rev 
15551)
@@ -106,3 +106,4 @@
 
        create_input_box('With of textarea', 'textareacols', 'With of textarea 
in forms');
        create_input_box('Height of textarea', 'textarearows', 'Height of 
textarea in forms');
+       create_input_box('Your Email', 'email', 'Insert your email address');




reply via email to

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