dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #11017
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3052: finished vm/js separation in module dhis-web-maintenance-organisationunit
------------------------------------------------------------
revno: 3052
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-03-16 17:52:50 +0100
message:
finished vm/js separation in module dhis-web-maintenance-organisationunit
added:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitForm.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitGroupForm.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitGroupSetForm.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitForm.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitGroupForm.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitGroupSetForm.js
modified:
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupSetForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/saveOrganisationUnitLevelForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupSetForm.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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2011-03-16 09:23:45 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2011-03-16 16:52:50 +0000
@@ -1,37 +1,78 @@
-
var validationRules = {
- "user": {
- "name": {
- "length": [2,140]
- },
- "username": {
- "length": [2,140],
- "firstletteralphabet" : true,
+ /* dhis-web-maintenance-user */
+ "user" : {
+ "name" : {
+ "length" : [ 2, 140 ]
+ },
+ "username" : {
+ "length" : [ 2, 140 ],
+ "firstletteralphabet" : true,
"alphanumeric" : true
- },
- "password": {
- "length": [8,35]
- },
- "email": {
- "length": [0,160]
- },
- "phone": {
- "length": [0,80]
- }
- },
- "role": {
- "name": {
- "length": [2,140]
- },
- "description": {
- "length": [2,210]
- }
- },
- "userGroup": {
- "name": {
- "length": [2,210],
- "alphanumericwithbasicpuncspaces" : true,
+ },
+ "password" : {
+ "length" : [ 8, 35 ]
+ },
+ "email" : {
+ "length" : [ 0, 160 ]
+ },
+ "phone" : {
+ "length" : [ 0, 80 ]
+ }
+ },
+ "role" : {
+ "name" : {
+ "length" : [ 2, 140 ]
+ },
+ "description" : {
+ "length" : [ 2, 210 ]
+ }
+ },
+ "userGroup" : {
+ "name" : {
+ "length" : [ 2, 210 ],
+ "alphanumericwithbasicpuncspaces" : true,
"firstletteralphabet" : true
- }
- }
-}
\ No newline at end of file
+ }
+ },
+
+ /* dhis-web-maintenance-organisationunit */
+ "organisationUnit": {
+ "name": {
+ "length": [2, 160]
+ },
+ "shortName": {
+ "length": [2, 25]
+ },
+ "code": {
+ "length": [0, 25]
+ },
+ "url": {
+ "length": [0, 255]
+ },
+ "contactPerson": {
+ "length": [0, 255]
+ },
+ "address": {
+ "length": [0, 255]
+ },
+ "email": {
+ "length": [0, 250]
+ },
+ "phoneNumber": {
+ "length": [0, 255]
+ }
+ },
+ "organisationUnitGroup": {
+ "name": {
+ "length": [2, 160]
+ }
+ },
+ "organisationUnitGroupSet": {
+ "name": {
+ "length": [2, 230]
+ },
+ "description": {
+ "length": [2, 255]
+ }
+ }
+}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm 2011-02-02 17:56:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm 2011-03-16 16:52:50 +0000
@@ -1,11 +1,6 @@
-<script>
- jQuery(document).ready( function(){
- validation( 'addOrganisationUnitForm' );
-
- checkValueIsExist( "name", "validateOrganisationUnit.action");
-
- datePickerValid( 'openingDate', false );
- });
+<script type="text/javascript" src="javascript/addOrganisationUnitForm.js"></script>
+<script type="text/javascript">
+ var adding_the_org_unit_failed = '$encoder.jsEscape( $i18n.getString( "adding_the_org_unit_failed" ) , "'" )';
</script>
<h3>$i18n.getString( "create_new_org_unit" ) #openHelp( "ou_edit" )</h3>
@@ -18,19 +13,19 @@
</tr>
<tr>
<td><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td><input type="text" id="name" name="name" onchange="nameChanged()" style="width:20em" maxlength="160" class="{validate:{required:true,minlength:2}}"/></td>
+ <td><input type="text" id="name" name="name" onchange="nameChanged()" style="width:20em"></td>
</tr>
<tr>
<td><label for="shortName">$i18n.getString( "short_name" )</label></td>
- <td><input type="text" id="shortName" name="shortName" maxlength="25" style="width:20em" class="{validate:{required:true,minlength:2}}"/></td>
+ <td><input type="text" id="shortName" name="shortName" style="width:20em"></td>
</tr>
<tr>
<td><label for="code">$i18n.getString( "code" )</label></td>
- <td><input type="text" id="code" name="code" style="width:20em" class="{validate:{maxlength:25}}"></td>
+ <td><input type="text" id="code" name="code" style="width:20em"></td>
</tr>
<tr>
<td><label for="openingDate">$i18n.getString( "opening_date" ) ($i18n.getString( "format.date.label" )) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td><input type="text" id="openingDate" name="openingDate" value="$format.formatDate( $defaultDate )" style="width:20em" class="{validate:{required:true}}"/></td>
+ <td><input type="text" id="openingDate" name="openingDate" value="$format.formatDate( $defaultDate )" style="width:20em"></td>
<td></td>
</tr>
<tr>
@@ -47,39 +42,27 @@
</tr>
<tr>
<td><label for="url">$i18n.getString( "url" )</label></td>
- <td><input type="text" id="url" name="url" style="width:20em" maxlength="255" class="{validate:{url:true}}"/></td>
+ <td><input type="text" id="url" name="url" style="width:20em"></td>
</tr>
<tr>
<td><label for="contactPerson">$i18n.getString( "contact_person" ) </label></td>
- <td colspan="3"><input type="text" id="contactPerson" name="contactPerson" style="width:20em" maxlength="255"/></td>
+ <td colspan="3"><input type="text" id="contactPerson" name="contactPerson" style="width:20em"></td>
</tr>
<tr>
<td><label for="address">$i18n.getString( "address" ) </label></td>
- <td colspan="3"><input type="text" id="address" name="address" style="width:20em" maxlength="255"/></td>
+ <td colspan="3"><input type="text" id="address" name="address" style="width:20em"></td>
</tr>
<tr>
<td><label for="email">$i18n.getString( "email" )</label></td>
- <td colspan="3"><input type="text" id="email" name="email" style="width:20em" maxlength="150" class="{validate:{email:true}}"/></td>
+ <td colspan="3"><input type="text" id="email" name="email" style="width:20em"></td>
</tr>
<tr>
<td><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
- <td colspan="3"><input type="text" id="phoneNumber" name="phoneNumber" style="width:20em" maxlength="150"/></td>
+ <td colspan="3"><input type="text" id="phoneNumber" name="phoneNumber" style="width:20em"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="$i18n.getString( 'add' )" style="width:10em"/><input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='organisationUnit.action'" style="width:10em"/></td>
</tr>
</table>
-
</form>
-
-<script type="text/javascript">
-
- var previousName = '';
-
- var nameField = document.getElementById( 'name' );
- nameField.select();
- nameField.focus();
- var adding_the_org_unit_failed = '$encoder.jsEscape( $i18n.getString( "adding_the_org_unit_failed" ) , "'" )';
-
-</script>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupForm.vm 2010-12-09 22:05:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupForm.vm 2011-03-16 16:52:50 +0000
@@ -1,18 +1,14 @@
-<script>
- jQuery(document).ready( function(){
- validation( 'addOrganisationUnitGroupForm', function( form ){ form.submit() });
-
- checkValueIsExist( "name", "validateOrganisationUnitGroup.action" );
-
- });
-</script>
-
+<script type="text/javascript" src="javascript/addOrganisationUnitGroupForm.js"></script>
<h3>$i18n.getString( "crease_new_org_unit_group" ) #openHelp( "ou_groups_edit" )</h3>
<form name="addOrganisationUnitGroupForm" id="addOrganisationUnitGroupForm" action="addOrganisationUnitGroup.action" method="POST">
-<p>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em> <input type="text" name="name" id="name" style="width:300px" maxlength="160" class="{validate:{required:true,minlength:2}}"/></p>
+<p>$i18n.getString( "name" )
+ <em title="$i18n.getString( 'required' )" class="required">*</em>
+ <input type="text" name="name" id="name" style="width:300px">
+</p>
+
<table>
<tr>
<td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupSetForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupSetForm.vm 2011-01-21 03:37:12 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupSetForm.vm 2011-03-16 16:52:50 +0000
@@ -1,36 +1,23 @@
-<script>
- jQuery(document).ready( function(){
- validation( 'addOrganisationUnitGroupSetForm', function( form ){ validateAddOrganisationGroupSet( form ) }, function(){
- selectAllById( 'selectedGroups' );
- } );
-
- checkValueIsExist( "name", "validateOrganisationUnitGroupSet.action");
-
- changeCompulsory( getFieldValue( 'compulsory' ) );
- });
-
-</script>
+<script type="text/javascript" src="javascript/addOrganisationUnitGroupSetForm.js"></script>
<h3>$i18n.getString( "create_new_org_unit_group_set" ) #openHelp( "ou_groupsets_edit" )</h3>
<form id="addOrganisationUnitGroupSetForm" action="addOrganisationUnitGroupSet.action" method="post" >
-
<table>
-
<tr>
<th colspan="2">$i18n.getString( "details" )</th>
</tr>
-
+
<tr>
<td><label for="name" style="width:100%">$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td><input type="text" id="name" name="name" style="width:20em" maxlength="230" class="{validate:{required:true,minlength:2}}"/></td>
+ <td><input type="text" id="name" name="name" style="width:20em"></td>
</tr>
-
+
<tr>
<td><label for="description" style="width:100%">$i18n.getString( "description" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td><input type="text" id="description" name="description" style="width:20em" maxlength="255" class="{validate:{required:true,minlength:2}}"/></td>
+ <td><input type="text" id="description" name="description" style="width:20em"></td>
</tr>
-
+
<tr>
<td><label for="compulsory" style="width:100%">$i18n.getString( "compulsory" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td>
@@ -40,7 +27,7 @@
</select>
</td>
</tr>
-
+
<tr>
<td colspan="2" style="height:15px"></td>
</tr>
@@ -94,5 +81,4 @@
</td>
</tr>
</table>
-
</form>
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitForm.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitForm.js 2011-03-16 16:52:50 +0000
@@ -0,0 +1,70 @@
+jQuery( document ).ready( function()
+{
+ var r = getValidationRules();
+
+ var rules = {
+ name : {
+ required : true,
+ rangelength : r.organisationUnit.name.length
+ },
+ shortName : {
+ required : true,
+ rangelength : r.organisationUnit.shortName.length
+ },
+ code : {
+ required : true,
+ rangelength : r.organisationUnit.code.length
+ },
+ openingDate : {
+ required : true
+ },
+ comment : {
+
+ },
+ coordinates : {
+
+ },
+ featureType : {
+
+ },
+ url : {
+ url : true,
+ rangelength : r.organisationUnit.url.length
+ },
+ contactPerson : {
+ rangelength : r.organisationUnit.contactPerson.length
+ },
+ address : {
+ rangelength : r.organisationUnit.address.length
+ },
+ email : {
+ email : true,
+ rangelength : r.organisationUnit.email.length
+ },
+ phoneNumber : {
+ rangelength : r.organisationUnit.phoneNumber.length
+ }
+ };
+
+ validation2( 'addOrganisationUnitForm', undefined, {
+ 'rules' : rules
+ } );
+
+ jQuery( "#name" ).attr( "maxlength", r.organisationUnit.name.length );
+ jQuery( "#shortName" ).attr( "maxlength", r.organisationUnit.shortName.length );
+ jQuery( "#code" ).attr( "maxlength", r.organisationUnit.code.length );
+ jQuery( "#url" ).attr( "maxlength", r.organisationUnit.url.length );
+ jQuery( "#contactPerson" ).attr( "maxlength", r.organisationUnit.contactPerson.length );
+ jQuery( "#address" ).attr( "maxlength", r.organisationUnit.address.length );
+ jQuery( "#email" ).attr( "maxlength", r.organisationUnit.email.length );
+ jQuery( "#phoneNumber" ).attr( "maxlength", r.organisationUnit.phoneNumber.length );
+
+ checkValueIsExist( "name", "validateOrganisationUnit.action" );
+ datePickerValid( 'openingDate', false );
+
+ var previousName = '';
+
+ var nameField = document.getElementById( 'name' );
+ nameField.select();
+ nameField.focus();
+} );
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitGroupForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitGroupForm.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitGroupForm.js 2011-03-16 16:52:50 +0000
@@ -0,0 +1,22 @@
+jQuery( document ).ready( function()
+{
+ var r = getValidationRules();
+
+ var rules = {
+ name : {
+ required : true,
+ rangelength : r.organisationUnitGroup.name.length
+ }
+ };
+
+ validation2( 'addOrganisationUnitGroupForm', function( form )
+ {
+ form.submit()
+ }, {
+ 'rules' : rules
+ } );
+
+ jQuery( "#name" ).attr( "maxlength", r.organisationUnitGroup.name.length );
+
+ checkValueIsExist( "name", "validateOrganisationUnitGroup.action" );
+} );
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitGroupSetForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitGroupSetForm.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitGroupSetForm.js 2011-03-16 16:52:50 +0000
@@ -0,0 +1,33 @@
+jQuery( document ).ready( function()
+{
+ var r = getValidationRules();
+
+ var rules = {
+ name : {
+ required : true,
+ rangelength : r.organisationUnitGroupSet.name.length
+ },
+ description : {
+ required : true,
+ rangelength : r.organisationUnitGroupSet.description.length
+ }
+ };
+
+ validation2( 'addOrganisationUnitGroupSetForm', function( form )
+ {
+ validateAddOrganisationGroupSet( form )
+ }, {
+ 'beforeValidateHandler' : function()
+ {
+ selectAllById( 'selectedGroups' );
+ },
+ 'rules' : rules
+ } );
+
+ jQuery( "#name" ).attr( "maxlength", r.organisationUnitGroupSet.name.length );
+ jQuery( "#description" ).attr( "maxlength", r.organisationUnitGroupSet.description.length );
+
+ checkValueIsExist( "name", "validateOrganisationUnitGroupSet.action" );
+
+ changeCompulsory( getFieldValue( 'compulsory' ) );
+} );
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitForm.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitForm.js 2011-03-16 16:52:50 +0000
@@ -0,0 +1,61 @@
+jQuery( document ).ready( function()
+{
+ var r = getValidationRules();
+
+ var rules = {
+ name : {
+ required : true,
+ rangelength : r.organisationUnit.name.length
+ },
+ shortName : {
+ required : true,
+ rangelength : r.organisationUnit.shortName.length
+ },
+ code : {
+ required : true,
+ rangelength : r.organisationUnit.code.length
+ },
+ openingDate : {
+ required : true
+ },
+ comment : {
+
+ },
+ coordinates : {
+
+ },
+ featureType : {
+
+ },
+ url : {
+ url : true,
+ rangelength : r.organisationUnit.url.length
+ },
+ contactPerson : {
+ rangelength : r.organisationUnit.contactPerson.length
+ },
+ address : {
+ rangelength : r.organisationUnit.address.length
+ },
+ email : {
+ email : true,
+ rangelength : r.organisationUnit.email.length
+ },
+ phoneNumber : {
+ rangelength : r.organisationUnit.phoneNumber.length
+ }
+ };
+
+ validation2( 'updateOrganisationUnitForm', undefined, {
+ 'rules' : rules
+ } );
+
+ jQuery( "#name" ).attr( "maxlength", r.organisationUnit.name.length );
+ jQuery( "#shortName" ).attr( "maxlength", r.organisationUnit.shortName.length );
+ jQuery( "#code" ).attr( "maxlength", r.organisationUnit.code.length );
+ jQuery( "#url" ).attr( "maxlength", r.organisationUnit.url.length );
+ jQuery( "#contactPerson" ).attr( "maxlength", r.organisationUnit.contactPerson.length );
+ jQuery( "#address" ).attr( "maxlength", r.organisationUnit.address.length );
+ jQuery( "#email" ).attr( "maxlength", r.organisationUnit.email.length );
+ jQuery( "#phoneNumber" ).attr( "maxlength", r.organisationUnit.phoneNumber.length );
+} );
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitGroupForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitGroupForm.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitGroupForm.js 2011-03-16 16:52:50 +0000
@@ -0,0 +1,17 @@
+jQuery(document).ready( function(){
+ var r = getValidationRules();
+
+ var rules = {
+ name: {
+ required:true,
+ rangelength : r.organisationUnitGroup.name.length
+ }
+ };
+
+ validation2( 'updateOrganisationUnitGroupForm', function( form ) { form.submit() },
+ {
+ 'rules': rules
+ });
+
+ jQuery( "#name" ).attr( "maxlength", r.organisationUnitGroup.name.length );
+});
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitGroupSetForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitGroupSetForm.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitGroupSetForm.js 2011-03-16 16:52:50 +0000
@@ -0,0 +1,35 @@
+jQuery( document ).ready( function()
+{
+ var r = getValidationRules();
+
+ var rules = {
+ name : {
+ required : true,
+ rangelength : r.organisationUnitGroupSet.name.length
+ },
+ description : {
+ required : true,
+ rangelength : r.organisationUnitGroupSet.description.length
+ }
+ };
+
+ validation2( 'updateOrganisationUnitGroupSetForm', function( form )
+ {
+ validateAddOrganisationGroupSet( form )
+ }, {
+ 'beforeValidateHandler' : function()
+ {
+ selectAllById( 'selectedGroups' );
+ },
+ 'rules' : rules
+ } );
+
+ jQuery( "#name" ).attr( "maxlength", r.organisationUnitGroupSet.name.length );
+ jQuery( "#description" ).attr( "maxlength", r.organisationUnitGroupSet.description.length );
+
+ checkValueIsExist( "name", "validateOrganisationUnitGroupSet.action", {
+ id : $organisationUnitGroupSet.id
+ } );
+
+ changeCompulsory( getFieldValue( 'compulsory' ) );
+} );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/saveOrganisationUnitLevelForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/saveOrganisationUnitLevelForm.vm 2010-12-09 22:05:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/saveOrganisationUnitLevelForm.vm 2011-03-16 16:52:50 +0000
@@ -1,6 +1,6 @@
-<script>
+<script type="text/javascript">
jQuery(document).ready( function(){
- validation( 'saveOrganisationUnitLevelsForm', function( form ){ form.submit() } );
+ validation( 'saveOrganisationUnitLevelsForm', function( form ){ form.submit() } );
});
</script>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm 2011-02-02 17:56:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm 2011-03-16 16:52:50 +0000
@@ -1,11 +1,11 @@
-<script>
- jQuery(document).ready( function(){
- validation( 'updateOrganisationUnitForm' );
-
+<script type="text/javascript" src="javascript/updateOrganisationUnitForm.js"></script>
+<script type="text/javascript">
+ jQuery( document ).ready( function()
+ {
checkValueIsExist( "name", "validateOrganisationUnit.action", {
- id: $organisationUnit.id
- });
-
+ id : $organisationUnit.id
+ } );
+
#if ( $numberOfChildren == 0 )
datePickerInRange( 'openingDate', 'closedDate', false, false );
#else
@@ -29,19 +29,19 @@
</tr>
<tr>
<td><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input type="text" id="name" name="name" maxlength="160" value="$encoder.htmlEncode( $organisationUnit.name )" onchange="nameChanged()" style="width:20em" class="{validate:{required:true,minlength:2}}"/></td>
+ <td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $organisationUnit.name )" onchange="nameChanged()" style="width:20em"></td>
</tr>
<tr>
<td><label for="shortName">$i18n.getString( "short_name" )</label></td>
- <td><input type="text" id="shortName" name="shortName" maxlength="25" value="$encoder.htmlEncode( $organisationUnit.shortName )" style="width:20em" class="{validate:{required:true,minlength:2}}"/></td>
+ <td><input type="text" id="shortName" name="shortName" value="$encoder.htmlEncode( $organisationUnit.shortName )" style="width:20em"></td>
</tr>
<tr>
<td><label for="code">$i18n.getString( "code" )</label></td>
- <td><input type="text" id="code" name="code" value="$!encoder.htmlEncode( $organisationUnit.code )" maxlength="25" style="width:20em"/></td>
+ <td><input type="text" id="code" name="code" value="$!encoder.htmlEncode( $organisationUnit.code )" style="width:20em"/></td>
</tr>
<tr>
<td><label for="openingDate">$i18n.getString( "opening_date" ) ($i18n.getString( "format.date.label" )) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input type="text" id="openingDate" name="openingDate" value="$!format.formatDate( $organisationUnit.openingDate )" style="width:20em" class="{validate:{required:true}}"/></td>
+ <td><input type="text" id="openingDate" name="openingDate" value="$!format.formatDate( $organisationUnit.openingDate )" style="width:20em"></td>
<td></td>
</tr>
#if( $numberOfChildren == 0 )
@@ -73,23 +73,23 @@
</tr>
<tr>
<td><label for="url">$i18n.getString( "url" )</label></td>
- <td><input type="text" id="url" name="url" value="$!encoder.htmlEncode( $organisationUnit.url )" style="width:20em" maxlength="255" class="{validate:{maxlength:255,url:true}}"/></td>
+ <td><input type="text" id="url" name="url" value="$!encoder.htmlEncode( $organisationUnit.url )" style="width:20em"></td>
</tr>
<tr>
<td><label for="contactPerson">$i18n.getString( "contact_person" ) </label></td>
- <td colspan="3"><input type="text" id="contactPerson" name="contactPerson" value="$!encoder.htmlEncode( $organisationUnit.contactPerson )" style="width:20em" maxlength="255"/></td>
+ <td colspan="3"><input type="text" id="contactPerson" name="contactPerson" value="$!encoder.htmlEncode( $organisationUnit.contactPerson )" style="width:20em"></td>
</tr>
<tr>
<td><label for="address">$i18n.getString( "address" ) </label></td>
- <td colspan="3"><input type="text" id="address" name="address" value="$!encoder.htmlEncode( $organisationUnit.address )" style="width:20em" maxlength="255"/></td>
+ <td colspan="3"><input type="text" id="address" name="address" value="$!encoder.htmlEncode( $organisationUnit.address )" style="width:20em"></td>
</tr>
<tr>
<td><label for="email">$i18n.getString( "email" )</label></td>
- <td colspan="3"><input type="text" id="email" name="email" value="$!encoder.htmlEncode( $organisationUnit.email )" style="width:20em" maxlength="150" class="{validate:{email:true}}"/></td>
+ <td colspan="3"><input type="text" id="email" name="email" value="$!encoder.htmlEncode( $organisationUnit.email )" style="width:20em"></td>
</tr>
<tr>
<td><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
- <td colspan="3"><input type="text" id="phoneNumber" name="phoneNumber" value="$!encoder.htmlEncode( $organisationUnit.phoneNumber )" style="width:20em" maxlength="150"/></td>
+ <td colspan="3"><input type="text" id="phoneNumber" name="phoneNumber" value="$!encoder.htmlEncode( $organisationUnit.phoneNumber )" style="width:20em"></td>
</tr>
<tr>
<td></td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupForm.vm 2011-01-20 15:03:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupForm.vm 2011-03-16 16:52:50 +0000
@@ -1,10 +1,8 @@
-<script>
- jQuery(document).ready( function(){
- validation( 'updateOrganisationUnitGroupForm', function( form ){ form.submit() } );
-
- checkValueIsExist( "name", "validateOrganisationUnitGroup.action", {id:$!organisationUnitGroup.id} );
-
- });
+<script type="text/javascript" src="javascript/updateOrganisationUnitGroupForm.js"></script>
+<script type="text/javascript">
+ jQuery(document).ready(function() {
+ checkValueIsExist( "name", "validateOrganisationUnitGroup.action", {id:$!organisationUnitGroup.id} );
+ });
</script>
<h3>$i18n.getString( "edit_org_unit_group" ) #openHelp( "ou_groups_edit" )</h3>
@@ -12,7 +10,10 @@
<form id="updateOrganisationUnitGroupForm" action="updateOrganisationUnitGroup.action" method="post">
<input type="hidden" name="id" id="id" style="width:300px" value="$!organisationUnitGroup.id"/>
- <p>$i18n.getString( "name" ) <em title="$i18n.getString( "required" )" class="required">*</em><input type="text" name="name" id="name" style="width:300px" value="$!organisationUnitGroup.name" maxlength="160" class="{validate:{required:true,minlength:2}}"/></p>
+ <p>$i18n.getString( "name" )
+ <em title="$i18n.getString( "required" )" class="required">*</em>
+ <input type="text" name="name" id="name" style="width:300px" value="$!organisationUnitGroup.name">
+ </p>
<table>
<tr>
<td>
@@ -24,4 +25,4 @@
<input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/>
<input type="button" onclick="window.location.href='organisationUnitGroup.action'" value="$i18n.getString( 'cancel' )" style="width:10em"/>
</p>
-</form>
\ No newline at end of file
+</form>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupSetForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupSetForm.vm 2011-01-21 03:37:12 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupSetForm.vm 2011-03-16 16:52:50 +0000
@@ -1,22 +1,12 @@
-<script>
- jQuery(document).ready( function(){
- validation( 'updateOrganisationUnitGroupSetForm', function( form ){ validateAddOrganisationGroupSet( form ) }, function(){
- selectAllById( 'selectedGroups' );
- } );
-
- checkValueIsExist( "name", "validateOrganisationUnitGroupSet.action", {id: $organisationUnitGroupSet.id});
-
- changeCompulsory( getFieldValue( 'compulsory' ) );
- });
-
+<script type="text/javascript" src="javascript/updateOrganisationUnitGroupSetForm.js"></script>
+<script type="text/javascript">
+ var saving_the_org_unit_group_set_failed = '$encoder.jsEscape( $i18n.getString( "saving_the_org_unit_group_set_failed" ) , "'" )';
</script>
<h3>$i18n.getString( "edit_org_unit_group_set" ) #openHelp( "ou_groupsets_edit" )</h3>
<form id="updateOrganisationUnitGroupSetForm" action="updateOrganisationUnitGroupSet.action" method="post" >
-
<input type="hidden" id="id" name="id" value="$organisationUnitGroupSet.id"/>
-
<table>
<tr>
<th colspan="2">$i18n.getString( "details" )</th>
@@ -24,12 +14,12 @@
<tr>
<td><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $organisationUnitGroupSet.name )" style="width:20em" maxlength="230" class="{validate:{required:true,minlength:2}}"/></td>
+ <td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $organisationUnitGroupSet.name )" style="width:20em"></td>
</tr>
<tr>
<td><label for="description">$i18n.getString( "description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input type="text" id="description" name="description" value="$encoder.htmlEncode( $organisationUnitGroupSet.description )" style="width:20em" maxlength="255" class="{validate:{required:true,minlength:2}}"/></td>
+ <td><input type="text" id="description" name="description" value="$encoder.htmlEncode( $organisationUnitGroupSet.description )" style="width:20em"></td>
</tr>
<tr>
@@ -98,9 +88,4 @@
</td>
</tr>
</table>
-
</form>
-
-<script type="text/javascript">
- var saving_the_org_unit_group_set_failed = '$encoder.jsEscape( $i18n.getString( "saving_the_org_unit_group_set_failed" ) , "'" )';
-</script>