dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #11343
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3212: Data Set Editor - Applied pivot css to grid table and showed column name as shortname instead of ...
------------------------------------------------------------
revno: 3212
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-03-30 12:05:04 +0700
message:
Data Set Editor - Applied pivot css to grid table and showed column name as shortname instead of name for data sets.
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/editor/ShowedAssociationsEditorAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/htmlGrid.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/editor.js
--
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-dataset/src/main/java/org/hisp/dhis/dataset/action/editor/ShowedAssociationsEditorAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/editor/ShowedAssociationsEditorAction.java 2011-03-23 04:38:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/editor/ShowedAssociationsEditorAction.java 2011-03-30 05:05:04 +0000
@@ -115,18 +115,18 @@
return maps;
}
-
+
public List<String> getHeaderIds()
{
List<String> ids = new ArrayList<String>();
-
+
for ( GridHeader header : grid.getVisibleHeaders() )
{
ids.add( header.getColumn() );
}
-
+
ids.remove( 0 );
-
+
return ids;
}
@@ -167,7 +167,7 @@
for ( DataSet dataSet : dataSets )
{
- grid.addHeader( new GridHeader( dataSet.getName(), dataSet.getId() + "", String.class.getName(), false,
+ grid.addHeader( new GridHeader( dataSet.getShortName(), dataSet.getId() + "", dataSet.getName(), false,
false ) );
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/htmlGrid.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/htmlGrid.vm 2011-03-23 04:38:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/htmlGrid.vm 2011-03-30 05:05:04 +0000
@@ -1,3 +1,11 @@
+<style type="text/css">
+.pivot td
+{
+ border: 1px solid #d0d0d0;
+ padding: 2px 10px 3px 10px
+}
+</style>
+
#set( $headers = $grid.getVisibleHeaders() )
#set( $i18nAssigned = $i18n.getString( "assigned" ) )
#set( $i18nUnassigned = $i18n.getString( "unassigned" ) )
@@ -6,48 +14,40 @@
<h5>$!encoder.htmlEncode( $grid.subtitle )</h5>
-<table class="listTable">
-<col width="5px"/>
-<col width="80px"/>
-#foreach( $header in $headers )
-#if ( $velocityCount > 1 )
-<col width="35px"/>
-#end
-#end
-
-<thead>
-<tr>
-<th></th>
-#foreach( $header in $headers )
-<th>$!encoder.htmlEncode( $header.name )</th>
-#end
-</tr>
-</thead>
-
-<tbody>
-#foreach( $meta in $!MetaValues )
- #set( $list = $!MetaValueMaps.get( $meta.id ) )
- <tr>
- <td><input type="checkbox" onchange="assignAll( $meta.id )"/></td>
- <td>$meta</td>
- #foreach( $item in $list )
- #set( $title = " - " + $headers.get( $velocityCount ).name + " - " + $meta )
- #if( $item.metaValue == "true" )
- #set( $title = $i18nAssigned + $title )
- #else
- #set( $title = $i18nUnassigned + $title )
+<table class="pivot">
+ <thead>
+ <tr>
+ <th></th>
+ #foreach( $header in $headers )
+ <th>$!encoder.htmlEncode( $header.name )</th>
+ #end
+ </tr>
+ </thead>
+
+ <tbody>
+ #foreach( $meta in $!MetaValues )
+ #set( $list = $!MetaValueMaps.get( $meta.id ) )
+ <tr>
+ <td><input type="checkbox" onchange="assignAll( this, $meta.id )"/></td>
+ <td>$meta</td>
+ #foreach( $item in $list )
+ #set( $title = " - " + $headers.get( $velocityCount ).type + " - " + $meta )
+ #if( $item.metaValue == "true" )
+ #set( $title = $i18nAssigned + $title )
+ #else
+ #set( $title = $i18nUnassigned + $title )
+ #end
+ <td>
+ <div id="div$item.id$item.name" align="center">
+ <img #if ( $item.metaValue == "true" ) src="../images/edit_add.png" #else src="../images/cancel.png" #end
+ onclick="changeAssociatedStatus( $item.id, $item.name, $item.metaValue )" style="cursor:pointer" title="$title"/>
+ <input type="hidden" value="$item.metaValue"/>
+ </div>
+ </td>
#end
- <td>
- <div id="div$item.id$item.name" align="center">
- <img #if ( $item.metaValue == "true" ) src="../images/edit_add.png" #else src="../images/cancel.png" #end
- onclick="changeAssociatedStatus( $item.id, $item.name, $item.metaValue )" style="cursor:pointer" title="$title"/>
- <input type="hidden" value="$item.metaValue"/>
- </div>
- </td>
+ </tr>
#end
- </tr>
-#end
-</tbody>
+ </tbody>
</table>
<script type="text/javascript">
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/editor.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/editor.js 2011-03-23 04:38:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/editor.js 2011-03-30 05:05:04 +0000
@@ -25,10 +25,22 @@
$( "#div" + orgunitId + dataSetId ).load( url );
}
-function assignAll( orgunitId )
+function assignAll( element, orgunitId )
{
+ var status = false;
+ var checked = element.checked;
+
+ lockScreen();
+
for ( var i = 0 ; i < arrayIds.length ; i++ )
{
- changeAssociatedStatus( orgunitId, arrayIds[i], eval($("#div" + orgunitId + arrayIds[i] + " input[type='hidden']").val()) );
+ status = eval( $("#div" + orgunitId + arrayIds[i] + " input[type='hidden']").val() );
+
+ if ( (checked && !status) || (!checked && status) )
+ {
+ changeAssociatedStatus( orgunitId, arrayIds[i], !checked );
+ }
}
+
+ unLockScreen();
}
\ No newline at end of file