$class = 'rof' if $type eq 'output';
my $flesh = {
flesh => 1,
- flesh_fields => { $class => ['owner', 'share_with']},
- order_by => { $class => 'name ASC'}
+ flesh_fields => { $class => ['owner', 'share_with']},
+ order_by => { $class => 'name ASC'}
};
my $meth = "search_reporter_${type}_folder";
my $fs2 = $e->$meth(
[
{
- shared => 't',
- share_with => \@orgs,
- owner => { '!=' => $e->requestor->id }
- },
+ shared => 't',
+ share_with => \@orgs,
+ owner => { '!=' => $e->requestor->id }
+ },
$flesh
]
);
$class = 'rt' if $type eq 'template';
my $flesh = {
flesh => 1,
- flesh_fields => { $class => ['owner']},
- order_by => { $class => 'create_time DESC'}
+ flesh_fields => { $class => ['owner']},
+ order_by => { $class => 'create_time DESC'}
};
$flesh->{limit} = $limit if $limit;
- return $e->$meth([{ folder => $folderid }, $flesh]);
+ return $e->$meth([{ folder => $folderid }, $flesh]);
}
__PACKAGE__->register_method(
my $search = { folder => $folderId };
my $query = [
{ folder => $folderId },
- {
+ {
order_by => { rs => 'run_time DESC' } ,
flesh => 1,
flesh_fields => { rs => ['report'] }
return $e->die_event unless $e->allowed('RUN_REPORTS');
$template->owner($e->requestor->id);
- my $existing = $e->search_reporter_template( {owner=>$template->owner,
+ my $existing = $e->search_reporter_template( {owner=>$template->owner,
folder=>$template->folder, name=>$template->name},{idlist=>1});
return OpenILS::Event->new('REPORT_TEMPLATE_EXISTS') if @$existing;
-
+
__PACKAGE__->register_method(
api_name => 'open-ils.reporter.report.create',
return $e->die_event unless $e->allowed('RUN_REPORTS');
$report->owner($e->requestor->id);
- my $existing = $e->search_reporter_report( {owner=>$report->owner,
+ my $existing = $e->search_reporter_report( {owner=>$report->owner,
folder=>$report->folder, name=>$report->name},{idlist=>1});
return OpenILS::Event->new('REPORT_REPORT_EXISTS') if @$existing;
my $e = new_rstore_editor(authtoken=>$auth);
return $e->event unless $e->checkauth;
return $e->event unless $e->allowed('RUN_REPORTS');
- my $t = $e->retrieve_reporter_template($id)
+ my $t = $e->retrieve_reporter_template($id)
or return $e->event;
return $t;
}
my $e = new_rstore_editor(authtoken=>$auth);
return $e->event unless $e->checkauth;
return $e->event unless $e->allowed('RUN_REPORTS');
- my $r = $e->retrieve_reporter_report($id)
+ my $r = $e->retrieve_reporter_report($id)
or return $e->event;
return $r;
}
}
# fetch all reports attached to this template that
- # do not belong to $owner. If there are any, we can't
+ # do not belong to $owner. If there are any, we can't
# delete the template
my $alt_reports = $e->search_reporter_report(
{template=>$templateId, owner=>{"!=" => $owner}},{idlist=>1});
- # all_rpts_deleted will be false if a report has an
+ # all_rpts_deleted will be false if a report has an
# attached scheduled owned by a different user
return 1 if @$alt_reports or not $all_rpts_deleted;
- $e->delete_reporter_template($template)
+ $e->delete_reporter_template($template)
or return $e->die_event;
return 2;
}
}
# fetch all schedules attached to this report that
- # do not belong to $owner. If there are any, we can't
+ # do not belong to $owner. If there are any, we can't
# delete the report
my $alt_scheds = $e->search_reporter_schedule(
{report=>$reportId, runner=>{"!=" => $owner}},{idlist=>1});
return 1 if @$alt_scheds;
- $e->delete_reporter_report($report)
+ $e->delete_reporter_report($report)
or return $e->die_event;
return 2;
# }
# Find the class the iplements the given hint
- my ($class) = grep {
+ my ($class) = grep {
$Fieldmapper::fieldmap->{$_}{hint} eq $hint } Fieldmapper->classes;
return undef unless $class->Selector;
$class =~ s/Fieldmapper:://og;
$class =~ s/::/_/og;
-
+
my $method;
my $margs;