fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16022] more on integration


From: sigurdne
Subject: [Fmsystem-commits] [16022] more on integration
Date: Thu, 24 Nov 2016 14:29:27 +0000 (UTC)

Revision: 16022
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16022
Author:   sigurdne
Date:     2016-11-24 14:29:27 +0000 (Thu, 24 Nov 2016)
Log Message:
-----------
more on integration

Modified Paths:
--------------
    trunk/property/inc/class.botts.inc.php
    trunk/property/inc/class.sogeneric.inc.php
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/js/portico/project.edit.js
    trunk/property/js/portico/workorder.edit.js
    trunk/property/templates/base/project.xsl

Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php      2016-11-24 14:28:37 UTC (rev 
16021)
+++ trunk/property/inc/class.botts.inc.php      2016-11-24 14:29:27 UTC (rev 
16022)
@@ -1949,56 +1949,63 @@
                        return json_decode($result, true);
                }
 
-               protected function get_supervisor_approval($supervisors, 
$order_id)
+               protected function get_supervisor_approval($supervisors, 
$order_id = 0)
                {
                        $need_approval = 
isset($this->config->config_data['workorder_approval']) ? 
$this->config->config_data['workorder_approval'] : '';
 
-                       $order_type = 
$this->bocommon->socommon->get_order_type($order_id);
+                       if($order_id)
+                       {
+                               $order_type = 
$this->bocommon->socommon->get_order_type($order_id);
 
-                       switch ($order_type)
-                       {
-                               case 'workorder':
-                                       $location = '.project.workorder';
-                                       $location_item_id = $order_id;
-                                       break;
-                               case 'ticket':
-                                       $location = '.ticket';
-                                       $location_item_id = 
$this->so->get_ticket_from_order($order_id);
-                                       break;
-                               default:
-                                       throw new Exception('Not supported');
+                               switch ($order_type)
+                               {
+                                       case 'workorder':
+                                               $location = 
'.project.workorder';
+                                               $location_item_id = $order_id;
+                                               break;
+                                       case 'ticket':
+                                               $location = '.ticket';
+                                               $location_item_id = 
$this->so->get_ticket_from_order($order_id);
+                                               break;
+                                       default:
+                                               throw new Exception('Not 
supported');
+                               }
                        }
 
                        $supervisor_email = array();
                        if ($supervisors && $need_approval)
                        {
+                               $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
                                foreach ($supervisors as $supervisor_id => 
$info)
                                {
-                                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
 
-                                       $pending_action = 
CreateObject('property.sopending_action');
+                                       if($location_item_id)
+                                       {
+                                               $pending_action = 
CreateObject('property.sopending_action');
 
-                                       $action_params = array(
-                                               'appname' => 'property',
-                                               'location' => $location,
-                                               'id'            => 
$location_item_id,
-                                               'responsible' => $supervisor_id,
-                                               'responsible_type' => 'user',
-                                               'action' => 'approval',
-                                               'deadline' => '',
-                                               'created_by' => '',
-                                               'allrows' => false,
-                                               'closed' => true
-                                       );
+                                               $action_params = array(
+                                                       'appname' => 'property',
+                                                       'location' => $location,
+                                                       'id'            => 
$location_item_id,
+                                                       'responsible' => 
$supervisor_id,
+                                                       'responsible_type' => 
'user',
+                                                       'action' => 'approval',
+                                                       'deadline' => '',
+                                                       'created_by' => '',
+                                                       'allrows' => false,
+                                                       'closed' => true
+                                               );
 
-                                       $approvals = 
$pending_action->get_pending_action($action_params);
-                                       if(!$approvals)
-                                       {
-                                               $action_params['closed'] = 
false;
+                                               $approvals = 
$pending_action->get_pending_action($action_params);
+                                               if(!$approvals)
+                                               {
+                                                       
$action_params['closed'] = false;
+                                               }
+
+                                               $requests = 
$pending_action->get_pending_action($action_params);
                                        }
 
-                                       $requests = 
$pending_action->get_pending_action($action_params);
-
                                        $prefs = 
$this->bocommon->create_preferences('property', $supervisor_id);
                                        if (!empty($prefs['email']))
                                        {

Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php  2016-11-24 14:28:37 UTC (rev 
16021)
+++ trunk/property/inc/class.sogeneric.inc.php  2016-11-24 14:29:27 UTC (rev 
16022)
@@ -1376,7 +1376,12 @@
                                                                'name' => 
'active',
                                                                'descr' => 
lang('active'),
                                                                'type' => 
'checkbox',
-                                                               'default' => 
'checked'
+                                                               'default' => 
'checked',
+                                                               'filter' => 
true,
+                                                               'sortable' => 
true,
+                                                               'values_def' => 
array(
+                                                                       
'valueset' => array(array('id' => 1, 'name' => lang('active'))),
+                                                               )
                                                        ),
                                                ),
                                                'edit_msg' => lang('edit'),

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2016-11-24 14:28:37 UTC (rev 
16021)
+++ trunk/property/inc/class.uiproject.inc.php  2016-11-24 14:29:27 UTC (rev 
16022)
@@ -783,12 +783,28 @@
                                $error_id = true;
                        }
 
-                       if (isset($values['b_account_id']) && 
$values['b_account_id'])
+                       if (!empty($values['b_account_id']))
                        {
-                               $sogeneric = CreateObject('property.sogeneric');
-                               $sogeneric->get_location_info('budget_account', 
false);
-                               $status_data = 
$sogeneric->read_single(array('id' => (int)$values['b_account_id']), array());
-                               $values['b_account_group'] = 
$status_data['category'];
+//                             $sogeneric = CreateObject('property.sogeneric');
+//                             $sogeneric->get_location_info('budget_account', 
false);
+//                             $status_data = 
$sogeneric->read_single(array('id' => (int)$values['b_account_id']), array());
+//                             $values['b_account_group'] = 
$status_data['category'];
+
+
+                               $_b_account = 
execMethod('property.bogeneric.read_single', array(
+                                       'id' => $values['b_account_id'],
+                                       'location_info' => array(
+                                               'type' => 'budget_account')));
+                               $values['b_account_group'] = 
$_b_account['category'];
+
+                               if (!$_b_account || !$_b_account['active'])
+                               {
+                                       $values['b_account_id'] = '';
+                                       $values['b_account_name'] = '';
+                                       $values['b_account_group'] = '';
+                                       $this->receipt['error'][] = array(
+                                               'msg' => lang('Please select a 
valid budget account !'));
+                               }
                        }
 
                        if (isset($values['b_account_group']) && 
$values['b_account_group'])

Modified: trunk/property/js/portico/project.edit.js
===================================================================
--- trunk/property/js/portico/project.edit.js   2016-11-24 14:28:37 UTC (rev 
16021)
+++ trunk/property/js/portico/project.edit.js   2016-11-24 14:29:27 UTC (rev 
16022)
@@ -161,11 +161,17 @@
                JqueryPortico.updateinlineTableHelper(oTable2, requestUrl2);
        });
 
-       var api1 = oTable1.api();
-       api1.on('draw', sum_columns_table_orders);
+       if(typeof(oTable1) !== 'undefined')
+       {
+               var api1 = oTable1.api();
+               api1.on('draw', sum_columns_table_orders);
+       }
 
-       var api2 = oTable2.api();
-       api2.on('draw', sum_columns_table_invoice);
+       if(typeof(oTable2) !== 'undefined')
+       {
+               var api2 = oTable2.api();
+               api2.on('draw', sum_columns_table_invoice);
+       }
 
 
 // -- buttons--//

Modified: trunk/property/js/portico/workorder.edit.js
===================================================================
--- trunk/property/js/portico/workorder.edit.js 2016-11-24 14:28:37 UTC (rev 
16021)
+++ trunk/property/js/portico/workorder.edit.js 2016-11-24 14:29:27 UTC (rev 
16022)
@@ -597,6 +597,10 @@
                                htmlString += "</tbody></table>";
                                $("#approval_container").html(htmlString);
                        }
+               },
+               error: function()
+               {
+                       alert('feil med oppslag til fullmakter');
                }
        });
 }

