← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1344: Function Excel management - Working in progress ...

 

------------------------------------------------------------
revno: 1344
committer: hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Tue 2010-01-26 16:04:04 +0700
message:
  Function Excel management - Working in progress ...
modified:
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/filemanager/action/ExcelTemplateListAction.java
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/excelTemplateList.vm
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-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 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/filemanager/action/ExcelTemplateListAction.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/filemanager/action/ExcelTemplateListAction.java	2010-01-26 08:19:44 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/filemanager/action/ExcelTemplateListAction.java	2010-01-26 09:04:04 +0000
@@ -1,6 +1,7 @@
 package org.hisp.dhis.reportexcel.filemanager.action;
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.Collection;
 
 import org.hisp.dhis.options.SystemSettingManager;
@@ -20,7 +21,7 @@
     // -------------------------------------------
     // Output
     // -------------------------------------------
-    private Collection<File> templateFiles;
+    private Collection<File> templateFiles = new ArrayList<File>();
 
     // -------------------------------------------
     // Getter && Setter
@@ -46,10 +47,8 @@
     {
         String templateDirectory = (String) systemSettingManager
             .getSystemSetting( SystemSettingManager.KEY_REPORT_TEMPLATE_DIRECTORY );
-
-        File reportTempDir = new File( templateDirectory );
-
-        templateFiles = FileUtils.getListFile( reportTempDir );
+        
+        templateFiles = FileUtils.getListFile( new File( templateDirectory ) );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml	2010-01-26 08:19:44 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml	2010-01-26 09:04:04 +0000
@@ -1242,7 +1242,9 @@
 			ref="org.hisp.dhis.reportexcel.excelitem.ExcelItemService" />
 		<property name="statementManager" ref="statementManager" />
 	</bean>
-
+	
+	<!-- Excel Templates Management -->
+	
 	<bean
 		id="org.hisp.dhis.reportexcel.filemanager.action.ExcelTemplateListAction"
 		class="org.hisp.dhis.reportexcel.filemanager.action.ExcelTemplateListAction"

=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties	2010-01-12 06:00:44 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties	2010-01-26 09:04:04 +0000
@@ -180,4 +180,5 @@
 value_rounded               = This value maybe have been rounded
 level_and_orgunit_group 	= Level and Organisation Unit Group
 levels						= Level
-no_item						= Don't have any items chosen
\ No newline at end of file
+no_item						= Don't have any items chosen
+excel_template_management   = Excel Template Management

=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties	2010-01-18 03:21:24 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties	2010-01-26 09:04:04 +0000
@@ -181,4 +181,5 @@
 no_item						= Kh\u00f4ng c\u00f3 ph\u1ea7n t\u1eed \u0111\u01b0\u1ee3c ch\u1ecdn
 input_sheet_no				= Ch\u01b0a nh\u1eadp sheet
 choose_excel_group          = Ch\u01b0a ch\u1ecdn nh\u00f3m
-choose_report               = Ch\u01b0a ch\u1ecdn b\u00e1o c\u00e1o
\ No newline at end of file
+choose_report               = Ch\u01b0a ch\u1ecdn b\u00e1o c\u00e1o
+excel_template_management   = Qu\u1ea3n l\u00fd c\u00e1c t\u1eadp tin excel m\u1eabu
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml	2010-01-26 08:19:44 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/struts.xml	2010-01-26 09:04:04 +0000
@@ -1211,10 +1211,10 @@
 				/dhis-web-excel-reporting/responsePeriodColumn.vm
 			</result>
 		</action>
-		
-		<!-- File management -->
-		
-		<action name="excelTemplateList"
+
+		<!-- Excel Templates Management -->
+		
+		<action name="listAllExcelTemplates"
 			class="org.hisp.dhis.reportexcel.filemanager.action.ExcelTemplateListAction">
 			<result name="success" type="velocity">/main.vm</result>
 			<param name="page">/dhis-web-excel-reporting/excelTemplateList.vm</param>

=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/excelTemplateList.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/excelTemplateList.vm	2010-01-26 08:19:44 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/excelTemplateList.vm	2010-01-26 09:04:04 +0000
@@ -1,11 +1,11 @@
-<h2>$i18n.getString('excel_template_group')</h2>
+<h2>$i18n.getString('excel_template_management')</h2>
 <table width=100%>
 	<tr>
 		<td>
 			$i18n.getString( "filter_by_name" ): <input type="text" onkeyup="filterValues( this.value , 1)" style="width:300px"/>
 		</td>
 		<td align=right>
-			<input type="button" onclick="mode='add'; openAddExcelItemGroup()" value="$i18n.getString('add')" style="width:100px"/>
+			<input type="button" onclick="mode='add'; openAddTemplateFile()" value="$i18n.getString('add')" style="width:100px"/>
 			<input type="button" value="$i18n.getString( "cancel" )" onclick="window.location='administration.action'" style="width:100px">
 		</td>
 	</tr>
@@ -22,9 +22,9 @@
 		<tr #alternate( $mark )>
 			<td>$encoder.htmlEncode( $templateFile.name )</td>
 			<td align="left">
-				<a href="openExcelItemGroupAssociations.action?excelItemGroupId=$excelItemGroup.id" title="$i18n.getString( 'associations' )"><img src="../images/assign.png" alt="$i18n.getString( 'associations' )"></a>
-				<a href="listExcelItems.action?excelItemGroupId=$excelItemGroup.id" title="$i18n.getString( 'excel_item' )"><img src="../images/add_section.png" alt="$i18n.getString( 'excelitem' )"></a>
-				<a href="javascript: deleteExcelTemplate('$templateFile.name');" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
+				<a href="openExcelTemplateAssociations.action?templateFileId=$templateFile.id" title="$i18n.getString( 'associations' )"><img src="../images/assign.png" alt="$i18n.getString( 'associations' )"></a>
+				<a href="javascript:deleteExcelTemplate('$templateFile.id');" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
+				<a href="javascript:mode = 'edit'; openUpdateExcelTemplate( '$templateFile.id' );" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
 			</td>
 		</tr>
 		
@@ -43,6 +43,30 @@
 
 <span id="message" style="top:100px;right:5px;position:fixed;width:200px;z-index:10002" onclick="javascript:hideById(this.id);"></span>
 
-
+<div id="divExcelTemplateList" style="position:fixed;display:none;width:609px;z-index:11;background-color: white;border: medium solid silver;height:209px;padding:20px">
+	<div id="close" style="position:absolute;top:2px;right:2px;cursor: pointer;color:red;" onclick="hideById('divExcelTemplateList');deleteDivEffect();">[x]</div>
+	<input type="hidden" value="" id="id"/>
+	<table>
+		<tr>
+			<td><label>$i18n.getString('name')<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+			<td><input type="text" id="name"  style="width:20em" name="T1" size="20"/></td>
+		</tr>
+		<tr>
+			<td><label>$i18n.getString('choose_file_uploaded')<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+			<td><input type="file" id="upload"></td>
+		</tr>
+	</table>
+	<p align="center">
+	<input type="button" value="$i18n.getString('ok')" id="excelTemplateList" onClick="validateExcelItemGroup()"/>
+	<input type="button" value="$i18n.getString('cancel')" onclick="hideById('divExcelTemplateList');deleteDivEffect();"/>
+	</p>
+</div>
+<script language="javascript">
+	var mode = 'add';
+	var i18n_confirm_delete = '$encoder.jsEscape($i18n.getString( 'confirm_delete' ) , "'")';
+
+</script>
+
+<span id="message" style="top:100px;right:5px;position:fixed;width:200px;z-index:10002" onclick="javascript:hideById(this.id);"></span>
 
 

=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/viewAdministrator.vm'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/viewAdministrator.vm	2009-10-27 06:05:22 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/viewAdministrator.vm	2010-01-26 09:04:04 +0000
@@ -5,7 +5,8 @@
 	<li><a href="listReportExcel.action">$i18n.getString( "reports" )&nbsp;</a></li>		
 	<li><a href="listDataEntryStatus.action">$i18n.getString( "data_status" )&nbsp;</a></li>
 	<li><a href="javascript: cleanUp();">$i18n.getString( "clean_up" )&nbsp;</a></li>
-	<li><a href="listAllExcelItemGroup.action">$i18n.getString( "excel_item" )&nbsp;</a></li>		
+	<li><a href="listAllExcelItemGroup.action">$i18n.getString( "excel_item" )&nbsp;</a></li>
+	<li><a href="listAllExcelTemplates.action">$i18n.getString( "excel_template_management" )&nbsp;</a></li>
 </ul>
 
 <script>