[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [17162] property: more on location exceptions
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [17162] property: more on location exceptions |
Date: |
Wed, 18 Oct 2017 04:23:18 -0400 (EDT) |
Revision: 17162
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17162
Author: sigurdne
Date: 2017-10-18 04:23:17 -0400 (Wed, 18 Oct 2017)
Log Message:
-----------
property: more on location exceptions
Modified Paths:
--------------
trunk/property/js/portico/project.edit.js
trunk/property/js/portico/workorder.edit.js
trunk/property/templates/base/project.xsl
trunk/property/templates/base/workorder.xsl
Modified: trunk/property/js/portico/project.edit.js
===================================================================
--- trunk/property/js/portico/project.edit.js 2017-10-18 07:59:44 UTC (rev
17161)
+++ trunk/property/js/portico/project.edit.js 2017-10-18 08:23:17 UTC (rev
17162)
@@ -397,16 +397,18 @@
JqueryPortico.autocompleteHelper(strURL, 'b_account_name', 'b_account_id',
'b_account_container');
-window.on_location_updated = function ()
+window.on_location_updated = function (location_code)
{
+ location_code = location_code || $("#loc1").val();
+
+ get_location_exception(location_code);
+
if( $("#delivery_address").val() )
{
return;
}
- var loc1 = $("#loc1").val();
-
- var oArgs = {menuaction: 'property.uilocation.get_delivery_address',
loc1: loc1};
+ var oArgs = {menuaction: 'property.uilocation.get_delivery_address',
loc1: location_code};
var requestUrl = phpGWLink('index.php', oArgs, true);
$.ajax({
@@ -423,3 +425,38 @@
}
});
};
+
+window.get_location_exception = function (location_code)
+{
+
+ var oArgs = {menuaction: 'property.uilocation.get_location_exception',
location_code: location_code};
+ var requestUrl = phpGWLink('index.php', oArgs, true);
+
+ $.ajax({
+ type: 'POST',
+ dataType: 'json',
+ url: requestUrl,
+ success: function (data)
+ {
+ $("#message").html('');
+
+ if (data != null)
+ {
+ var htmlString = '';
+ var exceptions = data.location_exception;
+ $.each(exceptions, function (k, v)
+ {
+ htmlString += "<div class=\"error\">";
+ htmlString += v.severity + ": " +
v.category_text;
+ if(v.location_descr)
+ {
+ htmlString += "<br/>" +
v.location_descr;
+ }
+ htmlString += '</div>';
+
+ });
+ $("#message").html(htmlString);
+ }
+ }
+ });
+};
Modified: trunk/property/js/portico/workorder.edit.js
===================================================================
--- trunk/property/js/portico/workorder.edit.js 2017-10-18 07:59:44 UTC (rev
17161)
+++ trunk/property/js/portico/workorder.edit.js 2017-10-18 08:23:17 UTC (rev
17162)
@@ -662,16 +662,18 @@
});
}
-window.on_location_updated = function ()
+window.on_location_updated = function (location_code)
{
+ location_code = location_code || $("#loc1").val();
+
+ get_location_exception(location_code);
+
if( $("#delivery_address").val() )
{
return;
}
- var loc1 = $("#loc1").val();
-
- var oArgs = {menuaction: 'property.uilocation.get_delivery_address',
loc1: loc1};
+ var oArgs = {menuaction: 'property.uilocation.get_delivery_address',
loc1: location_code};
var requestUrl = phpGWLink('index.php', oArgs, true);
$.ajax({
@@ -687,4 +689,40 @@
}
}
});
+
};
+
+window.get_location_exception = function (location_code)
+{
+
+ var oArgs = {menuaction: 'property.uilocation.get_location_exception',
location_code: location_code};
+ var requestUrl = phpGWLink('index.php', oArgs, true);
+
+ $.ajax({
+ type: 'POST',
+ dataType: 'json',
+ url: requestUrl,
+ success: function (data)
+ {
+ $("#message").html('');
+
+ if (data != null)
+ {
+ var htmlString = '';
+ var exceptions = data.location_exception;
+ $.each(exceptions, function (k, v)
+ {
+ htmlString += "<div class=\"error\">";
+ htmlString += v.severity + ": " +
v.category_text;
+ if(v.location_descr)
+ {
+ htmlString += "<br/>" +
v.location_descr;
+ }
+ htmlString += '</div>';
+
+ });
+ $("#message").html(htmlString);
+ }
+ }
+ });
+};
Modified: trunk/property/templates/base/project.xsl
===================================================================
--- trunk/property/templates/base/project.xsl 2017-10-18 07:59:44 UTC (rev
17161)
+++ trunk/property/templates/base/project.xsl 2017-10-18 08:23:17 UTC (rev
17162)
@@ -43,6 +43,8 @@
</dl>
</xsl:when>
</xsl:choose>
+ <div id="message" class='message'/>
+
<form ENCTYPE="multipart/form-data" method="post" id="form" name="form"
action="{form_action}" class= "pure-form pure-form-aligned">
<xsl:variable name="decimal_separator">
<xsl:value-of select="decimal_separator"/>
Modified: trunk/property/templates/base/workorder.xsl
===================================================================
--- trunk/property/templates/base/workorder.xsl 2017-10-18 07:59:44 UTC (rev
17161)
+++ trunk/property/templates/base/workorder.xsl 2017-10-18 08:23:17 UTC (rev
17162)
@@ -100,6 +100,8 @@
</xsl:choose>
<table cellpadding="2" cellspacing="2" align="center">
<div id="receipt"></div>
+ <div id="message" class='message'/>
+
<input type="hidden" id = "lean" name="lean" value="{lean}"/>
<!--
<xsl:choose>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [17162] property: more on location exceptions,
sigurdne <=