← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14664: Impl sharing ui for data approval level

 

------------------------------------------------------------
revno: 14664
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-04-04 16:42:26 +0200
message:
  Impl sharing ui for data approval level
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevel.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicator.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/javascripts/systemApprovalSettings.js
  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-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevel.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevel.java	2014-04-03 16:03:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataapproval/DataApprovalLevel.java	2014-04-04 14:42:26 +0000
@@ -104,19 +104,6 @@
     // -------------------------------------------------------------------------
 
     /**
-     * Constructs a name that can refer to this data approval level.
-     *
-     * @return name of this data approval level.
-     */
-    public String getName()
-    {
-        String name = orgUnitLevel
-            + ( categoryOptionGroupSet == null ? "" : ( " - " + categoryOptionGroupSet.getName() ) );
-
-        return name;
-    }
-
-    /**
      * Returns the name of the category option group set for this data approval
      * level, or an empty string if there is no category option group set.
      *

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicator.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicator.vm	2013-12-04 12:58:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicator.vm	2014-04-04 14:42:26 +0000
@@ -10,7 +10,7 @@
 	// Are you sure you want to delete this?
 	var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ) , "'")';
 	var i18n_yes = '$encoder.jsEscape( $i18n.getString( "yes" ) , "'")';
-  var i18n_no = '$encoder.jsEscape( $i18n.getString( "no" ) , "'")';
+    var i18n_no = '$encoder.jsEscape( $i18n.getString( "no" ) , "'")';
 	var i18n_adding_indicator_failed = '$encoder.jsEscape( $i18n.getString( "adding_indicator_failed" ) , "'")';
 	var i18n_saving_indicator_failed = '$encoder.jsEscape( $i18n.getString( "saving_indicator_failed" ) , "'")';
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/javascripts/systemApprovalSettings.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/javascripts/systemApprovalSettings.js	2014-02-19 04:19:40 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/javascripts/systemApprovalSettings.js	2014-04-04 14:42:26 +0000
@@ -1,3 +1,10 @@
+$(function() {
+  dhis2.contextmenu.makeContextMenu({
+    menuId: 'contextMenu',
+    menuItemActiveClass: 'contextMenuItemActive'
+  });
+});
+
 function removeApprovalLevel( context ) {
     removeItem( context.id, context.name, i18n_confirm_delete_data_approval_level, 'removeApprovalLevel.action' );
 }

=== 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-03-31 10:35:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/webapp/dhis-web-maintenance-settings/systemApprovalSettings.vm	2014-04-04 14:42:26 +0000
@@ -1,3 +1,6 @@
+
+#sharingDialog()
+
 <script type="text/javascript">
     jQuery(document).ready(function() {
         dhis2.contextmenu.makeContextMenu({
@@ -13,6 +16,7 @@
 
 <div id="contextMenu" class="contextMenu">
     <ul id="contextMenuItems" class="contextMenuItems">
+    	<li data-enabled="canManage"><a data-target-fn="showSharingDialogWithContext"><i class="fa fa-share"></i>&nbsp;&nbsp;$i18n.getString( "sharing_settings" )</a></li>
         <li data-enabled="canMoveUp"><a data-target-fn="moveApprovalLevelUp"><i class="fa fa-arrow-up"></i>&nbsp;&nbsp;$i18n.getString( "move_up" )</a></li>
         <li data-enabled="canMoveDown"><a data-target-fn="moveApprovalLevelDown"><i class="fa fa-arrow-down"></i>&nbsp;&nbsp;$i18n.getString( "move_down" )</a></li>
         <li><a data-target-fn="removeApprovalLevel"><i class="fa fa-trash-o"></i>&nbsp;&nbsp;$i18n.getString( "remove" )</a></li>
@@ -43,9 +47,10 @@
                 </thead>
                 <tbody id="list">
                     #foreach( $level in $dataApprovalLevels )
-                    <tr id="tr${level.level}" data-id="$!level.level" data-name="$encoder.htmlEncode( $!level.getName() )"
+                    <tr id="tr${level.level}" data-id="$!level.id" data-uid="$!level.uid" data-type="DataApprovalLevel" data-name="$encoder.htmlEncode( $!level.displayName )"
                             data-can-move-up="$approvalLevelService.canMoveUp( $level.level )"
-                            data-can-move-down="$approvalLevelService.canMoveDown( $level.level )">
+                            data-can-move-down="$approvalLevelService.canMoveDown( $level.level )"
+                            data-can-manage="$security.canManage( $level )">
                         <td>$encoder.htmlEncode( $!level.orgUnitLevelName )</td>
                         <td>$encoder.htmlEncode( $!level.getCategoryOptionGroupSetName() )</td>
                     </tr>