[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [12020] property: add field for actual cost year in t
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [12020] property: add field for actual cost year in tickets |
Date: |
Mon, 23 Jun 2014 14:29:25 +0000 |
Revision: 12020
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12020
Author: sigurdne
Date: 2014-06-23 14:29:25 +0000 (Mon, 23 Jun 2014)
Log Message:
-----------
property: add field for actual cost year in tickets
Modified Paths:
--------------
trunk/property/inc/class.botts.inc.php
trunk/property/inc/class.sotts.inc.php
trunk/property/inc/class.uitts.inc.php
trunk/property/setup/setup.inc.php
trunk/property/setup/tables_current.inc.php
trunk/property/setup/tables_update.inc.php
trunk/property/templates/base/tts.xsl
Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php 2014-06-23 12:35:24 UTC (rev
12019)
+++ trunk/property/inc/class.botts.inc.php 2014-06-23 14:29:25 UTC (rev
12020)
@@ -260,6 +260,12 @@
'name'=> lang('actual cost')
);
+ $columns['actual_cost_year'] = array
+ (
+ 'id' => 'actual_cost_year',
+ 'name'=> lang('year')
+ );
+
$columns['difference'] = array
(
'id' => 'difference',
Modified: trunk/property/inc/class.sotts.inc.php
===================================================================
--- trunk/property/inc/class.sotts.inc.php 2014-06-23 12:35:24 UTC (rev
12019)
+++ trunk/property/inc/class.sotts.inc.php 2014-06-23 14:29:25 UTC (rev
12020)
@@ -459,7 +459,7 @@
$return_fields =
"fm_tts_tickets.id,fm_tts_tickets.assignedto,fm_tts_tickets.status,fm_tts_tickets.user_id,"
.
"fm_tts_tickets.subject,fm_tts_tickets.address,fm_tts_tickets.location_code,fm_tts_tickets.priority,fm_tts_tickets.cat_id,fm_tts_tickets.group_id,"
.
"fm_tts_tickets.entry_date,fm_tts_tickets.modified_date,fm_tts_tickets.finnish_date,fm_tts_tickets.finnish_date2,fm_tts_tickets.order_id,fm_tts_tickets.vendor_id,fm_tts_tickets.actual_cost,"
- .
"fm_tts_tickets.budget,fm_tts_tickets.billable_hours,fm_district.descr as
district,fm_tts_views.id as view,fm_location1.loc1_name,fm_tts_tickets.ecodimb
{$result_order_field}";
+ .
"fm_tts_tickets.actual_cost_year,fm_tts_tickets.budget,fm_tts_tickets.billable_hours,fm_district.descr
as district,fm_tts_views.id as
view,fm_location1.loc1_name,fm_tts_tickets.ecodimb {$result_order_field}";
$custom_cols = $this->custom->find('property',
'.ticket', 0, '', 'ASC', 'attrib_sort', true, true);
@@ -601,6 +601,7 @@
'order_id'
=> $this->db->f('order_id'),
'vendor_id'
=> $this->db->f('vendor_id'),
'actual_cost'
=> $this->db->f('actual_cost'),
+ 'actual_cost_year'
=> $this->db->f('actual_cost_year'),
'estimate'
=> $this->db->f('budget'),
'new_ticket'
=> $this->db->f('view') ? false : true,
'billable_hours'
=> $this->db->f('billable_hours'),
@@ -692,6 +693,7 @@
$ticket['ecodimb'] =
$this->db->f('ecodimb');
$ticket['budget'] =
$this->db->f('budget');
$ticket['actual_cost'] =
$this->db->f('actual_cost');
+ $ticket['actual_cost_year'] =
$this->db->f('actual_cost_year');
$ticket['order_cat_id'] =
$this->db->f('order_cat_id');
$ticket['building_part'] =
$this->db->f('building_part',true);
$ticket['order_dim1'] =
$this->db->f('order_dim1');
@@ -1466,13 +1468,12 @@
$this->historylog->add('B',$id,$ticket['budget'],$old_budget);
}
- $value_set['vendor_id'] =
$ticket['vendor_id'];
- $value_set['b_account_id'] =
$ticket['b_account_id'];
- $value_set['order_descr'] =
$this->db->db_addslashes($ticket['order_descr']);
- $value_set['ecodimb'] =
$ticket['ecodimb'];
-// $value_set['budget'] =
$ticket['budget'];
- $value_set['branch_id'] =
$ticket['branch_id'];
-
+ $value_set['vendor_id'] =
$ticket['vendor_id'];
+ $value_set['b_account_id'] =
$ticket['b_account_id'];
+ $value_set['order_descr'] =
$this->db->db_addslashes($ticket['order_descr']);
+ $value_set['ecodimb'] =
$ticket['ecodimb'];
+ $value_set['actual_cost_year'] =
$ticket['actual_cost_year'];
+ $value_set['branch_id'] =
$ticket['branch_id'];
}
$value_set =
$this->db->validate_update($value_set);
Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php 2014-06-23 12:35:24 UTC (rev
12019)
+++ trunk/property/inc/class.uitts.inc.php 2014-06-23 14:29:25 UTC (rev
12020)
@@ -3289,6 +3289,19 @@
$property_js =
"/phpgwapi/inc/combine.php?cachedir={$cachedir}&type=javascript&files=" .
str_replace('/', '--', ltrim($property_js,'/'));
}
+ $year = date('Y') -1;
+ $limit = $year + 3;
+
+ while ($year < $limit)
+ {
+ $year_list[] = array
+ (
+ 'id' => $year,
+ 'name' => $year
+ );
+ $year++;
+ }
+
$data = array
(
'custom_attributes'
=> array('attributes' => $ticket['attributes']),
@@ -3304,6 +3317,7 @@
'ecodimb_data'
=> $ecodimb_data,
'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 )),
'need_approval'
=> $need_approval,
'value_approval_mail_address' =>
$supervisor_email,
// 'vendor_email'
=> $vendor_email,
Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php 2014-06-23 12:35:24 UTC (rev 12019)
+++ trunk/property/setup/setup.inc.php 2014-06-23 14:29:25 UTC (rev 12020)
@@ -12,7 +12,7 @@
*/
$setup_info['property']['name'] = 'property';
- $setup_info['property']['version'] = '0.9.17.681';
+ $setup_info['property']['version'] = '0.9.17.683';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2014-06-23 12:35:24 UTC (rev
12019)
+++ trunk/property/setup/tables_current.inc.php 2014-06-23 14:29:25 UTC (rev
12020)
@@ -1059,6 +1059,7 @@
'ecodimb' => array('type' => 'int','precision'
=> 4,'nullable' => True),
'budget' => array('type' => 'int','precision'
=> '4','nullable' => True),
'actual_cost' => array('type' =>
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' =>
'0.00'),
+ 'actual_cost_year' => array('type' =>
'int','precision' => '4','nullable' => True),
'order_cat_id' => array('type' =>
'int','precision' => '4','nullable' => True),
'building_part'=> array('type' =>
'varchar','precision' => 4,'nullable' => True),
'order_dim1'=> array('type' =>
'int','precision' => 4,'nullable' => True),
@@ -1728,9 +1729,9 @@
'fm_document_relation' => array(
'fd' => array(
'id' => array('type' => 'auto','precision' =>
'4','nullable' => False),
- 'document_id' => array('type' =>
'int','precision' => '4','nullable' => True),
- 'location_id' => array('type' =>
'int','precision' => '4','nullable' => True),
- 'location_item_id' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'document_id' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'location_id' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'location_item_id' => array('type' =>
'int','precision' => '4','nullable' => False),
'entry_date' => array('type' =>
'int','precision' => '4','nullable' => True),
),
'pk' => array('id'),
Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php 2014-06-23 12:35:24 UTC (rev
12019)
+++ trunk/property/setup/tables_update.inc.php 2014-06-23 14:29:25 UTC (rev
12020)
@@ -8046,9 +8046,9 @@
'fm_document_relation', array(
'fd' => array(
'id' => array('type' =>
'auto','precision' => '4','nullable' => False),
- 'document_id' => array('type' =>
'int','precision' => '4','nullable' => True),
- 'location_id' => array('type' =>
'int','precision' => '4','nullable' => True),
- 'location_item_id' => array('type' =>
'int','precision' => '4','nullable' => True),
+ 'document_id' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'location_id' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'location_item_id' => array('type' =>
'int','precision' => '4','nullable' => False),
'entry_date' => array('type' =>
'int','precision' => '4','nullable' => True),
),
'pk' => array('id'),
@@ -8064,3 +8064,16 @@
return $GLOBALS['setup_info']['property']['currentver'];
}
}
+
+ $test[] = '0.9.17.682';
+ function property_upgrade0_9_17_682()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_tts_tickets','actual_cost_year',array('type'
=> 'int','precision' => 4,'nullable' => True));
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.683';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
+ }
Modified: trunk/property/templates/base/tts.xsl
===================================================================
--- trunk/property/templates/base/tts.xsl 2014-06-23 12:35:24 UTC (rev
12019)
+++ trunk/property/templates/base/tts.xsl 2014-06-23 14:29:25 UTC (rev
12020)
@@ -944,7 +944,22 @@
</label>
</td>
<td>
-
<input type="text" name="values[actual_cost]"
value="{value_actual_cost}"><xsl:attribute name="title"><xsl:value-of
select="php:function('lang', 'Enter actual
cost')"/></xsl:attribute></input><!--<xsl:value-of select="value_actual_cost"/>
--><xsl:text> </xsl:text> [ <xsl:value-of select="currency"/> ]
+
<input type="text" name="values[actual_cost]"
value="{value_actual_cost}">
+
<xsl:attribute name="title">
+
<xsl:value-of
select="php:function('lang', 'Enter actual cost')"/>
+
</xsl:attribute>
+
</input>
+
<xsl:text> </xsl:text> [ <xsl:value-of
select="currency"/> ]
+
<xsl:variable name="lang_year"><xsl:value-of
select="php:function('lang', 'year')"/></xsl:variable>
+
+
<select name="values[actual_cost_year]">
+
<xsl:attribute name="title">
+
<xsl:value-of select='$lang_year'/>
+
</xsl:attribute>
+
<xsl:apply-templates
select="year_list/options"/>
+
</select>
+
+
<xsl:text> </xsl:text> [ <xsl:value-of
select='$lang_year'/> ]
</td>
</tr>
<tr>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [12020] property: add field for actual cost year in tickets,
Sigurd Nes <=