← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 583: Improved the dynamic help solution.

 

------------------------------------------------------------
revno: 583
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Sat 2009-09-05 09:00:46 +0200
message:
  Improved the dynamic help solution.
added:
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/StringTypeDataElementPredicate.java
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.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.
=== added file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/StringTypeDataElementPredicate.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/StringTypeDataElementPredicate.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/StringTypeDataElementPredicate.java	2009-09-05 07:00:46 +0000
@@ -0,0 +1,44 @@
+package org.hisp.dhis.system.filter;
+
+/*
+ * Copyright (c) 2004-2007, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import org.apache.commons.collections.Predicate;
+import org.hisp.dhis.dataelement.DataElement;
+
+/**
+ * @author Lars Helge Overland
+ * @version $Id$
+ */
+public class StringTypeDataElementPredicate
+    implements Predicate
+{
+    public boolean evaluate( Object object )
+    {
+        return ((DataElement) object).getType().equals( DataElement.TYPE_STRING );
+    }
+}

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm	2009-09-05 07:00:46 +0000
@@ -89,3 +89,7 @@
         $i18n.getString( "unknown" )
     #end
 #end
+
+#macro( openHelp $id )
+	<a href="javascript:openHelpForm('${id}')" title="$i18n.getString( 'help' )"><img src="../images/help.png" alt="$i18n.getString( 'help' )"></a>
+#end

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2009-09-04 14:41:05 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2009-09-05 07:00:46 +0000
@@ -223,3 +223,6 @@
 
 help.dhis-web-reporting.datacompleteness.general = Data completeness
 help.dhis-web-reporting.datacompleteness.general.content = The data completeness reporting functionality provides information on the degree of completeness of the reported data, based on user registrations of completely filled data sets.
+
+help.dhis-web-maintenance-dataset.datasetcustomvalue = Custom Value Help
+help.dhis-web-maintenance-dataset.datasetcustomvalue.content	= <b>Purpose</b><br>Custom Values are predefied data entry values. Custom Values appear in the form of a drop down box, where you can select a value from the list for the current Data Element.<p><b>How to manage Custom Values</b><br>You will see four selection areas and number of buttons to manage Custom Values. First box <b>"Available Data Elements"</b> lists all Data Elements for selected Data Set. Second box <b>"Available Category Options"</b> will list Available Category Options upon selection of Data Element from first box. If Data Element has only <b>default</b> Category Option, it will be automatically selected and any Custom Value selected for it will be listed in box four - <b>"Selected Custom Values"</b>. Box three - <b>Suggested Custom Values</b> will list possible values from existing Custom Values as user types new Custom Value text. Adding/Deleting are explained in their respective help content next to control. All actions will produce message, messages are shown at the end of form and their background colour will change depending on failure or success of action. System prevents errors by providing useful messages.

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties	2009-09-05 06:36:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties	2009-09-05 07:00:46 +0000
@@ -102,12 +102,3 @@
 edit_custom_values											= Edit custom values
 select_customvalue											= Selected Custom Values
 selectdataelement 											= Available Data Elements
-
-help.datasetcustomvalue										= Custom Value Help
-help.datasetcustomvalue.content								= <b>Purpose</b><br>Custom Values are predefied data entry values. Custom Values appear in the form of a drop down box, where you can select a value from the list for the current Data Element.<p><b>How to manage Custom Values</b><br>You will see four selection areas and number of buttons to manage Custom Values. First box <b>"Available Data Elements"</b> lists all Data Elements for selected Data Set. Second box <b>"Available Category Options"</b> will list Available Category Options upon selection of Data Element from first box. If Data Element has only <b>default</b> Category Option, it will be automatically selected and any Custom Value selected for it will be listed in box four - <b>"Selected Custom Values"</b>. Box three - <b>Suggested Custom Values</b> will list possible values from existing Custom Values as user types new Custom Value text. Adding/Deleting are explained in their respective help content next to control. All actions will produce message, messages are shown at the end of form and their background colour will change depending on failure or success of action. System prevents errors by providing useful messages.
-help.dscv_done_button										= <b>Command Done</b>
-help.dscv_done_button.content								= <b>"Done"</b> button silently leaves Custom Value Management screen and displays default Data Set page.
-help.dscv_addnew_button										= <b>"Add New Command"</b>
-help.dscv_addnew_button.content								= <b>"Add New"</b> button adds new Custom Value to the list of Selected Custom Values (box four). While typing new Custom Value text, box three provides possible values for selection. If user finds one of suggested values suitable, he can click on it in box three, value will be copied to new value entry point, clicking Add will save new value. Follow instructions in message pane at the bottom of form.
-help.dscv_delete_button										= <b>Delete Command</b>
-help.dscv_delete_button.content								= <b>"Delete"</b> button deletes selected Custom Value from particular Data Element. Follow instructions in message pane at the bottom of form

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm	2009-09-05 06:36:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm	2009-09-05 07:00:46 +0000
@@ -917,7 +917,8 @@
             <td><input type="text" name="newCustomValue" id="newCustomValue" onkeydown="findSimilar()" maxlength="160" style="min-width:25em" size="60"/>&nbsp;&nbsp;
             </td>
             <td>
-                <button type="button" onclick="addNew()">$i18n.getString( "add_new_custom_value" )</button>&nbsp;&nbsp;
+                <button type="button" onclick="addNew()">$i18n.getString( "add_new_custom_value" )</button> &nbsp;
+                #openHelp( "dhis-web-maintenance-dataset.datasetcustomvalue" )
             </td>
         </tr>
      </tbody>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm	2009-07-07 14:54:57 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm	2009-09-05 07:00:46 +0000
@@ -16,7 +16,7 @@
         </td>
         <td></td>
         <td valign="bottom">
-        	<a href="javascript:openHelpForm('dhis-web-reporting.datacompleteness.general')" title="$i18n.getString( 'help' )"><img src="../images/help.png" alt="$i18n.getString( 'help' )"></a><br>
+        	#openHelp( "dhis-web-reporting.datacompleteness.general" )<br>
         	<input type="button" value="$i18n.getString( 'generate_pdf' )" style="width:150px"
                 onclick="window.location.href='getDataCompletenessPDF.action'"><input 
                 type="button" value="$i18n.getString( 'generate_workbook' )" style="width:150px"