added method to determine if a report has attached schedule objects
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 4 Oct 2006 22:41:39 +0000 (22:41 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 4 Oct 2006 22:41:39 +0000 (22:41 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6389 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Reporter.pm

index 052c28f..f92e811 100644 (file)
@@ -344,6 +344,20 @@ sub has_reports {
        return 0;
 }
 
+__PACKAGE__->register_method(
+       api_name => 'open-ils.reporter.report_has_output',
+       method => 'has_output');
+sub has_output {
+       my( $self, $conn, $auth, $reportId ) = @_;
+       my $e = new_rstore_editor(authtoken=>$auth);
+       return $e->die_event unless $e->checkauth;
+       return $e->die_event unless $e->allowed('RUN_REPORTS');
+       my $outs = $e->search_reporter_schedule({report=>$reportId},{idlist=>1});
+       return 1 if @$outs;
+       return 0;
+}
+
+
 
 __PACKAGE__->register_method(
        method => 'org_full_path',