From: dbs Date: Mon, 13 Sep 2010 21:18:45 +0000 (+0000) Subject: Merge r17574, r17575, r17584, r17585, r17628, r17639 from trunk to delete deprecated... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fbb6b2808b24030ef7c914bfad8c18d1e37c5f35;p=evergreen%2Fjoelewis.git Merge r17574, r17575, r17584, r17585, r17628, r17639 from trunk to delete deprecated cgi-bin configuration interfaces The CGI interfaces have not been maintained; the interfaces available through the Admin -> Server Administration menu in the staff client are the recommended method for setting up new libraries in the organizational hierarchy, permissions, copy statuses, and circulation rules. Note that an adjustment to eg.conf is recommended to point to the offline.pl script, which is the only remaining CGI script in use; this should avoid conflicting Apache definitions for the /cgi-bin/ alias. Most modern systems will install Class::DBI::Frozen::301 to avoid conflicts with incompatible Class::DBI packages. We need to teach offline.pl how to use Class::DBI::Frozen::301 if it is available. Note that we're using "use parent" instead of "use base" per the recommendation of "perldoc base"; accordingly, we're adding the system prerequisite for the parent pragma. git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@17642 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/examples/apache/eg.conf b/Open-ILS/examples/apache/eg.conf index 17eb787bc7..243e1b88d8 100644 --- a/Open-ILS/examples/apache/eg.conf +++ b/Open-ILS/examples/apache/eg.conf @@ -53,8 +53,8 @@ AliasMatch ^/opac/.*/extras/selfcheck/(.*) /openils/var/web/opac/extras/selfchec # ---------------------------------------------------------------------------------- # System config CGI scripts go here # ---------------------------------------------------------------------------------- -Alias /cgi-bin/ "/openils/var/cgi-bin/" - +Alias /cgi-bin/offline/ "/openils/var/cgi-bin/offline/" + AddHandler cgi-script .cgi .pl AllowOverride None Options None diff --git a/Open-ILS/src/cgi-bin/circ-rules.cgi b/Open-ILS/src/cgi-bin/circ-rules.cgi deleted file mode 100755 index d65c39fb58..0000000000 --- a/Open-ILS/src/cgi-bin/circ-rules.cgi +++ /dev/null @@ -1,308 +0,0 @@ -#!/usr/bin/perl -w -# vim:noet:ts=4 -use strict; - -use OpenILS::Application::Storage; -use OpenILS::Application::Storage::CDBI; - -# I need to abstract the driver loading away... -use OpenILS::Application::Storage::Driver::Pg; - -use CGI qw/:standard start_*/; - -our %config; -do '##CONFIG##/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; - -#------------------------------------------------------------------------------- -# HTML part -#------------------------------------------------------------------------------- - -print < - - - - - - - - -Home - -

Configure Circulation Rules

-
- -HEADER - -#------------------------------------------------------------------------------- -# setup part -#------------------------------------------------------------------------------- - -my %dur_cols = ( - name => "Name", - extended => "Extended", - normal => "Normal", - shrt => "Short", - max_renewals => "Max Renewals", -); - -my @dur_display_order = ( qw/name normal extended shrt max_renewals/ ); - -my %fine_cols = ( - name => "Name", - high => "High", - normal => "Normal", - low => "Low", - recurrence_interval => "Interval", -); - -my @fine_display_order = ( qw/name recurrence_interval normal high low/ ); - -my %age_cols = ( - name => "Name", - age => "Item Age", - prox => "Holdable Radius", -); - -my @age_display_order = ( qw/name age prox/ ); - -my %max_fine_cols = ( - name => "Name", - amount => "Amount", -); - -my @max_fine_display_order = ( qw/name amount/ ); - - -#------------------------------------------------------------------------------- -# Logic part -#------------------------------------------------------------------------------- - -if (my $action = $cgi->param('action')) { - my $form = $cgi->param('rules_form'); - - if ($form eq 'duration') { - if ($action eq 'Remove Selected') { - for my $id ( ($cgi->param('remove_me')) ) { - config::rules::circ_duration->retrieve($id)->delete; - } - } elsif ( $action eq 'Add New' ) { - config::rules::circ_duration->create( - { map { ($_ => $cgi->param($_)) } keys %dur_cols } - ); - } - } elsif ($form eq 'recurring_fine') { - if ($action eq 'Remove Selected') { - for my $id ( ($cgi->param('remove_me')) ) { - config::rules::recurring_fine->retrieve($id)->delete; - } - } elsif ( $action eq 'Add New' ) { - config::rules::recurring_fine->create( - { map { ($_ => $cgi->param($_)) } keys %fine_cols } - ); - } - } elsif ($form eq 'max_fine') { - if ($action eq 'Remove Selected') { - for my $id ( ($cgi->param('remove_me')) ) { - config::rules::max_fine->retrieve($id)->delete; - } - } elsif ( $action eq 'Add New' ) { - config::rules::max_fine->create( - { map { ($_ => $cgi->param($_)) } keys %max_fine_cols } - ); - } - } elsif ($form eq 'age_hold') { - if ($action eq 'Remove Selected') { - for my $id ( ($cgi->param('remove_me')) ) { - config::rules::age_hold_protect->retrieve($id)->delete; - } - } elsif ( $action eq 'Add New' ) { - config::rules::age_hold_protect->create( - { map { ($_ => $cgi->param($_)) } keys %age_cols } - ); - } - } - - -} - - -#------------------------------------------------------------------------------- -# Form part -#------------------------------------------------------------------------------- -{ - #----------------------------------------------------------------------- - # Duration form - #----------------------------------------------------------------------- - print "
". - "". - "

