From 7e7c3826846790b4ada839201473f1e259f56f80 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 15 Jun 2007 21:52:49 +0000 Subject: [PATCH] forward porting: added method to check on an existing report with the given name in the given folder git-svn-id: svn://svn.open-ils.org/ILS/trunk@7439 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/perlmods/OpenILS/Application/Reporter.pm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Reporter.pm b/Open-ILS/src/perlmods/OpenILS/Application/Reporter.pm index 43eb35eb15..915c35dd45 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Reporter.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Reporter.pm @@ -32,6 +32,28 @@ sub create_folder { __PACKAGE__->register_method( + api_name => 'open-ils.reporter.report.exists', + method => 'report_exists', + notes => q/ + Returns 1 if a report with the given name and folder already exists. + / +); + +sub report_exists { + my( $self, $conn, $auth, $report ) = @_; + + my $e = new_rstore_editor(authtoken=>$auth); + return $e->event unless $e->checkauth; + return $e->event unless $e->allowed('RUN_REPORTS'); + + my $existing = $e->search_reporter_report( + {folder=>$report->folder, name=>$report->name}); + return 1 if @$existing; + return 0; +} + + +__PACKAGE__->register_method( api_name => 'open-ils.reporter.folder.visible.retrieve', method => 'retrieve_visible_folders' ); -- 2.11.0