Modified: trunk/property/templates/base/project.xsl
===================================================================
--- trunk/property/templates/base/project.xsl   2016-11-24 14:28:37 UTC (rev 
16021)
+++ trunk/property/templates/base/project.xsl   2016-11-24 14:29:27 UTC (rev 
16022)
@@ -351,130 +351,72 @@
                        </div>
 
                        <div id="budget">
-                               <!--fieldset-->
-                               <div class="pure-control-group">
-                                       <label for="name">
-                                               <xsl:value-of 
select="lang_start_date"/>
-                                       </label>
-                                       <input type="text" 
id="values_start_date" name="values[start_date]" size="10" 
value="{value_start_date}" readonly="readonly">
-                                               <xsl:attribute name="title">
-                                                       <xsl:value-of 
select="lang_start_date_statustext"/>
-                                               </xsl:attribute>
-                                               <xsl:attribute 
name="data-validation">
-                                                       
<xsl:text>required</xsl:text>
-                                               </xsl:attribute>
-                                       </input>
-                               </div>
-                               <div class="pure-control-group">
-                                       <label for="name">
-                                               <xsl:value-of 
select="lang_end_date"/>
-                                       </label>
-                                       <input type="text" id="values_end_date" 
name="values[end_date]" size="10" value="{value_end_date}" readonly="readonly">
-                                               <xsl:attribute name="title">
-                                                       <xsl:value-of 
select="lang_end_date_statustext"/>
-                                               </xsl:attribute>
-                                               <xsl:attribute 
name="data-validation">
-                                                       
<xsl:text>required</xsl:text>
-                                               </xsl:attribute>
-                                               <xsl:attribute 
name="data-validation-error-msg">
-                                                       <xsl:value-of 
select="php:function('lang', 'Please select an end date!')"/>
+                               <fieldset>
+                                       <div class="pure-control-group">
+                                               <label for="name">
+                                                       <xsl:value-of 
select="lang_start_date"/>
+                                               </label>
+                                               <input type="text" 
id="values_start_date" name="values[start_date]" size="10" 
value="{value_start_date}" readonly="readonly">
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="lang_start_date_statustext"/>
+                                                       </xsl:attribute>
+                                                       <xsl:attribute 
name="data-validation">
+                                                               
<xsl:text>required</xsl:text>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </div>
+                                       <div class="pure-control-group">
+                                               <label for="name">
+                                                       <xsl:value-of 
select="lang_end_date"/>
+                                               </label>
+                                               <input type="text" 
id="values_end_date" name="values[end_date]" size="10" value="{value_end_date}" 
readonly="readonly">
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="lang_end_date_statustext"/>
+                                                       </xsl:attribute>
+                                                       <xsl:attribute 
name="data-validation">
+                                                               
<xsl:text>required</xsl:text>
+                                                       </xsl:attribute>
+                                                       <xsl:attribute 
name="data-validation-error-msg">
+                                                               <xsl:value-of 
select="php:function('lang', 'Please select an end date!')"/>
 
