← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20156: SQL view, fixed bug with validation

 

------------------------------------------------------------
revno: 20156
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-09-15 09:52:33 +0200
message:
  SQL view, fixed bug with validation
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js	2015-07-14 14:50:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js	2015-09-15 07:52:33 +0000
@@ -3,7 +3,7 @@
 function validateAddUpdateSqlView( mode ) {
   var name = $("#name").val();
   var sqlquery = $("#sqlquery").val();
-  var query = $("#query").val();
+  var query = !!( $("#type").val() == "QUERY" );
 
   $.ajax( {
     url: "validateAddUpdateSqlView.action",

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm	2015-07-31 12:46:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm	2015-09-15 07:52:33 +0000
@@ -16,6 +16,7 @@
         <input type="hidden" id="id" name="id" value="$!sqlViewObject.id" />
         <input type="hidden" id="name" name="name" value="$!encoder.htmlEncode( $!sqlViewObject.name )" />
         <input type="hidden" id="query" name="query" value="$!encoder.htmlEncode( $!sqlViewObject.query )" />
+        <input type="hidden" id="type" name="query" value="$sqlViewObject.type" />
     </div>
 
     <table>