From 9c2852631f2616138581293a3fa8449dec5148f1 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Mon, 20 Apr 2015 16:38:13 -0400 Subject: [PATCH] webstaff: Integrate Monograph Parts UI Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- .../src/templates/staff/cat/catalog/t_catalog.tt2 | 8 ++++++++ .../web/js/ui/default/staff/cat/catalog/app.js | 23 +++++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2 b/Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2 index 872a6cc506..3dc6fd2980 100644 --- a/Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2 +++ b/Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2 @@ -44,6 +44,11 @@ [% l('View Holds') %] +
  • + + [% l('Monograph Parts') %] + +
  • @@ -65,5 +70,8 @@
    [% INCLUDE 'staff/cat/catalog/t_holds.tt2' %]
    +
    + +
    diff --git a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js index 6fa704b2da..437f62c7d1 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js @@ -160,12 +160,14 @@ function($scope , $routeParams , $location , $q , egCore , egHolds, // will hold a ref to the opac iframe $scope.opac_iframe = null; + $scope.parts_iframe = null; + $scope.in_opac_call = false; $scope.opac_call = function (opac_frame_function, force_opac_tab) { if ($scope.opac_iframe) { if (force_opac_tab) $scope.record_tab = 'catalog'; $scope.in_opac_call = true; - $scope.opac_iframe.contentWindow[opac_frame_function](); + $scope.opac_iframe.dom.contentWindow[opac_frame_function](); } } @@ -173,11 +175,12 @@ function($scope , $routeParams , $location , $q , egCore , egHolds, $scope.$watch('stop_unload', function(newVal, oldVal) { if (newVal && newVal != oldVal && $scope.opac_iframe) { - $($scope.opac_iframe.contentWindow).on('beforeunload', function(){ + $($scope.opac_iframe.dom.contentWindow).on('beforeunload', function(){ return 'There is unsaved data in this record.' }); } else { - $($scope.opac_iframe.contentWindow).off('beforeunload'); + if ($scope.opac_iframe) + $($scope.opac_iframe.dom.contentWindow).off('beforeunload'); } } ); @@ -198,6 +201,7 @@ function($scope , $routeParams , $location , $q , egCore , egHolds, if (match) { $scope.record_id = match[1]; egCore.hatch.setLocalItem("eg.cat.last_record_retrieved", $scope.record_id); + init_parts_url(); } else { delete $scope.record_id; $scope.from_route = false; @@ -334,11 +338,24 @@ function($scope , $routeParams , $location , $q , egCore , egHolds, $scope.catalog_url = url; } + function init_parts_url() { + $scope.parts_url = $location + .absUrl() + .replace( + /\/staff.*/, + '/conify/global/biblio/monograph_part?r='+$scope.record_id + ); + } + $scope.set_record_tab = function(tab) { $scope.record_tab = tab; switch(tab) { + case 'monoparts': + init_parts_url(); + break; + case 'catalog': init_cat_url(); break; -- 2.11.0