Circulation Duration

". - "\n"; - - for my $col ( @dur_display_order ) { - print th($dur_cols{$col}); - } - - print ""; - for my $col ( @dur_display_order ) { - print td($row->$col); - } - print "\n"; - - for my $col ( @dur_display_order ) { - print td(""); - } - - - print "
\n"; - - for my $row ( config::rules::circ_duration->retrieve_all ) { - print "
"; - } - print "
". - " | ". - "". - "

"; -} - -{ - #----------------------------------------------------------------------- - # Recurring Fine form - #----------------------------------------------------------------------- - print "
". - "". - "

Recurring Fine Levels

". - "\n"; - - for my $col ( @fine_display_order ) { - print th($fine_cols{$col}); - } - - print "\n"; - for my $col ( @fine_display_order ) { - print td($row->$col); - } - print "\n"; - - for my $col ( @fine_display_order ) { - print td(""); - } - - - print "
\n"; - - for my $row ( config::rules::recurring_fine->retrieve_all ) { - print "
"; - } - - print "
". - " | ". - "". - "

"; -} - -{ - #----------------------------------------------------------------------- - # Max Fine form - #----------------------------------------------------------------------- - print "
". - "". - "

Max Fine Levels

". - "\n"; - - for my $col ( @max_fine_display_order ) { - print th($max_fine_cols{$col}); - } - - print "\n"; - for my $col ( @max_fine_display_order ) { - print td($row->$col); - } - print "\n"; - - for my $col ( @max_fine_display_order ) { - print td(""); - } - - - print "
\n"; - - for my $row ( config::rules::max_fine->retrieve_all ) { - print "
"; - } - - print "
". - " | ". - "". - "

"; -} - -{ - #----------------------------------------------------------------------- - # Age hold protect form - #----------------------------------------------------------------------- - print "
". - "". - "

Item Age Hold Protection

". - "\n"; - - for my $col ( @age_display_order ) { - print th($age_cols{$col}); - } - - print "\n"; - for my $col ( @age_display_order ) { - print td($row->$col); - } - print "\n"; - - for my $col ( @age_display_order ) { - print td(""); - } - - - print "
\n"; - - for my $row ( config::rules::age_hold_protect->retrieve_all ) { - print "
"; - } - - print "
". - " | ". - "". - "

"; -} - - -print ""; - - diff --git a/Open-ILS/src/cgi-bin/config.cgi b/Open-ILS/src/cgi-bin/config.cgi deleted file mode 100755 index 041fb90db8..0000000000 --- a/Open-ILS/src/cgi-bin/config.cgi +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/perl -print < - - - Open-ILS Bootstrapping Scripts - - -

Open-ILS Bootstrapping Scripts

-
- - - -CGI diff --git a/Open-ILS/src/cgi-bin/copy_statuses.cgi b/Open-ILS/src/cgi-bin/copy_statuses.cgi deleted file mode 100755 index 5c5dc92dec..0000000000 --- a/Open-ILS/src/cgi-bin/copy_statuses.cgi +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/perl -use strict; -# vim:noet:ts=4 - -use OpenILS::Application::Storage; -use OpenILS::Application::Storage::CDBI; - -# I need to abstract the driver loading away... -use OpenILS::Application::Storage::Driver::Pg; - -use CGI qw/:standard start_*/; -our %config; -do '##CONFIG##/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; - -#------------------------------------------------------------------------------- -# HTML part -#------------------------------------------------------------------------------- - -print < - - - - - - - - -Home - -

Copy Status Setup

