updatedatabase.pl: add change of borrowers table to deletedborrowers table

deletemem.pl: delete use of warn function
This commit is contained in:
btoumi 2006-06-16 09:45:02 +00:00
parent 5e4e931d2e
commit 72363f4a1e
2 changed files with 166 additions and 1 deletions

View file

@ -46,7 +46,6 @@ my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
#print $input->header;
my $member=$input->param('member');
my %env;
warn "user num".$member;
$env{'nottodayissues'}=1;
my %member2;
$member2{'borrowernumber'}=$member;

View file

@ -193,6 +193,7 @@ my %dropable_table = (
my %uselessfields = (
# tablename => "field1,field2",
borrowers => "suburb,altstreetaddress,altsuburb,altcity,studentnumber,school,area,preferredcont,altcp",
deletedborrowers=> "suburb,altstreetaddress,altsuburb,altcity,studentnumber,school,area,preferredcont,altcp",
);
# the other hash contains other actions that can't be done elsewhere. they are done
# either BEFORE of AFTER everything else, depending on "when" entry (default => AFTER)
@ -585,6 +586,68 @@ my %fielddefinitions = (
},
],
deletedborrowers => [
{ field => 'B_email',
type => 'text',
null => 'NULL',
after => 'B_zipcode',
},
{
field => 'streetnumber', # street number (hidden if streettable table is empty)
type => 'char(10)',
null => 'NULL',
after => 'initials',
},
{
field => 'streettype', # street table, list builded from a system table
type => 'char(50)',
null => 'NULL',
after => 'streetnumber',
},
{
field => 'B_streetnumber', # street number (hidden if streettable table is empty)
type => 'char(10)',
null => 'NULL',
after => 'fax',
},
{
field => 'B_streettype', # street table, list builded from a system table
type => 'char(50)',
null => 'NULL',
after => 'B_streetnumber',
},
{
field => 'phonepro',
type => 'text',
null => 'NULL',
after => 'fax',
},
{
field => 'address2', # complement address
type => 'text',
null => 'NULL',
after => 'address',
},
{
field => 'emailpro',
type => 'text',
null => 'NULL',
after => 'fax',
},
{
field => 'contactfirstname', # contact's firstname
type => 'text',
null => 'NULL',
after => 'contactname',
},
{
field => 'contacttitle', # contact's title
type => 'text',
null => 'NULL',
after => 'contactfirstname',
},
],
branches => [
{
field => 'branchip',
@ -898,6 +961,21 @@ my %foreign_keys = (
onDelete => 'RESTRICT',
},
],
deletedborrowers => [ # foreign keys are RESTRICT as we don't want to delete borrowers when a branch is deleted
# but prevent deleting a branch as soon as it has 1 borrower !
{ key => 'categorycode',
foreigntable => 'categories',
foreignkey => 'categorycode',
onUpdate => 'RESTRICT',
onDelete => 'RESTRICT',
},
{ key => 'branchcode',
foreigntable => 'branches',
foreignkey => 'branchcode',
onUpdate => 'RESTRICT',
onDelete => 'RESTRICT',
},
],
accountlines => [
{ key => 'borrowernumber',
foreigntable => 'borrowers',
@ -1009,6 +1087,90 @@ my %column_change = (
after => 'borrowernotes',
},
],
deletedborrowers => [
{
from => 'emailaddress',
to => 'email',
after => 'city',
},
{
from => 'streetaddress',
to => 'address',
after => 'initials',
},
{
from => 'faxnumber',
to => 'fax',
after => 'phone',
},
{
from => 'textmessaging',
to => 'opacnote',
after => 'userid',
},
{
from => 'altnotes',
to => 'contactnote',
after => 'opacnote',
},
{
from => 'physstreet',
to => 'B_address',
after => 'fax',
},
{
from => 'streetcity',
to => 'B_city',
after => 'B_address',
},
{
from => 'phoneday',
to => 'mobile',
after => 'phone',
},
{
from => 'zipcode',
to => 'zipcode',
after => 'city',
},
{
from => 'homezipcode',
to => 'B_zipcode',
after => 'B_city',
},
{
from => 'altphone',
to => 'B_phone',
after => 'B_zipcode',
},
{
from => 'expiry',
to => 'dateexpiry',
after => 'dateenrolled',
},
{
from => 'guarantor',
to => 'guarantorid',
after => 'contactname',
},
{
from => 'textmessaging',
to => 'opacnotes',
after => 'flags',
},
{
from => 'altnotes',
to => 'contactnotes',
after => 'opacnotes',
},
{
from => 'altrelationship',
to => 'relationship',
after => 'borrowernotes',
},
],
);
foreach my $table (keys %column_change) {
@ -1613,6 +1775,10 @@ sub MARCgetitem {
exit;
# $Log$
# Revision 1.145 2006/06/16 09:45:02 btoumi
# updatedatabase.pl: add change of borrowers table to deletedborrowers table
# deletemem.pl: delete use of warn function
#
# Revision 1.144 2006/06/08 15:36:31 alaurin
# Add a new system preference 'AutomaticItemReturn' :
#