← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6886: local vn - Seperated the defined associations category option with orgunit.

 

------------------------------------------------------------
revno: 6886
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-05-09 12:19:35 +0700
message:
  local vn - Seperated the defined associations category option with orgunit.
modified:
  local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exporting/GenerateExcelReportGeneric.java
  local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exporting/action/GenerateReportVerticalCategoryAction.java
  local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exportreport/action/GetExportReportAction.java
  local/vn/dhis-web-spreadsheet-reporting/src/main/resources/org/hisp/dhis/reportsheet/i18n_module.properties
  local/vn/dhis-web-spreadsheet-reporting/src/main/resources/org/hisp/dhis/reportsheet/i18n_module_vi_VN.properties
  local/vn/dhis-web-spreadsheet-reporting/src/main/resources/struts.xml
  local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/categoryOptionAssociations.vm
  local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/attribute.ajax.js
  local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/category.ajax.js
  local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/jsonPeriodColumn.vm
  local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/viewAdministrator.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 'local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exporting/GenerateExcelReportGeneric.java'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exporting/GenerateExcelReportGeneric.java	2012-05-03 10:04:29 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exporting/GenerateExcelReportGeneric.java	2012-05-09 05:19:35 +0000
@@ -26,16 +26,16 @@
  */
 package org.hisp.dhis.reportsheet.exporting;
 
+import static org.hisp.dhis.reportsheet.utils.ExpressionUtils.generateExpression;
+import static org.hisp.dhis.reportsheet.utils.ExpressionUtils.generateIndicatorExpression;
+import static org.hisp.dhis.reportsheet.utils.DateUtils.getTimeRoll;
+import static org.hisp.dhis.reportsheet.utils.DateUtils.getFirstDayOfMonth;
+import static org.hisp.dhis.reportsheet.utils.DateUtils.getStartQuaterly;
 import static org.hisp.dhis.reportsheet.utils.DateUtils.getEndQuaterly;
+import static org.hisp.dhis.reportsheet.utils.DateUtils.getStartSixMonthly;
 import static org.hisp.dhis.reportsheet.utils.DateUtils.getEndSixMonthly;
-import static org.hisp.dhis.reportsheet.utils.DateUtils.getFirstDayOfMonth;
 import static org.hisp.dhis.reportsheet.utils.DateUtils.getFirstDayOfYear;
 import static org.hisp.dhis.reportsheet.utils.DateUtils.getLastDayOfYear;
-import static org.hisp.dhis.reportsheet.utils.DateUtils.getStartQuaterly;
-import static org.hisp.dhis.reportsheet.utils.DateUtils.getStartSixMonthly;
-import static org.hisp.dhis.reportsheet.utils.DateUtils.getTimeRoll;
-import static org.hisp.dhis.reportsheet.utils.ExpressionUtils.generateExpression;
-import static org.hisp.dhis.reportsheet.utils.ExpressionUtils.generateIndicatorExpression;
 import static org.hisp.dhis.reportsheet.utils.FileUtils.checkingExtensionExcelFile;
 import static org.hisp.dhis.system.util.MathUtils.calculateExpression;
 
@@ -219,6 +219,10 @@
     protected Font csFont11Bold;
 
     protected Font csFont10Bold;
+    
+    protected Font csFont9Bold;
+    
+    protected Font csFont8Bold;
 
     protected Font csFont12BoldCenter;
 
@@ -229,6 +233,10 @@
     protected CellStyle csText;
 
     protected CellStyle csText10Bold;
+    
+    protected CellStyle csText9Bold;
+    
+    protected CellStyle csText8Bold;
 
     protected CellStyle csTextSerial;
 
