From 817688fe8291da7bb6c1cf1ced75403427711f53 Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 20 Apr 2006 03:49:44 +0000 Subject: [PATCH] adding hours of operation git-svn-id: svn://svn.open-ils.org/ILS/trunk@3760 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/cgi-bin/lib-setup.cgi | 66 +++++++++++++++++-- .../OpenILS/Application/Storage/CDBI/actor.pm | 10 +++ .../Application/Storage/Driver/Pg/dbi.pm | 5 ++ Open-ILS/src/sql/Pg/005.schema.actors.sql | 18 +++++ 4 files changed, 94 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/cgi-bin/lib-setup.cgi b/Open-ILS/src/cgi-bin/lib-setup.cgi index 9be5b20c3f..4e54f5ef49 100755 --- a/Open-ILS/src/cgi-bin/lib-setup.cgi +++ b/Open-ILS/src/cgi-bin/lib-setup.cgi @@ -1,6 +1,7 @@ #!/usr/bin/perl use strict; +use DateTime; use OpenILS::Application::Storage; use OpenILS::Application::Storage::CDBI; @@ -9,11 +10,13 @@ use OpenILS::Application::Storage::Driver::Pg; use CGI qw/:standard start_*/; our %config; -do '##CONFIG##/live-db-setup.pl'; +#do '##CONFIG##/live-db-setup.pl'; +do '/openils/conf/live-db-setup.pl'; OpenILS::Application::Storage::CDBI->connection($config{dsn},$config{usr},$config{pw}); OpenILS::Application::Storage::CDBI->db_Main->{ AutoCommit } = 1; + my $cgi = new CGI; #------------------------------------------------------------------------------- @@ -34,6 +37,14 @@ if (my $action = $cgi->param('action')) { } $u->update; } + } elsif ( $action eq 'Update Hours' ) { + for my $id ( ($cgi->param('id')) ) { + my $hoo = actor::org_unit::hours_of_operation->retrieve($id); + for my $col ( $hoo->columns('Essential') ) { + $hoo->$col( $cgi->param($col) ); + } + $hoo->update; + } } elsif ( $action eq 'Add New' ) { actor::org_unit->create( { map { defined($cgi->param($_)) ? ($_ => $cgi->param($_)) : () } keys %org_cols } ); } elsif ( $action eq 'Save Address' ) { @@ -162,7 +173,7 @@ for my $lib ( actor::org_unit->search( {parent_ou=>undef} ) ) { $name =~ s/'/\\'/og; $top = $lib->id; print <<" HEADER"; -
+