fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15605] Property: tickets


From: sigurdne
Subject: [Fmsystem-commits] [15605] Property: tickets
Date: Wed, 7 Sep 2016 13:14:31 +0000 (UTC)

Revision: 15605
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15605
Author:   sigurdne
Date:     2016-09-07 13:14:31 +0000 (Wed, 07 Sep 2016)
Log Message:
-----------
Property: tickets

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

Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php      2016-09-07 12:44:56 UTC (rev 
15604)
+++ trunk/property/inc/class.botts.inc.php      2016-09-07 13:14:31 UTC (rev 
15605)
@@ -56,6 +56,7 @@
                public $sum_difference = 0;
                public $show_finnish_date = false;
                public $simple = false;
+               public $group_candidates = array(-1);
                protected $custom_filters = array();
                var $public_functions = array
                        (
@@ -86,6 +87,29 @@
                        $this->config->read();
 
 
+                       $user_groups =  
$GLOBALS['phpgw']->accounts->membership($this->account);
+                       $simple_group = 
isset($this->config->config_data['fmttssimple_group']) ? 
$this->config->config_data['fmttssimple_group'] : array();
+
+                       if 
(isset($this->config->config_data['fmtts_assign_group_candidates']) && 
is_array($this->config->config_data['fmtts_assign_group_candidates']))
+                       {
+                               foreach 
($this->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) && 
!in_array($group, $this->group_candidates))
+                               {
+                                       $this->simple = true;
+                                       break;
+                               }
+                       }
+
+                       reset($user_groups);
                        $user_groups = 
$GLOBALS['phpgw']->accounts->membership($this->account);
                        $simple_group = 
isset($this->config->config_data['fmttssimple_group']) ? 
$this->config->config_data['fmttssimple_group'] : array();
                        foreach ($user_groups as $group => $dummy)

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2016-09-07 12:44:56 UTC (rev 
15604)
+++ trunk/property/inc/class.uitts.inc.php      2016-09-07 13:14:31 UTC (rev 
15605)
@@ -63,6 +63,7 @@
                 * @var boolean $_simple use simplified interface
                 */
                protected $simple = false;
+               protected $group_candidates = array(-1);
                protected $_show_finnish_date = false;
                protected $_category_acl = false;
                var $part_of_town_id;
@@ -112,6 +113,7 @@
                        $this->location_code = $this->bo->location_code;
                        $this->p_num = $this->bo->p_num;
                        $this->simple = $this->bo->simple;
+                       $this->group_candidates = $this->bo->group_candidates;
                        $this->show_finnish_date = $this->bo->show_finnish_date;
 
                        $this->_category_acl = 
isset($this->bo->config->config_data['acl_at_tts_category']) ? 
$this->bo->config->config_data['acl_at_tts_category'] : false;
@@ -729,9 +731,8 @@
                                        'list' => $values_combo_box[2]
                                );
 
-                               $filter_tts_assigned_to_me = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_assigned_to_me'];
+                               $values_combo_box[4] = 
$this->_get_user_list($this->user_id);
 