@@ -287,6 +295,8 @@
     {
         sheetPOI = templateWorkbook.getSheetAt( 0 );
         csFont = templateWorkbook.createFont();
+        csFont8Bold = templateWorkbook.createFont();
+        csFont9Bold = templateWorkbook.createFont();
         csFont10Bold = templateWorkbook.createFont();
         csFont11Bold = templateWorkbook.createFont();
         csFont12BoldCenter = templateWorkbook.createFont();
@@ -295,6 +305,7 @@
         csFormula = templateWorkbook.createCellStyle();
         csText = templateWorkbook.createCellStyle();
         csText10Bold = templateWorkbook.createCellStyle();
+        csText10Bold = templateWorkbook.createCellStyle();
         csTextSerial = templateWorkbook.createCellStyle();
         csTextICDJustify = templateWorkbook.createCellStyle();
         csText12BoldCenter = templateWorkbook.createCellStyle();
@@ -307,6 +318,12 @@
         initPOIStylesManager.initDefaultFont( csFont );
         initPOIStylesManager.initDefaultCellStyle( csText, csFont );
 
+        initPOIStylesManager.initFont( csFont8Bold, "Tahoma", (short) 8, Font.BOLDWEIGHT_BOLD, IndexedColors.BLACK
+            .getIndex() );
+        
+        initPOIStylesManager.initFont( csFont9Bold, "Tahoma", (short) 9, Font.BOLDWEIGHT_BOLD, IndexedColors.BLACK
+            .getIndex() );
+        
         initPOIStylesManager.initFont( csFont10Bold, "Tahoma", (short) 10, Font.BOLDWEIGHT_BOLD, IndexedColors.BLACK
             .getIndex() );
         initPOIStylesManager.initFont( csFont11Bold, "Tahoma", (short) 11, Font.BOLDWEIGHT_BOLD,
@@ -321,6 +338,14 @@
             this.CELLSTYLE_BORDER_COLOR, this.CELLSTYLE_BORDER, this.CELLSTYLE_BORDER_COLOR, this.CELLSTYLE_BORDER,
             this.CELLSTYLE_BORDER_COLOR, this.CELLSTYLE_BORDER, this.CELLSTYLE_BORDER_COLOR,
             this.CELLSTYLE_ALIGN_RIGHT, true );
+        initPOIStylesManager.initCellStyle( csText8Bold, csFont8Bold, this.CELLSTYLE_BORDER,
+            this.CELLSTYLE_BORDER_COLOR, this.CELLSTYLE_BORDER, this.CELLSTYLE_BORDER_COLOR, this.CELLSTYLE_BORDER,
+            this.CELLSTYLE_BORDER_COLOR, this.CELLSTYLE_BORDER, this.CELLSTYLE_BORDER_COLOR, this.CELLSTYLE_ALIGN_LEFT,
+            true );
+        initPOIStylesManager.initCellStyle( csText9Bold, csFont9Bold, this.CELLSTYLE_BORDER,
+            this.CELLSTYLE_BORDER_COLOR, this.CELLSTYLE_BORDER, this.CELLSTYLE_BORDER_COLOR, this.CELLSTYLE_BORDER,
+            this.CELLSTYLE_BORDER_COLOR, this.CELLSTYLE_BORDER, this.CELLSTYLE_BORDER_COLOR, this.CELLSTYLE_ALIGN_LEFT,
+            true );
         initPOIStylesManager.initCellStyle( csText10Bold, csFont10Bold, this.CELLSTYLE_BORDER,
             this.CELLSTYLE_BORDER_COLOR, this.CELLSTYLE_BORDER, this.CELLSTYLE_BORDER_COLOR, this.CELLSTYLE_BORDER,
             this.CELLSTYLE_BORDER_COLOR, this.CELLSTYLE_BORDER, this.CELLSTYLE_BORDER_COLOR, this.CELLSTYLE_ALIGN_LEFT,

=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exporting/action/GenerateReportVerticalCategoryAction.java'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exporting/action/GenerateReportVerticalCategoryAction.java	2012-05-04 09:50:39 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exporting/action/GenerateReportVerticalCategoryAction.java	2012-05-09 05:19:35 +0000
@@ -109,7 +109,7 @@
                 if ( reportItem.getItemType().equalsIgnoreCase( ExportItem.TYPE.DATAELEMENT_NAME ) )
                 {
                     ExcelUtils.writeValueByPOI( rowBegin, reportItem.getColumn(), group.getName(), ExcelUtils.TEXT,
-                        sheet, this.csText12BoldCenter );
+                        sheet, this.csText10Bold );
                 }
 
                 run++;
@@ -123,7 +123,7 @@
                         if ( reportItem.getItemType().equalsIgnoreCase( ExportItem.TYPE.DATAELEMENT_NAME ) )
                         {
                             ExcelUtils.writeValueByPOI( rowBegin, reportItem.getColumn(), categoryOption.getName(),
-                                ExcelUtils.TEXT, sheet, this.csText10Bold );
+                                ExcelUtils.TEXT, sheet, this.csText8Bold );
                         }
                         else if ( reportItem.getItemType().equalsIgnoreCase( ExportItem.TYPE.SERIAL ) )
                         {

=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exportreport/action/GetExportReportAction.java'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exportreport/action/GetExportReportAction.java	2012-04-16 03:00:30 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exportreport/action/GetExportReportAction.java	2012-05-09 05:19:35 +0000
@@ -27,6 +27,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.List;
+
+import org.hisp.dhis.reportsheet.ExportItem;
 import org.hisp.dhis.reportsheet.ExportReportService;
 import org.hisp.dhis.reportsheet.ExportReport;
 import org.hisp.dhis.reportsheet.action.ActionSupport;
@@ -95,6 +98,11 @@
         return ExportReport.class.getSimpleName();
     }
 
