fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16688] more on helpdesk


From: sigurdne
Subject: [Fmsystem-commits] [16688] more on helpdesk
Date: Thu, 4 May 2017 09:51:23 -0400 (EDT)

Revision: 16688
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16688
Author:   sigurdne
Date:     2017-05-04 09:51:23 -0400 (Thu, 04 May 2017)
Log Message:
-----------
more on helpdesk

Modified Paths:
--------------
    trunk/helpdesk/inc/class.uitts.inc.php
    trunk/helpdesk/js/portico/tts.add.js
    trunk/helpdesk/setup/phpgw_no.lang
    trunk/helpdesk/templates/base/tts.xsl
    trunk/phpgwapi/inc/accounts/class.accounts_.inc.php
    trunk/phpgwapi/inc/accounts/class.accounts_ldap.inc.php
    trunk/phpgwapi/inc/accounts/class.accounts_sql.inc.php
    trunk/phpgwapi/inc/class.db.inc.php

Modified: trunk/helpdesk/inc/class.uitts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.uitts.inc.php      2017-05-04 11:48:39 UTC (rev 
16687)
+++ trunk/helpdesk/inc/class.uitts.inc.php      2017-05-04 13:51:23 UTC (rev 
16688)
@@ -51,7 +51,8 @@
                                'columns'                       => true,
                                'update_data'           => true,
                                'upload_clip'           => true,
-                               'view_image'            => true
+                               'view_image'            => true,
+                               'get_reverse_assignee'=>true
                        );
 
                /**
@@ -179,6 +180,33 @@
                        }
                }
 
+               /**
+                * called as ajax from edit form
+                *
+                * @param string  $query
+                *
+                * @return array
+                */
+               public function get_reverse_assignee()
+               {
+                       $query = phpgw::get_var('query');
+
+                       $filter = array('active' => 1);
+
+                       $account_list = 
$GLOBALS['phpgw']->accounts->get_list('accounts', -1,'ASC', 'account_lastname', 
 $query, false, $filter);
+
+                       $values = array();
+
+                       foreach ($account_list as $account)
+                       {
+                               $values[] = array(
+                                       'id' => $account->id,
+                                       'name' => $account->__toString()
+                               );
+                       }
+                       return array('ResultSet' => array('Result' => $values));
+               }
+
                function get_params()
                {
                        $search = phpgw::get_var('search');

Modified: trunk/helpdesk/js/portico/tts.add.js
===================================================================
--- trunk/helpdesk/js/portico/tts.add.js        2017-05-04 11:48:39 UTC (rev 
16687)
+++ trunk/helpdesk/js/portico/tts.add.js        2017-05-04 13:51:23 UTC (rev 
16688)
@@ -262,4 +262,8 @@
                };
        }
 
-});
\ No newline at end of file
+});
+
+var oArgs = {menuaction: 'helpdesk.uitts.get_reverse_assignee'};
+var strURL = phpGWLink('index.php', oArgs, true);
+JqueryPortico.autocompleteHelper(strURL, 'reverse_name', 'reverse_id', 
'reverse_container');

Modified: trunk/helpdesk/setup/phpgw_no.lang
===================================================================
--- trunk/helpdesk/setup/phpgw_no.lang  2017-05-04 11:48:39 UTC (rev 16687)
+++ trunk/helpdesk/setup/phpgw_no.lang  2017-05-04 13:51:23 UTC (rev 16688)
@@ -199,4 +199,5 @@
 select helpdesk        no      Velg
 modified       helpdesk        no      Endret
 sent   helpdesk        no      Sendt
-generic        helpdesk        no      Generelt
\ No newline at end of file
+generic        helpdesk        no      Generelt
+reverse        helpdesk        no      Revers tildeling
\ No newline at end of file

Modified: trunk/helpdesk/templates/base/tts.xsl
===================================================================
--- trunk/helpdesk/templates/base/tts.xsl       2017-05-04 11:48:39 UTC (rev 
16687)
+++ trunk/helpdesk/templates/base/tts.xsl       2017-05-04 13:51:23 UTC (rev 
16688)
@@ -87,6 +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>
                                                        <!--xsl:call-template 
name="contact_form"/-->
                                                        <!--div 