-
- -HEADER - -#------------------------------------------------------------------------------- -# setup part -#------------------------------------------------------------------------------- - -my %cs_cols = ( qw/id SysID name Name holdable Unholdable/ ); - -my @col_display_order = ( qw/id name holdable/ ); - -#------------------------------------------------------------------------------- -# Logic part -#------------------------------------------------------------------------------- - -if (my $action = $cgi->param('action')) { - if ( $action eq 'Remove Selected' ) { - for my $id ( ($cgi->param('id')) ) { - next unless ($id > 99); - config::copy_status->retrieve($id)->delete; - } - } elsif ( $action eq 'Update Selected' ) { - for my $id ( ($cgi->param('id')) ) { - my $u = config::copy_status->retrieve($id); - $u->name( $cgi->param("name_$id") ); - $u->holdable( $cgi->param("holdable_$id") ); - $u->update; - } - } elsif ( $action eq 'Add New' ) { - config::copy_status->create( { name => $cgi->param("name") } ); - } -} - - -#------------------------------------------------------------------------------- -# Form part -#------------------------------------------------------------------------------- -{ - #----------------------------------------------------------------------- - # User form - #----------------------------------------------------------------------- - print "
". - "\n"; - - for my $col ( @col_display_order ) { - print th($cs_cols{$col}); - } - - print ''; - - for my $row ( sort { $a->name cmp $b->name } (config::copy_status->retrieve_all) ) { - print Tr( - td( $row->id() ), - td(""), - td("holdable()} .">"), - td(""), - ); - } - - print "", - td(), - td(""), - td(""), - td(), - ""; - - print "
Action
"; - print " | "; - print " | "; - print "

"; -} - -print ""; - - diff --git a/Open-ILS/src/cgi-bin/lib-setup.cgi b/Open-ILS/src/cgi-bin/lib-setup.cgi deleted file mode 100755 index f93455cb10..0000000000 --- a/Open-ILS/src/cgi-bin/lib-setup.cgi +++ /dev/null @@ -1,465 +0,0 @@ -#!/usr/bin/perl -use strict; -# vim:noet:ts=4 - -use DateTime; -use OpenILS::Application::Storage; -use OpenILS::Application::Storage::CDBI; - -# I need to abstract the driver loading away... -use OpenILS::Application::Storage::Driver::Pg; - -use CGI qw/:standard start_*/; -our %config; -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; - -#------------------------------------------------------------------------------- -# setup part -#------------------------------------------------------------------------------- - -my %org_cols = ( qw/id SysID name Name parent_ou Parent ou_type OrgUnitType shortname ShortName email Email phone Phone opac_visible OPACVisible/ ); - -my @col_display_order = ( qw/id name shortname ou_type email phone opac_visible parent_ou/ ); - -if (my $action = $cgi->param('action')) { - if ( $action eq 'Update' ) { - for my $id ( ($cgi->param('id')) ) { - my $u = actor::org_unit->retrieve($id); - for my $col ( keys %org_cols ) { - next if ($cgi->param($col."_$id") =~ /Select One/o); - if ($col eq 'shortname') { - $u->$col( uc( $cgi->param($col."_$id") ) ); - } else { - $u->$col( $cgi->param($col."_$id") ); - } - } - $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($_)) ? - ( $_ eq 'shortname' ? - ($_ => uc($cgi->param($_))) : - ($_ => $cgi->param($_)) - ) : - () - } keys %org_cols - } - ); - } elsif ( $action eq 'Save Address' ) { - my $org = actor::org_unit->retrieve($cgi->param('id')); - - my $addr = {}; - - $$addr{org_unit} = $cgi->param('org_unit') || $org->id; - $$addr{street1} = $cgi->param('street1'); - $$addr{street2} = $cgi->param('street2'); - $$addr{city} = $cgi->param('city'); - $$addr{county} = $cgi->param('county'); - $$addr{state} = $cgi->param('state'); - $$addr{country} = $cgi->param('country'); - $$addr{post_code} = $cgi->param('post_code'); - - my $a_type = $cgi->param('addr_type'); - - - my $a = actor::org_address->retrieve($cgi->param('aid')); - - if ($a) { - for (keys %$addr) { - next unless $$addr{$_}; - $a->$_($$addr{$_}); - } - $a->update; - } else { - $a = actor::org_address->create( {map {defined($$addr{$_}) ? ($_ => $$addr{$_}) : ()} keys %$addr} ); - } - - $org->$a_type($a->id); - $org->update; - } -} - -#------------------------------------------------------------------------------- -# HTML part -#------------------------------------------------------------------------------- - -print < - - - - - - - - - - - -Home - -

Library Hierarchy Setup

