[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8991] property: approval and veendor email
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [8991] property: approval and veendor email |
Date: |
Sun, 18 Mar 2012 21:07:16 +0000 |
Revision: 8991
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8991
Author: sigurdne
Date: 2012-03-18 21:07:15 +0000 (Sun, 18 Mar 2012)
Log Message:
-----------
property: approval and veendor email
Modified Paths:
--------------
trunk/property/inc/class.boworkorder.inc.php
trunk/property/inc/class.soworkorder.inc.php
trunk/property/inc/class.uitts.inc.php
trunk/property/inc/class.uiworkorder.inc.php
trunk/property/js/yahoo/workorder.edit.js
trunk/property/setup/phpgw_no.lang
trunk/property/setup/setup.inc.php
trunk/property/setup/tables_current.inc.php
trunk/property/setup/tables_update.inc.php
trunk/property/templates/base/workorder.xsl
Modified: trunk/property/inc/class.boworkorder.inc.php
===================================================================
--- trunk/property/inc/class.boworkorder.inc.php 2012-03-17 21:06:17 UTC
(rev 8990)
+++ trunk/property/inc/class.boworkorder.inc.php 2012-03-18 21:07:15 UTC
(rev 8991)
@@ -625,6 +625,8 @@
case 'ON': $type = lang('Owner
notified'); break;
case 'H': $type = lang('Billable hours
changed'); break;
case 'NP': $type = lang('moved to
another project'); break;
+ case 'OA': $type = lang('order
approved'); break;
+ case 'OB': $type = lang('order approval
revoked'); break;
default:
}
Modified: trunk/property/inc/class.soworkorder.inc.php
===================================================================
--- trunk/property/inc/class.soworkorder.inc.php 2012-03-17 21:06:17 UTC
(rev 8990)
+++ trunk/property/inc/class.soworkorder.inc.php 2012-03-18 21:07:15 UTC
(rev 8991)
@@ -752,6 +752,8 @@
'grants'
=> (int)$this->grants[$this->db->f('user_id')],
'billable_hours'
=> $this->db->f('billable_hours'),
'contract_sum'
=> $this->db->f('contract_sum'),
+ 'approved'
=> $this->db->f('approved'),
+ 'mail_recipients'
=> explode(',', $this->db->f('mail_recipients')),
);
}
@@ -1013,13 +1015,15 @@
$workorder['ecodimb'],
$workorder['cat_id'],
$workorder['billable_hours'],
- $workorder['contract_sum']
+ $workorder['contract_sum'],
+ $workorder['approved'],
+ isset($workorder['vendor_email']) &&
is_array($workorder['vendor_email']) ? implode(',', $workorder['vendor_email'])
: ''
);
$values = $this->bocommon->validate_db_insert($values);
$this->db->query("INSERT INTO fm_workorder
(id,num,project_id,title,access,entry_date,start_date,end_date,status,"
- .
"descr,budget,combined_cost,account_id,rig_addition,addition,key_deliver,key_fetch,vendor_id,charge_tenant,user_id,ecodimb,category,billable_hours,contract_sum
$cols) "
+ .
"descr,budget,combined_cost,account_id,rig_addition,addition,key_deliver,key_fetch,vendor_id,charge_tenant,user_id,ecodimb,category,billable_hours,contract_sum,approved,'mail_recipients
$cols) "
. "VALUES ( $values $vals)",__LINE__,__FILE__);
$this->db->query("INSERT INTO fm_orders (id,type)
VALUES ({$id},'workorder')");
@@ -1075,12 +1079,13 @@
$workorder['title'] =
$this->db->db_addslashes($workorder['title']);
$workorder['billable_hours'] =
(float)str_replace(',','.', $workorder['billable_hours']);
- $this->db->query("SELECT
status,budget,calculation,billable_hours FROM fm_workorder WHERE id =
{$workorder['id']}",__LINE__,__FILE__);
+ $this->db->query("SELECT
status,budget,calculation,billable_hours,approved FROM fm_workorder WHERE id =
{$workorder['id']}",__LINE__,__FILE__);
$this->db->next_record();
$old_status =
$this->db->f('status');
$old_budget =
$this->db->f('budget');
$old_billable_hours =
$this->db->f('billable_hours');
+ $old_approved = $this->db->f('approved');
if ($this->db->f('calculation') > 0)
{
@@ -1119,24 +1124,26 @@
$value_set = array
(
- 'title' =>
$workorder['title'],
- 'status' =>
$workorder['status'],
- 'start_date' =>
$workorder['start_date'],
- 'end_date' =>
$workorder['end_date'],
- 'descr' =>
$workorder['descr'],
- 'budget' =>
(int)$workorder['budget'],
- 'combined_cost' => $combined_cost,
- 'key_deliver' =>
$workorder['key_deliver'],
- 'key_fetch' =>
$workorder['key_fetch'],
- 'account_id' =>
$workorder['b_account_id'],
- 'rig_addition' =>
$workorder['addition_rs'],
- 'addition' =>
$workorder['addition_percentage'],
- 'charge_tenant' =>
$workorder['charge_tenant'],
- 'vendor_id' =>
$workorder['vendor_id'],
- 'ecodimb' =>
$workorder['ecodimb'],
- 'category' =>
$workorder['cat_id'],
- 'billable_hours'=>
$workorder['billable_hours'],
- 'contract_sum' =>
$workorder['contract_sum'],
+ 'title' =>
$workorder['title'],
+ 'status' =>
$workorder['status'],
+ 'start_date' =>
$workorder['start_date'],
+ 'end_date' =>
$workorder['end_date'],
+ 'descr' =>
$workorder['descr'],
+ 'budget' =>
(int)$workorder['budget'],
+ 'combined_cost' =>
$combined_cost,
+ 'key_deliver' =>
$workorder['key_deliver'],
+ 'key_fetch' =>
$workorder['key_fetch'],
+ 'account_id' =>
$workorder['b_account_id'],
+ 'rig_addition' =>
$workorder['addition_rs'],
+ 'addition' =>
$workorder['addition_percentage'],
+ 'charge_tenant' =>
$workorder['charge_tenant'],
+ 'vendor_id' =>
$workorder['vendor_id'],
+ 'ecodimb' =>
$workorder['ecodimb'],
+ 'category' =>
$workorder['cat_id'],
+ 'billable_hours' =>
$workorder['billable_hours'],
+ 'contract_sum' =>
$workorder['contract_sum'],
+ 'approved' =>
$workorder['approved'],
+ 'mail_recipients' =>
isset($workorder['vendor_email']) && is_array($workorder['vendor_email']) ?
implode(',', $workorder['vendor_email']) : '',
);
if($workorder['status'] == 'closed')
@@ -1185,6 +1192,20 @@
*/
// $this->update_planned_cost($workorder['project_id']);
// at project
+
+ if ($old_approved != $workorder['approved'])
+ {
+ if($workorder['approved'])
+ {
+
$historylog->add('OA',$workorder['id'],$workorder['approved'], $old_approved);
+ }
+ else//revoked
+ {
+
$historylog->add('OB',$workorder['id'],$workorder['approved'], $old_approved);
+ }
+ $check_pending_action = true;
+ }
+
$check_pending_action = false;
if ((float)$old_billable_hours !=
(float)$workorder['billable_hours'])
{
@@ -1210,7 +1231,7 @@
{
$this->db->query("SELECT * FROM
fm_workorder_status WHERE id = '{$workorder['status']}'");
$this->db->next_record();
- if ($this->db->f('approved') )
+ if ($this->db->f('approved') ||
$workorder['approved'] )
{
$action_params = array
(
Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php 2012-03-17 21:06:17 UTC (rev
8990)
+++ trunk/property/inc/class.uitts.inc.php 2012-03-18 21:07:15 UTC (rev
8991)
@@ -51,6 +51,7 @@
'edit_status' => true,
'edit_priority' => true,
'update_data' => true,
+ 'get_vendor_email' => true,
'_print' => true,
'columns' => true
);
@@ -2288,13 +2289,14 @@
$vendor_email =
execMethod('property.sowo_hour.get_email', $vendor_id);
$content_email = array();
+ $title = lang('The address to which this order will be
sendt');
foreach($vendor_email as $_entry )
{
$content_email[] = array
(
'value_email' =>
$_entry['email'],
- 'value_select' =>
'<input type="checkbox" name="values[vendor_email][]"
value="'.$_entry['email'].'" title="'.lang('The address to which this order
will be sendt').'">'
+ 'value_select' =>
"<input type='checkbox' name='values[vendor_email][]'
value='{$_entry['email']}' title='{$title}'>"
);
}
Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php 2012-03-17 21:06:17 UTC
(rev 8990)
+++ trunk/property/inc/class.uiworkorder.inc.php 2012-03-18 21:07:15 UTC
(rev 8991)
@@ -1616,6 +1616,44 @@
$myButtons[] = $notify_info['buttons'];
}
+
+
+ $myColumnDefs[] = array
+ (
+ 'name' => "4",
+ 'values' =>
json_encode(array( array('key' => 'value_email', 'label'=>lang('email'),
'sortable'=>true,'resizeable'=>true),
+
array('key' =>
'value_select','label'=>lang('select'),'sortable'=>false,'resizeable'=>true)))
+ );
+
+
+ $content_email =
execMethod('property.uitts.get_vendor_email', isset($values['vendor_id']) ?
$values['vendor_id'] : 0 );
+
+ if(isset($values['mail_recipients']) &&
is_array($values['mail_recipients']))
+ {
+ $_recipients_found = array();
+ foreach($content_email as &$vendor_email)
+ {
+
if(in_array($vendor_email['value_email'], $values['mail_recipients']))
+ {
+ $vendor_email['value_select']
= str_replace("type='checkbox'", "type='checkbox' checked='checked'",
$vendor_email['value_select']);
+ $_recipients_found[] =
$vendor_email['value_email'];
+ }
+ }
+ $value_extra_mail_address = implode(',',
array_diff($values['mail_recipients'], $_recipients_found));
+ }
+
+ $datavalues[] = array
+ (
+ 'name'
=> "4",
+ 'values'
=> json_encode($content_email),
+ 'total_records' =>
count($content_email),
+ 'permission' => "''",
+ 'is_paginator' => 0,
+ 'edit_action' => "''",
+ 'footer'
=> 0
+ );
+
+
$link_claim = '';
if(isset($values['charge_tenant'])?$values['charge_tenant']:'')
{
@@ -1795,6 +1833,7 @@
'lang_key_deliver'
=> lang('key deliver location'),
'lang_key_deliver_statustext'
=> lang('Select where to deliver the key'),
+ 'value_approved'
=> isset($values['approved']) ? $values['approved'] :
'',
'need_approval'
=> $need_approval,
'lang_ask_approval'
=> lang('Ask for approval'),
'lang_ask_approval_statustext'
=> lang('Check this to send a mail to your supervisor for approval'),
@@ -1811,10 +1850,12 @@
'lang_upload_file'
=> lang('Upload file'),
'lang_file_statustext'
=> lang('Select file to upload'),
'value_billable_hours'
=> $values['billable_hours'],
- 'base_java_notify_url'
=>
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:'{$id}'}",
+ 'base_java_url'
=>
"{menuaction:'property.uitts.get_vendor_email',phpgw_return_as:'json'}",
+ 'base_java_notify_url'
=>
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:'{$id}'}",
'edit_action'
=>
$GLOBALS['phpgw']->link('/index.php',array('menuaction' =>
'property.uiworkorder.edit', 'id' => $id)),
'lang_edit_statustext'
=> lang('Edit this entry '),
'lang_edit'
=> lang('Edit'),
+ 'value_extra_mail_address'
=> $value_extra_mail_address
);
$appname
= lang('Workorder');
Modified: trunk/property/js/yahoo/workorder.edit.js
===================================================================
--- trunk/property/js/yahoo/workorder.edit.js 2012-03-17 21:06:17 UTC (rev
8990)
+++ trunk/property/js/yahoo/workorder.edit.js 2012-03-18 21:07:15 UTC (rev
8991)
@@ -1,7 +1,9 @@
var myPaginator_0, myDataTable_0
var myPaginator_1, myDataTable_1;
var myPaginator_2, myDataTable_2;
+var myPaginator_3, myDataTable_3;
var lightbox;
+var vendor_id;
YAHOO.widget.DataTable.formatLink = function(elCell, oRecord, oColumn,
oData)
{
@@ -72,7 +74,7 @@
if(typeof(tableYUI)=='undefined')
{
- tableYUI =
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[0].parentNode;
+ tableYUI =
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[1].parentNode;
tableYUI.setAttribute("id","tableYUI");
}
else
@@ -105,6 +107,35 @@
/********************************************************************************/
+ this.fetch_vendor_email=function()
+ {
+// formObject = document.body.getElementsByTagName('form');
+// YAHOO.util.Connect.setForm(formObject[0]);//First form
+ if(document.getElementById('vendor_id').value)
+ {
+ base_java_url['vendor_id'] =
document.getElementById('vendor_id').value;
+ }
+
+ if(document.getElementById('vendor_id').value != vendor_id)
+ {
+ execute_async(myDataTable_4);
+ vendor_id = document.getElementById('vendor_id').value;
+ }
+ }
+
+
+ this.onDOMAttrModified = function(e)
+ {
+ var attr = e.attrName || e.propertyName
+ var target = e.target || e.srcElement;
+ if (attr.toLowerCase() == 'vendor_id')
+ {
+ fetch_vendor_email();
+ }
+ }
+
+
+
YAHOO.util.Event.addListener(window, "load", function()
{
loader = new YAHOO.util.YUILoader();
@@ -118,3 +149,19 @@
loader.insert();
});
+YAHOO.util.Event.addListener(window, "load", function()
+{
+ d = document.getElementById('vendor_id');
+ if(d)
+ {
+ if (d.attachEvent)
+ {
+ d.attachEvent('onpropertychange', onDOMAttrModified,
false);
+ }
+ else
+ {
+ d.addEventListener('DOMAttrModified',
onDOMAttrModified, false);
+ }
+ }
+});
+
Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang 2012-03-17 21:06:17 UTC (rev 8990)
+++ trunk/property/setup/phpgw_no.lang 2012-03-18 21:07:15 UTC (rev 8991)
@@ -881,6 +881,7 @@
input type property no input type
input name property no input navn
select value property no Angi verdi
+selected mail addresses property no Valgte adresser
insert the date for the acquisition property no angi dato for
anskaffelsen
insert the date for the initial value property no angi dato for
initiell verdi
insert the value at the start-date as a positive amount property
no angi verdie ved startdatoen som en positiv verdi
@@ -1143,6 +1144,8 @@
open JasperReport %1 in new window property no Åpne
JasperReport %1 i nytt vindu
open view in new window property no Åpne visning i nytt
vindu
order property no Bestilling
+order approval revoked property no Bestillingsgodkjenning opphevet
+order approved property no Bestilling godkjent
order_dim1 property no Aktivitet
order id property no BestillingsNr
order_id property no BestillingsNr
Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php 2012-03-17 21:06:17 UTC (rev 8990)
+++ trunk/property/setup/setup.inc.php 2012-03-18 21:07:15 UTC (rev 8991)
@@ -3,7 +3,7 @@
* phpGroupWare - property: a Facilities Management System.
*
* @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2003-2009 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @copyright Copyright (C) 2003-2012 Free Software Foundation, Inc.
http://www.fsf.org/
* @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2012-03-17 21:06:17 UTC (rev
8990)
+++ trunk/property/setup/tables_current.inc.php 2012-03-18 21:07:15 UTC (rev
8991)
@@ -526,6 +526,8 @@
'event_id' => array('type' => 'int','precision'
=> 4,'nullable' => True),
'billable_hours' => array('type' =>
'decimal','precision' => '20','scale' => '2','nullable' => True),
'contract_sum' => array('type' =>
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' =>
'0.00'),
+ 'approved' => array('type' =>
'int','precision' => 2, 'nullable' => True),
+ 'mail_recipients' => array('type' =>
'varchar','precision' => 255, 'nullable' => True)
),
'pk' => array('id'),
'fk' => array(),
Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php 2012-03-17 21:06:17 UTC (rev
8990)
+++ trunk/property/setup/tables_update.inc.php 2012-03-18 21:07:15 UTC (rev
8991)
@@ -6023,7 +6023,30 @@
}
+
/**
+ * Update property version from 0.9.17.635 to 0.9.17.636
+ * Add percent value to tax-code
+ *
+ */
+ $test[] = '0.9.17.636';
+ function property_upgrade0_9_17_636()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+ $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM fm_cache");
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_workorder','approved',array('type'
=> 'int','precision' => 2, 'nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_workorder','mail_recipients',array('type'
=> 'varchar','precision' => 255, 'nullable' => True));
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.637';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
+ }
+
+
+
+ /**
* Update property version from 0.9.17.607 to 0.9.17.608
* Add more room for address at tickets
*
Modified: trunk/property/templates/base/workorder.xsl
===================================================================
--- trunk/property/templates/base/workorder.xsl 2012-03-17 21:06:17 UTC (rev
8990)
+++ trunk/property/templates/base/workorder.xsl 2012-03-18 21:07:15 UTC (rev
8991)
@@ -339,22 +339,6 @@
</td>
</tr>
<xsl:choose>
- <xsl:when
test="value_workorder_id!='' and mode='edit'">
- <tr>
-
<td>
-
<xsl:value-of select="lang_confirm_status"/>
-
</td>
-
<td>
-
<input type="checkbox" name="values[confirm_status]" value="True"
onMouseout="window.status='';return true;">
-
<xsl:attribute name="title">
-
<xsl:value-of select="lang_confirm_statustext"/>
-
</xsl:attribute>
-
</input>
-
</td>
- </tr>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
<xsl:when
test="need_approval='1' and mode='edit'">
<tr>
<td valign="top">
@@ -385,6 +369,32 @@
</tr>
</xsl:when>
</xsl:choose>
+ <xsl:choose>
+ <xsl:when
test="value_workorder_id!=''">
+ <tr>
+
<td>
+
<xsl:value-of select="php:function('lang', 'approved')"/>
+
</td>
+
<td>
+
<input type="checkbox" name="values[approved]" value="1">
+
<xsl:attribute name="title">
+
<xsl:value-of select="php:function('lang',
'approved')"/>
+
</xsl:attribute>
+
<xsl:if test="value_approved = '1'">
+
<xsl:attribute name="checked">
+
<xsl:text>checked</xsl:text>
+
</xsl:attribute>
+
</xsl:if>
+
<xsl:if test="mode != 'edit'">
+
<xsl:attribute name="disabled">
+
<xsl:text>disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:if>
+
</input>
+
</td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
<tr>
<td
valign="top">
<xsl:value-of select="lang_remark"/>
@@ -433,6 +443,35 @@
<xsl:when
test="mode='edit'">
<xsl:call-template name="event_form"/>
<xsl:call-template name="vendor_form"/>
+ <tr>
+
<td valign="top">
+
<xsl:value-of select="php:function('lang', 'send order')"/>
+
</td>
+
<td>
+
<div id="paging_4"/>
+
<div id="datatable-container_4"/>
+
</td>
+
<tr>
+
<td valign="top">
+
<xsl:value-of select="php:function('lang', 'extra mail
address')"/>
+
</td>
+
<td>
+
<input type="text" name="values[vendor_email][]"
value="{value_extra_mail_address}">
+
<xsl:attribute name="title">
+
<xsl:value-of select="php:function('lang', 'The
order will also be sent to this one')"/>
+
</xsl:attribute>
+
</input>
+
</td>
+
</tr>
+
<tr>
+
<td valign="top">
+
<xsl:value-of select="php:function('lang', 'selected mail
addresses')"/>
+
</td>
+
<td>
+
<xsl:value-of select="mail_recipients"/>
+
</td>
+
</tr>
+ </tr>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="event_view"/>
@@ -712,6 +751,7 @@
</xsl:choose>
<script type="text/javascript">
var property_js = <xsl:value-of
select="property_js"/>;
+ var base_java_url =
<xsl:value-of select="base_java_url"/>;
var base_java_notify_url =
<xsl:value-of select="base_java_notify_url"/>;
var datatable = new Array();
var myColumnDefs = new Array();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8991] property: approval and veendor email,
Sigurd Nes <=