fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15463] property: simple interface


From: sigurdne
Subject: [Fmsystem-commits] [15463] property: simple interface
Date: Mon, 15 Aug 2016 14:25:26 +0000 (UTC)

Revision: 15463
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15463
Author:   sigurdne
Date:     2016-08-15 14:25:25 +0000 (Mon, 15 Aug 2016)
Log Message:
-----------
property: simple interface

Modified Paths:
--------------
    trunk/property/inc/class.uitts.inc.php
    trunk/property/templates/base/tts.xsl

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2016-08-15 07:53:08 UTC (rev 
15462)
+++ trunk/property/inc/class.uitts.inc.php      2016-08-15 14:25:25 UTC (rev 
15463)
@@ -1415,6 +1415,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]',
                                'user_list' => 
$this->bocommon->get_user_list_right2('select', 4, $values['assignedto'], 
$this->acl_location),
+//                             'user_list' => 
$this->_get_user_list($values['assignedto']),
                                'disable_userassign_on_add' => 
isset($this->bo->config->config_data['tts_disable_userassign_on_add']) ? 
$this->bo->config->config_data['tts_disable_userassign_on_add'] : '',
                                'lang_no_group' => lang('No group'),
                                'group_list' => 
$this->bo->get_group_list($values['group_id']),
@@ -1812,7 +1813,7 @@
                        );
 
 
-                       if ($ticket['origin'] || $ticket['target'])
+                       if ($ticket['origin'] || $ticket['target'] || 
$this->simple)
                        {
                                $lookup_type = 'view2';
                                $type_id = count(explode('-', 
$ticket['location_data']['location_code']));
@@ -2759,6 +2760,7 @@
                                'select_user_name' => 'values[assignedto]',
                                'value_assignedto_id' => $ticket['assignedto'],
                                'user_list' => 
$this->bocommon->get_user_list_right2('select', 4, $ticket['assignedto'], 
$this->acl_location),
+//                             'user_list' => 
$this->_get_user_list($ticket['assignedto']),
                                'lang_no_group' => lang('No group'),
                                'group_list' => 
$this->bo->get_group_list($ticket['group_id']),
                                'select_group_name' => 'values[group_id]',
@@ -3463,4 +3465,53 @@
                                phpgwapi_jquery::load_widget('core');
                        }
                }
+
+               private function _get_user_list($selected)
+               {
+                       $_candidates = array();
+                       $_candidates[] = -1;
+                       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, 'property', $_candidates);
+                       $user_list = array();
+                       $selected_found = false;
+                       foreach ($users as $user)
+                       {
+                               $name = (isset($user['account_lastname']) ? 
$user['account_lastname'] . ' ' : '') . $user['account_firstname'];
+                               $user_list[] = array(
+                                       'id' => $user['account_id'],
+                                       'name' => $name,
+                                       'selected' => $user['account_id'] == 
$selected ? 1 : 0
+                               );
+
+                               if (!$selected_found)
+                               {
+                                       $selected_found = $user['account_id'] 
== $selected ? true : false;
+                               }
+                       }
+                       if ($selected && !$selected_found)
+                       {
+                               $user_list[] = array
+                                       (
+                                       'id' => $selected,
+                                       'name' => 
$GLOBALS['phpgw']->accounts->get($selected)->__toString(),
+                                       'selected' => 1
+                               );
+                       }
+                       return $user_list;
+               }
+
        }
\ No newline at end of file

Modified: trunk/property/templates/base/tts.xsl
===================================================================
--- trunk/property/templates/base/tts.xsl       2016-08-15 07:53:08 UTC (rev 
15462)
+++ trunk/property/templates/base/tts.xsl       2016-08-15 14:25:25 UTC (rev 
15463)
@@ -282,7 +282,7 @@
                var base_java_url = <xsl:value-of select="base_java_url"/>;
                var location_item_id = '<xsl:value-of 
select="location_item_id"/>';
 
-       //      var initialSelection = <xsl:value-of select="resources_json"/>;
+               //      var initialSelection = <xsl:value-of 
select="resources_json"/>;
                var lang = <xsl:value-of select="php:function('js_lang',  
'Name', 'Address')"/>
 
 
@@ -1173,77 +1173,80 @@
        </xsl:variable>
        <form name="cancel_form" id="cancel_form" action="{$done_action}" 
method="post"></form>
 
-       <hr noshade="noshade" width="100%" align="center" size="1"/>
-       <div class="proplist-col">
-               <xsl:choose>
-                       <xsl:when test="request_link != ''">
-                               <xsl:variable name="request_link">
-                                       <xsl:value-of select="request_link"/>
-                               </xsl:variable>
-                               <form method="post" action="{$request_link}">
-                                       <xsl:variable 
name="lang_generate_request">
-                                               <xsl:value-of 
select="php:function('lang', 'Generate Request')"/>
+       <xsl:if test="simple !='1'">
+
+               <hr noshade="noshade" width="100%" align="center" size="1"/>
+               <div class="proplist-col">
+                       <xsl:choose>
+                               <xsl:when test="request_link != ''">
+                                       <xsl:variable name="request_link">
+                                               <xsl:value-of 
select="request_link"/>
                                        </xsl:variable>