-                                               </xsl:attribute>
-                                       </input>
-                               </div>
-                               <!--xsl:call-template 
name="external_project_form"/-->
-                               <div class="pure-control-group">
-                                       <label>
-                                               <xsl:value-of 
select="php:function('lang', 'external project')"/>
-                                       </label>
-                                       <input type="hidden" 
id="external_project_id" name="values[external_project_id]"  
value="{value_external_project_id}"/>
-                                       <input type="text" 
id="external_project_name" name="values[external_project_name]" 
value="{value_external_project_name}"/>
-                                       <div id="external_project_container"/>
-                               </div>
-
-                               <!--xsl:choose>
-                                       <xsl:when test="ecodimb_data!=''">
-                                               <xsl:call-template 
name="ecodimb_form"/>
-                                       </xsl:when>
-                               </xsl:choose-->
-
-
-                               <div class="pure-control-group">
-                                       <xsl:variable name="lang_dimb">
-                                               <xsl:value-of 
select="php:function('lang', 'dimb')"/>
-                                       </xsl:variable>
-                                       <label>
-                                               <xsl:value-of 
select="$lang_dimb"/>
-                                       </label>
-                                       <xsl:if test="mode='edit'">
-                                               <input type="hidden" 
id="ecodimb" name="values[ecodimb]"  value="{ecodimb_data/value_ecodimb}"/>
-                                       </xsl:if>
-                                       <input type="text" id="ecodimb_name" 
name="values[ecodimb_name]" value="{ecodimb_data/value_ecodimb} 
{ecodimb_data/value_ecodimb_descr}">
-                                               <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_dimb"/>
-                                                               </xsl:attribute>
-                                                       </xsl:when>
-                                                       <xsl:otherwise>
-                                                               <xsl:attribute 
name="disabled">
-                                                                       
<xsl:text>disabled</xsl:text>
-                                                               </xsl:attribute>
-                                                       </xsl:otherwise>
-                                               </xsl:choose>
-                                       </input>
-                                       <div id="ecodimb_container"/>
-                               </div>
-                               <xsl:if test="b_account_data =''">
+                                                       </xsl:attribute>
+                                               </input>
+                                       </div>
+                                       <!--xsl:call-template 
name="external_project_form"/-->
                                        <div class="pure-control-group">
-                                               <xsl:variable 
name="lang_budget_account">
-                                                       <xsl:value-of 
select="php:function('lang', 'budget account group')"/>
-                                               </xsl:variable>
                                                <label>
-                                                       <xsl:value-of 
select="$lang_budget_account"/>
+                                                       <xsl:value-of 
select="php:function('lang', 'external project')"/>
                                                </label>
-                                               <input type="hidden" 
id="b_account_group" name="values[b_account_group]"  
value="{b_account_group_data/value_b_account_id}"/>
-                                               <input type="text" 
id="b_account_group_name" name="values[b_account_group_name]" 
value="{b_account_group_data/value_b_account_name}">
-                                                       <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_group_container"/>
+                                               <input type="hidden" 
id="external_project_id" name="values[external_project_id]"  
value="{value_external_project_id}"/>
+                                               <input type="text" 
id="external_project_name" name="values[external_project_name]" 
value="{value_external_project_name}"/>
+                                               <div 
id="external_project_container"/>
                                        </div>
-                               </xsl:if>
 
-                               <xsl:if test="b_account_data !=''">
+                                       <!--xsl:choose>
+                                               <xsl:when 
test="ecodimb_data!=''">
+                                                       <xsl:call-template 
name="ecodimb_form"/>
+                                               </xsl:when>
+                                       </xsl:choose-->
+
+
                                        <div class="pure-control-group">
-                                               <xsl:variable 
name="lang_budget_account">
-                                                       <xsl:value-of 
select="php:function('lang', 'budget account')"/>
+                                               <xsl:variable name="lang_dimb">
+                                                       <xsl:value-of 
select="php:function('lang', 'dimb')"/>
                                                </xsl:variable>
                                                <label>
-                                                       <xsl:value-of 
select="$lang_budget_account"/>
+                                                       <xsl:value-of 
select="$lang_dimb"/>
                                                </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_name}">
+                                               <xsl:if test="mode='edit'">
+                                                       <input type="hidden" 
id="ecodimb" name="values[ecodimb]"  value="{ecodimb_data/value_ecodimb}"/>
+                                               </xsl:if>
+                                               <input type="text" 
id="ecodimb_name" name="values[ecodimb_name]" 
value="{ecodimb_data/value_ecodimb} {ecodimb_data/value_ecodimb_descr}">
                                                        <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:value-of select="$lang_dimb"/>
                                                                        
</xsl:attribute>
                                                                </xsl:when>
                                                                <xsl:otherwise>
@@ -484,296 +426,351 @@
                                                                </xsl:otherwise>
                                                        </xsl:choose>
                                                </input>
-                                               <div id="b_account_container"/>
+                                               <div id="ecodimb_container"/>
                                        </div>
