fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16825] property: configurable: budget account as lis


From: sigurdne
Subject: [Fmsystem-commits] [16825] property: configurable: budget account as listbox or autocomplete
Date: Sun, 4 Jun 2017 14:34:24 -0400 (EDT)

Revision: 16825
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16825
Author:   sigurdne
Date:     2017-06-04 14:34:24 -0400 (Sun, 04 Jun 2017)
Log Message:
-----------
property: configurable: budget account as listbox or autocomplete

Modified Paths:
--------------
    trunk/property/inc/class.uiworkorder.inc.php
    trunk/property/inc/hook_settings.inc.php
    trunk/property/templates/base/workorder.xsl

Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php        2017-06-04 17:48:34 UTC 
(rev 16824)
+++ trunk/property/inc/class.uiworkorder.inc.php        2017-06-04 18:34:24 UTC 
(rev 16825)
@@ -1647,6 +1647,15 @@
                                'required' => true
                        ));
 
+                       $b_account_list = 
execMethod('property.bogeneric.get_list', array(
+                                               'type' => 'budget_account', 
'selected' => $values['b_account_id'] ? $values['b_account_id'] : 
$project['b_account_id'], 'add_empty' => true, 'filter' => array('active' => 
1)));
+
+                       foreach ($b_account_list as &$entry)
+                       {
+                               $entry['name'] = "{$entry['id']} 
{$entry['name']}";
+                       }
+                       unset($entry);
+
                        $ecodimb_data = 
$this->bocommon->initiate_ecodimb_lookup(array
                                (
                                'ecodimb' => $project['ecodimb'] ? 
$project['ecodimb'] : $values['ecodimb'],
@@ -2491,6 +2500,8 @@
                                        'menuaction' => 
'property.uiproject.edit')),
                                'b_group_data' => $b_group_data,
                                'b_account_data' => $b_account_data,
+                               'b_account_as_listbox' => 
$GLOBALS['phpgw_info']['user']['preferences']['property']['b_account_as_listbox'],
+                               'b_account_list'        => array('options' => 
$b_account_list),
                                'value_start_date' => $values['start_date'],
                                'value_end_date' => $values['end_date'],
                                'value_tender_deadline' => 
$values['tender_deadline'],

Modified: trunk/property/inc/hook_settings.inc.php
===================================================================
--- trunk/property/inc/hook_settings.inc.php    2017-06-04 17:48:34 UTC (rev 
16824)
+++ trunk/property/inc/hook_settings.inc.php    2017-06-04 18:34:24 UTC (rev 
16825)
@@ -260,6 +260,8 @@
 
        create_select_box('Default project status', 'project_status', 
$_status_project, 'The default status for your projects');
        create_select_box('Default workorder status', 'workorder_status', 
$_status_workorder, 'The default status for your workorders');
+       create_select_box('Budget account as listbox', 'b_account_as_listbox', 
$yes_and_no, 'The input type for budget account');
+
        create_select_box('Default project categories', 'project_category', 
$_categories_project, 'The default category for your projects and workorders');
        create_select_box('Default district-filter', 'default_district', 
$_districts, 'Your default district-filter ');
 

Modified: trunk/property/templates/base/workorder.xsl
===================================================================
--- trunk/property/templates/base/workorder.xsl 2017-06-04 17:48:34 UTC (rev 
16824)
+++ trunk/property/templates/base/workorder.xsl 2017-06-04 18:34:24 UTC (rev 
16825)
@@ -699,25 +699,52 @@
                                                <label>
                                                        <xsl:value-of 
select="$lang_budget_account"/>
                                                </label>
-                                               <input type="hidden" 
id="b_account_id" name="values[b_account_id]"  
value="{b_account_data/value_b_account_id}"/>
-                                               <input type="text" 
id="b_account_name" name="values[b_account_name]" 
value="{b_account_data/value_b_account_id} 
{b_account_data/value_b_account_name}" class="pure-input-1-2">
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="mode='edit'">
-                                                                       
<xsl:attribute name="data-validation">
-                                                                               
<xsl:text>required</xsl:text>
-                                                                       
</xsl:attribute>
-                                                                       
<xsl:attribute name="data-validation-error-msg">
+                                               <xsl:choose>
+                                                       <xsl:when 
test="b_account_as_listbox = 1">
+                                                               <select 
name="values[b_account_id]" class="pure-input-1-2">
+                                                                       
<xsl:attribute name="title">
                                                                                
<xsl:value-of select="$lang_budget_account"/>
                                                                        
</xsl:attribute>
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                                       
<xsl:attribute name="disabled">
-                                                                               
<xsl:text>disabled</xsl:text>
-                                                                       
</xsl:attribute>
-                                                               </xsl:otherwise>
-                                                       </xsl:choose>
-                                               </input>
-                                               <div id="b_account_container"/>
+                                                                       
<xsl:choose>
+                                                                               
<xsl:when test="mode='edit'">
+                                                                               
        <xsl:attribute name="data-validation">
+                                                                               
                <xsl:text>required</xsl:text>
+                                                                               
        </xsl:attribute>
+                                                                               
        <xsl:attribute name="data-validation-error-msg">
+                                                                               
                <xsl:value-of select="$lang_budget_account"/>
+                                                                               
        </xsl:attribute>
+                                                                               
</xsl:when>
+                                                                               
<xsl:otherwise>
+                                                                               
        <xsl:attribute name="disabled">
+                                                                               
                <xsl:text>disabled</xsl:text>
+                                                                               
        </xsl:attribute>
+                                                                               
</xsl:otherwise>
+                                                                       
</xsl:choose>
+                                                                       
<xsl:apply-templates select="b_account_list/options"/>
+                                                               </select>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <input 
type="hidden" id="b_account_id" name="values[b_account_id]"  
value="{b_account_data/value_b_account_id}"/>
+                                                               <input 
type="text" id="b_account_name" name="values[b_account_name]" 
value="{b_account_data/value_b_account_id} 
{b_account_data/value_b_account_name}" class="pure-input-1-2">
+                                                                       
<xsl:choose>
+                                                                               
<xsl:when test="mode='edit'">
+                                                                               
        <xsl:attribute name="data-validation">
+                                                                               
                <xsl:text>required</xsl:text>
+                                                                               
        </xsl:attribute>
+                                                                               
        <xsl:attribute name="data-validation-error-msg">
+                                                                               
                <xsl:value-of select="$lang_budget_account"/>
+                                                                               
        </xsl:attribute>
+                                                                               
</xsl:when>
+                                                                               
<xsl:otherwise>
+                                                                               
        <xsl:attribute name="disabled">
+                                                                               
                <xsl:text>disabled</xsl:text>
+                                                                               
        </xsl:attribute>
+                                                                               
</xsl:otherwise>
+                                                                       
</xsl:choose>
+                                                               </input>
+                                                               <div 
id="b_account_container"/>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
                                        </div>
                                        <xsl:if test="enable_unspsc = 1">
                                                <div class="pure-control-group">




reply via email to

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