← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17560: Category option screen, short name required

 

------------------------------------------------------------
revno: 17560
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-11-21 10:58:37 +0100
message:
  Category option screen, short name required
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryOptionForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryOptionForm.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-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2014-11-15 13:26:06 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2014-11-21 09:58:37 +0000
@@ -763,6 +763,8 @@
         executeSql( "alter table dataelement drop column sortorder" );
         executeSql( "alter table indicator drop column sortorder" );
         executeSql( "alter table dataset drop column sortorder" );
+        
+        executeSql( "alter table dataelement drop column active" );
 
         executeSql( "alter table datavalue alter column value type varchar(50000)" );
         executeSql( "alter table datavalue alter column comment type varchar(50000)" );
@@ -771,13 +773,13 @@
         executeSql( "update datavalueaudit set attributeoptioncomboid = " + defaultOptionComboId + " where attributeoptioncomboid is null" );
         executeSql( "alter table datavalueaudit alter column attributeoptioncomboid set not null;" );
         
+        executeSql( "update dataelementcategoryoption set shortname = substring(name,0,50) where shortname is null" );
+        
         upgradeDataValuesWithAttributeOptionCombo();
         upgradeCompleteDataSetRegistrationsWithAttributeOptionCombo();
         upgradeMapViewsToAnalyticalObject();
         upgradeTranslations();
 
-        executeSql( "ALTER TABLE dataelement DROP COLUMN active" );
-
         updateOptions();
 
         log.info( "Tables updated" );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryOptionForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryOptionForm.vm	2014-11-15 13:26:06 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryOptionForm.vm	2014-11-21 09:58:37 +0000
@@ -46,7 +46,7 @@
     </tr>
     <tr>
       <td style="width: 100px"><label>$i18n.getString( "short_name" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-      <td><input type="text" id="shortName" name="shortName" class="{validate:{rangelength:[2,50]}}"/></td>
+      <td><input type="text" id="shortName" name="shortName" class="{validate:{required:true,rangelength:[2,50]}}"/></td>
     </tr>
 	<tr>
 	  <td><label>$i18n.getString( "code" )</td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryOptionForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryOptionForm.vm	2014-11-15 13:26:06 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryOptionForm.vm	2014-11-21 09:58:37 +0000
@@ -53,13 +53,13 @@
     </tr>
     <tr>
       <td style="width: 100px"><label>$i18n.getString( "short_name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-      <td><input type="text" id="shortName" name="shortName" value="$!encoder.htmlEncode( $dataElementCategoryOption.shortName )" class="{validate:{rangelength:[2,50]}}"/></td>
+      <td><input type="text" id="shortName" name="shortName" value="$!encoder.htmlEncode( $dataElementCategoryOption.shortName )" class="{validate:{required:true,rangelength:[2,50]}}"/></td>
     </tr>
 	<tr>
 	  <td><label>$i18n.getString( "code" )</label></td>
 	  <td><input type="text" id="code" name="code" value="$!encoder.htmlEncode( $dataElementCategoryOption.code )" /></td>
     </tr>
-  </table>  
+  </table>
   
   <div id="showMoreOptions" style="margin: 20px 0;"><a href="javascript:showMoreOrFewerOptions()">$i18n.getString( "show_more_options" )</a></div>