[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [9225] property: invoice
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [9225] property: invoice |
Date: |
Wed, 25 Apr 2012 13:57:35 +0000 |
Revision: 9225
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9225
Author: sigurdne
Date: 2012-04-25 13:57:35 +0000 (Wed, 25 Apr 2012)
Log Message:
-----------
property: invoice
Modified Paths:
--------------
trunk/property/inc/class.uiinvoice.inc.php
trunk/property/inc/class.uiworkorder.inc.php
trunk/property/js/portico/ajax_invoice.js
trunk/property/templates/base/css/base.css
trunk/property/templates/base/workorder.xsl
Modified: trunk/property/inc/class.uiinvoice.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice.inc.php 2012-04-25 13:57:33 UTC (rev
9224)
+++ trunk/property/inc/class.uiinvoice.inc.php 2012-04-25 13:57:35 UTC (rev
9225)
@@ -3783,14 +3783,17 @@
$order_id = phpgw::get_var('order_id'); // could
be bigint
$soXport = CreateObject('property.soXport');
+ $nonavbar = phpgw::get_var('nonavbar', 'bool');
+ $lean = phpgw::get_var('lean', 'bool');
+
$order_type = $soXport->check_order($order_id);
switch($order_type)
{
case 'workorder':
-
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uiworkorder.edit', 'id'=> $order_id, 'tab' => 'budget'));
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uiworkorder.edit', 'id'=> $order_id, 'tab' => 'budget', 'nonavbar' =>
$nonavbar, 'lean' => $lean));
break;
case 's_agreement':
-
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uis_agreement.view', 'id'=> $order_id));
+
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uis_agreement.view', 'id'=> $order_id, 'nonavbar' => $nonavbar,
'lean' => $lean));
break;
default:
$GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php 2012-04-25 13:57:33 UTC
(rev 9224)
+++ trunk/property/inc/class.uiworkorder.inc.php 2012-04-25 13:57:35 UTC
(rev 9225)
@@ -27,8 +27,16 @@
* @version $Id$
*/
+ /**
+ * Import the YUI class
+ */
phpgw::import_class('phpgwapi.yui');
+ /**
+ * Import the jQuery class
+ */
+ phpgw::import_class('phpgwapi.jquery');
+
/**
* Description
* @package property
@@ -840,6 +848,14 @@
function edit($mode = 'edit')
{
+ if( $GLOBALS['phpgw_info']['flags']['nonavbar'] =
phpgw::get_var('nonavbar', 'bool'))
+ {
+ $GLOBALS['phpgw_info']['flags']['noheader_xsl']
= true;
+ $GLOBALS['phpgw_info']['flags']['nofooter']
= true;
+ }
+
+ $_lean = phpgw::get_var('lean', 'bool');
+
$id = phpgw::get_var('id'); // in case of bigint
$selected_tab = phpgw::get_var('tab', 'string',
'REQUEST', 'general');
@@ -882,11 +898,11 @@
$project_id =
phpgw::get_var('project_id', 'int');
$values
= phpgw::get_var('values');
$values['ecodimb'] =
phpgw::get_var('ecodimb');
- $values['vendor_id'] =
phpgw::get_var('vendor_id', 'int', 'POST');
- $values['vendor_name'] =
phpgw::get_var('vendor_name', 'string', 'POST');
- $values['b_account_id'] =
phpgw::get_var('b_account_id', 'int', 'POST');
- $values['b_account_name'] =
phpgw::get_var('b_account_name', 'string', 'POST');
- $values['event_id'] =
phpgw::get_var('event_id', 'int', 'POST');
+ $values['vendor_id'] =
phpgw::get_var('vendor_id', 'int');
+ $values['vendor_name'] =
phpgw::get_var('vendor_name', 'string');
+ $values['b_account_id'] =
phpgw::get_var('b_account_id', 'int');
+ $values['b_account_name'] =
phpgw::get_var('b_account_name', 'string');
+ $values['event_id'] =
phpgw::get_var('event_id', 'int');
$origin
= phpgw::get_var('origin');
$origin_id
= phpgw::get_var('origin_id', 'int');
@@ -1194,6 +1210,29 @@
}
}
}
+
+ if( phpgw::get_var('phpgw_return_as') == 'json'
)
+ {
+
+ if(!$receipt['error'])
+ {
+ $result = array
+ (
+ 'status' =>
'updated'
+ );
+ }
+ else
+ {
+ $result = array
+ (
+ 'status' =>
'error'
+ );
+ }
+ $result['receipt'] = $receipt;
+
+ return $result;
+ }
+
}
if($project_id && !isset($values['project_id']))
@@ -1858,7 +1897,8 @@
'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
+ 'value_extra_mail_address'
=> $value_extra_mail_address,
+ 'lean'
=> $_lean ? 1 : 0
);
$appname
= lang('Workorder');
@@ -1881,6 +1921,7 @@
// phpgwapi_yui::load_widget('button');
+ phpgwapi_jquery::load_widget('core');
$GLOBALS['phpgw']->css->validate_file('datatable');
$GLOBALS['phpgw']->css->validate_file('property');
@@ -1890,7 +1931,7 @@
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
$GLOBALS['phpgw']->js->validate_file( 'yahoo',
'workorder.edit', 'property' );
- // $GLOBALS['phpgw']->xslttpl->pp();
+ $GLOBALS['phpgw']->js->validate_file( 'portico',
'ajax_workorder_edit', 'property' );
}
function add()
Modified: trunk/property/js/portico/ajax_invoice.js
===================================================================
--- trunk/property/js/portico/ajax_invoice.js 2012-04-25 13:57:33 UTC (rev
9224)
+++ trunk/property/js/portico/ajax_invoice.js 2012-04-25 13:57:35 UTC (rev
9225)
@@ -249,7 +249,6 @@
var line_id = $(this).val();
var voucher_id_orig = $("#voucher_id").val();
update_form_values(line_id, voucher_id_orig);
-// load_order();
});
@@ -378,7 +377,10 @@
{
var oArgs_order =
{menuaction:'property.uiinvoice.view_order', order_id: voucher[0].order_id};
var requestUrl_order =
phpGWLink('index.php', oArgs_order);
- var htmlString_order = " <a target=
\"_blank\" href=\"" + requestUrl_order + "\" title=\"" + voucher[0].status +
"\" > Bestilling</a>";
+// var htmlString_order = " <a target=
\"_blank\" href=\"" + requestUrl_order + "\" title=\"" + voucher[0].status +
"\" > Bestilling</a>";
+
+ var htmlString_order = " <a
href=\"javascript:load_order(" + voucher[0].order_id + ");\" title=\"" +
voucher[0].status + "\" > Bestilling</a>";
+
$("#order_text").html( htmlString_order
);
}
else
@@ -655,42 +657,25 @@
//------------
-function load_order( order_id ){
-
- var order_id = $("#order_id").val( );
+function load_order( id ){
+// var order_id = $("#order_id").val( );
$("#curtain").show();
$("#popupBox").fadeIn("slow");
-
- //$("#curtain").hide();
- //$("#popupBox").hide();
- var oArgs = {menuaction:'property.uiworkorder.edit', id: order_id};
+ var oArgs = {menuaction: 'property.uiinvoice.view_order', order_id: id,
nonavbar: true, lean: true};
var requestUrl = phpGWLink('index.php', oArgs);
-// requestUrl = "http://www.nettavisen.no/";
-//alert(requestUrl); return;
-
var htmlString = "";
- htmlString += "<iframe width=\"100%\" height=\"1000\" src = \"" +
requestUrl + "\" ><p>Your browser does not support iframes.</p></iframe>";
+ htmlString += "<iframe width=\"100%\" height=\"100%\" src = \"" +
requestUrl + "\" ><p>Your browser does not support iframes.</p></iframe>";
$("#popupBox").html( htmlString );
+}
+function hide_popupBox( ){
+ var line_id = $("#line_id").val( );
+ var voucher_id_orig = $("#voucher_id").val();
+ $("#curtain").hide();
+ $("#popupBox").hide();
+ update_form_values(line_id, voucher_id_orig);
+}
- var oArgs = {menuaction:'property.uiinvoice2.get_single_line'};
- var requestUrl = phpGWLink('index.php', oArgs, true);
-/*
- $.ajax({
- type: 'POST',
- dataType: 'json',
- url: requestUrl + "&order_id=" + order_id,
- success: function(data) {
- if(data.sessionExpired)
- {
- alert('Sesjonen er utløpt - du må logge inn på
nytt');
- return;
- }
- var voucher = data['voucher'];
- }
- });
-*/
-}
Modified: trunk/property/templates/base/css/base.css
===================================================================
--- trunk/property/templates/base/css/base.css 2012-04-25 13:57:33 UTC (rev
9224)
+++ trunk/property/templates/base/css/base.css 2012-04-25 13:57:35 UTC (rev
9225)
@@ -126,11 +126,11 @@
#popupBox {
background: none repeat scroll 0 0 #fff;
display: none;
- height: 90%;
+ height: 50%;
left: 80px;
position: absolute;
top: 80px;
- width: 1200px;
+ width: 800px;
z-index: 2;
}
Modified: trunk/property/templates/base/workorder.xsl
===================================================================
--- trunk/property/templates/base/workorder.xsl 2012-04-25 13:57:33 UTC (rev
9224)
+++ trunk/property/templates/base/workorder.xsl 2012-04-25 13:57:35 UTC (rev
9225)
@@ -87,8 +87,11 @@
</tr>
</xsl:when>
</xsl:choose>
+
+ <div id="receipt"></div>
+
<xsl:choose>
- <xsl:when test="value_workorder_id!='' and
mode='edit'">
+ <xsl:when test="value_workorder_id!='' and
mode='edit' and lean = 0">
<td>
<table>
<tr>
@@ -121,7 +124,7 @@
<xsl:variable name="form_action">
<xsl:value-of select="form_action"/>
</xsl:variable>
- <form ENCTYPE="multipart/form-data" method="post" name="form"
action="{$form_action}">
+ <form ENCTYPE="multipart/form-data" method="post"
id='workorder_edit' name="form" action="{$form_action}">
<div class="yui-navset" id="workorder_tabview">
<xsl:value-of disable-output-escaping="yes"
select="tabs"/>
<div class="yui-content">
@@ -786,7 +789,8 @@
<xsl:variable
name="lang_save">
<xsl:value-of select="lang_save"/>
</xsl:variable>
- <input
type="submit" name="values[save]" value="{$lang_save}"
onMouseout="window.status='';return true;">
+ <input
type="hidden" name="values[save]" value="1"/>
+ <input
type="submit" name="save" value="{$lang_save}"
onMouseout="window.status='';return true;">
<xsl:attribute name="title">
<xsl:value-of select="lang_save_statustext"/>
</xsl:attribute>
@@ -806,7 +810,7 @@
<xsl:variable name="lang_done">
<xsl:value-of
select="lang_done"/>
</xsl:variable>
- <form method="post"
action="{$done_action}">
+ <form id="workorder_cancel"
method="post" action="{$done_action}">
<input type="submit"
name="done" value="{$lang_done}" onMouseout="window.status='';return true;">
<xsl:attribute
name="title">
<xsl:value-of
select="lang_done_statustext"/>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [9225] property: invoice,
Sigurd Nes <=