← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14772: Show approval level listing column 'Category option group set' only when COGS is present in >= 1 ...

 

------------------------------------------------------------
revno: 14772
committer: Jim Grace <jimgrace@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-04-10 10:59:27 -0400
message:
  Show approval level listing column 'Category option group set' only when COGS is present in >= 1 approval level.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetApprovalSettingsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/addApprovalLevel.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemApprovalSettings.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/resources/org/hisp/dhis/dataadmin/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2014-02-12 12:08:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2014-04-10 14:59:27 +0000
@@ -1,6 +1,7 @@
 remove_all=Remove All Locks
 done=Done
 loading=Loading, please wait
+optional=Optional
 data_administration=Data Administration
 period_type=Period Type
 select_options=Please select at least one option

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetApprovalSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetApprovalSettingsAction.java	2014-04-09 04:27:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/system/GetApprovalSettingsAction.java	2014-04-10 14:59:27 +0000
@@ -85,6 +85,13 @@
         return approvalLevelService;
     }
 
+    private boolean categoryOptionGroupSetsPresent;
+
+    public boolean isCategoryOptionGroupSetsPresent()
+    {
+        return categoryOptionGroupSetsPresent;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -95,6 +102,17 @@
 
         dataApprovalLevels = dataApprovalLevelService.getAllDataApprovalLevels();
 
+        categoryOptionGroupSetsPresent = false;
+
+        for ( DataApprovalLevel level : dataApprovalLevels )
+        {
+            if ( level.getCategoryOptionGroupSet() != null )
+            {
+                categoryOptionGroupSetsPresent = true;
+                break;
+            }
+        }
+
         approvalLevelService = dataApprovalLevelService;
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/addApprovalLevel.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/addApprovalLevel.vm	2014-03-31 11:43:23 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/addApprovalLevel.vm	2014-04-10 14:59:27 +0000
@@ -6,7 +6,7 @@
             <th colspan="2">$i18n.getString( "details" )</th>
         </tr>
         <tr>
-            <td><label for="organisationUnitLevel">$i18n.getString( "organisation_unit_level" )<em title="$i18n.getString( "required" )" class="required">*</em></label> &nbsp; </td>
+            <td><label for="organisationUnitLevel">$i18n.getString( "organisation_unit_level" ) <em title="$i18n.getString( "required" )" class="required">*</em></label> &nbsp; </td>
             <td>
                 <select type="text" id="organisationUnitLevel" name="organisationUnitLevel">
                     <option value="">[ $encoder.htmlEncode( $i18n.getString( "select_level" ) ) ]</option>
@@ -17,7 +17,7 @@
             </td>
         </tr>
         <tr>
-            <td><label for="categoryOptionGroupSet">$i18n.getString( "category_option_group_set" )</label> &nbsp; </td>
+            <td><label for="categoryOptionGroupSet">$i18n.getString( "category_option_group_set" ) <span class="tipText">($i18n.getString( "optional" ))</label> &nbsp; </td>
             <td>
                 <select type="text" id="categoryOptionGroupSet" name="categoryOptionGroupSet">
                     <option value="0">[ $encoder.htmlEncode( $i18n.getString( "select_set" ) ) ]</option>
@@ -32,7 +32,7 @@
         	<td>
         		<input type="button" value="$i18n.getString( "add" )" onclick="javascript:validateApprovalLevel()" style="width:10em" />
                 <input type="button" value="$i18n.getString( "cancel" )" onclick="window.location.href='systemApprovalSettings.action'" style="width:10em" />
-            </td>
+            </td>
         </tr>
     </table>
 </form>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemApprovalSettings.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemApprovalSettings.vm	2014-04-10 01:28:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemApprovalSettings.vm	2014-04-10 14:59:27 +0000
@@ -63,7 +63,9 @@
                 <tr>
                     <th class="{sorter: false}">$i18n.getString( "approval_level" )</th>
                     <th class="{sorter: false}">$i18n.getString( "organisation_unit_level" )</th>
-                    <th class="{sorter: false}">$i18n.getString( "category_option_group_set" )</th>
+                    #if( $categoryOptionGroupSetsPresent )
+                        <th class="{sorter: false}">$i18n.getString( "category_option_group_set" )</th>
+                    #end
                 </tr>
                 </thead>
                 <tbody id="list">
@@ -74,7 +76,9 @@
                             data-can-manage="$security.canManage( $level )">
                         <td class="levelNumber">$encoder.htmlEncode( $!level.level )</td>
                         <td>$encoder.htmlEncode( $!level.orgUnitLevelName )</td>
-                        <td>$encoder.htmlEncode( $!level.getCategoryOptionGroupSetName() )</td>
+                        #if( $categoryOptionGroupSetsPresent )
+                            <td>$encoder.htmlEncode( $!level.getCategoryOptionGroupSetName() )</td>
+                        #end
                     </tr>
                     #end
                 </tbody>