Revision 4361
Added by ben leinfelder about 16 years ago
lib/style/skins/first/first-assessment-resultset.xsl | ||
---|---|---|
60 | 60 |
<![CDATA[ |
61 | 61 |
downloadMergedResponseData = function(formId) { |
62 | 62 |
|
63 |
if (!areItemsSelected('docids')) {
|
|
64 |
alert("Please select at least one dataset for download");
|
|
63 |
if (!areItemsSelected('docid')) { |
|
64 |
alert("Please select at least one dataset"); |
|
65 | 65 |
return false; |
66 | 66 |
} |
67 | 67 |
|
... | ... | |
77 | 77 |
|
78 | 78 |
submitFormObj.submit(); |
79 | 79 |
} |
80 |
editCart = function(formId, operation) { |
|
81 |
|
|
82 |
var metacatURL = "]]><xsl:value-of select="$contextURL" /><![CDATA[/metacat"; |
|
83 |
if (!areItemsSelected('docid')) { |
|
84 |
alert("Please select at least one dataset"); |
|
85 |
return false; |
|
86 |
} |
|
87 |
|
|
88 |
var submitFormObj = document.getElementById(formId); |
|
89 |
submitFormObj.qformat.value = 'first'; |
|
90 |
submitFormObj.action.value = 'editcart'; |
|
91 |
submitFormObj.operation.value = operation; |
|
92 |
|
|
93 |
var myUpdate = new Ajax.Request( |
|
94 |
metacatURL, |
|
95 |
{ method: 'post', |
|
96 |
parameters: Form.serialize(submitFormObj), |
|
97 |
evalScripts: true, |
|
98 |
onFailure: function(transport) {alert('failure making ajax call');} |
|
99 |
}); |
|
100 |
|
|
101 |
} |
|
80 | 102 |
areItemsSelected = function(checkBoxName) { |
81 | 103 |
var checkBoxes = document.getElementsByName(checkBoxName); |
82 | 104 |
|
... | ... | |
102 | 124 |
|
103 | 125 |
<xsl:if test="count(resultset/document) > 0"> |
104 | 126 |
|
127 |
<!-- for reading the assessment details --> |
|
128 |
<form action="{$contextURL}/metacat" method="POST" id="readForm" name="readForm" > |
|
129 |
<input type="hidden" name="qformat" value="first" /> |
|
130 |
<input type="hidden" name="sessionid"> |
|
131 |
<xsl:attribute name="value"> |
|
132 |
<xsl:value-of select="$sessid" /> |
|
133 |
</xsl:attribute> |
|
134 |
</input> |
|
135 |
<input type="hidden" name="action" value="read" /> |
|
136 |
<input type="hidden" name="docid" /> |
|
137 |
</form> |
|
138 |
|
|
139 |
<!-- for managing the ajax actions --> |
|
105 | 140 |
<form action="{$contextURL}/metacat" method="POST" id="assessmentForm" name="assessmentForm" > |
106 | 141 |
<input type="hidden" name="qformat" value="first" /> |
107 | 142 |
<input type="hidden" name="sessionid"> |
... | ... | |
111 | 146 |
</input> |
112 | 147 |
<input type="hidden" name="action" value="read" /> |
113 | 148 |
<input type="hidden" name="dataquery" /> |
114 |
<input type="hidden" name="docid" />
|
|
149 |
<input type="hidden" name="operation" />
|
|
115 | 150 |
<xsl:element name="input"> |
116 | 151 |
<xsl:attribute name="type">hidden</xsl:attribute> |
117 | 152 |
<xsl:attribute name="id">questionId</xsl:attribute> |
... | ... | |
127 | 162 |
<xsl:text>Datafile (.csv)</xsl:text> |
128 | 163 |
</a> |
129 | 164 |
<br/> |
130 |
<div id="mergedResponseData"/> |
|
165 |
Edit Cart: |
|
166 |
<a> |
|
167 |
<xsl:attribute name="href">#</xsl:attribute> |
|
168 |
<xsl:attribute name="onClick">javascript:editCart('assessmentForm', 'add')</xsl:attribute> |
|
169 |
<xsl:text>Add Selected</xsl:text> |
|
170 |
</a> |
|
171 |
/ |
|
172 |
<a> |
|
173 |
<xsl:attribute name="href">#</xsl:attribute> |
|
174 |
<xsl:attribute name="onClick">javascript:editCart('assessmentForm', 'remove')</xsl:attribute> |
|
175 |
<xsl:text>Remove Selected</xsl:text> |
|
176 |
</a> |
|
131 | 177 |
<br/> |
132 | 178 |
|
133 | 179 |
<table width="95%" align="left" border="0" cellpadding="0" |
... | ... | |
135 | 181 |
<tr> |
136 | 182 |
<th style="text-align: left"> |
137 | 183 |
<input type="checkbox"> |
138 |
<xsl:attribute name="onclick">setSelect(document.assessmentForm, 'docids', this.checked)</xsl:attribute>
|
|
184 |
<xsl:attribute name="onclick">setSelect(document.assessmentForm, 'docid', this.checked)</xsl:attribute> |
|
139 | 185 |
</input> |
140 | 186 |
</th> |
141 | 187 |
<th style="text-align: left"> |
... | ... | |
169 | 215 |
</xsl:attribute> |
170 | 216 |
|
171 | 217 |
<td class="text_plain"> |
172 |
<input type="checkbox" name="docids">
|
|
218 |
<input type="checkbox" name="docid"> |
|
173 | 219 |
<xsl:attribute name="value"> |
174 | 220 |
<xsl:value-of select="./docid" /> |
175 | 221 |
</xsl:attribute> |
... | ... | |
178 | 224 |
<td> |
179 | 225 |
|
180 | 226 |
<a> |
181 |
<xsl:attribute name="href">javascript:submitform('read','<xsl:value-of select="./docid" />',document.assessmentForm)</xsl:attribute>
|
|
227 |
<xsl:attribute name="href">javascript:submitform('read','<xsl:value-of select="./docid" />',document.readForm)</xsl:attribute>
|
|
182 | 228 |
<xsl:text>» </xsl:text> |
183 | 229 |
<xsl:value-of select="./param[@name='assessment/@title']" /> |
184 | 230 |
</a> |
Also available in: Unified diff
added place holders for structured search fields