dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21103
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9905: Apply css and add insert-images button in design case entry form of program stage.
------------------------------------------------------------
revno: 9905
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-02-26 15:38:13 +0700
message:
Apply css and add insert-images button in design case entry form of program stage.
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/ViewDataEntryFormAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewDataEntryForm.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.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-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/ViewDataEntryFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/ViewDataEntryFormAction.java 2013-02-01 08:40:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/ViewDataEntryFormAction.java 2013-02-26 08:38:13 +0000
@@ -40,6 +40,7 @@
import org.hisp.dhis.program.ProgramStageDataElementService;
import org.hisp.dhis.program.ProgramStageService;
import org.hisp.dhis.program.comparator.ProgramStageNameComparator;
+import org.hisp.dhis.setting.SystemSettingManager;
import com.opensymphony.xwork2.Action;
@@ -84,6 +85,13 @@
this.programStageDataElementService = programStageDataElementService;
}
+ private SystemSettingManager systemSettingManager;
+
+ public void setSystemSettingManager( SystemSettingManager systemSettingManager )
+ {
+ this.systemSettingManager = systemSettingManager;
+ }
+
// -------------------------------------------------------------------------
// Getters & Setters
// -------------------------------------------------------------------------
@@ -137,6 +145,13 @@
return dataElements;
}
+ private List<String> flags;
+
+ public List<String> getFlags()
+ {
+ return flags;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -195,6 +210,8 @@
Collections.sort( dataElements, new IdentifiableObjectNameComparator() );
+ flags = systemSettingManager.getFlags();
+
return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml 2013-02-26 07:29:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml 2013-02-26 08:38:13 +0000
@@ -422,6 +422,9 @@
ref="org.hisp.dhis.program.ProgramDataEntryService" />
<property name="programStageDataElementService"
ref="org.hisp.dhis.program.ProgramStageDataElementService" />
+ <property name="systemSettingManager">
+ <ref bean="org.hisp.dhis.setting.SystemSettingManager" />
+ </property>
</bean>
<bean
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2013-02-26 07:29:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2013-02-26 08:38:13 +0000
@@ -135,7 +135,7 @@
dataelement_of_orther_program_stage=Data element of other program stage
load_existed_form=Load existing form
design_dataentry_form=Design data entry form
-dataelement_is_inserted=This data element is used in form
+dataelement_is_inserted=This data element is inserted in form
compulsory=Compulsory
design_data_entry_form=Design data entry form
no_of_char=Number of characters
@@ -352,8 +352,10 @@
min_dataelement_value = Minimum of data element values
max_dataelement_value = Maximum of data element values
assign_program_to_userroles = Assign program to userroles
-property_is_inserted = The property is inserted
+property_is_inserted = The property is inserted in form
please_insert_all_required_fields = Please insert all required fields
required_fields_valivation = Required fields validation
insert_properties = Insert properties
-insert_images = Insert images
\ No newline at end of file
+insert_images = Insert images
+patient_registration_form = Person Registration Form
+insert_data_elements = Insert data elements
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewDataEntryForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewDataEntryForm.js 2013-02-25 07:12:31 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewDataEntryForm.js 2013-02-26 08:38:13 +0000
@@ -6,8 +6,8 @@
jQuery(function(){
dataElementSelector = jQuery("#dataElementSelection").dialog({
title: i18n_dataelement,
- height: 400,
- width: jQuery("#dataElementSelection [id=dataElementIds]").outerWidth() + 30,
+ height: 420,
+ width: 480,
autoOpen: false,
zIndex:99999
});
@@ -27,6 +27,28 @@
autoOpen: false,
zIndex:99999
});
+
+ $(":button").button();
+ $(":submit").button();
+ $("#saveButton").button("option", "icons", { primary: "ui-icon-disk" });
+ $("#cancelButton").button("option", "icons", { primary: "ui-icon-cancel" });
+ $("#deleteButton").button("option", "icons", { primary: "ui-icon-trash" });
+ $("#insertButton").button("option", "icons", { primary: "ui-icon-plusthick" });
+ $("#insertImagesButton").button("option", "icons", { primary: "ui-icon-newwin" });
+ $("#loadExistForms").button("option", "icons", { primary: "ui-icon-newwin" });
+ $("#insertDataElements").button("option", "icons", { primary: "ui-icon-newwin" });
+ $("#insertOtherDataElements").button("option", "icons", { primary: "ui-icon-newwin" });
+
+ $("#imageDialog").bind("dialogopen", function(event, ui) {
+ $("#insertImagesButton").button("disable");
+ })
+ $("#imageDialog").bind("dialogclose", function(event, ui) {
+ $("#insertImagesButton").button("enable");
+ })
+
+ $("#insertImagesButton").click(function() {
+ $("#imageDialog").dialog();
+ });
});
function openOtherProgramStageDataElements()
@@ -183,7 +205,6 @@
}
-
function displayNameOnChange( div, displayName )
{
// display - name
@@ -222,7 +243,6 @@
item[0].text = "(" + item.attr('decode') + ") " + item.attr('dename');
});
}
- jQuery('#' + div + ' [id=dataElementIds]').width(jQuery("#" + div).width() - 10 );
}
function sortByOnChange( div, sortBy)
@@ -262,3 +282,10 @@
});
}
}
+
+function insertImage() {
+ var image = $("#imageDialog :selected").val();
+ var html = "<img src=\"" + image + "\" title=\"" + $("#imageDialog :selected").text() + "\">";
+ var oEditor = $("#designTextarea").ckeditorGet();
+ oEditor.insertHtml( html );
+}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.vm 2013-01-23 10:27:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.vm 2013-02-26 08:38:13 +0000
@@ -67,24 +67,15 @@
<form id="saveDataEntryForm" name="saveDataEntryForm" action="saveDataEntryForm.action" method="post">
<input type="hidden" name="programStageId" id="programStageId" value="$!programStage.id"/>
+<h3>$i18n.getString( "dataentryform_management_for_program_stage" )</h3>
+<h4>$programStage.displayName</h4>
+
<input type="hidden" name="dataEntryFormId" id="dataEntryFormId" value="$!programStage.dataEntryForm.id"/>
-<h3>$i18n.getString( "dataentryform_management_for_program_stage" ): $programStage.displayName </h3>
<div class="container" >
<table id="detailsList" width="100%">
<col/>
<tr>
<th>$i18n.getString( "dataentryform_details" )</th>
- <td align="right" rowspan="2">
- #if( !$existingDataEntryForms.isEmpty() )
- <input type="button" style="width:250px" value="$i18n.getString( 'load_existed_form' )" onclick="openloadExistedForm()"/><br>
- #end
- #if(!$dataElements.isEmpty())
- <input type="button" style="width:250px" value="$i18n.getString( 'dataelement' )" onclick="openDataElementSelector()"/><br>
- #end
- #if(!$programStages.isEmpty())
- <input type="button" style="width:250px" value="$i18n.getString( 'dataelement_of_orther_program_stage' )" onclick="openOtherProgramStageDataElements()"/>
- #end
- </td>
</tr>
<tr>
<td>
@@ -110,10 +101,23 @@
<table width="100%">
<tr>
<td>
- <input type="submit" name="save" value="$i18n.getString( 'save' )" style="width:120px"/>
- <input type="button" name="cancel" value="$i18n.getString( 'cancel' )" style="width:120px" onclick="window.location='programStage.action?id=$!programStage.program.id'">
+ <button type="submit" id="saveButton">$i18n.getString( 'save' )</button>
+ <button type="button" id="cancelButton" onclick="window.location='programStage.action?id=$!programStage.program.id'">$i18n.getString( 'cancel' )</button>
+ <span style="color:#606060">|</span>
+ #if( !$existingDataEntryForms.isEmpty() )
+ <button type="button" id='loadExistForms' onclick="openloadExistedForm()">$i18n.getString( 'load_existed_form' )</button>
+ #end
+ #if(!$dataElements.isEmpty())
+ <button type="button" id='insertDataElements' onclick="openDataElementSelector()"/>$i18n.getString( 'insert_data_elements' )</button>
+ #end
+ #if(!$programStages.isEmpty())
+ <button type="button" id='insertOtherDataElements' value="$i18n.getString( 'dataelement_of_orther_program_stage' )" onclick="openOtherProgramStageDataElements()"></button>
+ #end
+ <button type="button" id="insertImagesButton">$i18n.getString( 'insert_images' )</button>
+
#if( $!dataEntryForm )
- <input type="button" name="delete" value="$i18n.getString( 'delete' )" style="width:120px" onclick="deleteDataEntryForm( $programStage.dataEntryForm.id, $programStage.id )" />
+ <span style="color:#606060">|</span>
+ <button type="button" id="deleteButton" onclick="deleteDataEntryForm( $programStage.dataEntryForm.id, $programStage.id )">$i18n.getString( 'delete' )</button>
#end
</td>
</tr>
@@ -127,7 +131,7 @@
<td class="bold">$i18n.getString("display_name")</td>
<td>
<select id='displayNameOption' onchange='displayNameOnChange( "dataElementSelection",this.value )'>
- <option selected value='1'>$i18n.getString("name")</option>
+ <option value='1'>$i18n.getString("name")</option>
<option value='2'>$i18n.getString("code")</option>
<option value='3'>$i18n.getString("code_and_name")</option>
</select>
@@ -136,10 +140,8 @@
<tr>
<td class="bold">$i18n.getString("sort_by")</td>
<td>
- <select id='sortBy' onchange="sortByOnChange('dataElementSelection', this.value)">
- <option value='1' selected>$i18n.getString("name")</option>
- <option value='2' >$i18n.getString("code")</option>
- </select>
+ <input type='radio' name='sortBy' value='1' onchange="sortByOnChange('dataElementSelection', '1')" checked >$i18n.getString("name")
+ <input type='radio' name='sortBy' value='2' onchange="sortByOnChange('dataElementSelection', '2')">$i18n.getString("code")
</td>
</tr>
<tr>
@@ -149,7 +151,8 @@
</tr>
<tr>
<td colspan='2'>
- <input type="text" style="width:100%" onkeyup="filterDataElements( this.value, '#dataElementSelection', '#dataElementIds')"/>
+ <input type="text" id='dataElementFilter' style="width:350px" onkeyup="filterDataElements( this.value, '#dataElementSelection', '#dataElementIds')"/>
+ <input type='button' value="$i18n.getString('clear')" style="width:80px;" onclick="setFieldValue('dataElementFilter','');">
</td>
</tr>
<tr>
@@ -170,10 +173,8 @@
</tr>
<tr>
<td>
- <input type="button" value="Insert" id="insert" name="insert" onclick="insertDataElement( '#dataElementSelection', '$programStage.id')" style="width:100px">
+ <input type="button" id="insertButton" value="$i18n.getString('insert')" onclick="insertDataElement( '#dataElementSelection', '$programStage.id')" style="width:100px">
</td>
- </tr>
- <tr>
<td>
<span id="message_"></span>
</td>
@@ -244,7 +245,6 @@
</table>
</div>
-
<div id="existedDataEntry">
<select id="existedDataEntryId" style="width:300px;float:left">
#foreach( $dataEntry in $existingDataEntryForms )
@@ -254,6 +254,19 @@
<input type="button" value="$i18n.getString( 'load' )" style="float:left" onclick="loadExistedForm()"/>
</div>
+<div id="imageDialog" title="$i18n.getString( 'insert_images' )" style='display:none;'>
+ <div style="margin:4px">
+ <div>
+ <select id="imageSelector" multiple="multiple" style="height: 200px; width:100%;" ondblclick='insertImage();'>
+ #foreach( $flag in $flags )
+ <option value="../dhis-web-commons/flags/${flag}.png">$i18n.getString( ${flag} )</option>
+ #end
+ </select>
+ </div>
+ <div style="margin-top:6px"><button type="button" id="insertImageButton">$i18n.getString( "insert" )</button></div>
+ </div>
+</div>
+
<script>
var i18n_delete_program_data_entry_confirm = '$encoder.jsEscape( $i18n.getString( "delete_program_data_entry_confirm" ) , "'" )';
</script>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm 2013-02-26 07:29:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm 2013-02-26 08:38:13 +0000
@@ -59,6 +59,8 @@
<input type="hidden" name="dataEntryFormId" id="dataEntryFormId" value="$!registrationForm.dataEntryForm.id"/>
<h3>$i18n.getString( "add_patient_registration_form" )</h3>
+<h4>$!program.displayName</h4>
+
<div class="container" >
<table id="detailsList" width="100%">
<col/>