if (typeof(row) == "undefined")
row = dojo.query('tr[li="' + li.id() + '"]', "acq-lit-tbody")[0];
- var recv_link = nodeByName("receive_link", row);
- var unrecv_link = nodeByName("unreceive_link", row);
- var real_copies_link = nodeByName("real_copies_link", row);
- var holdings_maintenance_link = nodeByName("holdings_maintenance_link", row);
+ var actReceive = nodeByName("action_mark_recv", row);
+ var actUnRecv = nodeByName("action_mark_unrecv", row);
+ var actUpdateBarcodes = nodeByName("action_update_barcodes", row);
+ var actHoldingsMaint = nodeByName("action_holdings_maint", row);
+
+ var actNewInvoice = nodeByName('action_new_invoice', row);
+ var actLinkInvoice = nodeByName('action_link_invoice', row);
+ var actViewInvoice = nodeByName('action_view_invoice', row);
+
var state_cell = nodeByName("li_state", row);
if (li.state() == "cancelled") {
var self = this;
switch(li.state()) {
case "on-order":
- openils.Util.hide(real_copies_link);
- openils.Util.hide(unrecv_link);
- openils.Util.show(recv_link, "inline");
- recv_link.onclick = function() {
+ actReceive.disabled = false;
+ actReceive.onclick = function() {
if (self.checkLiAlerts(li.id()))
self.issueReceive(li);
+ nodeByName("action_none", row).selected = true;
};
return;
case "received":
- openils.Util.hide(recv_link);
- openils.Util.show(unrecv_link, "inline");
- unrecv_link.onclick = function() {
+ actUnRecv.disabled = false;
+ actUnRecv.onclick = function() {
if (confirm(localeStrings.UNRECEIVE_LI))
self.issueReceive(li, /* rollback */ true);
+ nodeByName("action_none", row).selected = true;
};
// TODO we should allow editing before receipt, in which case the
// test should be "if 1 or more real (acp) copies exist
- openils.Util.show(real_copies_link, "inline");
- real_copies_link.onclick = function() {
+ actUpdateBarcodes.disabled = false;
+ actUpdateBarcodes.onclick = function() {
self.showRealCopyEditUI(li);
+ nodeByName("action_none", row).selected = true;
}
- openils.Util.show(holdings_maintenance_link, "inline");
- holdings_maintenance_link.onclick = self.generateMakeRecTab( li.eg_bib_id(), 'copy_browser' );
+ actHoldingsMaint.disabled = false;
+ actHoldingsMaint.onclick = self.generateMakeRecTab( li.eg_bib_id(), 'copy_browser', row );
+
+ actNewInvoice.disabled = false;
+ actLinkInvoice.disabled = false;
+ actViewInvoice.disabled = false;
+
+ actNewInvoice.onclick = function() {
+ location.href = oilsBasePath + '/acq/invoice/attach?create=1&attach_li=' + li.id();
+ nodeByName("action_none", row).selected = true;
+ };
+ actLinkInvoice.onclick = function() {
+ // TODO: show inv #/vendor entry then relocate to invoice attach page
+ nodeByName("action_none", row).selected = true;
+ };
+ actViewInvoice.onclick = function() {
+ // TODO: go to invoice search page, with lineitem filter = li.id()
+ nodeByName("action_none", row).selected = true;
+ };
+
return;
}
}
-
- openils.Util.hide(recv_link);
- openils.Util.hide(unrecv_link);
- openils.Util.hide(real_copies_link);
};
}
};
- this.generateMakeRecTab = function(bib_id,default_view) {
+ this.generateMakeRecTab = function(bib_id,default_view, row) {
return function() {
xulG.new_tab(
XUL_OPAC_WRAPPER,
default_view : default_view
}
);
+
+ if(row) nodeByName("action_none", row).selected = true;
}
};
<tr>
<td><span><a id='acq-lit-select-toggle' href='javascript:void(0);'>✓</a></span></td>
<td>Line Items</td>
- <td></td>
- <td></td>
<td>Items</td>
<td>Notes</td>
+ <td>Actions</td>
<td>Status</td>
- <td>Price</td>
+ <td>Estimated Price</td>
</tr>
</tbody>
<tbody id='acq-lit-tbody'>
</tbody>
</table>
</td>
- <td><a class='hidden' name='real_copies_link' href='javascript:void(0);'>Update Barcodes</a> <a class='hidden' name='holdings_maintenance_link' href='javascript:void(0);'>Holdings Maintenance</a></td>
- <td><a name='receive_link' href='javascript:void(0);'>Mark Received</a><a name='unreceive_link' href='javascript:void(0);'>Un-Receive</a></td>
- </td>
<td><a name='copieslink' href='javascript:void(0);'>Copies(<span name='count'>0</span>)</a></td>
<td>
<a name='noteslink' href='javascript:void(0);'>Notes(<span name='notes_count'>0</span>)</a><span name="notes_alert_flag"></span>
</td>
+ <td>
+ <select name='actions'>
+ <option name='action_none'>-- Actions --</option>
+ <option name='action_mark_recv' disabled='disabled'>Mark Received</option>
+ <option name='action_mark_unrecv' disabled='disabled'>Un-Receive</option>
+ <option name='action_update_barcodes' disabled='disabled'>Update Barcodes</option>
+ <option name='action_holdings_maint' disabled='disabled'>Holdings Maint.</option>
+ <option name='action_new_invoice' disabled='disabled'>New Invoice</option>
+ <option name='action_link_invoice' disabled='disabled'>Link to Invoice</option>
+ <option name='action_view_invoice' disabled='disabled'>View Invoice(s)</option>
+ </select>
+ </td>
<td><span name='li_state'></span></td>
<td><input type='text' size='8' name='price'/></td>
</tr>