[open-ils-commits] r11435 - in trunk/Open-ILS/src: . perlmods/OpenILS/Application/Storage/Publisher support-scripts
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Dec 5 23:08:23 EST 2008
Author: miker
Date: 2008-12-05 23:08:21 -0500 (Fri, 05 Dec 2008)
New Revision: 11435
Added:
trunk/Open-ILS/src/support-scripts/juv_to_adult.srfsh
Modified:
trunk/Open-ILS/src/Makefile.am
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm
Log:
adding script to set juvenile flag to false
Modified: trunk/Open-ILS/src/Makefile.am
===================================================================
--- trunk/Open-ILS/src/Makefile.am 2008-12-06 03:54:15 UTC (rev 11434)
+++ trunk/Open-ILS/src/Makefile.am 2008-12-06 04:08:21 UTC (rev 11435)
@@ -76,6 +76,7 @@
$(supportscr)/fine_generator.pl \
$(supportscr)/hold_targeter.pl \
$(supportscr)/reshelving_complete.srfsh \
+ $(supportscr)/juv_to_adult.srfsh \
$(supportscr)/thaw_expired_frozen_holds.srfsh \
$(supportscr)/long-overdue-status-update.pl \
$(srcdir)/extras/openurl_map.pl
@@ -222,6 +223,7 @@
sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/autogen.sh'
sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@bindir@/autogen.sh'
sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/reshelving_complete.srfsh'
+ sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/juv_to_adult.srfsh'
sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@bindir@/long-overdue-status-update.pl'
sed -i 's|BINDIR|@bindir@|g' '$(DESTDIR)@bindir@/thaw_expired_frozen_holds.srfsh'
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm 2008-12-06 03:54:15 UTC (rev 11434)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm 2008-12-06 04:08:21 UTC (rev 11435)
@@ -23,6 +23,28 @@
method => 'new_usergroup_id',
);
+sub juv_to_adult {
+ my $self = shift;
+ my $client = shift;
+ my $adult_age = shift;
+
+ my $sql = <<" SQL";
+ UPDATE actor.usr
+ SET juvenile = FALSE
+ WHERE AGE(dob) > ?::INTERVAL;
+ SQL
+
+ my $sth = actor::user->db_Main->prepare_cached($sql);
+ $sth->execute($adult_age);
+
+ return $sth->rows;
+}
+__PACKAGE__->register_method(
+ api_name => 'open-ils.storage.actor.user.juvenile_to_adult',
+ api_level => 1,
+ method => 'juv_to_adult',
+);
+
sub usr_total_owed {
my $self = shift;
my $client = shift;
Added: trunk/Open-ILS/src/support-scripts/juv_to_adult.srfsh
===================================================================
--- trunk/Open-ILS/src/support-scripts/juv_to_adult.srfsh (rev 0)
+++ trunk/Open-ILS/src/support-scripts/juv_to_adult.srfsh 2008-12-06 04:08:21 UTC (rev 11435)
@@ -0,0 +1,2 @@
+#!BINDIR/srfsh
+request open-ils.storage open-ils.storage.actor.user.juvenile_to_adult "18 years"
Property changes on: trunk/Open-ILS/src/support-scripts/juv_to_adult.srfsh
___________________________________________________________________
Name: svn:executable
+ *
More information about the open-ils-commits
mailing list