-
-HEADER - -my $uri = $cgi->url(-relative=>1); - -my $top; -for my $lib ( actor::org_unit->search( {parent_ou=>undef} ) ) { - my $name = $lib->name; - $name =~ s/'/\\'/og; - $top = $lib->id; - print <<" HEADER"; -
- -
-
- -HEADER - -#------------------------------------------------------------------------------- -# Logic part -#------------------------------------------------------------------------------- - -if (my $action = $cgi->param('action')) { - if ( $action eq 'child' ) { - my $id = $cgi->param('id'); - if ($id) { - my $node = actor::org_unit->retrieve($id); - #----------------------------------------------------------------------- - # child form - #----------------------------------------------------------------------- - - print "

Edit ".$node->name."

"; - print "
". - "\n"; - - print Tr( - th($org_cols{id}), - td( $node->id() ), - ); - print Tr( - th($org_cols{name}), - td("name() ."\">"), - ); - print Tr( - th($org_cols{shortname}), - td(""), - ); - print Tr( - th($org_cols{ou_type}), - td(""), - ); - print Tr( - th($org_cols{email}), - td("email() ."\">"), - ); - - print Tr( - th($org_cols{phone}), - td(""), - ); - - print Tr( - th($org_cols{opac_visible} .'*'), - td("" - ), - ); - - print Tr( - th($org_cols{parent_ou}), - td(""), - ); - - print Tr( "" ); - print "
*". - "You must hide every OU you want hidden, not just an ancestor!
"; - - #------------------------------------------------------------------------- - # Hours of operation form - #------------------------------------------------------------------------- - - - - my %dow = ( - 0 => 'Monday', - 1 => 'Tuesday', - 2 => 'Wednesday', - 3 => 'Thursday', - 4 => 'Friday', - 5 => 'Saturday', - 6 => 'Sunday', - ); - - print "

Hours of Operation for ".$node->name."

". - "
". - "\n"; - - print Tr( - th('Day of Week'), - th('Open Time'), - th('Close Time'), - ); - - my $hoo = actor::org_unit::hours_of_operation->find_or_create( { id => $node->id } ); - for my $day ( 0 .. 6 ) { - my $open = "dow_${day}_open"; - my $close = "dow_${day}_close"; - - print Tr( - th($dow{$day}), - td("$open ."\">"), - td("$close ."\">"), - ); - } - - print Tr( "" - ); - print "
". - "". - "
"; - - - #------------------------------------------------------------------------- - # Address edit form - #------------------------------------------------------------------------- - - print "

Addresses for ".$node->name."

"; - print ""; - my %addrs = ( ill_address => 'ILL Address', - holds_address => 'Consortial Holds Address', - mailing_address => 'Mailing Address', - billing_address => 'Physical Address' - ); - for my $a (qw/billing_address mailing_address holds_address ill_address/) { - my $addr = actor::org_address->retrieve( $node->$a ) if ($node->$a); - - my %ah = ( street1 => $addr?$addr->street1:'', - street2 => $addr?$addr->street2:'', - city => $addr?$addr->city:'', - county => $addr?$addr->county:'', - state => $addr?$addr->state:'', - country => $addr?$addr->country:'US', - post_code => $addr?$addr->post_code:'', - org_unit => $addr?$addr->org_unit:$node->id, - id => $addr?$addr->id:'', - ); - - #print '' if ($a eq 'holds_address'); - print <<" TABLE"; - - - - TABLE - } - - print "
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$addrs{$a}
SysID
*Street 1
Street 2
*City
County
*State
*Country
*ZIP
- - - - -

New Child

"; - - print "
". - "\n"; - - print Tr( - th($org_cols{name}), - td(""), - ); - print Tr( - th($org_cols{shortname}), - td(""), - ); - print Tr( - th($org_cols{ou_type}), - td(""), - ); - print Tr( - th($org_cols{email}), - td(""), - ); - print Tr( - th($org_cols{phone}), - td(""), - ); - - print Tr( "" ); - print "
", - "

"; - } - } -} - -print "
"; - - diff --git a/Open-ILS/src/cgi-bin/org_unit_types.cgi b/Open-ILS/src/cgi-bin/org_unit_types.cgi deleted file mode 100755 index db6bedf071..0000000000 --- a/Open-ILS/src/cgi-bin/org_unit_types.cgi +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/perl -use strict; -# vim:noet:ts=4 - -use OpenILS::Application::Storage; -use OpenILS::Application::Storage::CDBI; - -# I need to abstract the driver loading away... -use OpenILS::Application::Storage::Driver::Pg; - -use CGI qw/:standard start_*/; - -our %config; -do '##CONFIG##/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; - -#------------------------------------------------------------------------------- -# HTML part -#------------------------------------------------------------------------------- - -print < - - - - - - - - -Home - -

Organizational Unit Type Setup