-                               </xsl:if>
-
-                               <!--xsl:choose>
-                                       <xsl:when test="b_account_data!=''">
-                                               <xsl:choose>
-                                                       <xsl:when 
test="mode='edit'">
-                                                               
<xsl:call-template name="b_account_form"/>
-                                                       </xsl:when>
-                                                       <xsl:otherwise>
-                                                               
<xsl:call-template name="b_account_view"/>
-                                                       </xsl:otherwise>
-                                               </xsl:choose>
-                                       </xsl:when>
-                               </xsl:choose-->
-                               <xsl:if test="value_project_id &gt; 0 and 
mode='edit'">
-                                       <div class="pure-control-group">
-                                               <label for="name">
-                                                       <xsl:value-of 
select="php:function('lang', 'move')"/>
-                                               </label>
-                                               <input type="text" 
data-validation="number" data-validation-allowing="float" 
data-validation-decimal-separator="{$decimal_separator}" 
name="values[new_project_id]" value="">
-                                                       <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="php:function('lang', 'move budget and orders to another project')"/>
-                                                       </xsl:attribute>
-                                                       <xsl:attribute 
name="data-validation-optional">
-                                                               
<xsl:text>true</xsl:text>
-                                                       </xsl:attribute>
-                                               </input>
-                                       </div>
-                               </xsl:if>
-                               <div class="pure-control-group">
-                                       <xsl:variable name="lang_budget">
-                                               <xsl:value-of 
select="php:function('lang', 'budget')"/>
-                                       </xsl:variable>
-                                       <label for="name">
-                                               <xsl:value-of 
select="$lang_budget"/>
-                                       </label>
-                                       <div class="pure-custom">
-                                               <div>
-                                                       <input 
data-validation="number" data-validation-allowing="float" 
data-validation-decimal-separator="{$decimal_separator}" type="text" 
name="values[budget]" value="{value_budget}">
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="php:function('lang', 'Enter the budget')"/>
-                                                               </xsl:attribute>
+                                       <xsl:if test="b_account_data =''">
+                                               <div class="pure-control-group">
+                                                       <xsl:variable 
name="lang_budget_account">
+                                                               <xsl:value-of 
select="php:function('lang', 'budget account group')"/>
+                                                       </xsl:variable>
+                                                       <label>
+                                                               <xsl:value-of 
select="$lang_budget_account"/>
+                                                       </label>
+                                                       <input type="hidden" 
id="b_account_group" name="values[b_account_group]"  
value="{b_account_group_data/value_b_account_id}"/>
+                                                       <input type="text" 
id="b_account_group_name" name="values[b_account_group_name]" 
value="{b_account_group_data/value_b_account_name}">
                                                                <xsl:choose>
-                                                                       
<xsl:when  test="not(value_project_id &gt; 0) and mode='edit'">
+                                                                       
<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"/>
+                                                                               
        <xsl:value-of select="$lang_budget_account"/>
                                                                                
</xsl:attribute>
                                                                        
</xsl:when>
-                                                                       
<xsl:when  test="value_project_id &gt; 0 and not(check_for_budget &gt; 0) and 
mode='edit'">
+                                                                       
<xsl:otherwise>
+                                                                               
<xsl:attribute name="disabled">
+                                                                               
        <xsl:text>disabled</xsl:text>
+                                                                               
</xsl:attribute>
+                                                                       
</xsl:otherwise>
+                                                               </xsl:choose>
+                                                       </input>
+                                                       <div 
id="b_account_group_container"/>
+                                               </div>
+                                       </xsl:if>
+
+                                       <xsl:if test="b_account_data !=''">
+                                               <div class="pure-control-group">
+                                                       <xsl:variable 
name="lang_budget_account">
+                                                               <xsl:value-of 
select="php:function('lang', 'budget account')"/>
+                                                       </xsl:variable>
+                                                       <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_name}">
+                                                               <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"/>
+                                                                               
        <xsl:value-of select="$lang_budget_account"/>
                                                                                
</xsl:attribute>
                                                                        
</xsl:when>
                                                                        
<xsl:otherwise>
-                                                                               
<xsl:attribute name="data-validation-optional">
-                                                                               
        <xsl:text>true</xsl:text>
+                                                                               
<xsl:attribute name="disabled">
+                                                                               
        <xsl:text>disabled</xsl:text>
                                                                                
</xsl:attribute>
                                                                        
</xsl:otherwise>
                                                                </xsl:choose>
                                                        </input>
-                                                       <xsl:text> </xsl:text> 
[ <xsl:value-of select="currency"/> ]
-                                                       <select 
name="values[budget_year]">
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="php:function('lang', 'year')"/>
-                                                               </xsl:attribute>
-                                                               <option 
value="0">
-                                                                       
<xsl:value-of select="php:function('lang', 'year')"/>
-                                                               </option>
-                                                               
<xsl:apply-templates select="year_list/options"/>
-                                                       </select>
+                                                       <div 
id="b_account_container"/>
+                                               </div>
+                                       </xsl:if>
+
+                                       <!--xsl:choose>
+                                               <xsl:when 
test="b_account_data!=''">
                                                        <xsl:choose>
-                                                               <xsl:when 
test="project_type_id ='3'">
-                                                                       <input 
type="checkbox" name="values[budget_reset_buffer]" value="1">
-                                                                               
<xsl:attribute name="title">
-                                                                               
        <xsl:value-of select="php:function('lang', 'delete')"/>
-                                                                               
        <xsl:text> </xsl:text>
-                                                                               
        <xsl:value-of select="php:function('lang', 'buffer')"/>
-                                                                               
        <xsl:text> </xsl:text>
-                                                                               
        <xsl:value-of select="php:function('lang', 'budget')"/>
-                                                                               
</xsl:attribute>
-                                                                       </input>
+                                                               <xsl:when 
test="mode='edit'">
+                                                                       
<xsl:call-template name="b_account_form"/>
                                                                </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       
