fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14969] property: more on integration


From: Sigurd Nes
Subject: [Fmsystem-commits] [14969] property: more on integration
Date: Wed, 04 May 2016 08:19:07 +0000

Revision: 14969
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14969
Author:   sigurdne
Date:     2016-05-04 08:19:06 +0000 (Wed, 04 May 2016)
Log Message:
-----------
property: more on integration

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

Modified: trunk/property/inc/class.uiimport.inc.php
===================================================================
--- trunk/property/inc/class.uiimport.inc.php   2016-05-03 14:05:33 UTC (rev 
14968)
+++ trunk/property/inc/class.uiimport.inc.php   2016-05-04 08:19:06 UTC (rev 
14969)
@@ -50,6 +50,7 @@
 
                        $this->valid_tables = array
                                (
+                               'fm_streetaddress' => array('name' => 
'fm_streetaddress (' . lang('street name') . ')', 'permission' => 
PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
                                'fm_unspsc_code' => array('name' => 
'fm_unspsc_code (' . lang('unspsc code') . ')', 'permission' => PHPGW_ACL_READ 
| PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
                                'fm_external_project' => array('name' => 
'fm_external_project (' . lang('external project') . ')', 'permission' => 
PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
                                'fm_eco_service' => array('name' => 
'fm_eco_service (' . lang('service') . ')', 'permission' => PHPGW_ACL_READ | 
PHPGW_ACL_ADD | PHPGW_ACL_EDIT),

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2016-05-03 14:05:33 UTC (rev 
14968)
+++ trunk/property/inc/class.uitts.inc.php      2016-05-04 08:19:06 UTC (rev 
14969)
@@ -2734,6 +2734,7 @@
                        $tabs['history'] = array('label' => lang('History'), 
'link' => '#history');
                        $active_tab = 'general';
 
+                       $unspsc_code = $ticket['unspsc_code'] ? 
$ticket['unspsc_code'] : 
$GLOBALS['phpgw_info']['user']['preferences']['property']['unspsc_code'];
                        $data = array
                                (
                                'datatable_def' => $datatable_def,
@@ -2753,8 +2754,8 @@
                                'value_service_name' => 
$this->_get_eco_service_name($ticket['service_id']),
                                'value_external_project_id' => 
$ticket['external_project_id'],
                                'value_external_project_name' => 
$this->_get_external_project_name($ticket['external_project_id']),
-                               'value_unspsc_code' => $ticket['unspsc_code'],
-                               'value_unspsc_code_name' => 
$this->_get_unspsc_code_name($ticket['unspsc_code']),
+                               'value_unspsc_code' => $unspsc_code,
+                               'value_unspsc_code_name' => 
$this->_get_unspsc_code_name($unspsc_code),
                                'value_budget' => $ticket['budget'],
                                'value_actual_cost' => $ticket['actual_cost'],
                                'year_list' => array('options' => 
$this->bocommon->select_list($ticket['actual_cost_year'] ? 
$ticket['actual_cost_year'] : date('Y'), $year_list)),
@@ -2845,7 +2846,8 @@
                                'preview_html' => 
"javascript:preview_html($id)",
                                'preview_pdf' => "javascript:preview_pdf($id)",
                                'tabs' => 
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
-                               'value_order_received'  => 
$GLOBALS['phpgw']->common->show_date($ticket['order_received']),
+                               'value_order_sent'      => 
$ticket['order_sent'],
+                               'value_order_received'  => 
$ticket['order_received'] ? 
$GLOBALS['phpgw']->common->show_date($ticket['order_received']) : '[ DD/MM/YYYY 
- H:i ]',
                                'value_order_received_percent' => (int) 
$ticket['order_received_percent']
                        );
 

Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php        2016-05-03 14:05:33 UTC 
(rev 14968)
+++ trunk/property/inc/class.uiworkorder.inc.php        2016-05-04 08:19:06 UTC 
(rev 14969)
@@ -2210,6 +2210,8 @@
                                }
                        }
 
+                       $unspsc_code = $values['unspsc_code'] ? 
$values['unspsc_code'] : 
$GLOBALS['phpgw_info']['user']['preferences']['property']['unspsc_code'];
+
                        $data = array
                                (
                                'datatable_def' => $datatable_def,
@@ -2369,12 +2371,13 @@
                                                'type' => 'tax', 'selected' => 
$values['tax_code'], 'order' => 'id',
                                                'id_in_name' => 'num'))),
                                'contract_list' => array('options' => 
$this->get_vendor_contract($values['vendor_id'], $values['contract_id']) ),
-                               'value_unspsc_code' => $values['unspsc_code'],
-                               'value_unspsc_code_name' => 
$this->_get_unspsc_code_name($values['unspsc_code']),
+                               'value_unspsc_code' => $unspsc_code,
+                               'value_unspsc_code_name' => 
$this->_get_unspsc_code_name($unspsc_code),
                                'collect_building_part' => 