+    public List<String> getPeriodTypes()
+    {
+        return ExportItem.PERIODTYPE.getPeriodTypes();
+    }
+
     // -------------------------------------------------------------------------
     // Execute method
     // -------------------------------------------------------------------------

=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/resources/org/hisp/dhis/reportsheet/i18n_module.properties'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/resources/org/hisp/dhis/reportsheet/i18n_module.properties	2012-05-04 09:50:39 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/resources/org/hisp/dhis/reportsheet/i18n_module.properties	2012-05-09 05:19:35 +0000
@@ -206,6 +206,7 @@
 intro_clean_up              = This feature allows users to delete the temporary files generated during the generating report or previewing report.
 intro_import_reports        = Create, update, delete and view the elements for importing data from excel files. This import items closer to export items.
 intro_excel_template_management = Upload, rename, search, download and delete the file extension .xls or .xlsx. Users can identify which files are used and unused files to. Automatically, allowing to update excel reporting system when file names which are used to be changed.
+intro_define_categoryoption_associations = Thus function allows users for assigning the categoy option to organisation unit.
 translation_translate		= Translate
 template_using              = File is using
 template_pending            = File is pending

=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/resources/org/hisp/dhis/reportsheet/i18n_module_vi_VN.properties'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/resources/org/hisp/dhis/reportsheet/i18n_module_vi_VN.properties	2012-05-04 09:50:39 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/resources/org/hisp/dhis/reportsheet/i18n_module_vi_VN.properties	2012-05-09 05:19:35 +0000
@@ -26,6 +26,7 @@
 group=Nh\u00f3m
 move_selected=B\u1ecf v\u00e0o
 intro_clean_up=Ch\u1ee9c n\u0103ng n\u00e0y cho ph\u00e9p ng\u01b0\u1eddi d\u00f9ng x\u00f3a c\u00e1c t\u1eadp tin t\u1ea1m sinh ra trong qu\u00e1 tr\u00ecnh sinh b\u00e1o c\u00e1o ho\u1eb7c xem tr\u01b0\u1edbc b\u00e1o c\u00e1o.
+intro_define_categoryoption_associations=Ch\u1ee9c n\u0103ng n\u00e0y cho ph\u00e9p ng\u01b0\u1eddi d\u00f9ng g\u00e1n Ph\u1ea7n t\u1eed ph\u00e2n lo\u1ea1i v\u00e0o \u0111\u01a1n v\u1ecb.
 not_null=kh\u00f4ng r\u1ed7ng
 upload_file=T\u1ea3i l\u00ean
 add_export_item=Th\u00eam ph\u1ea7n t\u1eed

=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/resources/struts.xml'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/resources/struts.xml	2012-05-08 08:07:28 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/resources/struts.xml	2012-05-09 05:19:35 +0000
@@ -289,10 +289,11 @@
 		</action>
 		
 		<action name="openCategoryOptionAssociations"
-			class="org.hisp.dhis.reportsheet.cogroup.action.OpenCategoryOptionAssociationsAction">
+			class="org.hisp.dhis.reportsheet.action.NoAction">
 			<result name="success" type="velocity">/main.vm</result>
 			<param name="page">/dhis-web-spreadsheet-reporting/categoryOptionAssociations.vm</param>
 			<param name="menu">/dhis-web-spreadsheet-reporting/menu.vm</param>
+			<param name="javascripts">javascript/category.ajax.js</param>
 			<param name="stylesheets">style/basic.css</param>
 		</action>
 

=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/categoryOptionAssociations.vm'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/categoryOptionAssociations.vm	2012-05-04 09:50:39 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/categoryOptionAssociations.vm	2012-05-09 05:19:35 +0000
@@ -4,26 +4,30 @@
 	jQuery(document).ready( function()
 	{
 		validator = validation( "categoryOptionAssociationsForm", function( form ) { validateCategoryOptionAssociations( form ); });
+		
+		categoryLib.loadCategories( "categoryId" );
 	} );
 	
+	var i18n_label = '$encoder.jsEscape($i18n.getString( 'select_category_option' ) , "'")';
 	var i18n_verify_category_option = '$encoder.jsEscape($i18n.getString( 'please_select_category_option' ) , "'")';
 </script>
 
 <h3>$i18n.getString( "define_categoryoption_associations" )</h3>
 
-<h4>$encoder.htmlEncode( $!group.name )</h4>
-
 <form id="categoryOptionAssociationsForm" action="updateCategoryOptionAssociations.action">  
 	<table>
 		<tbody>