-
- -HEADER - -#------------------------------------------------------------------------------- -# setup part -#------------------------------------------------------------------------------- - -my %ou_cols = ( qw/id SysID name Name opac_label OpacLabel depth Depth parent ParentType can_have_vols CanHaveVolumes can_have_users CanHaveUsers/ ); - -my @col_display_order = ( qw/id name opac_label depth parent can_have_vols can_have_users/ ); - -#------------------------------------------------------------------------------- -# Logic part -#------------------------------------------------------------------------------- - -if (my $action = $cgi->param('action')) { - if ( $action eq 'Remove Selected' ) { - for my $id ( ($cgi->param('id')) ) { - actor::org_unit_type->retrieve($id)->delete; - } - } elsif ( $action eq 'Update Selected' ) { - for my $id ( ($cgi->param('id')) ) { - my $u = actor::org_unit_type->retrieve($id); - for my $col (@col_display_order) { - next if ($cgi->param($col."_$id") =~ /Select One/o); - $u->$col( $cgi->param($col."_$id") ); - } - $u->update; - } - } elsif ( $action eq 'Add New' ) { - actor::org_unit_type->create( { map {defined($cgi->param($_)) ? ($_ => $cgi->param($_)) : () } @col_display_order } ); - } -} - - -#------------------------------------------------------------------------------- -# Form part -#------------------------------------------------------------------------------- -{ - #----------------------------------------------------------------------- - # User form - #----------------------------------------------------------------------- - print "
". - "\n"; - - for my $col ( @col_display_order ) { - print th($ou_cols{$col}); - } - - print ''; - - for my $row ( sort { $a->depth <=> $b->depth } (actor::org_unit_type->retrieve_all) ) { - print Tr( - td( $row->id() ), - td(""), - td(""), - td(""), - td(""), - td("can_have_vols){"checked"}} .">"), - td("can_have_users){"checked"}} .">"), - td(""), - ); - } - - print "", - td(), - td(""), - td(""), - td(""), - td(""), - td(""), - td(""), - td(), - ""; - print "
Action
"; - print " | "; - print " | "; - print "

"; -} - -print ""; - - diff --git a/Open-ILS/src/cgi-bin/perms-setup.cgi b/Open-ILS/src/cgi-bin/perms-setup.cgi deleted file mode 100755 index b285d65313..0000000000 --- a/Open-ILS/src/cgi-bin/perms-setup.cgi +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/perl -use strict; -# vim:noet:ts=4 - -use OpenILS::Application::Storage; -use OpenILS::Application::Storage::CDBI; - -# I need to abstract the driver loading away... -use OpenILS::Application::Storage::Driver::Pg; - -use CGI qw/:standard start_*/; - -our %config; -do '##CONFIG##/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; - -#------------------------------------------------------------------------------- -# HTML part -#------------------------------------------------------------------------------- - -print < - - - - - - - - -Home - -

Permission List Setup

-
- -HEADER - -#------------------------------------------------------------------------------- -# setup part -#------------------------------------------------------------------------------- - -my %profile_cols = ( qw/id SysID code Name description Description/ ); - -my @col_display_order = ( qw/id code description/ ); - -#------------------------------------------------------------------------------- -# Logic part -#------------------------------------------------------------------------------- - -if (my $action = $cgi->param('action')) { - if ( $action eq 'Remove Selected' ) { - for my $id ( ($cgi->param('id')) ) { - permission::perm_list->retrieve($id)->delete; - } - } elsif ( $action eq 'Update Selected' ) { - for my $id ( ($cgi->param('id')) ) { - my $u = permission::perm_list->retrieve($id); - $u->code( $cgi->param("code_$id") ); - $u->description( $cgi->param("description_$id") ); - $u->update; - } - } elsif ( $action eq 'Add New' ) { - permission::perm_list->create( - { code => $cgi->param("code"), - description => $cgi->param("description") - } - ); - } -} - - -#------------------------------------------------------------------------------- -# Form part -#------------------------------------------------------------------------------- -{ - #----------------------------------------------------------------------- - # User form - #----------------------------------------------------------------------- - print "
". - "\n"; - - for my $col ( @col_display_order ) { - print th($profile_cols{$col}); - } - - print ''; - - for my $row ( sort { $a->code cmp $b->code } (permission::perm_list->retrieve_all) ) { - print Tr( - td( $row->id() ), - td(""), - td(""), - td(""), - ); - } - - print "", - td(), - td(""), - td(""), - td(), - ""; - print "
Action
"; - print " | "; - print " | "; - print "

"; -} - -print ""; - - diff --git a/Open-ILS/src/cgi-bin/support/base.gif b/Open-ILS/src/cgi-bin/support/base.gif deleted file mode 100644 index 9ac0b117b0..0000000000 Binary files a/Open-ILS/src/cgi-bin/support/base.gif and /dev/null differ diff --git a/Open-ILS/src/cgi-bin/support/cd.gif b/Open-ILS/src/cgi-bin/support/cd.gif deleted file mode 100644 index 7503819404..0000000000 Binary files a/Open-ILS/src/cgi-bin/support/cd.gif and /dev/null differ diff --git a/Open-ILS/src/cgi-bin/support/dtree.js b/Open-ILS/src/cgi-bin/support/dtree.js deleted file mode 100644 index 57dd30d07c..0000000000 --- a/Open-ILS/src/cgi-bin/support/dtree.js +++ /dev/null @@ -1,324 +0,0 @@ -/*--------------------------------------------------| -| dTree 2.05 | www.destroydrop.com/javascript/tree/ | -|---------------------------------------------------| -| Copyright (c) 2002-2003 Geir Landrö | -| | -| This script can be used freely as long as all | -| copyright messages are intact. | -| | -| Updated: 17.04.2003 | -|--------------------------------------------------*/ - -function Node(id, pid, name, url, title, target, icon, iconOpen, open) { - this.id = id; - this.pid = pid; - this.name = name; - this.url = url; - this.title = title; - this.target = target; - this.icon = icon; - this.iconOpen = iconOpen; - this._io = open || false; - this._is = false; - this._ls = false; - this._hc = false; - this._ai = 0; - this._p; -}; - -function dTree(objName) { - this.config = { - target : null, - folderLinks : true, - useSelection : true, - useCookies : true, - useLines : true, - useIcons : true, - useStatusText : false, - closeSameLevel : false, - inOrder : false - } - this.icon = { - root : 'support/base.gif', - folder : 'support/folder.gif', - folderOpen : 'support/folderopen.gif', - node : 'support/page.gif', - empty : 'support/empty.gif', - line : 'support/line.gif', - join : 'support/join.gif', - joinBottom : 'support/joinbottom.gif', - plus : 'support/plus.gif', - plusBottom : 'support/plusbottom.gif', - minus : 'support/minus.gif', - minusBottom : 'support/minusbottom.gif', - nlPlus : 'support/nolines_plus.gif', - nlMinus : 'support/nolines_minus.gif' - }; - this.obj = objName; - this.aNodes = []; - this.aIndent = []; - this.root = new Node(-1); - this.selectedNode = null; - this.selectedFound = false; - this.completed = false; -}; - -dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) { - this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open); -}; - -dTree.prototype.openAll = function() { - this.oAll(true); -}; -dTree.prototype.closeAll = function() { - this.oAll(false); -}; - -dTree.prototype.toString = function() { - var str = '
\n'; - if (document.getElementById) { - if (this.config.useCookies) this.selectedNode = this.getSelected(); - str += this.addNode(this.root); - } else str += 'Browser not supported.'; - str += '
'; - if (!this.selectedFound) this.selectedNode = null; - this.completed = true; - return str; -}; - -dTree.prototype.addNode = function(pNode) { - var str = ''; - var n=0; - if (this.config.inOrder) n = pNode._ai; - for (n; n'; - } - if (node.url) { - str += ''; - str += node.name; - if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += ''; - str += ''; - if (node._hc) { - str += '
'; - str += this.addNode(node); - str += '
'; - } - this.aIndent.pop(); - return str; -}; - -dTree.prototype.indent = function(node, nodeId) { - var str = ''; - if (this.root.id != node.pid) { - for (var n=0; n'; - (node._ls) ? this.aIndent.push(0) : this.aIndent.push(1); - if (node._hc) { - str += ''; - } else str += ''; - } - return str; -}; - -dTree.prototype.setCS = function(node) { - var lastId; - for (var n=0; nconnection($config{dsn},$config{usr},$config{pw}); -OpenILS::Application::Storage::CDBI->db_Main->{ AutoCommit } = 1; - -my $cgi = new CGI; - -#------------------------------------------------------------------------------- -# setup part -#------------------------------------------------------------------------------- -my @perms = sort { $a->code cmp $b->code } permission::perm_list->retrieve_all; - -my %org_cols = ( qw/id GroupID name Name parent ParentGroup description Description application_perm ApplicationPermission/ ); - -my @col_display_order = ( qw/id name parent description application_perm/ ); - -if (my $action = $cgi->param('action')) { - if ( $action eq 'Update' ) { - for my $id ( ($cgi->param('id')) ) { - my $u = permission::grp_tree->retrieve($id); - for my $col ( keys %org_cols ) { - next if ($cgi->param($col."_$id") =~ /Select One/o); - $u->$col( $cgi->param($col."_$id") ); - } - $u->update; - } - } elsif ( $action eq 'Set Permissions' ) { - my $grp = permission::grp_tree->retrieve($cgi->param('perms')); - my @ids = $cgi->param('permission'); - for my $perm ( @perms ) { - if (my $id = $cgi->param('permission_'.$perm->id) ) { - my $p = permission::grp_perm_map->search({perm=>$id,grp=>$grp->id})->next; - my $d = $cgi->param("depth_$id"); - my $g = $cgi->param("grant_$id") || 'f'; - if (!$p) { - $p = permission::grp_perm_map->create({perm=>$id,grp=>$grp->id,depth=>$d,grantable=>$g}); - } else { - $p->depth( $d ); - $p->grantable( $g ); - } - $p->update; - } else { - permission::grp_perm_map->search({perm=>$perm->id,grp=>$grp->id})->delete_all; - } - } - $cgi->param('action'=>'child'); - } elsif ( $action eq 'Add New' ) { - permission::grp_tree->create( { map { defined($cgi->param($_)) ? ($_ => $cgi->param($_)) : () } keys %org_cols } ); - } -} - -#------------------------------------------------------------------------------- -# HTML part -#------------------------------------------------------------------------------- - -print < - - - - - - - - - - - -Home - -

User Group Hierarchy Setup

-
-HEADER - -my $uri = $cgi->url(-relative=>1); - -my $top; -for my $grp ( permission::grp_tree->search( {parent=>undef} ) ) { - my $name = $grp->name; - my $desc = $grp->description || $grp->name; - $top = $grp->id; - $name =~ s/'/\\'/og; - print <<" HEADER"; -
- -
-
-HEADER - -#------------------------------------------------------------------------------- -# Logic part -#------------------------------------------------------------------------------- - -if (my $action = $cgi->param('action')) { - if ( $action eq 'child' ) { - my $id = $cgi->param('id'); - if ($id) { - my $node = permission::grp_tree->retrieve($id); - #----------------------------------------------------------------------- - # child form - #----------------------------------------------------------------------- - - print "

Edit Group '".$node->name."'

"; - print "
". - "\n"; - - print Tr( - th($org_cols{id}), - td( $node->id() ), - ); - print Tr( - th($org_cols{name}), - td("name() ."\">"), - ); - print Tr( - th($org_cols{parent}), - td(""), - ); - print Tr( - th($org_cols{description}), - td("description() ."\">"), - ); - print Tr( - th($org_cols{application_perm}), - "" - ); - - print Tr( "" ); - - print "
".do { - my $out = ''; - $out; - }."

"; - - - print "

Group Permissions

"; - - print "
". - "\n". - ""; - - for my $perm ( sort {$a->code cmp $b->code} @perms ) { - my $grp = $node; - my $out = 'parent)); - $stuff; - }.">".$outype->name.""; - } - $out .= ""; - $out .= "" - - ); - } - - print Tr( "" ); - print "
PermissionSelectAt DepthGrantable
search( - { grp => $grp->id, - perm => $perm->id } - )->next; - $stuff = "checked='checked' " if ($setting && $setting->grantable); - } - } while (!$stuff && $grp && ($grp = $grp->parent)); - $stuff; - }.">"; - - $grp = $node; - print Tr( "".$perm->code."". - "search( - { grp => $grp->id, - perm => $perm->id } - )->next; - $stuff = "checked " if ($setting); - $stuff .= "disabled " if($setting && $setting->grp != $node->id); - } - } while (!$stuff && $grp && ($grp = $grp->parent)); - $stuff; - }. - ">$out", - "

"; - - - - print "

New Child

"; - - print "
". - "\n"; - - print Tr( - th($org_cols{name}), - td(""), - ); - print Tr( - th($org_cols{description}), - td(""), - ); - print Tr( "" ); - print "
", - "

"; - - } - } -} - -print "
"; - - diff --git a/Open-ILS/src/extras/Makefile.install b/Open-ILS/src/extras/Makefile.install index 7df8e18af5..6c7161f948 100644 --- a/Open-ILS/src/extras/Makefile.install +++ b/Open-ILS/src/extras/Makefile.install @@ -91,6 +91,7 @@ DEBS = \ libnet-server-perl\ libnspr4-dev\ libole-storage-lite-perl\ + libparent-perl \ libpq-dev\ libreadline5-dev\ libspreadsheet-writeexcel-perl\ @@ -162,6 +163,7 @@ FEDORA_13_RPMS = \ mod_ssl \ ncurses-devel \ ncurses-libs \ + perl-parent \ perl-Business-CreditCard \ perl-Business-ISBN \ perl-Business-ISBN-Data \ diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/OfflineStore.pm b/Open-ILS/src/perlmods/OpenILS/Utils/OfflineStore.pm index abb50a32f8..5bf0141cdb 100644 --- a/Open-ILS/src/perlmods/OpenILS/Utils/OfflineStore.pm +++ b/Open-ILS/src/perlmods/OpenILS/Utils/OfflineStore.pm @@ -1,6 +1,15 @@ package OpenILS::Utils::OfflineStore; use strict; use warnings; -use base 'Class::DBI'; + +use UNIVERSAL::require; +if ('Class::DBI::Frozen::301'->use) { + use parent 'Class::DBI::Frozen::301'; +} elsif ('Class::DBI'->use) { + use parent 'Class::DBI'; +} else { + die $@; +} + use DBI; use OpenSRF::Utils::Config; @@ -40,7 +49,7 @@ sub disconnect { package OpenILS::Utils::OfflineStore::Session; -use base 'OpenILS::Utils::OfflineStore'; +use parent 'OpenILS::Utils::OfflineStore'; sub _create_table { my $self = shift; @@ -71,7 +80,7 @@ __PACKAGE__->has_many(scripts => 'OpenILS::Utils::OfflineStore::Script'); package OpenILS::Utils::OfflineStore::Script; -use base 'OpenILS::Utils::OfflineStore'; +use parent 'OpenILS::Utils::OfflineStore'; sub _create_table { my $self = shift; diff --git a/Open-ILS/src/support-scripts/eg_db_config.pl b/Open-ILS/src/support-scripts/eg_db_config.pl index 695602c154..ef6e87b37a 100755 --- a/Open-ILS/src/support-scripts/eg_db_config.pl +++ b/Open-ILS/src/support-scripts/eg_db_config.pl @@ -27,7 +27,6 @@ use File::Basename; my ($dbhost, $dbport, $dbname, $dbuser, $dbpw, $help); my $config_file = ''; my $build_db_sh = ''; -my $bootstrap_file = ''; my $offline_file = ''; my $prefix = ''; my $sysconfdir = ''; @@ -77,24 +76,6 @@ sub update_config { die "ERROR: Failed to update the configuration file '$config_file'\n"; } -# write out the DB bootstrapping config -sub create_db_bootstrap { - my ($setup, $settings) = @_; - - open(FH, '>', $setup) or die "Could not write database setup to $setup\n"; - - print "Writing database bootstrapping configuration to $setup\n"; - - printf FH "\$main::config{dsn} = 'dbi:Pg:host=%s;dbname=%s;port=%d';\n", - $settings->{host}, $settings->{db}, $settings->{port}; - - printf FH "\$main::config{usr} = '%s';\n", $settings->{user}; - printf FH "\$main::config{pw} = '%s';\n", $settings->{pw}; - - print FH "\$main::config{index} = 'config.cgi';\n"; - close(FH); -} - # write out the offline config sub create_offline_config { my ($setup, $settings) = @_; @@ -149,17 +130,14 @@ sub create_schema { chdir($script_dir); } -my $bootstrap; my $offline; my $cschema; my $uconfig; my %settings; GetOptions("create-schema" => \$cschema, - "create-bootstrap" => \$bootstrap, "create-offline" => \$offline, "update-config" => \$uconfig, - "bootstrap-file=s" => \$bootstrap_file, "config-file=s" => \$config_file, "build-db-file=s" => \$build_db_sh, "service=s" => \@services, @@ -194,10 +172,6 @@ if (!$build_db_sh) { $build_db_sh = File::Spec->catfile($script_dir, '../sql/Pg/build-db.sh'); } -if (!$bootstrap_file) { - $bootstrap_file = File::Spec->catfile($sysconfdir, 'live-db-setup.pl'); -} - if (!$offline_file) { $offline_file = File::Spec->catfile($sysconfdir, 'offline-config.pl'); } @@ -211,10 +185,9 @@ if ($uconfig) { update_config(\@services, \%settings); } get_settings(\%settings); if ($cschema) { create_schema(\%settings); } -if ($bootstrap) { create_db_bootstrap($bootstrap_file, \%settings); } if ($offline) { create_offline_config($offline_file, \%settings); } -if ((!$cschema && !$uconfig && !$bootstrap && !$offline) || $help) { +if ((!$cschema && !$uconfig && !$offline) || $help) { print < $(TMP)/cgi-bin/$$xxx; done - cp $(TMP)/cgi-bin/*cgi $(DESTDIR)$(CGIDIR) - cp -r @top_srcdir@/Open-ILS/src/cgi-bin/support $(DESTDIR)$(CGIDIR) - chmod 755 $(DESTDIR)$(CGIDIR)/*cgi - install-data-local: $(MKDIR_P) $(DESTDIR)$(WEBDIR)/opac/common/js for i in $(OPACJS); do \ diff --git a/README b/README index cccb45ae5e..dc671cf2d7 100644 --- a/README +++ b/README @@ -47,7 +47,7 @@ make STAFF_CLIENT_BUILD_ID=rel_trunk install This will install Evergreen, including example configuration files in /openils/conf/ that you can use as templates for your own configuration files. -The STAFF_CLIENT_BUILD_ID variable stamps the server-side and client-side files +The STAFF_CLIENT_STAMP_ID variable stamps the server-side and client-side files for the staff client to ensure that they match. Install Dojo Toolkit: @@ -125,7 +125,7 @@ up a database called "evergreen". Note that the location of the PostgreSQL commands, we assume that you are working with PostgreSQL 8.4 on a Debian-based system: -createdb -E UNICODE evergreen +createdb -t template0 -E UNICODE evergreen createlang plperl evergreen createlang plperlu evergreen createlang plpgsql evergreen @@ -147,7 +147,7 @@ source directory, replacing , , , , and with the appropriate values for your PostgreSQL database: perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \ - --service all --create-schema --create-bootstrap --create-offline \ + --service all --create-schema --create-offline \ --user --password --hostname --port \ --database