use OpenILS::WWW::EGCatLoader::Account;
use OpenILS::WWW::EGCatLoader::Browse;
use OpenILS::WWW::EGCatLoader::Library;
+use OpenILS::WWW::EGCatLoader::Tattler;
use OpenILS::WWW::EGCatLoader::Search;
use OpenILS::WWW::EGCatLoader::Record;
use OpenILS::WWW::EGCatLoader::Container;
# Everything below here requires SSL
# ----------------------------------------------------------------
return $self->redirect_ssl unless $self->cgi->https;
+ return $self->update_tattle_list if $path =~ m|opac/tattler|;
return $self->load_password_reset if $path =~ m|opac/password_reset|;
return $self->load_logout if $path =~ m|opac/logout|;
return $self->load_patron_reg if $path =~ m|opac/register|;
return $self->load_myopac_reservations if $path =~ m|opac/myopac/reservations|;
return $self->load_sms_cn if $path =~ m|opac/sms_cn|;
+
return Apache2::Const::OK;
}
--- /dev/null
+package OpenILS::WWW::EGCatLoader;
+use strict; use warnings;
+use Apache2::Const -compile => qw(OK DECLINED FORBIDDEN HTTP_INTERNAL_SERVER_ERROR REDIRECT HTTP_BAD_REQUEST);
+use OpenSRF::Utils::JSON;
+use OpenSRF::Utils::Logger qw/$logger/;
+use OpenILS::Utils::CStoreEditor qw/:funcs/;
+use OpenILS::Utils::Fieldmapper;
+use OpenILS::Application::AppUtils;
+
+my $U = 'OpenILS::Application::AppUtils';
+
+sub update_tattle_list {
+ my $self = shift;
+ my %kwargs = @_;
+ my $ctx = $self->ctx;
+ my $cgi = $self->cgi;
+ my $usr = $ctx->{user};
+ my $permission = $usr && $self->{editor}->allowed('UPDATE_RECORD');
+ return Apache2::Const::FORBIDDEN unless $permission == 1;
+ if( $cgi->request_method eq 'POST'){
+ $self->{editor}->xact_begin;
+ my $sysID = $cgi->param('systemID');
+ my $report = $cgi->param('reportName');
+ $ctx->{report} = $report;
+ $ctx->{copies} = [];
+ my @copy_array = $cgi->param("copyID[]");
+ $ctx->{copies} = [@copy_array];
+ foreach(@copy_array){
+ my $rec = Fieldmapper::tattler::ignore_list->new;
+ $logger->info("Adding Copy ".$_." to tattler ignore list for ".$report." at system ".$sysID);
+ $rec->org_unit($sysID);
+ $rec->target_copy($_);
+ $rec->report_name($report);
+ $self->{editor}->create_tattler_ignore_list($rec);
+ }
+ $self->{editor}->xact_commit;
+ }
+ return Apache2::Const::OK;
+}
+
+1;
\ No newline at end of file