-                               $values_combo_box[4] = 
$this->bocommon->get_user_list_right2('filter', PHPGW_ACL_EDIT, $this->user_id, 
$this->acl_location);
                                array_unshift($values_combo_box[4], array(
                                        'id' => -1 * 
$GLOBALS['phpgw_info']['user']['account_id'],
                                        'name' => lang('my assigned tickets'),
@@ -2764,8 +2765,25 @@
                        $unspsc_code = $ticket['unspsc_code'] ? 
$ticket['unspsc_code'] : 
$GLOBALS['phpgw_info']['user']['preferences']['property']['unspsc_code'];
                        $enable_order_service_id = 
isset($config->config_data['enable_order_service_id']) && 
$config->config_data['enable_order_service_id'] ? true : false;
                        $enable_unspsc = 
isset($config->config_data['enable_unspsc']) && 
$config->config_data['enable_unspsc'] ? true : false;
+
+                       $relation_type_list = array(
+                               array(
+                                       'id'    => 'property.uiproject.index',
+                                       'name'  => lang('project')
+                               ),
+                               array(
+                                       'id'    => 'property.uirequest.index',
+                                       'name'  => lang('request')
+                               ),
+                               array(
+                                       'id'    => 'property.uilookup.entity',
+                                       'name'  => 'Everything else'
+                               ),
+                       );
+
                        $data = array(
                                'datatable_def' => $datatable_def,
+                               'relation_type_list' => array('options' => 
$relation_type_list),
                                'my_groups' => json_encode($my_groups),
                                'custom_attributes' => array('attributes' => 
$ticket['attributes']),
                                'lookup_functions' => 
isset($ticket['lookup_functions']) ? $ticket['lookup_functions'] : '',
@@ -2800,6 +2818,7 @@
                                'td_count' => '""',
                                'base_java_url' => 
"{menuaction:'property.uitts.update_data',id:{$id}}",
                                'location_item_id' => $id,
+                               'value_location_code'   => 
$ticket['location_code'],
                                'value_origin' => $ticket['origin'],
                                'value_target' => $ticket['target'],
                                'value_finnish_date' => $ticket['finnish_date'],
@@ -3521,24 +3540,11 @@
 
                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);
+                       $users = 
$GLOBALS['phpgw']->acl->get_user_list_right(PHPGW_ACL_EDIT, 
$this->acl_location, 'property', $this->group_candidates);
                        $user_list = array();
                        $selected_found = false;
                        foreach ($users as $user)

Modified: trunk/property/js/portico/tts.view.js
===================================================================
--- trunk/property/js/portico/tts.view.js       2016-09-07 12:44:56 UTC (rev 
15604)
+++ trunk/property/js/portico/tts.view.js       2016-09-07 13:14:31 UTC (rev 
15605)
@@ -248,6 +248,25 @@
        JqueryPortico.updateinlineTableHelper(oTable2, strURL);
 };
 
+this.make_relation = function (id)
+{
+       var oArgs = null;
+       relation_type = $('#make_relation').val();
+       if (relation_type)
+       {
+               oArgs = {
+                       menuaction: relation_type,
+                       make_relation: true,
+                       relation_id: id,
+                       relation_type: 'ticket',
+                       query: location_code, //defined in xsl
+                       clear_state:1,
+               };
+               var strURL = phpGWLink('index.php', oArgs);
+               window.open(strURL, '_self');
+       }
+};
+
 window.addEventListener("load", function ()
 {
        d = document.getElementById('vendor_id');
@@ -370,11 +389,11 @@
 {
        ecodimb = ecodimb || $('#ecodimb').val();
 
-       if(!ecodimb)
+       if (!ecodimb)
        {
                return;
        }
-       
+
        var total_amount = Number(amount) + Number($('#budget').val());
        var oArgs = {menuaction: 'property.uitts.check_purchase_right', 
ecodimb: ecodimb, amount: total_amount};
        var requestUrl = phpGWLink('index.php', oArgs, true);
@@ -400,10 +419,10 @@
 
                                        if (obj[i].required == true)
                                        {
-                                               htmlString += "<input 
type=\"hidden\" name=\"values[approval][" + obj[i].id + "]\" value=\"" + 
obj[i].address +"\"></input>";
+                                               htmlString += "<input 
type=\"hidden\" name=\"values[approval][" + obj[i].id + "]\" value=\"" + 
obj[i].address + "\"></input>";
                                                required = 'checked="checked" 
disabled="disabled"';
                                        }
-                                       htmlString += "<input type=\"checkbox\" 
name=\"values[approval][" + obj[i].id + "]\" value=\"" + obj[i].address +"\"" + 
required +"></input>";
+                                       htmlString += "<input type=\"checkbox\" 
name=\"values[approval][" + obj[i].id + "]\" value=\"" + obj[i].address + "\"" 
+ required + "></input>";
                                        htmlString += "</td><td 
valign=\"top\">";
                                        htmlString += obj[i].address;
                                        htmlString += "</td></tr>";

Modified: trunk/property/templates/base/tts.xsl
===================================================================
--- trunk/property/templates/base/tts.xsl       2016-09-07 12:44:56 UTC (rev 
15604)
+++ trunk/property/templates/base/tts.xsl       2016-09-07 13:14:31 UTC (rev 
15605)
@@ -281,6 +281,7 @@
 
                var base_java_url = <xsl:value-of select="base_java_url"/>;
                var location_item_id = '<xsl:value-of 
select="location_item_id"/>';
+               var location_code = '<xsl:value-of 
select="value_location_code"/>';
 
                //      var initialSelection = <xsl:value-of 
select="resources_json"/>;
                var lang = <xsl:value-of select="php:function('js_lang',  
'Name', 'Address')"/>
@@ -370,6 +371,30 @@
                                                        </xsl:for-each>
                                                </div>
                                        </xsl:for-each>
+                                       <!--div class="pure-control-group">
+                                               <xsl:variable 
name="lang_make_relation">
+                                                       <xsl:value-of 
select="php:function('lang', 'make relation')"/>
+                                               </xsl:variable>
+
+                                               <label>
+                                                       <a href="#" 
onClick="make_relation({location_item_id});">
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="$lang_make_relation"/>
+                                                               </xsl:attribute>
+                                                               <xsl:value-of 
select="$lang_make_relation"/>
+                                                       </a>
+                                               </label>
+                                               <select name="make_relation" 
id="make_relation">
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="$lang_make_relation"/>
+                                                       </xsl:attribute>
+                                                       <option value="">
+                                                               <xsl:value-of 
select="php:function('lang', 'select')"/>
+                                                       </option>
+                                                       <xsl:apply-templates 
select="relation_type_list/options"/>
+                                               </select>
+                                       </div-->
+
                                        <div class="pure-control-group">
                                                <label>
                                                        <xsl:value-of 
select="php:function('lang', 'details')"/>
@@ -448,7 +473,7 @@
                                                                <xsl:variable 
name="select_priority_name">
                                                                        
<xsl:value-of select="select_priority_name"/>
                                                                </xsl:variable>
-                                                               <select 
name="{$select_priority_name}" class="forms" 
title="{$lang_priority_statustext}" 
onMouseover="window.status='{$lang_priority_statustext}'; return true;" 
onMouseout="window.status='';return true;">
+                                                               <select 
name="{$select_priority_name}" class="forms" 
title="{$lang_priority_statustext}">
                                                                        
<xsl:apply-templates select="priority_list/options"/>
                                                                </select>
                                                        </div>




reply via email to

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