}
+__PACKAGE__->register_method(
+ method => "retrieve_lineitem_by_copy_id",
+ api_name => "open-ils.acq.lineitem.retrieve.by_copy_id",
+ signature => {
+ desc => q/Manage lineitem notes/,
+ params => [
+ {desc => "Authentication token", type => "string"},
+ {desc => "Evergreen internal copy ID", type => "number"},
+ {desc => "Hash of options (see open-ils.acq.lineitem.retrieve",
+ type => "object"}
+ ],
+ return => {
+ desc => "Lineitem associated with given copy",
+ type => "object", class => "jub"
+ }
+ }
+);
+
+sub retrieve_lineitem_by_copy_id {
+ my ($self, $conn, $auth, $object_id, $options) = @_;
+
+ my $e = new_editor("authtoken" => $auth);
+ return $e->die_event unless $e->checkauth;
+
+ my $result = $e->json_query({
+ "select" => {"acqlid" => ["lineitem"]},
+ "from" => "acqlid",
+ "where" => {"eg_copy_id" => $object_id}
+ })->[0] or do {
+ $e->disconnect;
+ return new OpenILS::Event("ACQ_LINEITEM_NOT_FOUND");
+ };
+
+ my $li = retrieve_lineitem_impl($e, $result->{"lineitem"}, $options) or
+ return $e->die_event;
+
+ $e->disconnect;
+ return $li;
+}
+
1;
oncomplete : function() {
dojo.byId("acq-po-view-total-estimated").innerHTML = totalEstimated.toFixed(2);
+ if (liFocus) liTable.drawCopies(liFocus);
}
}
);
<!ENTITY staff.circ.copy_status_overlay.cmd_book_item_now.accesskey "N">
<!ENTITY staff.circ.copy_status_overlay.cmd_create_brt.label "Make Item Bookable">
<!ENTITY staff.circ.copy_status_overlay.cmd_create_brt.accesskey "K">
+<!ENTITY staff.circ.copy_status_overlay.cmd_find_acq_po.label "Find Originating Acquisition">
+<!ENTITY staff.circ.copy_status_overlay.cmd_find_acq_po.accesskey "F">
<!ENTITY staff.circ.copy_status_overlay.sel_edit.label "Edit Item Attributes">
<!ENTITY staff.circ.copy_status_overlay.sel_edit.accesskey "E">
<!ENTITY staff.circ.copy_status_overlay.sel_mark_items_damaged.label "Mark Item Damaged">
</div>
</div>
<script type="text/javascript">
- var [poId, liFocus] = "[% ctx.page_args.0 %]".split(",");
+ var poId = "[% ctx.page_args.1 %]";
+ var liFocus = "[% ctx.page_args.0 %]";
+ if (liFocus && !poId) {
+ poId = liFocus;
+ liFocus = null;
+ }
</script>
[% INCLUDE 'default/acq/common/li_table.tt2' %]
[% INCLUDE "default/acq/common/notes.tt2" which = "Po" %]
'CONIFY' : '/conify/' + LOCALE + '/global',
'EG_WEB_BASE' : '/eg',
'XUL_LOCAL_ADMIN_BASE' : '/xul/server/admin',
- 'XUL_REPORTS' : '/reports/oils_rpt.xhtml'
+ 'XUL_REPORTS' : '/reports/oils_rpt.xhtml',
+ 'EG_ACQ_PO_VIEW' : '/eg/acq/po/view'
}
obj.controller.view.cmd_triggered_events.setAttribute('disabled','true');
obj.controller.view.cmd_create_brt.setAttribute('disabled','true');
obj.controller.view.cmd_book_item_now.setAttribute('disabled','true');
+ obj.controller.view.cmd_find_acq_po.setAttribute('disabled','true');
obj.controller.view.sel_spine.setAttribute('disabled','true');
obj.controller.view.sel_transit_abort.setAttribute('disabled','true');
obj.controller.view.sel_clip.setAttribute('disabled','true');
obj.controller.view.cmd_book_item_now.setAttribute('disabled','true');
}
obj.controller.view.cmd_create_brt.setAttribute('disabled','false');
+ obj.controller.view.cmd_find_acq_po.setAttribute("disabled", obj.selection_list.length == 1 ? "false" : "true");
obj.controller.view.sel_spine.setAttribute('disabled','false');
obj.controller.view.sel_transit_abort.setAttribute('disabled','false');
obj.controller.view.sel_clip.setAttribute('disabled','false');
}
}
],
+ "cmd_find_acq_po" : [
+ ["command"],
+ function() {
+ JSAN.use("circ.util");
+ circ.util.find_acq_po(
+ ses(), obj.selection_list[0].copy_id
+ );
+ }
+ ],
'sel_checkin' : [
['command'],
function() {
<command id="cmd_alt_view" />
<command id="cmd_triggered_events" />
<command id="save_columns" />
+ <command id="cmd_find_acq_po" disabled="true"/>
<command id="cmd_create_brt" disabled="true"/>
<command id="cmd_book_item_now" disabled="true"/>
<command id="sel_copy_details" disabled="true"/>
<menuitem command="cmd_create_brt" label="&staff.circ.copy_status_overlay.cmd_create_brt.label;" accesskey="&staff.circ.copy_status_overlay.cmd_create_brt.accesskey;"/>
<menuitem command="cmd_book_item_now" label="&staff.circ.copy_status_overlay.cmd_book_item_now.label;" accesskey="&staff.circ.copy_status_overlay.cmd_book_item_now.accesskey;"/>
<menuseparator/>
+ <menuitem command="cmd_find_acq_po" label="&staff.circ.copy_status_overlay.cmd_find_acq_po.label;" accesskey="&staff.circ.copy_status_overlay.cmd_find_acq_po.accesskey;"/>
+ <menuseparator/>
<menuitem command="sel_edit" label="&staff.circ.copy_status_overlay.sel_edit.label;" accesskey="&staff.circ.copy_status_overlay.sel_edit.accesskey;" />
<menuseparator/>
<menuitem command="sel_mark_items_damaged" label="&staff.circ.copy_status_overlay.sel_mark_items_damaged.label;" accesskey="&staff.circ.copy_status_overlay.sel_mark_items_damaged.accesskey;"/>
<menuitem command="cmd_create_brt" label="&staff.circ.copy_status_overlay.cmd_create_brt.label;" accesskey="&staff.circ.copy_status_overlay.cmd_create_brt.accesskey;"/>
<menuitem command="cmd_book_item_now" label="&staff.circ.copy_status_overlay.cmd_book_item_now.label;" accesskey="&staff.circ.copy_status_overlay.cmd_book_item_now.accesskey;"/>
<menuseparator />
+ <menuitem command="cmd_find_acq_po" label="&staff.circ.copy_status_overlay.cmd_find_acq_po.label;" accesskey="&staff.circ.copy_status_overlay.cmd_find_acq_po.accesskey;"/>
+ <menuseparator/>
<menuitem command="sel_edit" label="&staff.circ.copy_status_overlay.sel_edit.label;" accesskey="&staff.circ.copy_status_overlay.sel_edit.accesskey;" />
<menuseparator />
<menuitem command="sel_mark_items_damaged" label="&staff.circ.copy_status_overlay.sel_mark_items_damaged.label;" accesskey="&staff.circ.copy_status_overlay.sel_mark_items_damaged.accesskey;"/>
}
};
+circ.util.find_acq_po = function(session, copy_id) {
+ dojo.require("openils.Util");
+ fieldmapper.standardRequest(
+ ["open-ils.acq", "open-ils.acq.lineitem.retrieve.by_copy_id"], {
+ "params": [session, copy_id, {"clear_marc": true}],
+ "onresponse": function(r) {
+ if (r = openils.Util.readResponse(r)) {
+ if (r.purchase_order()) {
+ /* XXX would prefer to use browser.xul to wrap this so
+ * that we get back/forward/reload buttons, but that
+ * doesn't work in this context. need to find out why.
+ */
+ xulG.new_tab(
+ urls.EG_ACQ_PO_VIEW +
+ "/" + r.purchase_order() + "/" + r.id(),
+ {}, {}
+ );
+ } else {
+ /* unlikely: got an LI with no PO */
+ alert(dojo.byId("circStrings").getFormattedString(
+ "staff.circ.utils.find_acq_po.no_po", [r.id()]
+ ));
+ }
+ }
+ }
+ }
+ );
+};
+
dump('exiting circ/util.js\n');
staff.circ.utils.potential_copies=Potential Copies
staff.circ.utils.queue_position=Queue Position
staff.circ.utils.total_holds=Total Number of Holds
+staff.circ.utils.find_acq_po.no_po=Lineitem found (%1$s), but without purchase order
staff.circ.work_log_column.message=Message
staff.circ.work_log_column.when=When
# 1 - Staff Username 2 - Patron Family 3 - Patron Barcode 4 - Item Barcode