<option name='action_view_history'>[% l('View History') %]</option>
</select>
</td>
- <td><span name='li_state'></span></td>
+ <td>
+ <span class="hidden" state-label name='li_state_new'>[% l('New') %]</span>
+ <span class="hidden" state-label name='li_state_selector-ready'>[% l('Selector-Ready') %]</span>
+ <span class="hidden" state-label name='li_state_order-ready'>[% l('Order-Ready') %]</span>
+ <span class="hidden" state-label name='li_state_approved'>[% l('Approved') %]</span>
+ <span class="hidden" state-label name='li_state_pending-order'>[% l('Pending-Order') %]</span>
+ <span class="hidden" state-label name='li_state_on-order'>[% l('On-Order') %]</span>
+ <span class="hidden" state-label name='li_state_received'>[% l('Received') %]</span>
+ <span class="hidden" state-label name='li_state_cancelled'>[% l('Canceled') %]</span>
+ </td>
<td><input type='text' size='8' name='price'/></td>
</tr>
<tr id='acq-inline-copies-row' class='acq-inline-copies-row'>
self.generateMakeRecTab( li.eg_bib_id(), 'copy_browser', row );
}
- var state_cell = nodeByName("li_state", row);
+ var state_cell = nodeByName("li_state_" + li.state(), row);
- switch(li.state()) {
+ // re-hide any state label nodes which may have been un-hidden
+ // through previous actions.
+ dojo.query('[state-label]', row).forEach(function(node) {
+ openils.Util.hide(node)
+ });
- case 'cancelled':
- if(typeof li.cancel_reason() == "object") {
- var holds_state = dojo.create(
- "span", {
- "style": "border-bottom: 1px dashed #000;",
- "innerHTML": li.state()
- }, state_cell, "only"
- );
- new dijit.Tooltip(
- {
- "label": "<em>" + li.cancel_reason().label() +
- "</em><br />" + li.cancel_reason().description(),
- "connectId": [holds_state]
- }, dojo.create("span", null, state_cell, "last")
- );
+ if (li.state() == 'cancelled') {
+ if(typeof li.cancel_reason() == "object") {
- if (li.cancel_reason().keep_debits() == 't') {
- openils.Util.removeCSSClass(row, /^oils-acq-li-state-/);
- openils.Util.addCSSClass(row, "oils-acq-li-state-delayed");
- }
- }
- return; // all done
+ // clear the stock "Canceled" label, since we have more
+ // information to replace it with.
+ state_cell.innerHTML = '';
- case "on-order":
- break;
+ var holds_state = dojo.create(
+ "span", {
+ "style": "border-bottom: 1px dashed #000;",
+ "innerHTML": li.cancel_reason().label()
+ }, state_cell, "only"
+ );
+ new dijit.Tooltip(
+ {
+ "label": "<em>" + li.cancel_reason().label() +
+ "</em><br />" + li.cancel_reason().description(),
+ "connectId": [holds_state]
+ }, dojo.create("span", null, state_cell, "last")
+ );
- case "received":
- break;
- }
+ if (li.cancel_reason().keep_debits() == 't') {
+ openils.Util.removeCSSClass(row, /^oils-acq-li-state-/);
+ openils.Util.addCSSClass(row, "oils-acq-li-state-delayed");
+ }
+ } else {
+ console.log('li cancel_reason is un-fleshed. Please fix');
+ }
+ }
- state_cell.innerHTML = li.state(); // TODO i18n state labels
+ openils.Util.show(state_cell);
};
var holds_reason = dojo.create(
"span", {
"style": "border-bottom: 1px dashed #000;",
- "innerHTML": "Cancelled" /* XXX [sic] and i18n */
+ "innerHTML": copy.cancel_reason().label()
}, cxl_reason_link, "only"
);
new dijit.Tooltip(