dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #23546
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11455: Custom forms, removed function for inserting dynamic dropdowns, not useful.
------------------------------------------------------------
revno: 11455
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2013-07-20 14:35:56 +0200
message:
Custom forms, removed function for inserting dynamic dropdowns, not useful.
modified:
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/customForm.vm
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
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_es.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_fr.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_id.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_pt.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_pt_BR.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_zh.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/viewDataEntryForm.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-dataentry/src/main/webapp/dhis-web-dataentry/customForm.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/customForm.vm 2013-01-05 15:22:55 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/customForm.vm 2013-07-20 12:35:56 +0000
@@ -3,10 +3,3 @@
<div class="${css}">
$customDataEntryFormCode
</div>
-
-<select id="dynselect" class="hidden">
-<option value="-1">[ $i18n.getString( "select_data_element" ) ]</option>
-#foreach( $element in $dataElementsNotInForm )
-<option value="${element.uid}">$encoder.htmlEncode( ${element.displayName} )</option>
-#end
-</select>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js 2013-06-11 21:03:10 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js 2013-07-20 12:35:56 +0000
@@ -112,19 +112,6 @@
return expression;
}
-function saveDynamicVal( code, optionComboId, fieldId )
-{
- var dataElementId = $( '#' + code + '-dynselect option:selected' ).val();
-
- if ( !isDefined( dataElementId ) || dataElementId == -1 )
- {
- log( 'There is no select list in form or no option selected for code: ' + code );
- return;
- }
-
- saveVal( dataElementId, optionComboId, fieldId );
-}
-
function saveVal( dataElementId, optionComboId, fieldId )
{
var fieldIds = fieldId.split( "-" );
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2013-07-08 04:59:58 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2013-07-20 12:35:56 +0000
@@ -480,39 +480,6 @@
viewHist( dataElementId, optionComboId );
} );
} );
-
- $( '[name="dynselect"]' ).each( function( i )
- {
- var id = $( this ).attr( 'id' );
- var code = id.split( '-' )[0];
-
- $( this ).unbind( 'change' );
-
- $( this ).change( function()
- {
- dynamicSelectChanged( id, code );
- } );
- } );
-
- $( '[name="dyninput"]' ).each( function( i )
- {
- var id = $( this ).attr( 'id' );
- var code = id.split( '-' )[0];
- var optionComboId = id.split( '-' )[1];
-
- $( this ).unbind( 'change' );
- $( this ).unbind( 'keyup' );
-
- $( this ).change( function()
- {
- saveDynamicVal( code, optionComboId, id );
- } );
-
- $( this ).keyup( function( event )
- {
- keyPress( event, this );
- } );
- } );
}
function resetSectionFilters()
@@ -569,7 +536,6 @@
}
enableSectionFilter();
- insertDynamicOptions();
}
loadDataValues();
@@ -595,7 +561,6 @@
}
enableSectionFilter();
- insertDynamicOptions();
}
else
{
@@ -609,68 +574,6 @@
}
//------------------------------------------------------------------------------
-// Dynamic input
-//------------------------------------------------------------------------------
-
-function insertDynamicOptions()
-{
- var optionMarkup = $( '#dynselect' ).html();
-
- if ( !isDefined( optionMarkup ) )
- {
- return; // Custom form only
- }
-
- $( '[name="dynselect"]' ).each( function( i )
- {
- $( this ).append( optionMarkup );
- } );
-}
-
-function dynamicSelectChanged( id, code )
-{
- var validSelection = $( '#' + id ).val() != -1;
- var color = validSelection ? COLOR_WHITE : COLOR_GREY;
-
- $( 'input[code="' + code + '"]' ).prop( 'disabled', !validSelection );
- $( 'input[code="' + code + '"]' ).css( 'background-color', color );
-}
-
-function getDynamicSelectElementId( dataElementId )
-{
- // Search for element where data element is already selected
-
- var id = null;
-
- $( '[name="dynselect"]' ).each( function( i )
- {
- if ( $( this ).val() == dataElementId )
- {
- id = $( this ).attr( 'id' );
- return false;
- }
- } );
-
- if ( id != null )
- {
- return id;
- }
-
- // Search for unselected element
-
- $( '[name="dynselect"]' ).each( function( i )
- {
- if ( $( this ).val() == -1 )
- {
- id = $( this ).attr( 'id' );
- return false;
- }
- } );
-
- return id;
-}
-
-//------------------------------------------------------------------------------
// Section filter
//------------------------------------------------------------------------------
@@ -1134,14 +1037,11 @@
$( '[name="entryselect"]' ).val( '' );
$( '[name="entrytrueonly"]' ).removeAttr('checked');
$( '[name="entryoptionset"]' ).val( '' );
- $( '[name="dyninput"]' ).val( '' );
- $( '[name="dynselect"]' ).val( '' );
$( '[name="entryfield"]' ).css( 'background-color', COLOR_WHITE );
$( '[name="entryselect"]' ).css( 'background-color', COLOR_WHITE );
$( '[name="entrytrueonly"]' ).css( 'background-color', COLOR_WHITE );
$( '[name="entryoptionset"]' ).css( 'background-color', COLOR_WHITE );
- $( '[name="dyninput"]' ).css( 'background-color', COLOR_WHITE );
$( '[name="min"]' ).html( '' );
$( '[name="max"]' ).html( '' );
@@ -1150,9 +1050,6 @@
// Disable and grey dynamic fields to start with and enable later
- $( '[name="dyninput"]' ).prop( 'disabled', true );
- $( '[name="dyninput"]' ).css( 'background-color', COLOR_GREY );
-
$.ajax( {
url: 'getDataValues.action',
data:
@@ -1190,7 +1087,7 @@
{
var fieldId = '#' + value.id + '-val';
- if ( $( fieldId ).length > 0 ) // Insert for fixed input fields
+ if ( $( fieldId ).length > 0 )
{
if ( $( fieldId ).attr( 'name' ) == 'entrytrueonly' ) {
$( fieldId ).attr('checked', true);
@@ -1198,48 +1095,7 @@
$( fieldId ).val( value.val );
}
}
- else // Insert for potential dynamic input fields
- {
- var split = splitFieldId( value.id );
- var dataElementId = split.dataElementId;
- var optionComboId = split.optionComboId;
-
- var selectElementId = '#' + getDynamicSelectElementId( dataElementId );
-
- if ( $( selectElementId ).length == 0 )
- {
- log( 'Could not find dynamic select element for data element: ' + dataElementId );
- return true;
- }
-
- var code = $( selectElementId ).attr( 'id' ).split( '-' )[0];
-
- if ( !isDefined( code ) )
- {
- log( 'Could not find code on select element: ' + selectElementId );
- return true;
- }
-
- var dynamicInputId = '#' + code + '-' + optionComboId + '-dyninput';
-
- if ( $( dynamicInputId ).length == 0 )
- {
- log( 'Could not find find dynamic input element for option combo: ' + optionComboId );
- return true;
- }
-
- // Set data element in select list
-
- $( selectElementId ).val( dataElementId );
-
- // Enable input fields and set value
-
- $( 'input[code="' + code + '"]' ).prop( 'disabled', false );
- $( 'input[code="' + code + '"]' ).css( 'background-color', COLOR_WHITE );
-
- $( dynamicInputId ).val( value.val );
- }
-
+
dataValueMap[value.id] = value.val;
} );
=== 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 2013-07-08 09:42:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module.properties 2013-07-20 12:35:56 +0000
@@ -91,11 +91,6 @@
allow_future_periods=Allow future periods
skip_aggregation=Skip data mart aggregation
insert_data_elements=Insert data elements
-dynamic_elements=Dynamic elements
-select_category_combo=Select category combination
-start=Start
-insert_data_element_drop_down=Insert data element drop-down
-select_category_combo_for_which_to_insert=Select category combination for which to insert dynamic fields
insert_input_fields_into_the_form=Insert input fields into the form
cat_option_combo_not_exist=Category option combo does not exist
data_element_not_exist=Data element does not exist
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_es.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_es.properties 2013-07-02 15:58:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_es.properties 2013-07-20 12:35:56 +0000
@@ -146,11 +146,6 @@
allow_future_periods=Permitir periodos futuros
skip_aggregation=Omitir agregaci\u00f3n
insert_data_elements=Insertar elementos de datos
-dynamic_elements=Elementos din\u00e1micos
-select_category_combo=Seleccionar combinaci\u00f3n de categor\u00edas
-start=Iniciar
-insert_data_element_drop_down=Insertar desplegable de elementos de datos
-select_category_combo_for_which_to_insert=Seleccione combinaci\u00f3n de categor\u00edas para insertar campos din\u00e1micos
insert_input_fields_into_the_form=Insertar campos de entrada en el formulario
cat_option_combo_not_exist=La combinaci\u00f3n de opciones de categor\u00eda no existe
data_element_not_exist=El elemento de datos no existe
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_fr.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_fr.properties 2013-07-02 15:58:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_fr.properties 2013-07-20 12:35:56 +0000
@@ -9,8 +9,6 @@
save_success=Enregistr\u00E9 avec succ\u00E8s
no_dataelement_was_selected=Aucun \u00E9l\u00E9ment de donn\u00E9e n'a \u00E9t\u00E9 selectionn\u00E9
select_category_combo_for_which_to_insert=S\u00E9lectionner une combinaison de cat\u00E9gorie pour laquelle ins\u00E9rer un champs dynamique
-dynamic_elements=El\u00E9ments dynamiques
-please_select_dataset_or_categorycombo=Veuillez s\u00E9lectionner un ensemble de donn\u00E9es et une combinaison de cat\u00E9gories
section_grey_field_managment=Gestion de champs gris\u00E9s de section
sort_section=Trier section
frequency=Fr\u00E9quence
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_id.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_id.properties 2013-07-02 15:58:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_id.properties 2013-07-20 12:35:56 +0000
@@ -90,7 +90,6 @@
allow_future_periods=Aktifkan periode mendatang
skip_aggregation=Skip agregasi
insert_data_elements=Insert elemen data
-dynamic_elements=Elemen dinamis
select_category_combo=Pilih kombinasi kategori
start=Start
insert_data_element_drop_down=Insert elemen data drop-down
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_pt.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_pt.properties 2013-07-02 15:58:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_pt.properties 2013-07-20 12:35:56 +0000
@@ -9,8 +9,6 @@
save_success=Gravado com sucesso
no_dataelement_was_selected=Nenhum elemento de dados foi selecionado
select_category_combo_for_which_to_insert=Selecinar combina\u00E7\u00E3o de categoria para inserir campos dinamicamente
-dynamic_elements=Elementos d\u00EDn\u00E2micos
-please_select_dataset_or_categorycombo=Por favor seleccione um combo de conjunto de dados / categoria
section_grey_field_managment=Sec\u00E7\u00E3o de gest\u00E3o de campos sombreados
sort_section=Editar sec\u00E7\u00E3o
frequency=Frequ\u00EAncia
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_pt_BR.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_pt_BR.properties 2013-05-01 12:55:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_pt_BR.properties 2013-07-20 12:35:56 +0000
@@ -9,8 +9,6 @@
save_success=Gravado com sucesso
no_dataelement_was_selected=Nenhum elemento de dados foi selecionado
select_category_combo_for_which_to_insert=Selecinar combina\u00E7\u00E3o de categoria para inserir campos dinamicamente
-dynamic_elements=Elementos d\u00EDn\u00E2micos
-please_select_dataset_or_categorycombo=Por favor seleccione um combo de conjunto de dados / categoria
section_grey_field_managment=Sec\u00E7\u00E3o de gest\u00E3o de campos sombreados
sort_section=Editar sec\u00E7\u00E3o
frequency=Frequ\u00EAncia
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_zh.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_zh.properties 2013-07-02 15:58:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/org/hisp/dhis/dataset/i18n_module_zh.properties 2013-07-20 12:35:56 +0000
@@ -163,11 +163,9 @@
rename_failed=\u91CD\u547D\u540D\u5931\u8D25
clear=\u6E05\u9664
edit_compulsory_data_elements=\u7F16\u8F91\u5F3A\u5236\u7684\u6570\u636E\u5143
-dynamic_elements=\u52A8\u6001\u5143\u7D20
allow_future_periods=\u5141\u8BB8\u5C06\u6765\u5468\u671F
unassigned=\u672A\u88AB\u5206\u914D
group_filter=\u7EC4\u8FC7\u6EE4\u5668
-select_category_combo_for_which_to_insert=\u9009\u62E9\u8981\u63D2\u5165\u52A8\u6001\u5B57\u6BB5\u7684\u5206\u7C7B\u7EC4\u5408
frequency=\u9891\u7387
manage_greyed_fields=\u7BA1\u7406\u7070\u7EFF\u8272\u533A\u57DF
title=\u6807\u9898
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.js 2013-01-23 09:08:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/viewDataEntryForm.js 2013-07-20 12:35:56 +0000
@@ -1,7 +1,4 @@
-var currentDynamicElementCode = null;
-var currentCategoryComboId = null;
-var currentCategoryComboName = null;
var timeOut;
$( document ).ready( function() {
@@ -20,12 +17,10 @@
var dataElementSelector = $("#dataElementSelector");
var totalSelector = $("#totalSelector");
var indicatorSelector = $("#indicatorSelector");
- var dynamicElementSelector = $("#dynamicElementSelector");
dataElementSelector.height( dialog.height() - 97 );
totalSelector.height( dialog.height() - 97 );
indicatorSelector.height( dialog.height() - 97 );
- dynamicElementSelector.height( dialog.height() - 120 );
});
$("#imageDialog").dialog({
@@ -65,14 +60,7 @@
$("#insertImagesButton").click(function() {
$("#imageDialog").dialog("open");
});
-
- $("#startButton").button("option", "icons", { primary: "ui-icon-triangle-1-e" });
- $("#startButton").click( showDynamicElementInsert );
- $("#doneButton").click( showDynamicElementSelect );
-
- $("#insertDynamicElementButton").button("option", "icons", { primary: "ui-icon-plusthick" });
- $("#insertDynamicElementButton").click( insertDropDownList );
-
+
showDataElements();
$("#dataElementsButton").addClass("ui-state-active2");
@@ -81,7 +69,6 @@
$("#dataElementsButton").addClass("ui-state-active2");
$("#totalsButton").removeClass("ui-state-active2");
$("#indicatorsButton").removeClass("ui-state-active2");
- $("#dynamicElementsButton").removeClass("ui-state-active2");
showDataElements();
});
@@ -90,7 +77,6 @@
$("#dataElementsButton").removeClass("ui-state-active2");
$("#totalsButton").addClass("ui-state-active2");
$("#indicatorsButton").removeClass("ui-state-active2");
- $("#dynamicElementsButton").removeClass("ui-state-active2");
showTotals();
});
@@ -99,20 +85,10 @@
$("#dataElementsButton").removeClass("ui-state-active2");
$("#totalsButton").removeClass("ui-state-active2");
$("#indicatorsButton").addClass("ui-state-active2");
- $("#dynamicElementsButton").removeClass("ui-state-active2");
showIndicators();
});
- $("#dynamicElementsButton").click(function() {
- $("#dataElementsButton").removeClass("ui-state-active2");
- $("#totalsButton").removeClass("ui-state-active2");
- $("#indicatorsButton").removeClass("ui-state-active2");
- $("#dynamicElementsButton").addClass("ui-state-active2");
-
- showDynamicElements();
- });
-
$("#insertButton").click(function() {
if( $("#dataElementsTab").is(":visible") ) {
insertDataElement();
@@ -123,9 +99,6 @@
else if( $("#indicatorsTab").is(":visible") ) {
insertIndicator();
}
- else if( $("#dynamicElementsTab").is(":visible") ) {
- insertDynamicElement();
- }
});
$("#insertImageButton").click(insertImage);
@@ -216,8 +189,7 @@
dataSetId: dataSetId
}
});
-
- $("#dynamicElementSelector").dblclick(insertDynamicElement);
+
$("#imageSelector").dblclick(insertImage);
if( autoSave )
@@ -233,7 +205,6 @@
$("#totalsFilter").hide();
$("#indicatorsTab").hide();
$("#indicatorsFilter").hide();
- $("#dynamicElementsTab").hide();
}
function showTotals() {
@@ -243,7 +214,6 @@
$("#totalsFilter").show();
$("#indicatorsTab").hide();
$("#indicatorsFilter").hide();
- $("#dynamicElementsTab").hide();
}
function showIndicators() {
@@ -253,17 +223,6 @@
$("#totalsFilter").hide();
$("#indicatorsTab").show();
$("#indicatorsFilter").show();
- $("#dynamicElementsTab").hide();
-}
-
-function showDynamicElements() {
- $("#dataElementsTab").hide();
- $("#dataElementsFilter").hide();
- $("#totalsTab").hide();
- $("#totalsFilter").hide();
- $("#indicatorsTab").hide();
- $("#indicatorsFilter").hide();
- $("#dynamicElementsTab").show();
}
function filterSelectList( select_id, filter )
@@ -393,68 +352,6 @@
}
}
-/**
- * A unique code is used to associate the data element drop down with the input
- * fields for each category option combo. The format for select / drop down list
- * is:
- *
- * id="<unique code>-dynselect" dyncselect="<category combo id>"
- */
-function insertDropDownList() {
- var oEditor = $("#designTextarea").ckeditorGet();
- if ( currentDynamicElementCode && currentCategoryComboId ) {
- var id = currentDynamicElementCode + "-dynselect";
- var template = '<input id="' + id + '" dynselect="' + currentCategoryComboId + '" value="[ ' + currentCategoryComboName + ' ]" title="' + currentCategoryComboName + '" style="width:15em;" />';
- oEditor.insertHtml( template );
- }
-}
-
-/**
- * A unique code is used to associate the data element drop down with the input
- * fields for each category option combo. The format for input field identifier
- * is:
- *
- * id="<unique code>-<category option combo id>-dyninput"
- */
-function insertDynamicElement() {
- var oEditor = $("#designTextarea").ckeditorGet();
- var $option = $("#dynamicElementSelector option:selected");
-
- if( $option.length !== 0 ) {
- var categoryOptionComboId = $option.val();
- var categoryOptionComboName = $option.text();
- var id = currentDynamicElementCode + "-" + categoryOptionComboId + "-dyninput";
-
- var template = '<input id="' + id + '" code="' + currentDynamicElementCode + '" value="[ ' + categoryOptionComboName + ' ]" title="' + categoryOptionComboName + '" style="width:7em;text-align:center;" />';
- oEditor.insertHtml( template );
- }
-}
-
-function showDynamicElementSelect() {
- $("#dynamicElementSelect").show();
- $("#dynamicElementInsert").hide();
-}
-
-function showDynamicElementInsert() {
- $("#dynamicElementSelect").hide();
- $("#dynamicElementInsert").show();
-
- var categoryComboId = $("#categoryComboSelect option:selected").val();
- var categoryComboName = $("#categoryComboSelect option:selected").text();
-
- currentDynamicElementCode = getRandomCode();
- currentCategoryComboId = categoryComboId;
- currentCategoryComboName = categoryComboName;
-
- clearListById( "dynamicElementSelector" );
-
- var optionCombos = $.getJSON( "../dhis-web-commons-ajax-json/getCategoryOptionCombos.action?categoryComboUid=" + categoryComboId, function( json ) {
- $.each( json.categoryOptionCombos, function( index, value ) {
- addOptionById( "dynamicElementSelector", value.uid, value.name );
- } );
- } );
-}
-
function insertImage() {
var image = $("#imageDialog :selected").val();
var html = "<img src=\"" + image + "\" title=\"" + $("#imageDialog :selected").text() + "\">";
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/viewDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/viewDataEntryForm.vm 2013-02-03 10:13:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/viewDataEntryForm.vm 2013-07-20 12:35:56 +0000
@@ -130,32 +130,11 @@
<select id="indicatorSelector" multiple="multiple" style="height: 200px; width: 100%;"></select>
</td>
</tr>
- <tr id="dynamicElementsTab">
- <td>
- <div id="dynamicElementSelect" style="margin-bottom: 10px;">
- <div style="color:#666; margin-top:5px; margin-bottom:5px;">$i18n.getString( "select_category_combo_for_which_to_insert" )</div>
- <select id="categoryComboSelect" style="width: 100%; margin-bottom: 10px;">
- #foreach( $categoryCombo in $categoryCombos )
- <option value="$categoryCombo.uid">$encoder.htmlEncode( $categoryCombo.displayName )</option>
- #end
- </select><br>
- <button type="button" id="startButton">$i18n.getString( "start" )</button>
- <div style="height:155px"></div>
- </div>
- <div id="dynamicElementInsert" style="margin-bottom: 10px; display:none;">
- <div style="color:#666; margin-top:5px; margin-bottom:5px;">$i18n.getString( "insert_input_fields_into_the_form" )</div>
- <select id="dynamicElementSelector" multiple="multiple" style="height: 177px; margin-bottom: 10px; width: 100%;"></select><br>
- <button type="button" id="insertDynamicElementButton">$i18n.getString( "insert_data_element_drop_down" )</button>
- <button type="button" id="doneButton">$i18n.getString( "done" )</button>
- </div>
- </td>
- </tr>
<tr>
<td>
<button type="button" id="dataElementsButton">$i18n.getString( "data_elements" )</button>
<button type="button" id="totalsButton">$i18n.getString( "totals" )</button>
- <button type="button" id="indicatorsButton">$i18n.getString( "indicators" )</button>
- <button type="button" id="dynamicElementsButton">$i18n.getString( "dynamic_elements" )</button> <span style="color:#606060">|</span>
+ <button type="button" id="indicatorsButton">$i18n.getString( "indicators" )</button> <span style="color:#606060">|</span>
<button type="button" id="insertButton">$i18n.getString( "insert" )</button>
<input type="checkbox" id="greyedField"><label for="greyedField">$i18n.getString( "grey_field" )</label>
</td>