<xsl:call-template name="b_account_view"/>
+                                                               </xsl:otherwise>
                                                        </xsl:choose>
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="project_type_id !='3'">
-                                                                       <select 
name="values[budget_periodization]">
-                                                                               
<xsl:attribute name="title">
-                                                                               
        <xsl:value-of select="php:function('lang', 'periodization')"/>
-                                                                               
</xsl:attribute>
-                                                                               
<option value="0">
-                                                                               
        <xsl:value-of select="php:function('lang', 'periodization')"/>
-                                                                               
</option>
-                                                                               
<xsl:apply-templates select="periodization_list/options"/>
-                                                                       
</select>
-                                                                       <input 
type="checkbox" name="values[budget_periodization_all]" value="True">
-                                                                               
<xsl:attribute name="title">
-                                                                               
        <xsl:value-of select="php:function('lang', 'all')"/>
-                                                                               
        <xsl:text> </xsl:text>
-                                                                               
        <xsl:value-of select="php:function('lang', 'periods')"/>
-                                                                               
</xsl:attribute>
-                                                                       </input>
-                                                                       <input 
type="checkbox" name="values[budget_periodization_activate]" value="1">
-                                                                               
<xsl:attribute name="title">
-                                                                               
        <xsl:value-of select="php:function('lang', 'activate')"/>
-                                                                               
</xsl:attribute>
-                                                                               
<xsl:attribute name="checked" value="checked"/>
-                                                                       </input>
-                                                               </xsl:when>
-                                                       </xsl:choose>
-                                               </div>
-                                       </div>
-                               </div>
-                               <!--div class="pure-control-group"-->
-                               <label for="name">
-                                       <xsl:value-of 
select="php:function('lang', 'budget')"/>
-                               </label>
-                               <!--div class="pure-custom">
-                               <div-->
-                               <xsl:for-each select="datatable_def">
-                                       <xsl:if test="container = 
'datatable-container_0'">
-                                               <xsl:call-template 
name="table_setup">
-                                                       <xsl:with-param 
name="container" select ='container'/>
-                                                       <xsl:with-param 
name="requestUrl" select ='requestUrl' />
-                                                       <xsl:with-param 
name="ColumnDefs" select ='ColumnDefs' />
-                                                       <xsl:with-param 
name="tabletools" select ='tabletools' />
-                                                       <xsl:with-param 
name="data" select ='data' />
-                                                       <xsl:with-param 
name="config" select ='config' />
-                                               </xsl:call-template>
-                                       </xsl:if>
-                               </xsl:for-each>
-                               <!--/div>
-                               </div-->
-                               <!--div-->
-                               <xsl:choose>
-                                       <xsl:when test="value_project_id!='' 
and mode='edit'">
+                                               </xsl:when>
+                                       </xsl:choose-->
+                                       <xsl:if test="value_project_id &gt; 0 
and mode='edit'">
                                                <div class="pure-control-group">
                                                        <label for="name">
-                                                               <xsl:value-of 
select="php:function('lang', 'transfer')"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'move')"/>
                                                        </label>
-                                                       <div 
class="pure-custom">
-                                                               <table>
-                                                                       <tr>
-                                                                               
<td>
-                                                                               
        <xsl:value-of select="php:function('lang', 'amount')"/>
-                                                                               
</td>
-                                                                               
<td>
-                                                                               
        <xsl:value-of select="php:function('lang', 'project')"/>
-                                                                               
</td>
-                                                                               
<td>
-                                                                               
        <xsl:value-of select="php:function('lang', 'remark')"/>
-                                                                               
</td>
-                                                                       </tr>
-                                                                       <tr>
-                                                                               
<td>
-                                                                               
        <input type="text" name="values[transfer_amount]" value="">
-                                                                               
                <xsl:attribute name="title">
-                                                                               
                        <xsl:value-of select="php:function('lang', 'amount to 
transfer')"/>
-                                                                               
                </xsl:attribute>
-                                                                               
        </input>
-                                                                               
</td>
-                                                                               
<td>
-                                                                               
        <input type="text" name="values[transfer_target]" value="">
-                                                                               
                <xsl:attribute name="title">
-                                                                               
                        <xsl:value-of select="php:function('lang', 'target 
project')"/>
-                                                                               
                </xsl:attribute>
-                                                                               
        </input>
-                                                                               
</td>
-                                                                               
<td>
-                                                                               
        <input type="text" name="values[transfer_remark]" value="">
-                                                                               
                <xsl:attribute name="title">
-                                                                               
                        <xsl:value-of select="php:function('lang', 'remark')"/>
-                                                                               
                </xsl:attribute>
-                                                                               
        </input>
-                                                                               
</td>
-                                                                       </tr>
-                                                               </table>
-                                                       </div>
-                                               </div>
-                                       </xsl:when>
-                               </xsl:choose>
-                               <xsl:choose>
-                                       <xsl:when test="project_type_id !='3'">
-                                               <div class="pure-control-group">
-                                                       <label for="name">
-                                                               <xsl:value-of 
select="lang_reserve"/>
-                                                       </label>
-                                                       <input 
data-validation="number" data-validation-allowing="float" 
data-validation-decimal-separator="{$decimal_separator}" type="text" 
name="values[reserve]" value="{value_reserve}">
+                                                       <input type="text" 
data-validation="number" data-validation-allowing="float" 
data-validation-decimal-separator="{$decimal_separator}" 
name="values[new_project_id]" value="">
                                                                <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="lang_reserve_statustext"/>