$collect_building_part,
                                'building_part_list' => $building_part_list,
                                'order_dim1_list' => $order_dim1_list,
-                               'value_order_received'  => 
$GLOBALS['phpgw']->common->show_date($values['order_received']),
+                               'value_order_sent'      => 
$values['order_sent'],
+                               'value_order_received'  => 
$values['order_received'] ? 
$GLOBALS['phpgw']->common->show_date($values['order_received']) : '[ DD/MM/YYYY 
- H:i ]',
                                'value_order_received_percent' => (int) 
$values['order_received_percent']
                        );
 

Modified: trunk/property/inc/hook_settings.inc.php
===================================================================
--- trunk/property/inc/hook_settings.inc.php    2016-05-03 14:05:33 UTC (rev 
14968)
+++ trunk/property/inc/hook_settings.inc.php    2016-05-04 08:19:06 UTC (rev 
14969)
@@ -269,6 +269,7 @@
        $ecodimb->get_location_info('dimb', false);
        $values_dimb = $ecodimb->read(array('sort' => 'ASC', 'order' => 'id', 
'allrows' => true));
 
+       $_dimb = array();
        foreach ($values_dimb as $entry)
        {
                $_dimb[$entry['id']] = "{$entry['id']} - {$entry['descr']}";
@@ -279,7 +280,22 @@
        unset($_dimb);
        unset($ecodimb);
        unset($values_dimb);
+       unset($entry);
 
+       $sogeneric = CreateObject('property.sogeneric', 'unspsc_code');
+       $_values_unspsc_code = $sogeneric->read(array('allrows' => true));
+       $_unspsc_code = array();
+       foreach ($_values_unspsc_code as &$entry)
+       {
+               $_unspsc_code[$entry['id']] = "{$entry['id']} {$entry['name']}";
+       }
+
+       create_select_box('unspsc code', 'unspsc_code', $_unspsc_code, 'default 
unspsc code');
+       unset($sogeneric);
+       unset($_unspsc_code);
+       unset($entry);
+       unset($_values_unspsc_code);
+
        create_select_box('Workorder Approval From', 'approval_from', 
$_accounts, 'If you need approval from your supervisor for 
projects/workorders');
 
        //      if(!$email_org)

Modified: trunk/property/templates/base/tts.xsl
===================================================================
--- trunk/property/templates/base/tts.xsl       2016-05-03 14:05:33 UTC (rev 
14968)
+++ trunk/property/templates/base/tts.xsl       2016-05-04 08:19:06 UTC (rev 
14969)
@@ -1054,6 +1054,11 @@
                                                                                
        <xsl:attribute name="title">
                                                                                
                <xsl:value-of select="$lang_receive_order"/>
                                                                                
        </xsl:attribute>
+                                                                               
        <xsl:if test="value_order_sent != 1">
+                                                                               
                <xsl:attribute name="disabled">
+                                                                               
                        <xsl:text>disabled</xsl:text>
+                                                                               
                </xsl:attribute>
+                                                                               
        </xsl:if>
                                                                                
</input>
                                                                                
<div id="order_received_time" class="pure-custom">
                                                                                
        <xsl:value-of select="value_order_received"/>

Modified: trunk/property/templates/base/workorder.xsl
===================================================================
--- trunk/property/templates/base/workorder.xsl 2016-05-03 14:05:33 UTC (rev 
14968)
+++ trunk/property/templates/base/workorder.xsl 2016-05-04 08:19:06 UTC (rev 
14969)
@@ -972,7 +972,7 @@
                                                </input>
                                        </div>
                                        <xsl:choose>
-                                               <xsl:when 
test="value_workorder_id!='' and mode='edit'">
+                                               <xsl:when test="mode='edit'">
                                                        <div 
class="pure-control-group">
                                                                <label 
for="name">
                                                                        
<xsl:value-of select="php:function('lang', 'order received')"/>
@@ -984,6 +984,11 @@
                                                                        
<xsl:attribute name="title">
                                                                                
<xsl:value-of select="$lang_receive_order"/>
                                                                        
</xsl:attribute>
+                                                                       <xsl:if 
test="value_order_sent != 1">
+                                                                               
<xsl:attribute name="disabled">
+                                                                               
        <xsl:text>disabled</xsl:text>
+                                                                               
</xsl:attribute>
+                                                                       
</xsl:if>
                                                                </input>
                                                                <div 
id="order_received_time" class="pure-custom">
                                                                        
<xsl:value-of select="value_order_received"/>




reply via email to

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