class="pure-control-group">
                                                                <label>

Modified: trunk/phpgwapi/inc/accounts/class.accounts_.inc.php
===================================================================
--- trunk/phpgwapi/inc/accounts/class.accounts_.inc.php 2017-05-04 11:48:39 UTC 
(rev 16687)
+++ trunk/phpgwapi/inc/accounts/class.accounts_.inc.php 2017-05-04 13:51:23 UTC 
(rev 16688)
@@ -215,7 +215,7 @@
                 * @return array list of accounts that match criteria
                 */
                abstract public function get_list($_type='both', $start = -1, 
$sort = '',
-                                                                               
        $order = '', $query = '', $offset = -1);
+                                                                               
        $order = '', $query = '', $offset = -1, $filter = array());
 
                /**
                 * Convert an account login id to an account id

Modified: trunk/phpgwapi/inc/accounts/class.accounts_ldap.inc.php
===================================================================
--- trunk/phpgwapi/inc/accounts/class.accounts_ldap.inc.php     2017-05-04 
11:48:39 UTC (rev 16687)
+++ trunk/phpgwapi/inc/accounts/class.accounts_ldap.inc.php     2017-05-04 
13:51:23 UTC (rev 16688)
@@ -307,7 +307,7 @@
                * @param integer $offset Offset from start position (-1 == no 
limit)
                * @return array|boolean List with all accounts|groups or false
                */
-               public function get_list($_type = 'both', $start = -1, $sort = 
'', $order = '', $query = '', $offset = -1)
+               public function get_list($_type = 'both', $start = -1, $sort = 
'', $order = '', $query = '', $offset = -1, $filter = array())
                {
                        //echo "accounts_ldap:get_list($_type, $start, $sort, 
$order, $query, $offset) called<br>";
                        $query = strtolower($query);

Modified: trunk/phpgwapi/inc/accounts/class.accounts_sql.inc.php
===================================================================
--- trunk/phpgwapi/inc/accounts/class.accounts_sql.inc.php      2017-05-04 
11:48:39 UTC (rev 16687)
+++ trunk/phpgwapi/inc/accounts/class.accounts_sql.inc.php      2017-05-04 
13:51:23 UTC (rev 16688)
@@ -437,7 +437,7 @@
                 * @return array list of accounts that match criteria
                 */
                public function get_list($_type='both', $start = -1, $sort = '',
-                                                               $order = '', 
$query = '', $offset = -1)
+                                                               $order = '', 
$query = '', $offset = -1, $filter = array())
                {
                        // For XML-RPC
 /*                     if (is_array($_type))
@@ -468,26 +468,30 @@
                        }
 
                        $whereclause = '';
+
+                       $where = 'WHERE';
+
+                       if($filter['active'] == 1)
+                       {
+                               $whereclause = "{$where} account_status = 'A'";
+                               $where = 'AND';
+                       }
+
                        switch($_type)
                        {
                                case 'accounts':
-                                       $whereclause = "WHERE account_type = 
'u'";
+                                       $whereclause .= " {$where} account_type 
= 'u'";
+                                       $where = 'AND';
                                        break;
                                case 'groups':
-                                       $whereclause = "WHERE account_type = 
'g'";
+                                       $whereclause .= " {$where} account_type 
= 'g'";
+                                       $where = 'AND';
                                        break;
                        }
 
                        if ($query)
                        {
-                               if ($whereclause)
-                               {
-                                       $whereclause .= ' AND (';
-                               }
-                               else
-                               {
-                                       $whereclause = ' WHERE (';
-                               }
+                               $whereclause .= " {$where} (";
 
                                if(ctype_digit($query))
                                {

Modified: trunk/phpgwapi/inc/class.db.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.db.inc.php 2017-05-04 11:48:39 UTC (rev 16687)
+++ trunk/phpgwapi/inc/class.db.inc.php 2017-05-04 13:51:23 UTC (rev 16688)
@@ -281,7 +281,7 @@
                */
                function get_offset($sql = '', $offset, $num_rows = 0)
                {
-                       $offset         = (int)$offset;
+                       $offset         =  $offset < 0 ? 0 : (int)$offset;
                        $num_rows       = (int)$num_rows;
 
                        if ($num_rows == 0)




reply via email to

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