source: main/trunk/ibisph-admin/src/main/webapp/WEB-INF/tags/mergeRecordData.tag @ 21380

Last change on this file since 21380 was 21380, checked in by GarthBraithwaite_STG, 2 months ago

admin - merge help and prompt text updates.

File size: 7.4 KB
Line 
1<%@tag description="Merge Record Data template"%>
2
3<%@include file="/WEB-INF/jsp/_taglibs.jsp"%>
4
5<%@attribute name="title"%>
6<%@attribute name="cssClass"%>
7<%@attribute name="startingDestinationTableRow"%>
8<%@attribute name="tableRowIndexAdjustment"%>
9<%@attribute name="firstNumericElementTDQuerySelector"%>
10
11<%@attribute name="help"%>
12
13<c:set var="mergeDestinationStartingRowHelp">
14        The starting destination row allows you to specify where this data will be
15        inserted into the dataset records table.  This value indexes starting at 1
16        which means 1 = the first row of data.
17</c:set>
18<c:set var="mergeDelimiterHelp">
19        Specifies how the above data values are seperated. 
20        Use <code class="Bold Larger">\t</code> if pasting from MS-Excel,
21        use a <code class="Bold Larger">comma</code> for CSV,
22        other delimiters could be <code class="Bold Larger">space, | #</code> etc.
23        <br/><br/>
24        Note: delimiter values are typically a single character but are not limited
25        to a single character.  For example you might have data that uses a string
26        like <code class="Bold Larger">#!#</code> that delimits the values etc.
27</c:set>
28
29<c:set var="mergeOverwriteHelp">
30        If you want to overwrite existing data make you MUST check this box.  If unchecked
31        then data are only merged into blank existing cells.  So if you are entering a
32        new year, all fields/cells on the dataset record page *SHOULD* be blank and thus
33        this option does not need to be selected.
34        <br/><br/>
35
36        <div class="Bold">IMPORTANT: Be very careful using this
37        option as it is rarely needed or used in this new version of the application. 
38        In older versions this was used to update all values when a new current year's
39        data was being implemented.  In version 3 this is NOT used as new data MUST
40        be associated with a new period dimension value.  This allows historical data
41        to not be thrown away so it can be used for trending etc.
42</c:set>
43
44<div id="mergeDialog" class="${empty cssClass ? "ModalDialog" : cssClass}">
45        <a href="javascript:global.mergeDialog.hide()" title="Close" class="CloseBox"><img src="${pageContext.request.contextPath}/image/icon/32/closebox.png"/></a>
46        <div class="InnerCanvas" style="padding: 2em;">
47                <h2 class="TitleBar">Merge Data into ${title} <tag:help content="${help}"/></h2>
48                <hr/>
49                <div id="mergeDialogContentContainer">
50                        <br/>
51                        The "Merge Data" function allows you to copy and paste data from outside
52                        applications like Excel spreadsheets, database tools, or CSV files.
53                        <br/><br/>
54
55                        <h4>Steps:</h4>
56                        <ol>
57                                <li>
58                                        <label for="mergeDataToParse">Paste or enter delimited numeric values (no commas, %, *, $ etc.):</label><br/>
59                                        <textarea id="mergeDataToParse" rows="10" title="Paste the delimited data into this edit box - or edit directly."></textarea>
60                                </li>
61                                <li>
62                                        <label for="mergeColumnDelimiter">Enter the delimiter for the pasted/entered values:</label>
63                                        <input type="text" name="mergeColumnDelimiter" id="mergeColumnDelimiter"
64                                                value="\t" maxlength="10" style="width: 4em;"
65                                                title="Use '\t' for Excel, or any character like ',' or ' ' etc."
66                                        />
67                                        <tag:help content="${mergeDelimiterHelp}"/>
68                                </li>
69                                <li>
70                                        <label for="mergeStartingTableRow">Enter the destination starting row: </label>
71                                        <input type="number" id="mergeStartingTableRow" maxlength="4"
72                                                value="${(empty startingDestinationTableRow) ? 1 : startingDestinationTableRow}"
73                                                indexAdjustment="${(empty tableRowIndexAdjustment) ? -1 : tableRowIndexAdjustment}"
74                                                style="width: 4em;"
75                                                title="Starting row to merge the data to."
76                                        />
77                                        <tag:help content="${mergeDestinationStartingRowHelp}"/>
78                                </li>
79
80                                <li>
81                                        <input type="checkbox" name="mergeOverwriteNonBlankData" id="mergeOverwriteNonBlankData" value="true"
82                                                onclick="javascript:alertIfExistingData()"
83                                                title="Check this to overwrite existing non blank data values."
84                                        />
85                                        <label for="mergeOverwriteNonBlankData">Check this to allow any existing, non blank data to be overwritten (if applicable).
86                                        <tag:help content="${mergeOverwriteHelp}"/>
87                                        </label>
88                                </li>
89
90                                <li>
91                                        Press the [Merge Data] button to proceed or click the "x" located
92                                        in the upper right corner of this window to cancel this operation. 
93                                        <br/><br/>
94
95                                        <div class="Note">
96                                                If you proceed with the merge operation and do not like the
97                                                merged result you can use the "Reset" option which will
98                                                reset the page to the initial values.  Once back on the
99                                                dataset records page IF you "Save" or navigate to another
100                                                page the values will be committed.
101                                        </div>
102
103                                        <input type="button" value="Merge Data" onclick="mergeParsedData()" style="padding: 0.5em 1em; margin-top: 1.5em;"/>
104
105                                </li>
106                        </ol>
107                </div>
108
109        </div>
110</div>
111
112
113<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/ModalDialog.css"/>
114
115<script language="JavaScript" type="text/javascript" src="${pageContext.request.contextPath}/js/DocumentSize.js"></script>
116<script language="JavaScript" type="text/javascript" src="${pageContext.request.contextPath}/js/ModalDialog.js"></script>
117<script language="JavaScript" type="text/javascript" src="${pageContext.request.contextPath}/js/merge.js"></script>
118
119<script language="JavaScript" type="text/javascript" src="${pageContext.request.contextPath}/js/Cookie.js"></script>
120<script language="JavaScript" type="text/javascript" src="${pageContext.request.contextPath}/js/NamedInputElement.js"></script>
121<script language="JavaScript" type="text/javascript" src="${pageContext.request.contextPath}/js/CookieBoundInputElement.js"></script>
122<script>
123        function showMergeDataDialog()
124        {
125                if(!global.mergeDialog)
126                {
127                        global.mergeDialog = new ModalDialog("mergeDialog", "mergeDialogContentContainer");
128                }
129                global.mergeDialog.show();
130        } //~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~
131
132
133        // checks if any blank values.  If so then show alert message.
134        function alertIfExistingData()
135        {
136                var isChecked = document.getElementById("mergeOverwriteNonBlankData").checked;
137
138                if(isChecked)
139                {
140                        var nonBlankValuesFound = false;
141                        var elements = document.getElementsByName("measureValue");
142                        for(var i = 0, element; element = elements[i++];)
143                        {
144                                nonBlankValuesFound = (element.value > " ");
145                                if(nonBlankValuesFound) break;
146                        }
147                        if(nonBlankValuesFound) alert(
148                                "***   STOP!   YOU ABOUT TO DESTROY DATA!   READ BELOW!   ***\n\n"
149                                + "Do NOT proceed if you are updating a new years data! "
150                                + "Close the Merge Data window to return to the records entry page "
151                                + "and correct this issue by changing to the appropriate new year. "
152                                + "If you proceed with the merge you will loose or corrupt valid historical data. \n\n"
153                                + "If you are not updating a new year's data proceed with extreme "
154                                + "caution!  Once merged you need to verify each and every value "
155                                + "before saving the values."
156                        );
157                }
158        } //~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~
159
160
161
162        // called from the dialog's [Merge] button when clicked.
163        function mergeParsedData()
164        {
165                mergeTextAreaDataToTableInput(
166                        "mergeDataToParse",
167                        "mergeColumnDelimiter",
168                        "valuesTable",
169                        "mergeStartingTableRow",
170                        "td.Number",
171                        "mergeOverwriteNonBlankData"
172                );
173                global.mergeDialog.hide();
174        } //~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~
175</script>
Note: See TracBrowser for help on using the repository browser.