+                                                                       
<xsl:value-of select="php:function('lang', 'move budget and orders to another 
project')"/>
                                                                </xsl:attribute>
                                                                <xsl:attribute 
name="data-validation-optional">
                                                                        
<xsl:text>true</xsl:text>
                                                                </xsl:attribute>
                                                        </input>
-                                                       <xsl:text> </xsl:text> 
[ <xsl:value-of select="currency"/> ]
                                                </div>
-                                               <div class="pure-control-group">
-                                                       <label for="name">
-                                                               <xsl:value-of 
select="lang_sum"/>
-                                                       </label>
-                                                       <xsl:value-of 
select="value_sum"/>
-                                                       <xsl:text> </xsl:text> 
[ <xsl:value-of select="currency"/> ]
+                                       </xsl:if>
+                                       <div class="pure-control-group">
+                                               <xsl:variable 
name="lang_budget">
+                                                       <xsl:value-of 
select="php:function('lang', 'budget')"/>
+                                               </xsl:variable>
+                                               <label for="name">
+                                                       <xsl:value-of 
select="$lang_budget"/>
+                                               </label>
+                                               <div class="pure-custom">
+                                                       <div>
+                                                               <input 
data-validation="number" data-validation-allowing="float" 
data-validation-decimal-separator="{$decimal_separator}" type="text" 
name="values[budget]" value="{value_budget}">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'Enter the budget')"/>
+                                                                       
</xsl:attribute>
+                                                                       
<xsl:choose>
+                                                                               
<xsl:when  test="not(value_project_id &gt; 0) and 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"/>
+                                                                               
        </xsl:attribute>
+                                                                               
</xsl:when>
+                                                                               
<xsl:when  test="value_project_id &gt; 0 and not(check_for_budget &gt; 0) and 
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"/>
+                                                                               
        </xsl:attribute>
+                                                                               
</xsl:when>
+                                                                               
<xsl:otherwise>
+                                                                               
        <xsl:attribute name="data-validation-optional">
+                                                                               
                <xsl:text>true</xsl:text>
+                                                                               
        </xsl:attribute>
+                                                                               
</xsl:otherwise>
+                                                                       
</xsl:choose>
+                                                               </input>
+                                                               <xsl:text> 
</xsl:text> [ <xsl:value-of select="currency"/> ]
+                                                               <select 
name="values[budget_year]">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'year')"/>
+                                                                       
</xsl:attribute>
+                                                                       <option 
value="0">
+                                                                               
<xsl:value-of select="php:function('lang', 'year')"/>
+                                                                       
</option>
+                                                                       
<xsl:apply-templates select="year_list/options"/>
+                                                               </select>
+                                                               <xsl:choose>
+                                                                       
<xsl:when test="project_type_id ='3'">
+                                                                               
<input type="checkbox" name="values[budget_reset_buffer]" value="1">
+                                                                               
        <xsl:attribute name="title">
+                                                                               
                <xsl:value-of select="php:function('lang', 'delete')"/>
+                                                                               
                <xsl:text> </xsl:text>
+                                                                               
                <xsl:value-of select="php:function('lang', 'buffer')"/>
+                                                                               
                <xsl:text> </xsl:text>
+                                                                               
                <xsl:value-of select="php:function('lang', 'budget')"/>
+                                                                               
        </xsl:attribute>
+                                                                               
</input>
+                                                                       
</xsl:when>
+                                                               </xsl:choose>
+                                                               <xsl:choose>
+                                                                       
<xsl:when test="project_type_id !='3'">
+                                                                               
<select name="values[budget_periodization]">
+                                                                               
        <xsl:attribute name="title">
+                                                                               
                <xsl:value-of select="php:function('lang', 'periodization')"/>
+                                                                               
        </xsl:attribute>
+                                                                               
        <option value="0">
+                                                                               
                <xsl:value-of select="php:function('lang', 'periodization')"/>
+                                                                               
        </option>
+                                                                               
        <xsl:apply-templates select="periodization_list/options"/>
+                                                                               
</select>
+                                                                               
<input type="checkbox" name="values[budget_periodization_all]" value="True">
+                                                                               
        <xsl:attribute name="title">
+                                                                               
                <xsl:value-of select="php:function('lang', 'all')"/>
+                                                                               
                <xsl:text> </xsl:text>
+                                                                               
                <xsl:value-of select="php:function('lang', 'periods')"/>
+                                                                               
        </xsl:attribute>
+                                                                               
</input>
+                                                                               
<input type="checkbox" name="values[budget_periodization_activate]" value="1">
+                                                                               
        <xsl:attribute name="title">
+                                                                               
                <xsl:value-of select="php:function('lang', 'activate')"/>
+                                                                               
        </xsl:attribute>
+                                                                               
        <xsl:attribute name="checked" value="checked"/>
+                                                                               
</input>
+                                                                       
</xsl:when>
+                                                               </xsl:choose>
+                                                       </div>
                                                </div>
-                                               <div class="pure-control-group">
-                                                       <label for="name">
-                                                               <xsl:value-of 
select="lang_remainder"/>
-                                                       </label>
-                                                       <xsl:value-of 
select="value_remainder"/>
-                                                       <xsl:text> </xsl:text> 
[ <xsl:value-of select="currency"/> ]
+                                       </div>
+                                       <xsl:choose>
+                                               <xsl:when 
test="value_project_id > 0 ">
+                                                       <div 
class="pure-custom">
+                                                               <label 
for="name">
+                                                                       
<xsl:value-of select="php:function('lang', 'budget')"/>
+                                                               </label>
+                                                               <xsl:for-each 
select="datatable_def">
+                                                                       <xsl:if 
test="container = 'datatable-container_0'">
+                                                                               
<xsl:call-template name="table_setup">
+                                                                               
        <xsl:with-param name="container" select ='container'/>
