dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #12973
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4068: local vn - Fixed NPE and replace showPopupWindowById by jquery dialog supported.
------------------------------------------------------------
revno: 4068
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-07-05 14:08:32 +0700
message:
local vn - Fixed NPE and replace showPopupWindowById by jquery dialog supported.
modified:
local/vn/dhis-web-excel-reporting/src/main/resources/struts.xml
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/import/excelFormulaBuilder.vm
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/import/importItems.vm
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataElementGroup.js
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/exportItem.js
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/importItems.js
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataElementGroup.vm
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/periodcolumns.vm
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/dataelementExpressionBuilderForm.vm
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/excelFormulaExpressionBuilderForm.vm
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/exportItems.vm
local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/indicatorExpressionBuilderForm.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-excel-reporting/src/main/resources/struts.xml'
--- local/vn/dhis-web-excel-reporting/src/main/resources/struts.xml 2011-06-29 07:29:06 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/resources/struts.xml 2011-07-05 07:08:32 +0000
@@ -373,7 +373,7 @@
</action>
<action name="getAllExportReports"
- class="org.hisp.dhis.reportexcel.action.ListExportReportAction">
+ class="org.hisp.dhis.reportexcel.exportreport.action.ListExportReportAction">
<result name="success" type="velocity-xml">
/dhis-web-excel-reporting/responseExportReports.vm</result>
</action>
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/import/excelFormulaBuilder.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/import/excelFormulaBuilder.vm 2011-01-17 06:08:02 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/import/excelFormulaBuilder.vm 2011-07-05 07:08:32 +0000
@@ -1,6 +1,18 @@
+<script>
+
+ jQuery(document).ready(function(){
+ divExpressionDialog = setUpDialog( 'divExpression', i18n_expression, 650, 350 );
+ divCategoryDialog = setUpDialog( 'divCategory', i18n_expression, 650, 350 );
+ });
+
+ var i18n_expression = '$encoder.jsEscape( $i18n.getString( "expression" ) , "'")';
+ var divExpressionDialog = null;
+ var divCategoryDialog = null;
+</script>
+
<!-- Expression -->
-<div id="divExpression" style="display:none;">
+<div id="divExpression">
<table width="100%">
<tr>
<th>$i18n.getString( "formula" )</th>
@@ -23,19 +35,19 @@
<td>
<select id="dataElementGroup" style="width:280px" onchange="getDataElements(this.value, '#divExpression select[id=availableDataElements]')"></select>
<select id="availableDataElements" size="11" style="width:280px" onchange="getOptionCombos(this.value, '#divExpression select[id=optionCombos]', 'divExpression input[id=insertExpression]')"></select>
- <select id="optionCombos" size="4" style="width:280px" onchange="enable( 'divExpression input[id=insertExpression]' );" ondblclick="insertDataElementId()"></select>
+ <select id="optionCombos" size="4" style="width:280px" onchange="enable( 'divExpression input[id=insertExpression]' );" ondblclick="insertDataElementId()"></select>
</td>
</tr>
</table>
<p>
<input type="button" value="$i18n.getString('ok')" onclick="updateNormalExpression();"/>
<input type="button" value="$i18n.getString('clean')" onclick="byId('formula').value = ''"/>
- <input type="button" value="$i18n.getString('cancel')" onclick="hideById('divExpression'); unLockScreen();" style="width:100px"/>
+ <input type="button" value="$i18n.getString('cancel')" onclick="closeDialog( divExpressionDialog )" style="width:100px"/>
</p>
</div>
<!-- Buil formula for Category Report -->
-<div id="divCategory" style="display:none">
+<div id="divCategory">
<table width="100%">
<tr>
<th>$i18n.getString( "formula" )</th>
@@ -66,11 +78,6 @@
<center>
<input type="button" value="$i18n.getString('ok')" onclick="updateCaExpression()" style="width:100px"/>
<input type="button" value="$i18n.getString('clean')" onclick="cleanFormula()" style="width:100px"/>
- <input type="button" value="$i18n.getString('cancel')" onclick="hideById('divCategory'); unLockScreen();" style="width:100px"/>
+ <input type="button" value="$i18n.getString('cancel')" onclick="closeDialog( divCategoryDialog )" style="width:100px"/>
</center>
-</div>
-
-<script>
-
-
-</script>
\ No newline at end of file
+</div>
\ No newline at end of file
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/import/importItems.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/import/importItems.vm 2011-05-24 07:48:23 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/import/importItems.vm 2011-07-05 07:08:32 +0000
@@ -1,7 +1,19 @@
<script>
jQuery(document).ready(function(){
tableSorter( 'listTable', [[1,0]] );
+
+ dialog1 = setUpDialog( 'copyToImportReport', i18n_expression, 500, 170 );
});
+
+ var i18n_copy_successful = '$encoder.jsEscape( $i18n.getString( "copy_successful" ) , "'")';
+ var i18n_copy_items_duplicated = '$encoder.jsEscape( $i18n.getString( "copy_items_duplicated" ) , "'")';
+ var i18n_copy_items = '$encoder.jsEscape( $i18n.getString( "copy_items" ) , "'")';
+ var i18n_input_sheet_no = '$encoder.jsEscape( $i18n.getString( "input_sheet_no" ) , "'")';
+ var i18n_choose_export_report = '$encoder.jsEscape( $i18n.getString( "choose_export_report" ) , "'")';
+ var i18n_choose_import_report = '$encoder.jsEscape( $i18n.getString( "choose_import_report" ) , "'")';
+ var i18n_expression = '$encoder.jsEscape( $i18n.getString( "expression" ) , "'")';
+ var dialog1 = null;
+ var dialog2 = null;
</script>
<span id="message" style="top:70px;right:5px;position:fixed;width:200px;z-index:100009" onclick="hideById(this.id);"></span>
@@ -15,7 +27,7 @@
</td>
<td align="right">
<input type="button" onclick="window.location.href='addImportItemForm.action?importReportId=$importReport.id' " value="$i18n.getString('add')" style="width:150px"/> <br>
- <input type="button" onclick="copySelectedItemToGroup()" value="$i18n.getString('copy_selected_item_to')" style="width:150px"/><br>
+ <input type="button" onclick="copySelectedItemToGroup()" value="$i18n.getString('copy_import_item_to_importreport')" style="width:150px"/><br>
<input type="button" onclick="window.location='listAllImportReport.action'" value="$i18n.getString('cancel')" style="width:150px"/>
</td>
</tr>
@@ -52,35 +64,29 @@
</tbody>
</table>
-<div id="copyTo" style="display:none;">
-<p></p>
-<table width="100%">
- <tr>
- <td style="width: 150px;"><label>$i18n.getString('reports')<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td>
- <select id="targetGroup" style="max-width:30em;min-width:30em;">
- </select>
- </td>
- </tr>
- <tr>
- <td><label>$i18n.getString('sheet_no')<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td><input id="targetSheetNo" type="text"/></td>
- </tr>
-</table>
-<p align="center">
-<input type="button" value="$i18n.getString('ok')" onclick="validateCopyImportItemsToImportReport();" style="width:100px"/>
-<input type="button" value="$i18n.getString('cancel')" onclick="hideById('copyTo'); unLockScreen();" style="width:100px"/>
-</p>
+<div id="copyToImportReport">
+ <p></p>
+ <table width="100%">
+ <tr>
+ <td style="width: 150px;"><label>$i18n.getString('reports')<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td>
+ <select id="targetGroup" style="max-width:30em;min-width:30em;">
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td><label>$i18n.getString('sheet_no')<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><input id="targetSheetNo" type="text"/></td>
+ </tr>
+ </table>
+ <p align="center">
+ <input type="button" value="$i18n.getString('ok')" onclick="validateCopyImportItemsToImportReport();" style="width:100px"/>
+ <input type="button" value="$i18n.getString('cancel')" onclick="closeDialog( dialog1 );" style="width:100px"/>
+ </p>
</div>
<script type="text/javascript">
- var i18n_copy_successful = '$encoder.jsEscape( $i18n.getString( "copy_successful" ) , "'")';
- var i18n_copy_items_duplicated = '$encoder.jsEscape( $i18n.getString( "copy_items_duplicated" ) , "'")';
- var i18n_copy_items = '$encoder.jsEscape( $i18n.getString( "copy_items" ) , "'")';
- var i18n_input_sheet_no = '$encoder.jsEscape( $i18n.getString( "input_sheet_no" ) , "'")';
- var i18n_choose_export_report = '$encoder.jsEscape( $i18n.getString( "choose_export_report" ) , "'")';
- var i18n_choose_import_report = '$encoder.jsEscape( $i18n.getString( "choose_import_report" ) , "'")';
-
+
function importItemSelect( checked )
{
if( checked ) checkALL( "input[type=checkbox][name=importItemChecked]" );
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataElementGroup.js'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataElementGroup.js 2010-12-10 07:45:59 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/dataElementGroup.js 2011-07-05 07:08:32 +0000
@@ -102,7 +102,7 @@
function updateDataElementGroupOrder(){
var dataElements = document.getElementsByName('dataElementGroupOrder');
- var url = "updateSortDataElementGroupOrder.action?reportId=" + reportId;
+ var url = "updateSortDataElementGroupOrder.action?exportReportId=" + reportId;
for(var i=0;i<dataElements.length;i++){
url += "&dataElementGroupOrderId=" + dataElements.item(i).value;
}
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/exportItem.js'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/exportItem.js 2011-05-24 07:48:23 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/exportItem.js 2011-07-05 07:08:32 +0000
@@ -1,3 +1,36 @@
+// ---------------------------------------------------------------------------
+// Dialog
+// ---------------------------------------------------------------------------
+
+function setUpDialog( elementId, title, width, height )
+{
+ var dialog = jQuery( '#'+elementId ).dialog({
+ title: title,
+ modal: true,
+ autoOpen: false,
+ minWidth: width,
+ minHeight: height,
+ width: width,
+ height: height
+ });
+
+ return dialog;
+}
+
+function openDialog( _dialog )
+{
+ _dialog.dialog( 'open' );
+}
+
+function closeDialog( _dialog )
+{
+ _dialog.dialog( 'close' );
+}
+
+// ---------------------------------------------------------------------------------
+// Methods
+// ---------------------------------------------------------------------------------
+
function changeItemType()
{
value = getFieldValue( 'itemType' );
@@ -157,7 +190,7 @@
options.add(new Option(name,id), null);
}
- showPopupWindowById( 'copyToExportReport', 450, 170 );
+ openDialog( dialog1 );
}
@@ -296,8 +329,7 @@
setMessage( warningMessages );
}
- hideById('copyToExportReport');
- unLockScreen();
+ closeDialog( dialog1 );
}
@@ -328,7 +360,7 @@
options.add(new Option(name,id), null);
}
- showPopupWindowById("copyToImportItem", 450,180 );
+ openDialog( dialog2 );
}
/*
@@ -417,8 +449,7 @@
setMessage( warningMessages );
}
- hideById("copyToImportItem");
- unLockScreen();
+ closeDialog( dialog2 );
}
function setUpDuplicatedItemsMessage()
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/importItems.js'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/importItems.js 2011-05-24 07:48:23 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/importItems.js 2011-07-05 07:08:32 +0000
@@ -1,3 +1,28 @@
+function setUpDialog( elementId, title, width, height )
+{
+ var dialog = jQuery( '#'+elementId ).dialog({
+ title: title,
+ modal: true,
+ autoOpen: false,
+ minWidth: width,
+ minHeight: height,
+ width: width,
+ height: height
+ });
+
+ return dialog;
+}
+
+function openDialog( _dialog )
+{
+ _dialog.dialog( 'open' );
+}
+
+function closeDialog( _dialog )
+{
+ _dialog.dialog( 'close' );
+}
+
// ========================================================================================================================
// IMPORT REPORT
// ========================================================================================================================
@@ -24,7 +49,7 @@
dataDictionary.loadDataElementGroups( "#divExpression select[id=dataElementGroup]" );
dataDictionary.loadAllDataElements( "#divExpression select[id=availableDataElements]" );
- showPopupWindowById( 'divExpression', 600, 300 );
+ openDialog( divExpressionDialog );
}
// Insert operand into the Formular textbox
@@ -45,8 +70,8 @@
{
expression = jQuery( '#divExpression textarea[id=formula]' ).val();
setFieldValue( 'expression', getFieldValue('formula' ) );
- hideById('divExpression');
- unLockScreen();
+
+ closeDialog( divExpressionDialog );
}
// -----------------------------------------------------------------------
@@ -60,7 +85,7 @@
dataDictionary.loadAllDataElements( "#divCategory select[id=availableDataElements]" );
setFieldValue( 'divCategory textarea[id=formula]', getFieldValue('expression') );
- showPopupWindowById( 'divCategory', 600, 320 );
+ openDialog( divCategoryDialog );
}
// Insert operand into the Formular textbox
@@ -75,8 +100,7 @@
{
expression = jQuery( '#divCategory textarea[id=formula]' ).val();
setFieldValue( 'expression', expression );
- hideById('divCategory');
- unLockScreen();
+ closeDialog( divCategoryDialog );
}
// Get option combos for selected dataelement
@@ -129,7 +153,7 @@
options.add(new Option(name,id), null);
}
- showPopupWindowById( 'copyTo', 480, 120 );
+ openDialog( dialog1 );
}
function validateCopyImportItemsToImportReport() {
@@ -164,7 +188,6 @@
request.setResponseTypeXML( 'xmlObject' );
request.setCallbackSuccess( validateCopyImportItemsToImportReportReceived );
request.send( "getImportItemsByGroup.action?importReportId=" + byId("targetGroup").value );
-
}
function validateCopyImportItemsToImportReportReceived( xmlObject ) {
@@ -270,8 +293,7 @@
setMessage( warningMessages );
}
- hideById('copyTo');
- unLockScreen();
+ closeDialog( dialog1 );
}
function saveCopiedImportItemsToImportReportReceived( data ) {
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataElementGroup.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataElementGroup.vm 2011-05-27 04:45:31 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/listDataElementGroup.vm 2011-07-05 07:08:32 +0000
@@ -20,7 +20,7 @@
<ul id="sortable">
-#foreach($group in $report.dataElementOrders)
+#foreach($group in $exportReport.dataElementOrders)
<li class="ui-state-default" name="dataElementGroupOrder" value="$group.id" title="$i18n.getString( 'sort_order_help' )">
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
@@ -40,7 +40,7 @@
<div id="dataElementGroups">
<form name="dataElementGroups" id="dataElementGroupsForm" method="POST">
-<input type="hidden" name="id" value="$report.id"/>
+<input type="hidden" name="id" value="$exportReport.id"/>
<input type="hidden" name="dataElementGroupOrderId" id="dataElementGroupOrderId"/>
<table>
<tr>
@@ -65,9 +65,9 @@
</td>
<td width="7%" align="center">
<input type="button" value=">" onclick="moveSelectedById('availableDataElements','dataElementIds');" style="width:50px"/><br>
- <input type="button" value="$lt;" onclick="moveSelectedById('dataElementIds' , 'availableDataElements' );" style="width:50px"/><br>
+ <input type="button" value="<" onclick="moveSelectedById('dataElementIds' , 'availableDataElements' );" style="width:50px"/><br>
<input type="button" value=">>" onclick="moveAllById('availableDataElements' , 'dataElementIds' );" style="width:50px"/><br>
- <input type="button" value="$lt;$lt;" onclick="moveAllById('dataElementIds' , 'availableDataElements' );" style="width:50px"/>
+ <input type="button" value="<<" onclick="moveAllById('dataElementIds' , 'availableDataElements' );" style="width:50px"/>
</td>
<td width="23%">
<select id="dataElementIds" name="dataElementIds" multiple size=13 style="width:300px" ondblclick="moveSelectedById('dataElementIds' , 'availableDataElements' );"/>
@@ -91,7 +91,7 @@
<script>
var i18n_confirm_delete = '$encoder.jsEscape($i18n.getString( 'confirm_delete' ) , "'")';
var i18n_name_is_null = '$encoder.jsEscape($i18n.getString( 'i18n_name_is_null' ) , "'")';
- var reportId = $report.id;
+ var reportId = $exportReport.id;
$(function() {
$("#sortable").sortable({
placeholder: 'ui-state-highlight'
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/periodcolumns.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/periodcolumns.vm 2011-05-27 04:45:31 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/periodcolumns.vm 2011-07-05 07:08:32 +0000
@@ -1,1 +1,1 @@
-<h3>$!encoder.htmlEncode($!exportReport.name)</h3>
<table width="100%">
<tr style="vertical-align:bottom;">
<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="openAddPeriodColumn()" value="$i18n.getString('add')" style="width:150px"/><br>
<input type="button" onclick="window.location='listAllExportReport.action'" value="$i18n.getString('cancel')" style="width:150px"/><br>
</td>
</tr>
</table>
<table width="100%" id="listTable" class="listTable">
<thead>
<tr>
<th>$i18n.getString('start_date')</th>
<th>$i18n.getString('end_date')</th>
<th>$i18n.getString('period_type')</th>
<th>$i18n.getString('column')</th>
<th width="70px" class="{sorter: false}">$i18n.getString('operations')</th>
</tr>
</thead>
<tbody id="list">
#set( $mark = false )
#foreach($periodColumn in $exportReport.periodColumns)
<tr #alternate( $mark )>
<td>$format.formatDate($periodColumn.startdate)</td>
<td>$format.formatDate($periodColumn.enddate)</td>
<td>$i18n.getString( $periodColumn.periodType )</td>
<td>$periodColumn.column</td>
<td align="center">
<a href="javascript:deletePeriodColumn($exportReport.id, $periodColumn.id );" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
<a href="javascript:openUpdatePeriodColumn( $periodColumn.id );" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
</td>
</tr>
#if( $mark )
#set( $mark = false )
#else
#set( $mark = true )
#end
#end
</tbody>
</table>
<div id="periodColumn" style="padding:10px;display:none">
<form id="periodColumnForm" method="POST">
<input type="hidden" id="action" value=""/>
<input type="hidden" name="id" id="id"/>
<input type="hidden" value="$!exportReport.id" name="exportReportId"/>
<table width="100%">
<tr>
<td><label>$i18n.getString('period_type')<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td>
<select type="text" id="periodType" name="periodType" style="min-width:20em">
<option value='selected_month'>$i18n.getString('selected_month')</option>
<option value='last_3_month'>$i18n.getString('last_3_month')</option>
<option value='last_6_month'>$i18n.getString('last_6_month')</option>
<option value='so_far_this_year'>$i18n.getString('so_far_this_year')</option>
<option value='quaterly'>$i18n.getString('quaterly')</option>
<option value='6_month'>$i18n.getString('six_monthly')</option>
<option value='yealy'>$i18n.getString('yearly')</option>
</select>
</td>
</tr>
<tr>
<td>$i18n.getString('start_date')</td>
<td>
<input id="startdate" name="startdate" type="text" readonly="readonly" /><em title="$i18n.getString( 'required' )" class="required">*</em>
</td>
</tr>
<tr>
<td>$i18n.getString('end_date')</td>
<td>
<input id="enddate" name="enddate" type="text" readonly="readonly"/><em title="$i18n.getString( 'required' )" class="required">*</em>
</td>
</tr>
<tr>
<td>$i18n.getString('column')</td>
<td>
<input id="column" name="column" type="text" class="{validate:{required:true, number:true}}"/><em title="$i18n.getString( 'required' )" class="required">*</em>
</td>
</tr>
<tr style="height:50px">
<td></td>
<td>
<input type="submit" id="action" value="$i18n.getString('save')" style="width:100px"/>
<input type="button" value="$i18n.getString('cancel')" style="width:100px" onclick="hidePopWindowById('periodColumn')"/>
</td>
</tr>
</table>
</form>
</div>
<script>
var i18n_startdate_null = "$encoder.jsEscape($i18n.getString( 'startdate_null' ) , "'")";
var i18n_enddate_null = "$encoder.jsEscape($i18n.getString( 'enddate_null' ) , "'")";
var i18n_column_is_null = "$encoder.jsEscape($i18n.getString( 'column_is_null' ) , "'")";
var i18n_confirm_delete = '$encoder.jsEscape($i18n.getString( 'confirm_delete' ) , "'")';
jQuery(document).ready(function(){
datePickerInRange( 'startdate' , 'enddate' );
tableSorter( 'listTable' );
validation( 'periodColumnForm', function( form ){
form.action = getFieldValue('action');
form.submit();
} );
});
function openAddPeriodColumn()
{
setFieldValue( "action", "savePeriodColumn.action" );
showPopupWindowById( 'periodColumn', 400, 170 );
}
function openUpdatePeriodColumn( id )
{
var request = new Request();
request.setResponseTypeXML( 'xmlObject' );
request.setCallbackSuccess( openUpdatePeriodColumnCompleted );
request.send( "getPeriodColumn.action?id=" + id );
}
function openUpdatePeriodColumnCompleted( xmlObject )
{
var id = xmlObject.getElementsByTagName("id")[0].firstChild.nodeValue;
var startdate = xmlObject.getElementsByTagName("startdate")[0].firstChild.nodeValue;
var enddate = xmlObject.getElementsByTagName("enddate")[0].firstChild.nodeValue;
var periodType = xmlObject.getElementsByTagName("periodType")[0].firstChild.nodeValue;
var column = xmlObject.getElementsByTagName("column")[0].firstChild.nodeValue;
byId("startdate").value = startdate;
byId("enddate").value = enddate;
byId("periodType").value = periodType;
byId("column").value = column;
byId("id").value = id;
setFieldValue('action', 'updatePeriodColumn.action' );
showPopupWindowById( 'periodColumn', 400, 170 );
}
function deletePeriodColumn( exportReportId, periodColumnId )
{
if(window.confirm(i18n_confirm_delete)){
window.location="deletePeriodColumn.action?exportReportId=" + exportReportId + "&id=" + periodColumnId;
}
}
</script>
\ No newline at end of file
+<script>
jQuery(document).ready(function(){
datePickerInRange( 'startdate' , 'enddate' );
tableSorter( 'listTable' );
validation( 'periodColumnForm', function( form ){
form.action = getFieldValue('action');
form.submit();
});
periodColumnDialog = setUpDialog( 'periodColumn', i18n_expression, 410, 210 );
});
var i18n_startdate_null = "$encoder.jsEscape($i18n.getString( 'startdate_null' ) , "'")";
var i18n_enddate_null = "$encoder.jsEscape($i18n.getString( 'enddate_null' ) , "'")";
var i18n_column_is_null = "$encoder.jsEscape($i18n.getString( 'column_is_null' ) , "'")";
var i18n_confirm_delete = '$encoder.jsEscape($i18n.getString( 'confirm_delete' ) , "'")';
var i18n_expression = '$encoder.jsEscape( $i18n.getString( "expression" ) , "'")';
var periodColumnDialog = null;
</script>
<h3>$!encoder.htmlEncode($!exportReport.name)</h3>
<table width="100%">
<tr style="vertical-align:bottom;">
<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="openAddPeriodColumn()" value="$i18n.getString('add')" style="width:150px"/><br>
<input type="button" onclick="window.location='listAllExportReport.action'" value="$i18n.getString('cancel')" style="width:150px"/><br>
</td>
</tr>
</table>
<table width="100%" id="listTable" class="listTable">
<thead>
<tr>
<th>$i18n.getString('start_date')</th>
<th>$i18n.getString('end_date')</th>
<th>$i18n.getString('period_type')</th>
<th>$i18n.getString('column')</th>
<th width="70px" class="{sorter: false}">$i18n.getString('operations')</th>
</tr>
</thead>
<tbody id="list">
#set( $mark = false )
#foreach($periodColumn in $exportReport.periodColumns)
<tr #alternate( $mark )>
<td>$format.formatDate($periodColumn.startdate)</td>
<td>$format.formatDate($periodColumn.enddate)</td>
<td>$i18n.getString( $periodColumn.periodType )</td>
<td>$periodColumn.column</td>
<td align="center">
<a href="javascript:deletePeriodColumn($exportReport.id, $periodColumn.id );" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
<a href="javascript:openUpdatePeriodColumn( $periodColumn.id );" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
</td>
</tr>
#if( $mark )
#set( $mark = false )
#else
#set( $mark = true )
#end
#end
</tbody>
</table>
<div id="periodColumn" style="padding:10px">
<form id="periodColumnForm" method="POST">
<input type="hidden" id="action" value=""/>
<input type="hidden" name="id" id="id"/>
<input type="hidden" value="$!exportReport.id" name="exportReportId"/>
<table width="100%">
<tr>
<td><label>$i18n.getString('period_type')<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td>
<select type="text" id="periodType" name="periodType" style="min-width:20em">
<option value='selected_month'>$i18n.getString('selected_month')</option>
<option value='last_3_month'>$i18n.getString('last_3_month')</option>
<option value='last_6_month'>$i18n.getString('last_6_month')</option>
<option value='so_far_this_year'>$i18n.getString('so_far_this_year')</option>
<option value='quaterly'>$i18n.getString('quaterly')</option>
<option value='6_month'>$i18n.getString('six_monthly')</option>
<option value='yealy'>$i18n.getString('yearly')</option>
</select>
</td>
</tr>
<tr>
<td>$i18n.getString('start_date')</td>
<td>
<input id="startdate" name="startdate" type="text" readonly="readonly" /><em title="$i18n.getString( 'required' )" class="required">*</em>
</td>
</tr>
<tr>
<td>$i18n.getString('end_date')</td>
<td>
<input id="enddate" name="enddate" type="text" readonly="readonly"/><em title="$i18n.getString( 'required' )" class="required">*</em>
</td>
</tr>
<tr>
<td>$i18n.getString('column')</td>
<td>
<input id="column" name="column" type="text" class="{validate:{required:true, number:true}}"/><em title="$i18n.getString( 'required' )" class="required">*</em>
</td>
</tr>
<tr style="height:50px">
<td></td>
<td>
<input type="submit" id="action" value="$i18n.getString('save')" style="width:100px"/>
<input type="button" value="$i18n.getString('cancel')" style="width:100px" onclick="closeDialog( periodColumnDialog )"/>
</td>
</tr>
</table>
</form>
</div>
<script>
// ---------------------------------------------------------------------------
// Dialog
// ---------------------------------------------------------------------------
function setUpDialog( elementId, title, width, height )
{
var dialog = jQuery( '#'+elementId ).dialog({
title: title,
modal: true,
autoOpen: false,
minWidth: width,
minHeight: height,
width: width,
height: height
});
return dialog;
}
function openDialog( _dialog )
{
_dialog.dialog( 'open' );
}
function closeDialog( _dialog )
{
_dialog.dialog( 'close' );
}
function openAddPeriodColumn()
{
setFieldValue( "action", "savePeriodColumn.action" );
openDialog( periodColumnDialog );
}
function openUpdatePeriodColumn( id )
{
var request = new Request();
request.setResponseTypeXML( 'xmlObject' );
request.setCallbackSuccess( openUpdatePeriodColumnCompleted );
request.send( "getPeriodColumn.action?id=" + id );
}
function openUpdatePeriodColumnCompleted( xmlObject )
{
var id = xmlObject.getElementsByTagName("id")[0].firstChild.nodeValue;
var startdate = xmlObject.getElementsByTagName("startdate")[0].firstChild.nodeValue;
var enddate = xmlObject.getElementsByTagName("enddate")[0].firstChild.nodeValue;
var periodType = xmlObject.getElementsByTagName("periodType")[0].firstChild.nodeValue;
var column = xmlObject.getElementsByTagName("column")[0].firstChild.nodeValue;
byId("startdate").value = startdate;
byId("enddate").value = enddate;
byId("periodType").value = periodType;
byId("column").value = column;
byId("id").value = id;
setFieldValue('action', 'updatePeriodColumn.action' );
openDialog( periodColumnDialog );
}
function deletePeriodColumn( exportReportId, periodColumnId )
{
if(window.confirm(i18n_confirm_delete)){
window.location="deletePeriodColumn.action?exportReportId=" + exportReportId + "&id=" + periodColumnId;
}
}
</script>
\ No newline at end of file
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/dataelementExpressionBuilderForm.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/dataelementExpressionBuilderForm.vm 2011-05-24 07:48:23 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/dataelementExpressionBuilderForm.vm 2011-07-05 07:08:32 +0000
@@ -1,17 +1,21 @@
<script>
- var deExpressionValidator = null;
jQuery(document).ready(function(){
deExpressionValidator = validation( 'dataelement-form', function(){
updateDeExpression();
});
+ deExpressionDialog = setUpDialog( 'dataelement', i18n_expression, 800, 430 );
+
#if( !$exportReport.isCategory() )
remoteValidate( jQuery( "#dataelement textarea[id=formula]" ), '../dhis-web-commons-ajax-json/getExpressionText.action' );
#end
changeItemType();
});
+
+ var deExpressionValidator = null;
+ var deExpressionDialog = null;
</script>
@@ -55,7 +59,7 @@
<center>
<input type="submit" value="$i18n.getString('ok')" style="width:100px"/>
<input type="button" value="$i18n.getString('clean')" onclick="cleanFormula()" style="width:100px"/>
- <input type="button" value="$i18n.getString('cancel')" onclick="hideById('dataelement'); unLockScreen();" style="width:100px"/>
+ <input type="button" value="$i18n.getString('cancel')" onclick="closeDialog( deExpressionDialog )" style="width:100px"/>
</center>
</form>
</div>
@@ -65,24 +69,20 @@
{
expression = jQuery( '#dataelement textarea[id=formula]' ).val();
setFieldValue( 'expression', expression );
- hideById('dataelement');
- unLockScreen();
+ closeDialog( deExpressionDialog );
}
function deExpressionBuilderForm()
{
- #if($exportReport.isCategory())
+ #if ( $exportReport.isCategory() )
getDataElementCategoryOptionCombos();
#else
dataDictionary.loadDataElementGroups("#dataelement select[id=groupSelect]") ;
#end
setFieldValue( 'dataelement textarea[id=formula]', getFieldValue('expression') );
- #if(!$exportReport.isCategory())
- showPopupWindowById( 'dataelement', 800, 430 );
- #else
- showPopupWindowById( 'dataelement', 800, 350 );
- #end
+
+ openDialog( deExpressionDialog );
}
function getDataElements( id, target )
@@ -109,8 +109,6 @@
jQuery.each( json.dataElementCategoryOptionCombos, function(i, item ){
select.append( "<option value='" + item.id + "'>" + item.name + "</option>" );
});
-
});
}
-
</script>
\ No newline at end of file
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/excelFormulaExpressionBuilderForm.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/excelFormulaExpressionBuilderForm.vm 2011-05-24 07:48:23 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/excelFormulaExpressionBuilderForm.vm 2011-07-05 07:08:32 +0000
@@ -1,10 +1,19 @@
-<div id="excelformula" style="display:none">
+<script>
+
+ jQuery(document).ready(function(){
+ excelFormulaDialog = setUpDialog( 'excelformula', i18n_expression, 600, 350 );
+ });
+
+ var excelFormulaDialog = null;
+</script>
+
+<div id="excelformula">
<textarea id="elementSelect" cols="90" rows="15"></textarea>
<br/>
<br/>
<center>
<input type="button" value="$i18n.getString('ok')" onclick="updateExExpression()" style="width:100px"/>
- <input type="button" value="$i18n.getString('cancel')" onclick="hideById('excelformula'); unLockScreen();" style="width:100px"/>
+ <input type="button" value="$i18n.getString('cancel')" onclick="closeDialog( excelFormulaDialog )" style="width:100px"/>
</center>
</div>
@@ -12,15 +21,13 @@
function updateExExpression()
{
expression = jQuery( '#excelformula textarea[id=elementSelect]' ).val();
- hideById('excelformula');
- unLockScreen();
+ closeDialog( excelFormulaDialog );
}
function excelFormulaExpressionBuilderForm()
{
setFieldValue( 'excelformula textarea[id=elementSelect]', getFieldValue('expression') );
-
- showPopupWindowById( 'excelformula', 500, 290 );
+ openDialog( excelFormulaDialog );
}
</script>
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/exportItems.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/exportItems.vm 2011-06-30 08:29:27 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/exportItems.vm 2011-07-05 07:08:32 +0000
@@ -1,6 +1,10 @@
<script>
jQuery(document).ready(function(){
- tableSorter( 'listTable', [[1,0]] );
+ tableSorter( 'listTable', [[1,0]] );
+
+ dialog1 = setUpDialog( 'copyToExportReport', i18n_copy_to_exportreport, 420, 170 );
+ dialog2 = setUpDialog( 'copyToImportReport', i18n_copy_to_importreport, 420, 170 );
+
});
function exportItemSelect( checked )
@@ -9,6 +13,17 @@
else unCheckALL( "input[type=checkbox][name=exportItemCheck]" );
}
+ var i18n_copy_successful = '$encoder.jsEscape( $i18n.getString( "copy_successful" ) , "'")';
+ var i18n_copy_items_duplicated = '$encoder.jsEscape( $i18n.getString( "copy_items_duplicated" ) , "'")';
+ var i18n_copy_items = '$encoder.jsEscape( $i18n.getString( "copy_items" ) , "'")';
+ var i18n_input_sheet_no = '$encoder.jsEscape( $i18n.getString( "input_sheet_no" ) , "'")';
+ var i18n_choose_export_report = '$encoder.jsEscape( $i18n.getString( "choose_export_report" ) , "'")';
+ var i18n_choose_excel_group = '$encoder.jsEscape( $i18n.getString( "choose_excel_group" ) , "'")';
+ var i18n_confirm_undo = '$encoder.jsEscape( $i18n.getString( "confirm_undo" ) , "'")';
+ var i18n_copy_to_exportreport = '$encoder.jsEscape( $i18n.getString( "copy_export_item_to_exportreport" ) , "'")';
+ var i18n_copy_to_importreport = '$encoder.jsEscape( $i18n.getString( "copy_export_item_to_importreport" ) , "'")';
+ var dialog1 = null;
+ var dialog2 = null;
</script>
<span id="message" onclick="hideMessage();"></span>
@@ -28,10 +43,10 @@
</select>
</td>
<td align="right">
- <input type="button" onclick="window.location='addExportItemForm.action?exportReportId=$exportReport.id'" value="$i18n.getString('add')" style="width:150px"/><br>
- <input type="button" onclick="window.location='listAllExportReport.action'" value="$i18n.getString('cancel')" style="width:150px"/><br>
- <input type="button" onclick="copySelectedExportItemToExportReport()" value="$i18n.getString('copy_export_item_to_exportreport')" style="width:150px"/><br>
- <input type="button" onclick="copySelectedExportItemToImportReport()" value="$i18n.getString('copy_export_item_to_importreport')" style="width:150px"/><br>
+ <input type="button" onclick="window.location='addExportItemForm.action?exportReportId=$exportReport.id'" value="$i18n.getString('add')" style="width:150px"/><br/>
+ <input type="button" onclick="window.location='listAllExportReport.action'" value="$i18n.getString('cancel')" style="width:150px"/><br/>
+ <input type="button" onclick="copySelectedExportItemToExportReport()" value="$i18n.getString('copy_export_item_to_exportreport')" style="width:150px"/><br/>
+ <input type="button" onclick="copySelectedExportItemToImportReport()" value="$i18n.getString('copy_export_item_to_importreport')" style="width:150px"/><br/>
<input type="button" onclick="deleteMultiExportItem( '$i18n.getString( 'confirm_delete' )')" value="$i18n.getString('remove')" style="width:150px"/>
</td>
</tr>
@@ -73,7 +88,6 @@
<td>$exportItem.sheetNo </td>
<td align="center">
<a href="updateExportItemForm.action?exportItemId=$exportItem.id&exportReportId=$exportReport.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
- <!--a href="javascript:translate( 'ExportItem', '$exportItem.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"></a-->
<a href="javascript:removeItem($exportItem.id, '$exportItem.name','$i18n.getString( 'confirm_delete' )', 'deleteExportItem.action');" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
</td>
</tr>
@@ -81,60 +95,57 @@
</tbody>
</table>
-<div id="copyToExportReport" style="display:none;">
-<h4>$i18n.getString('copy_selected_item_to')</h4>
+<div id="copyToExportReport">
<table width="100%">
+ <br/>
<tr>
<td>$i18n.getString('export_reports')</td>
<td>
- <select id="targetExportReport" name="targetExportReport" style="max-width:30em;min-width:30em;">
+ <select id="targetExportReport" name="targetExportReport" style="max-width:25em;min-width:25em;">
</select>
</td>
</tr>
+ <tr></tr>
+ <tr></tr>
<tr>
<td>$i18n.getString('sheet_no')</td>
- <td><input id="targetSheetNo" name="targetSheetNo" type="text"/></td>
+ <td><input id="targetSheetNo" name="targetSheetNo" type="text" style="max-width:25em;min-width:25em;"/></td>
</tr>
+ <tr></tr>
+ <tr></tr>
<tr>
<td></td>
<td>
- <input type="button" value="$i18n.getString('ok')" onclick="javascript: validateCopyExportItemsToExportReport(); " style="width:100px"/>
- <input type="button" value="$i18n.getString('cancel')" onclick="hideById('copyToExportReport'); unLockScreen();" style="width:100px"/>
+ <input type="button" value="$i18n.getString('ok')" onclick="validateCopyExportItemsToExportReport(); " style="width:100px"/>
+ <input type="button" value="$i18n.getString('cancel')" onclick="closeDialog( dialog1 );" style="width:100px"/>
</td>
</tr>
</table>
</div>
-<div id="copyToImportItem" style="display:none;">
-<h4>$i18n.getString('copy_selected_exportitem_to_importitem')</h4>
+<div id="copyToImportReport">
<table width="100%">
+ <br/>
<tr>
- <td>$i18n.getString('import_report')</td>
+ <td>$i18n.getString('import_reports')</td>
<td>
<select id="targetImportReport" name="targetImportReport" style="max-width:25em;min-width:25em;">
</select>
</td>
</tr>
+ <tr></tr>
+ <tr></tr>
<tr>
<td>$i18n.getString('sheet_no')</td>
<td><input id="targetImportReportSheetNo" name="targetImportReportSheetNo" type="text" style="max-width:25em;min-width:25em;"/></td>
</tr>
+ <tr></tr>
+ <tr></tr>
<tr>
<td></td>
<td><input type="button" value="$i18n.getString('ok')" onclick="validateCopyExportItemsToImportReport();" style="width:100px"/>
- <input type="button" value="$i18n.getString('cancel')" onclick="hideById('copyToImportItem'); unLockScreen();" style="width:100px"/>
+ <input type="button" value="$i18n.getString('cancel')" onclick="closeDialog( dialog2 );" style="width:100px"/>
</td>
</tr>
</table>
-</div>
-
-<script type="text/javascript">
- var i18n_copy_successful = '$encoder.jsEscape( $i18n.getString( "copy_successful" ) , "'")';
- var i18n_copy_items_duplicated = '$encoder.jsEscape( $i18n.getString( "copy_items_duplicated" ) , "'")';
- var i18n_copy_items = '$encoder.jsEscape( $i18n.getString( "copy_items" ) , "'")';
- var i18n_input_sheet_no = '$encoder.jsEscape( $i18n.getString( "input_sheet_no" ) , "'")';
- var i18n_choose_export_report = '$encoder.jsEscape( $i18n.getString( "choose_export_report" ) , "'")';
- var i18n_choose_excel_group = '$encoder.jsEscape( $i18n.getString( "choose_excel_group" ) , "'")';
- var i18n_confirm_undo = '$encoder.jsEscape( $i18n.getString( "confirm_undo" ) , "'")';
-</script>
-
\ No newline at end of file
+</div>
\ No newline at end of file
=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/indicatorExpressionBuilderForm.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/indicatorExpressionBuilderForm.vm 2010-10-07 07:10:30 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/report/indicatorExpressionBuilderForm.vm 2011-07-05 07:08:32 +0000
@@ -1,4 +1,14 @@
-<div id="indicator" style="display:none">
+<script>
+
+ jQuery(document).ready(function(){
+ inExpressionDialog = setUpDialog( 'indicator', i18n_expression, 550, 350 );
+ });
+
+ var inExpressionDialog = null;
+ var i18n_expression = '$encoder.jsEscape( $i18n.getString( "expression" ) , "'")';
+</script>
+
+<div id="indicator">
<table width="100%">
<tr>
<th>$i18n.getString( "indicator" )</th>
@@ -10,39 +20,31 @@
</td>
</tr>
</table>
- <br>
- <br>
+ <br/>
+ <br/>
<center>
<input type="button" value="$i18n.getString('ok')" onclick="updateInExpression()" style="width:100px"/>
- <input type="button" value="$i18n.getString('cancel')" onclick="closeInExpression()" style="width:100px"/>
+ <input type="button" value="$i18n.getString('cancel')" onclick="closeDialog( inExpressionDialog )" style="width:100px"/>
</center>
</div>
<script>
+
+ function inExpressionBuilderForm()
+ {
+ dataDictionary.loadIndicatorGroups( "#indicator select[id=groupSelect]");
+ openDialog( inExpressionDialog );
+ }
+
function updateInExpression()
{
expression = jQuery( '#indicator select[id=elementSelect]' ).val();
setFieldValue( 'expression', '[' + expression + ']');
- closeInExpression();
- }
-
-
- function inExpressionBuilderForm()
- {
- loadIndicatorGroups( "#indicator select[id=groupSelect]");
-
- showPopupWindowById( 'indicator', 550, 350 );
- }
-
+ closeDialog( inExpressionDialog );
+ }
+
function getIndicators( id, target)
{
- loadIndicatorsByGroup( id, target );
- }
-
- function closeInExpression()
- {
- hideById('indicator');
- unLockScreen();
- }
-
+ dataDictionary.loadIndicatorsByGroup( id, target );
+ }
</script>