% if ($message) {
<% $message %>

% } Add a journal

ISSN :
Title :
Frequency :
Subject :
Publisher :
Vendor :
Cost :
Bought :
(YYYY-MM-DD)
Renewed :
(YYYY-MM-DD)
Subscription Ends :
(YYYY-MM-DD)
Cancellable :
Notes :

Add a frequency

Frequency:
Add a publisher
Publisher ID:
Name:
Address 1:
Address 2:
Notes:
Add a vendor
Vendor ID:
Name:
Notes:
%# %# ======================================================================== %# <%args> $action => '' $ISSN => '' $title => '' $journal_frequency => '' $subject => '' $journal_publisher => '' $journal_vendor => '' $cost => '' $bought => '' $renewed => '' $subscription_ends => '' $cancellable => '' $journal_notes => '' $new_frequency => '' $publisher_id => '' $publisher_name => '' $address1 => '' $address2 => '' $publisher_notes => '' $vendor_id => '' $vendor_name => '' $vendor_notes => '' <%init> my $message = ''; if ($action =~ /journal/){ if (not $ISSN or not $title or not $journal_frequency or not $subject or not $journal_publisher or not $journal_vendor or not $cost or not $bought or not $renewed or not $subscription_ends or not $cancellable){ $message = "Oops - please fill in all fields for Journal."; } else { periodicals::journal->find_or_create({issn => $ISSN, title => $title, frequency => $journal_frequency, subject => $subject, publisher => $journal_publisher, vendor => $journal_vendor, cost => $cost, bought => $bought, renewed => $renewed, subscription_ends => $subscription_ends, cancellable => $cancellable, notes => $journal_notes, }); $message = "OK, '$title' has been added to the database."; $ISSN = ''; $title = ''; $journal_frequency = ''; $subject = ''; $journal_publisher = ''; $journal_vendor = ''; $cost = ''; $bought = ''; $renewed = ''; $subscription_ends = ''; $cancellable = ''; $journal_notes = ''; } } if ($action =~ /frequency/){ if (not $new_frequency){ $message = "Oops - please provide a frequency."; } else { periodicals::frequency->find_or_create({frequency => $new_frequency}); $message = "OK, '$new_frequency' has been added to the database."; $new_frequency = ''; } } if ($action =~ /publisher/){ if (not $publisher_id or not $publisher_name or not $address1 or not $address2){ $message = "Oops - please provide an ID, Name, and Address for Publisher."; } else { periodicals::publisher->find_or_create({publisher_id => $publisher_id, name => $publisher_name, address1 => $address1, address2 => $address2, notes => $publisher_notes, }); $message = "OK, '$publisher_name' has been added to the database."; $publisher_id = ''; $publisher_name = ''; $address1 = ''; $address2 = ''; $publisher_notes = ''; } } if ($action =~ /vendor/){ if (not $vendor_id or not $vendor_name){ $message = "Oops - please provide an ID and Name for Vendor."; } else { periodicals::vendor->find_or_create({vendor_id => $vendor_id, name => $vendor_name, notes => $vendor_notes, }); $message = "OK, '$vendor_name' has been added to the database."; $vendor_id = ''; $vendor_name = ''; $vendor_notes = ''; } } my $journal_list = periodicals::journal->retrieve_all; my $frequency_list = periodicals::frequency->retrieve_all; my $publisher_list = periodicals::publisher->retrieve_all; my $vendor_list = periodicals::vendor->retrieve_all;