-                                       <input type="submit" class="pure-button 
pure-button-primary" name="location" value="{$lang_generate_request}">
-                                               <xsl:attribute name="title">
-                                                       <xsl:value-of 
select="php:function('lang', 'click this to generate a request with this 
information')"/>
-                                               </xsl:attribute>
-                                       </input>
-                               </form>
-                       </xsl:when>
-               </xsl:choose>
-               <xsl:choose>
-                       <xsl:when test="order_link != ''">
-                               <xsl:variable name="order_link">
-                                       <xsl:value-of select="order_link"/>
-                               </xsl:variable>
-                               <form method="post" action="{$order_link}">
-                                       <xsl:variable 
name="lang_generate_project">
-                                               <xsl:value-of 
select="php:function('lang', 'generate new project')"/>
+                                       <form method="post" 
action="{$request_link}">
+                                               <xsl:variable 
name="lang_generate_request">
+                                                       <xsl:value-of 
select="php:function('lang', 'Generate Request')"/>
+                                               </xsl:variable>
+                                               <input type="submit" 
class="pure-button pure-button-primary" name="location" 
value="{$lang_generate_request}">
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="php:function('lang', 'click this to generate a request with this 
information')"/>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </form>
+                               </xsl:when>
+                       </xsl:choose>
+                       <xsl:choose>
+                               <xsl:when test="order_link != ''">
+                                       <xsl:variable name="order_link">
+                                               <xsl:value-of 
select="order_link"/>
                                        </xsl:variable>
-                                       <input type="submit" class="pure-button 
pure-button-primary" name="location" value="{$lang_generate_project}">
-                                               <xsl:attribute name="title">
-                                                       <xsl:value-of 
select="php:function('lang', 'click this to generate a project with this 
information')"/>
-                                               </xsl:attribute>
-                                       </input>
-                               </form>
+                                       <form method="post" 
action="{$order_link}">
+                                               <xsl:variable 
name="lang_generate_project">
+                                                       <xsl:value-of 
select="php:function('lang', 'generate new project')"/>
+                                               </xsl:variable>
+                                               <input type="submit" 
class="pure-button pure-button-primary" name="location" 
value="{$lang_generate_project}">
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="php:function('lang', 'click this to generate a project with this 
information')"/>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </form>
 
-                               <xsl:variable name="add_to_project_link">
-                                       <xsl:value-of 
select="add_to_project_link"/>
-                               </xsl:variable>
-                               <form method="post" 
action="{$add_to_project_link}">
-                                       <xsl:variable 
name="lang_add_to_project">
-                                               <xsl:value-of 
select="php:function('lang', 'add to project')"/>
+                                       <xsl:variable 
name="add_to_project_link">
+                                               <xsl:value-of 
select="add_to_project_link"/>
                                        </xsl:variable>
-                                       <input type="submit" class="pure-button 
pure-button-primary" name="location" value="{$lang_add_to_project}">
-                                               <xsl:attribute name="title">
-                                                       <xsl:value-of 
select="php:function('lang', 'click this to add an order to an existing 
project')"/>
-                                               </xsl:attribute>
-                                       </input>
-                               </form>
-                       </xsl:when>
-               </xsl:choose>
-               <xsl:choose>
-                       <xsl:when test="link_entity!=''">
-                               <xsl:for-each select="link_entity">
-                                       <xsl:variable name="link">
-                                               <xsl:value-of select="link"/>
-                                       </xsl:variable>
-                                       <form method="post" action="{$link}">
-                                               <xsl:variable name="name">
-                                                       <xsl:value-of 
select="name"/>
+                                       <form method="post" 
action="{$add_to_project_link}">
+                                               <xsl:variable 
name="lang_add_to_project">
+                                                       <xsl:value-of 
select="php:function('lang', 'add to project')"/>
                                                </xsl:variable>
-                                               <input type="submit" 
class="pure-button pure-button-primary" name="location" value="{$name}" 
onMouseout="window.status='';return true;">
+                                               <input type="submit" 
class="pure-button pure-button-primary" name="location" 
value="{$lang_add_to_project}">
                                                        <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="lang_start_statustext"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'click this to add an order to an existing 
project')"/>
                                                        </xsl:attribute>
                                                </input>
                                        </form>
-                               </xsl:for-each>
-                       </xsl:when>
-               </xsl:choose>
-       </div>
-       <hr noshade="noshade" width="100%" align="center" size="1"/>
+                               </xsl:when>
+                       </xsl:choose>
+                       <xsl:choose>
+                               <xsl:when test="link_entity!=''">
+                                       <xsl:for-each select="link_entity">
+                                               <xsl:variable name="link">
+                                                       <xsl:value-of 
select="link"/>
+                                               </xsl:variable>
+                                               <form method="post" 
action="{$link}">
+                                                       <xsl:variable 
name="name">
+                                                               <xsl:value-of 
select="name"/>
+                                                       </xsl:variable>
+                                                       <input type="submit" 
class="pure-button pure-button-primary" name="location" value="{$name}" 
onMouseout="window.status='';return true;">
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="lang_start_statustext"/>
+                                                               </xsl:attribute>
+                                                       </input>
+                                               </form>
+                                       </xsl:for-each>
+                               </xsl:when>
+                       </xsl:choose>
+               </div>
+               <hr noshade="noshade" width="100%" align="center" size="1"/>
+       </xsl:if>
 </xsl:template>
 
 




reply via email to

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