From 2da72f9b1bcfa7ae6cfe3990497282a8ec2d5249 Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 9 Jun 2008 21:30:18 +0000 Subject: [PATCH] undelete for bib records. This is local chrome, so need to deploy a new staff client to see this functionality git-svn-id: svn://svn.open-ils.org/ILS/trunk@9805 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 2 ++ .../staff_client/chrome/content/cat/opac.js | 19 +++++++++++++++++++ .../staff_client/chrome/content/cat/opac.xul | 1 + .../chrome/content/main/constants.js | 1 + .../chrome/locale/en-US/offline.properties | 5 +++++ 5 files changed, 28 insertions(+) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index c9dd4484b5..36dded85fc 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -236,6 +236,8 @@ + + diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js index b11012d3aa..1d539fa5b1 100644 --- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js +++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js @@ -248,6 +248,25 @@ function delete_record() { } } +function undelete_record() { + if (g.error.yns_alert( + document.getElementById('offlineStrings').getFormattedString('cat.opac.undelete_record.confirm', [docid]), + document.getElementById('offlineStrings').getString('cat.opac.undelete_record'), + document.getElementById('offlineStrings').getString('cat.opac.undelete'), + document.getElementById('offlineStrings').getString('cat.opac.cancel'), + null, + document.getElementById('offlineStrings').getString('cat.opac.record_undeleted.confirm')) == 0) { + + var robj = g.network.simple_request('FM_BRE_UNDELETE',[ses(),docid]); + if (typeof robj.ilsevent != 'undefined') { + alert(document.getElementById('offlineStrings').getFormattedString('cat.opac.record_undeleted.error', [docid, robj.textcode, robj.desc]) + '\n'); + } else { + alert(document.getElementById('offlineStrings').getString('cat.opac.record_undeleted')); + refresh_display(docid,true); + } + } +} + function refresh_display(id,reset) { try { while(top_pane.node.lastChild) top_pane.node.removeChild( top_pane.node.lastChild ); diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul b/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul index 8ecf5ddf3c..f147eba7b9 100644 --- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul +++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul @@ -53,6 +53,7 @@ + diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index f6ae1ea291..c3ff848f66 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -137,6 +137,7 @@ const api = { 'FM_BRE_ID_SEARCH_VIA_MULTICLASS_QUERY' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.multiclass.query.staff' }, 'FM_BRE_ID_SEARCH_VIA_TCN' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.tcn', 'secure' : false }, 'FM_BRE_DELETE' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record_entry.delete', 'secure' : false }, + 'FM_BRE_UNDELETE' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record_entry.undelete', 'secure' : false }, 'FM_BRN_FROM_MARCXML' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.z3950.marcxml_to_brn', 'secure' : false }, 'FM_CCS_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.config.copy_status.retrieve.all', 'secure' : false }, 'FM_CIRC_DETAILS' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.fleshed.retrieve' }, diff --git a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties index 35b1cd203c..0c34ac0ca2 100644 --- a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties +++ b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties @@ -18,9 +18,14 @@ cat.bib_record=Bib Record: %1$s cat.opac.delete_record.confirm=Are you sure you want to delete title record #%1$s from the catalog? cat.opac.delete_record=Delete Record cat.opac.delete=Delete +cat.opac.undelete_record.confirm=Are you sure you want to undelete title record #%1$s from the catalog? +cat.opac.undelete_record=Undelete Record +cat.opac.undelete=Undelete cat.opac.cancel=Cancel cat.opac.record_deleted=Record deleted. cat.opac.record_deleted.confirm=Check here to confirm this action. +cat.opac.record_undeleted=Record undeleted. +cat.opac.record_undeleted.confirm=Check here to confirm this action. # variables: document ID, error code, error description cat.opac.record_delete.error=Error deleting record #%1$s : %2$s : %3$s cat.save_record=Save Record -- 2.43.2