[% IF ctx.has_perm('UPDATE_COPY', copy_info.circ_lib)
OR ctx.has_perm('UPDATE_COPY', copy_info.call_number_owning_lib) %]
<span> | </span>
- <!-- XXX: copy edit is not yet supported in browser client.
- Enable this link when available
- -->
- <!--
- <a href="[% ctx.base_path %]/staff/cat/item/[% copy_info.id %]/edit">[% l('edit') %]</a>
- -->
+ <a target="_blank" href="[% ctx.base_path %]/staff/cat/item/[% copy_info.id %]/edit">[% l('edit') %]</a>
[% END %]
[% ELSE %]
<a onclick="xulG.new_tab(xulG.urls.XUL_COPY_STATUS, {}, {'from_item_details_new': true, 'barcodes': ['[%- copy_info.barcode | html | replace('\'', '\\\'') -%]']})"
$scope.tab = $routeParams.tab || 'summary';
$scope.context.page = 'detail';
+ $scope.edit = false;
+ if ($scope.tab == 'edit') {
+ $scope.tab = 'summary';
+ $scope.edit = true;
+ }
+
+
// use the cached record info
if (itemSvc.copy)
$scope.summaryRecord = itemSvc.copy.call_number().record();
$scope.triggered_events_url = url;
$scope.funcs = {};
}
+
+ if ($scope.edit) {
+ egCore.net.request(
+ 'open-ils.actor',
+ 'open-ils.actor.anon_cache.set_value',
+ null, 'edit-these-copies', {
+ record_id: $scope.recordId,
+ copies: [copyId],
+ hide_vols : true,
+ hide_copies : false
+ }
+ ).then(function(key) {
+ if (key) {
+ var url = egCore.env.basePath + 'cat/volcopy/' + key;
+ $window.location.href = url;
+ } else {
+ alert('Could not create anonymous cache key!');
+ }
+ });
+ }
+
+ return;
}
$scope.context.toggleDisplay = function() {