+                                                                               
        <xsl:with-param name="requestUrl" select ='requestUrl' />
+                                                                               
        <xsl:with-param name="ColumnDefs" select ='ColumnDefs' />
+                                                                               
        <xsl:with-param name="tabletools" select ='tabletools' />
+                                                                               
        <xsl:with-param name="data" select ='data' />
+                                                                               
        <xsl:with-param name="config" select ='config' />
+                                                                               
</xsl:call-template>
+                                                                       
</xsl:if>
+                                                               </xsl:for-each>
+                                                       </div>
+                                               </xsl:when>
+                                       </xsl:choose>
+                                       <xsl:choose>
+                                               <xsl:when 
test="value_project_id > 0 and mode='edit'">
+                                                       <div 
class="pure-control-group">
+                                                               <label 
for="name">
+                                                                       
<xsl:value-of select="php:function('lang', 'transfer')"/>
+                                                               </label>
+                                                               <div 
class="pure-custom">
+                                                                       <table>
+                                                                               
<tr>
+                                                                               
        <td>
+                                                                               
                <xsl:value-of select="php:function('lang', 'amount')"/>
+                                                                               
        </td>
+                                                                               
        <td>
+                                                                               
                <xsl:value-of select="php:function('lang', 'project')"/>
+                                                                               
        </td>
+                                                                               
        <td>
+                                                                               
                <xsl:value-of select="php:function('lang', 'remark')"/>
+                                                                               
        </td>
+                                                                               
</tr>
+                                                                               
<tr>
+                                                                               
        <td>
+                                                                               
                <input type="text" name="values[transfer_amount]" value="">
+                                                                               
                        <xsl:attribute name="title">
+                                                                               
                                <xsl:value-of select="php:function('lang', 
'amount to transfer')"/>
+                                                                               
                        </xsl:attribute>
+                                                                               
                </input>
+                                                                               
        </td>
+                                                                               
        <td>
+                                                                               
                <input type="text" name="values[transfer_target]" value="">
+                                                                               
                        <xsl:attribute name="title">
+                                                                               
                                <xsl:value-of select="php:function('lang', 
'target project')"/>
+                                                                               
                        </xsl:attribute>
+                                                                               
                </input>
+                                                                               
        </td>
+                                                                               
        <td>
+                                                                               
                <input type="text" name="values[transfer_remark]" value="">
+                                                                               
                        <xsl:attribute name="title">
+                                                                               
                                <xsl:value-of select="php:function('lang', 
'remark')"/>
+                                                                               
                        </xsl:attribute>
+                                                                               
                </input>
+                                                                               
        </td>
+                                                                               
</tr>
+                                                                       </table>
+                                                               </div>
+                                                       </div>
+                                               </xsl:when>
+                                       </xsl:choose>
+                                       <xsl:choose>
+                                               <xsl:when test="project_type_id 
!='3'">
+                                                       <div 
class="pure-control-group">
+                                                               <label 
for="name">
+                                                                       
<xsl:value-of select="lang_reserve"/>
+                                                               </label>
+                                                               <input 
data-validation="number" data-validation-allowing="float" 
data-validation-decimal-separator="{$decimal_separator}" type="text" 
name="values[reserve]" value="{value_reserve}">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="lang_reserve_statustext"/>
+                                                                       
</xsl:attribute>
+                                                                       
<xsl:attribute name="data-validation-optional">
+                                                                               
<xsl:text>true</xsl:text>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                               <xsl:text> 
</xsl:text> [ <xsl:value-of select="currency"/> ]
+                                                       </div>
+                                                       <div 
class="pure-control-group">
+                                                               <label 
for="name">
+                                                                       
<xsl:value-of select="lang_sum"/>
+                                                               </label>
+                                                               <xsl:value-of 
select="value_sum"/>
+                                                               <xsl:text> 
</xsl:text> [ <xsl:value-of select="currency"/> ]
+                                                       </div>
+                                                       <div 
class="pure-control-group">
+                                                               <label 
for="name">
+                                                                       
<xsl:value-of select="lang_remainder"/>
+                                                               </label>
+                                                               <xsl:value-of 
select="value_remainder"/>
+                                                               <xsl:text> 
</xsl:text> [ <xsl:value-of select="currency"/> ]
+                                                       </div>
+                                                       <div 
class="pure-control-group">
+                                                               <label 
for="name">
+                                                                       
<xsl:value-of select="lang_reserve_remainder"/>
+                                                               </label>
+                                                               <xsl:value-of 
select="value_reserve_remainder"/>
+                                                               <xsl:text> 
</xsl:text> [ <xsl:value-of select="currency"/> ]
+                                                               <xsl:text> 
</xsl:text> ( <xsl:value-of select="value_reserve_remainder_percent"/>
+                                                               <xsl:text> % 
)</xsl:text>
+                                                       </div>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                                       <div class="pure-control-group">
+                                               <label for="name">
+                                                       <xsl:value-of 
select="lang_workorder_id"/>
+                                               </label>
+                                               <xsl:choose>
+                                                       <xsl:when 
test="value_project_id = 0">
+                                                               <xsl:value-of 
select="lang_no_workorders"/>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <select id = 
"order_time_span" name="order_time_span">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'select')"/>
+                                                                       
</xsl:attribute>
+                                                                       <option 
value="0">
+                                                                               
<xsl:value-of select="php:function('lang', 'select')"/>
+                                                                       
</option>
+                                                                       
<xsl:apply-templates select="order_time_span/options"/>
+                                                               </select>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
+                                       </div>
+                                       <xsl:if test="value_project_id > 0">
+
+                                               <div class="pure-custom">
+                                                       <xsl:for-each 
select="datatable_def">
+                                                               <xsl:if 
test="container = 'datatable-container_1'">
+                                                                       
<xsl:call-template name="table_setup">
+                                                                               
<xsl:with-param name="container" select ='container'/>
+                                                                               
<xsl:with-param name="requestUrl" select ='requestUrl' />
+                                                                               
<xsl:with-param name="ColumnDefs" select ='ColumnDefs' />
+                                                                               
<xsl:with-param name="tabletools" select ='tabletools' />
+                                                                               
<xsl:with-param name="data" select ='data' />
+                                                                               
<xsl:with-param name="config" select ='config' />
+                                                                       
</xsl:call-template>
+                                                               </xsl:if>
+                                                       </xsl:for-each>
                                                </div>