+			<tr><th>$i18n.getString( "categories" )</th></tr>
+			<tr>
+				<td>
+					<select id="categoryId" style="width:220px" onchange="getCategoryOptions();" class="{validate:{required:true}}">
+					</select>
+				</td>
+			</tr>
 			<tr><th>$i18n.getString( "category_options" )</th></tr>
 			<tr>
 				<td>
 					<select id="categoryOptionId" style="width:220px" onchange="getAssociationsByCategoryOption( this.value )" class="{validate:{required:true}}">
-						<option value="">[ $i18n.getString( "select_category_option" ) ]</option>
-						#foreach( $option in $!group.categoryOptions )
-						<option value="$!option.id">$encoder.htmlEncode( $!option.name )</option>
-						#end
 					</select>
 				</td>
 			</tr>
@@ -39,7 +43,7 @@
     <tr>
       <td>
         <input type="submit" id="submitButton" value="$i18n.getString( 'save' )" style="width:10em"/>
-		<input type="button" onclick="window.location.href='listCategoryOptionGroupOrderForExportReport.action?id=$!reportId'" value="$i18n.getString( 'back' )" style="width:10em"/>
+		<input type="button" onclick="window.location.href='openAdministrator.action'" value="$i18n.getString( 'back' )" style="width:10em"/>
       </td>
     </tr>
   </table>
@@ -48,6 +52,12 @@
 
 <script type="text/javascript">
 
+	function getCategoryOptions()
+	{
+		categoryLib.loadCategoryOptionsByCategory( getFieldValue( 'categoryId' ), null, 'categoryOptionId' );
+		getAssociationsByCategoryOption( getFieldValue( 'categoryOptionId' ) );
+	}
+
 	function getAssociationsByCategoryOption( value )
 	{
 		if ( value && value != "" )

=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/attribute.ajax.js'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/attribute.ajax.js	2012-04-25 09:59:24 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/attribute.ajax.js	2012-05-09 05:19:35 +0000
@@ -93,7 +93,10 @@
 			} );
 		}
 		
-		this.removeDuplicatedItem( sourceList, destList );
+		if ( source && dest )
+		{
+			this.removeDuplicatedItem( sourceList, destList );
+		}
 	};
 	
 	this.removeDuplicatedItem = function( availableList, selectedList )
@@ -114,7 +117,7 @@
 	{
 		this.attributeMap = new Array();
 		this.attributeValueMap = new Array();
-	}
+	};
 }
 
 

=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/category.ajax.js'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/category.ajax.js	2012-04-26 18:25:07 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/javascript/category.ajax.js	2012-05-09 05:19:35 +0000
@@ -93,7 +93,10 @@
 			} );
 		}
 		
-		this.removeDuplicatedItem( sourceList, destList );
+		if ( source && dest )
+		{
+			this.removeDuplicatedItem( sourceList, destList );
+		}
 	};
 	
 	this.removeDuplicatedItem = function( availableList, selectedList )
@@ -114,7 +117,7 @@
 	{
 		this.categoryMap = new Array();
 		this.categoryOptionMap = new Array();
-	}
+	};
 }
 
 

=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/jsonPeriodColumn.vm'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/jsonPeriodColumn.vm	2012-02-28 08:50:46 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/jsonPeriodColumn.vm	2012-05-09 05:19:35 +0000
@@ -2,7 +2,7 @@
   {
 	"id": "${periodColumn.id}",
 	"startdate": "$!encoder.jsonEncode( $!format.formatDate( ${periodColumn.startdate} ) )",
-	"enddate": "$!encoder.jsonEncode( $!format.formatDate( ${periodColumn.enddate ) )",
+	"enddate": "$!encoder.jsonEncode( $!format.formatDate( ${periodColumn.enddate} ) )",
 	"column": "${periodColumn.column}",
 	"periodType": "$!encoder.jsonEncode( ${periodColumn.periodType} )"
   }

=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/viewAdministrator.vm'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/viewAdministrator.vm	2012-04-16 03:00:30 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/viewAdministrator.vm	2012-05-09 05:19:35 +0000
@@ -4,6 +4,7 @@
     #introListImgItem( "getConfiguration.action" "configuration" "systemsettings")
     #introListImgItem( "listAllExportReport.action" "design_export_reports" "export")
 	#introListImgItem( "listAllImportReport.action" "design_import_reports" "import" )
+    #introListImgItem( "openCategoryOptionAssociations.action" "define_categoryoption_associations" "dhis-web-maintenance-datadictionary")
     #introListImgItem( "listDataEntryStatus.action" "data_status_management" "validationcriteria")
     #introListImgItem( "listAllExcelTemplates.action" "excel_template_management" "excel")
 	#introListImgItem( "javascript: cleanUp();" "clean_up" "clean-up")