-                                               <div class="pure-control-group">
+                                               <div class="pure-control-group 
pure-custom">
                                                        <label for="name">
-                                                               <xsl:value-of 
select="lang_reserve_remainder"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'invoice')"/>
                                                        </label>
-                                                       <xsl:value-of 
select="value_reserve_remainder"/>
-                                                       <xsl:text> </xsl:text> 
[ <xsl:value-of select="currency"/> ]
-                                                       <xsl:text> </xsl:text> 
( <xsl:value-of select="value_reserve_remainder_percent"/>
-                                                       <xsl:text> % 
)</xsl:text>
+                                                       <xsl:for-each 
select="datatable_def">
+                                                               <xsl:if 
test="container = 'datatable-container_2'">
+                                                                       
<xsl:call-template name="table_setup">
+                                                                               
<xsl:with-param name="container" select ='container'/>
+                                                                               
<xsl:with-param name="requestUrl" select ='requestUrl' />
+                                                                               
<xsl:with-param name="ColumnDefs" select ='ColumnDefs' />
+                                                                               
<xsl:with-param name="tabletools" select ='tabletools' />
+                                                                               
<xsl:with-param name="data" select ='data' />
+                                                                               
<xsl:with-param name="config" select ='config' />
+                                                                       
</xsl:call-template>
+                                                               </xsl:if>
+                                                       </xsl:for-each>
                                                </div>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                               <!--div class="pure-control-group"-->
-                               <label for="name">
-                                       <xsl:value-of 
select="lang_workorder_id"/>
-                               </label>
-                               <xsl:choose>
-                                       <xsl:when 
test="sum_workorder_budget=''">
-                                               <xsl:value-of 
select="lang_no_workorders"/>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <!--div class="pure-custom">
-                                               <div-->
-                                               <select id = "order_time_span" 
name="order_time_span">
-                                                       <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="php:function('lang', 'select')"/>
-                                                       </xsl:attribute>
-                                                       <option value="0">
-                                                               <xsl:value-of 
select="php:function('lang', 'select')"/>
-                                                       </option>
-                                                       <xsl:apply-templates 
select="order_time_span/options"/>
-                                               </select>
-                                               <!--/div>
-                                               <div-->
-                                               <xsl:for-each 
select="datatable_def">
-                                                       <xsl:if test="container 
= 'datatable-container_1'">
-                                                               
<xsl:call-template name="table_setup">
-                                                                       
<xsl:with-param name="container" select ='container'/>
-                                                                       
<xsl:with-param name="requestUrl" select ='requestUrl' />
-                                                                       
<xsl:with-param name="ColumnDefs" select ='ColumnDefs' />
-                                                                       
<xsl:with-param name="tabletools" select ='tabletools' />
-                                                                       
<xsl:with-param name="data" select ='data' />
-                                                                       
<xsl:with-param name="config" select ='config' />
-                                                               
</xsl:call-template>
-                                                       </xsl:if>
-                                               </xsl:for-each>
-                                               <!--/div>
-                                               </div-->
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                               <!--/div-->
-                               <!--div class="pure-control-group"-->
-                               <label for="name">
-                                       <xsl:value-of 
select="php:function('lang', 'invoice')"/>
-                               </label>
-                               <!--div class="pure-custom"-->
-                               <xsl:for-each select="datatable_def">
-                                       <xsl:if test="container = 
'datatable-container_2'">
-                                               <xsl:call-template 
name="table_setup">
-                                                       <xsl:with-param 
name="container" select ='container'/>
-                                                       <xsl:with-param 
name="requestUrl" select ='requestUrl' />
-                                                       <xsl:with-param 
name="ColumnDefs" select ='ColumnDefs' />
-                                                       <xsl:with-param 
name="tabletools" select ='tabletools' />
-                                                       <xsl:with-param 
name="data" select ='data' />
-                                                       <xsl:with-param 
name="config" select ='config' />
-                                               </xsl:call-template>
                                        </xsl:if>
-                               </xsl:for-each>
-                               <!--/div-->
-                               <!--/div-->
-                               <!--/fieldset-->
+                               </fieldset>
                        </div>
 
                        <div id="coordination">




reply via email to

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