+ 姓別:
Alternative Contact:
Phone:
Relationship:
diff --git a/mainpage.pl b/mainpage.pl
index 5ca4a0fc9f..cf3b48601d 100755
--- a/mainpage.pl
+++ b/mainpage.pl
@@ -4,7 +4,7 @@ use strict;
require Exporter;
use C4::Database;
use C4::Output; # contains gettemplate
-use C4::Charset;
+use C4::Interface::CGI::Output;
use CGI;
use C4::Auth;
@@ -18,7 +18,4 @@ my ($template, $loggedinuser, $cookie)
debug => 1,
});
-print $query->header(
- -type => guesstype($template->output),
- -cookie => $cookie
-), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/mancredit.pl b/mancredit.pl
index 90b5356dc4..449bfb184e 100755
--- a/mancredit.pl
+++ b/mancredit.pl
@@ -24,7 +24,7 @@
use strict;
use C4::Auth;
use C4::Output;
-use C4::Charset;
+use C4::Interface::CGI::Output;
use CGI;
use HTML::Template;
use C4::Search;
diff --git a/maninvoice.pl b/maninvoice.pl
index 5719c4d7c3..de1385e305 100755
--- a/maninvoice.pl
+++ b/maninvoice.pl
@@ -24,7 +24,7 @@
use strict;
use C4::Auth;
use C4::Output;
-use C4::Charset;
+use C4::Interface::CGI::Output;
use CGI;
use C4::Search;
use C4::Accounts2;
diff --git a/member.pl b/member.pl
index 8d0951638e..6baa3a39fd 100755
--- a/member.pl
+++ b/member.pl
@@ -26,7 +26,7 @@
use strict;
use C4::Auth;
use C4::Output;
-use C4::Charset;
+use C4::Interface::CGI::Output;
use CGI;
use C4::Search;
use HTML::Template;
@@ -78,7 +78,4 @@ $template->param(
member => $member,
resultsloop => \@resultsdata );
-print $input->header(
- -type => guesstype($template->output),
- -cookie => $cookie
-),$template->output;
+output_html_with_http_headers $input, $cookie, $template->output;
diff --git a/memberentry.pl b/memberentry.pl
index 98660f02f8..3e532aebfc 100755
--- a/memberentry.pl
+++ b/memberentry.pl
@@ -27,7 +27,7 @@ use strict;
use C4::Auth;
use C4::Context;
use C4::Output;
-use C4::Charset;
+use C4::Interface::CGI::Output;
use CGI;
use C4::Search;
use C4::Koha;
@@ -242,10 +242,7 @@ if ($delete){
cardnumber => $cardnumber,
dateofbirth => $data->{'dateofbirth'});
-print $input->header(
- -type => guesstype($template->output),
- -cookie => $cookie
-),$template->output;
+output_html_with_http_headers $input, $cookie, $template->output;
}
diff --git a/members-home.pl b/members-home.pl
index e910c30e6b..b2730e0fed 100755
--- a/members-home.pl
+++ b/members-home.pl
@@ -4,7 +4,7 @@ use strict;
use CGI;
use C4::Auth;
use C4::Output;
-use C4::Charset;
+use C4::Interface::CGI::Output;
use C4::Context;
use HTML::Template;
@@ -18,7 +18,4 @@ my ($template, $loggedinuser, $cookie)
debug => 1,
});
-print $query->header(
- -type => guesstype($template->output),
- -cookie => $cookie
-),$template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/moremember.pl b/moremember.pl
index a9c7b29574..4fbd333a1f 100755
--- a/moremember.pl
+++ b/moremember.pl
@@ -34,7 +34,8 @@ use strict;
use C4::Auth;
use C4::Context;
use C4::Output;
-use C4::Charset;
+use C4::Interface::CGI::Output;
+use C4::Interface::CGI::Template;
use CGI;
use C4::Search;
use Date::Manip;
@@ -69,6 +70,8 @@ $data->{'dateofbirth'} = slashifyDate($data->{'dateofbirth'});
$data->{'ethnicity'} = fixEthnicity($data->{'ethnicity'});
+$data->{&expand_sex_into_predicate($data->{'sex'})} = 1;
+
if ($data->{'categorycode'} eq 'C'){
my $data2=borrdata('',$data->{'guarantor'});
$data->{'streetaddress'}=$data2->{'streetaddress'};
@@ -203,7 +206,4 @@ $template->param(
issueloop => \@issuedata,
reserveloop => \@reservedata);
-print $input->header(
- -type => guesstype($template->output),
- -cookie => $cookie
-),$template->output;
+output_html_with_http_headers $input, $cookie, $template->output;
diff --git a/newmember.pl b/newmember.pl
index b83a59046c..070293c72e 100755
--- a/newmember.pl
+++ b/newmember.pl
@@ -38,7 +38,7 @@
use strict;
use C4::Auth;
use C4::Input;
-use C4::Charset;
+use C4::Interface::CGI::Output;
use CGI;
use Date::Manip;
use HTML::Template;
@@ -180,9 +180,6 @@ if ($ok == 0) {
;
}
-print $input->header(
- -type => guesstype($template->output),
- -cookie => $cookie
-), $template->output;
+output_html_with_http_headers $input, $cookie, $template->output;
diff --git a/opac/opac-account.pl b/opac/opac-account.pl
index 4d0e27cdca..68f23240c7 100755
--- a/opac/opac-account.pl
+++ b/opac/opac-account.pl
@@ -55,5 +55,5 @@ $template->param( ACCOUNT_LINES => $accts );
$template->param( total => $total );
#$template->param(loggeninuser => $loggedinuser);
-print $query->header(-cookie => $cookie), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index 3a01739d31..dbdfff4356 100755
--- a/opac/opac-detail.pl
+++ b/opac/opac-detail.pl
@@ -4,7 +4,7 @@ require Exporter;
use CGI;
use C4::Search;
use C4::Auth;
-use C4::Charset;
+use C4::Interface::CGI::Output;
use HTML::Template;
my $query=new CGI;
@@ -54,8 +54,5 @@ $template->param(ITEM_RESULTS => $itemsarray);
$template->param(WEB_RESULTS => $webarray);
$template->param(SITE_RESULTS => $sitearray);
-print $query->header(
- -type => guesstype($template->output),
- -cookie => $cookie
-), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/opac/opac-main.pl b/opac/opac-main.pl
index b3a9854742..9e253058b0 100755
--- a/opac/opac-main.pl
+++ b/opac/opac-main.pl
@@ -5,7 +5,7 @@ use CGI;
use HTML::Template;
use C4::Auth; # get_template_and_user
-use C4::Charset;
+use C4::Interface::CGI::Output;
my $query = new CGI;
@@ -17,7 +17,4 @@ my ($template, $borrowernumber, $cookie)
flagsrequired => {borrow => 1},
});
-print $query->header(
- -type => guesstype($template->output),
- -cookie => $cookie
-), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/opac/opac-membership.pl b/opac/opac-membership.pl
index 7096e65996..20f04069bc 100644
--- a/opac/opac-membership.pl
+++ b/opac/opac-membership.pl
@@ -15,4 +15,4 @@ my ($template, $borrowernumber, $cookie)
flagsrequired => {borrow => 1},
});
-print $query->header(-cookie => $cookie), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/opac/opac-readingrecord.pl b/opac/opac-readingrecord.pl
index 1db46633e7..b0eb1783cb 100755
--- a/opac/opac-readingrecord.pl
+++ b/opac/opac-readingrecord.pl
@@ -51,5 +51,5 @@ $template->param(count => $count);
$template->param(READING_RECORD => $issues);
-print $query->header(-cookie => $cookie), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl
index 3e490c75b3..5233e9b1ff 100755
--- a/opac/opac-reserve.pl
+++ b/opac/opac-reserve.pl
@@ -225,4 +225,4 @@ if ($query->param('item_types_selected')) {
$template->param(BIBLIOITEMS => \@data);
-print $query->header(-cookie => $cookie), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/opac/opac-search.pl b/opac/opac-search.pl
index b03de616b1..93bfa393cc 100755
--- a/opac/opac-search.pl
+++ b/opac/opac-search.pl
@@ -3,7 +3,7 @@ use strict;
require Exporter;
use C4::Auth;
-use C4::Charset;
+use C4::Interface::CGI::Output;
use C4::Context;
use CGI;
use C4::Database;
@@ -32,7 +32,4 @@ my ($template, $borrowernumber, $cookie)
$template->param(classlist => $classlist);
-print $query->header(
- -type => guesstype($template->output),
- -cookie => $cookie
-), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/opac/opac-searchresults.pl b/opac/opac-searchresults.pl
index dafdcb0519..9e9ef48ad0 100755
--- a/opac/opac-searchresults.pl
+++ b/opac/opac-searchresults.pl
@@ -4,7 +4,7 @@ require Exporter;
use CGI;
use C4::Search;
use C4::Auth;
-use C4::Charset;
+use C4::Interface::CGI::Output;
use HTML::Template;
my $query=new CGI;
@@ -127,8 +127,5 @@ if ($count>10) {
$template->param(numbers => $numbers);
-print $query->header(
- -type => guesstype($template->output),
- -cookie => $cookie
-), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/opac/opac-sidebar.pl b/opac/opac-sidebar.pl
index 059896d4b0..0c37f6881e 100755
--- a/opac/opac-sidebar.pl
+++ b/opac/opac-sidebar.pl
@@ -28,4 +28,4 @@ $template->param(INPUTS => \@inputs);
my $self_url = $query->url(-absolute => 1);
$template->param(url => $self_url);
-print $query->header(-cookie => $cookie), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/opac/opac-user.pl b/opac/opac-user.pl
index cdcdde8b5e..5aac6c19cb 100755
--- a/opac/opac-user.pl
+++ b/opac/opac-user.pl
@@ -131,5 +131,5 @@ foreach my $res (@$reserves) {
# $template->param(WAITING => \@waiting);
$template->param(waiting_count => $wcount);
-print $query->header(-cookie => $cookie), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/opac/opac-userdetails.pl b/opac/opac-userdetails.pl
index d914528729..a476bf0321 100755
--- a/opac/opac-userdetails.pl
+++ b/opac/opac-userdetails.pl
@@ -30,5 +30,5 @@ $borr->{'ethnicity'} = fixEthnicity($borr->{'ethnicity'});
$template->param($borr);
-print $query->header(-cookie => $cookie), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/opac/opac-userupdate.pl b/opac/opac-userupdate.pl
index c609da103f..a85e31209a 100755
--- a/opac/opac-userupdate.pl
+++ b/opac/opac-userupdate.pl
@@ -68,4 +68,4 @@ $bordat[0] = $borr;
$template->param(BORROWER_INFO => \@bordat);
-print $query->header(-cookie => $cookie), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/readingrec.pl b/readingrec.pl
index c4d258ca4d..120cfd561b 100755
--- a/readingrec.pl
+++ b/readingrec.pl
@@ -25,7 +25,7 @@
use strict;
use C4::Auth;
use C4::Output;
-use C4::Charset;
+use C4::Interface::CGI::Output;
use CGI;
use C4::Search;
use HTML::Template;
@@ -73,10 +73,7 @@ $template->param(title => $data->{'title'},
bornum => $bornum,
limit => $limit,
loop_reading => \@loop_reading);
-print $input->header(
- -type => guesstype($template->output),
- -cookie => $cookie
-),$template->output;
+output_html_with_http_headers $input, $cookie, $template->output;
diff --git a/reports-home.pl b/reports-home.pl
index 4a86630b3e..488b7c477e 100755
--- a/reports-home.pl
+++ b/reports-home.pl
@@ -4,7 +4,7 @@ use strict;
use CGI;
use C4::Auth;
use C4::Output;
-use C4::Charset;
+use C4::Interface::CGI::Output;
use C4::Context;
use HTML::Template;
@@ -17,7 +17,4 @@ my ($template, $loggedinuser, $cookie)
flagsrequired => {permissions => 1},
debug => 1,
});
-print $query->header(
- -type => guesstype($template->output),
- -cookie => $cookie
-),$template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/search.marc/search.pl b/search.marc/search.pl
index 7bc0ced68f..d77502abf2 100755
--- a/search.marc/search.pl
+++ b/search.marc/search.pl
@@ -26,7 +26,7 @@ use C4::Context;
use C4::Search;
use C4::Auth;
use C4::Output;
-use C4::Charset;
+use C4::Interface::CGI::Output;
use C4::Biblio;
use C4::SearchMarc;
@@ -108,7 +108,4 @@ if ($op eq "do_search") {
$template->param("marclist" => $marclist);
}
# Print the page
-print $query->header(
- -type => guesstype($template->output),
- -cookie => $cookie
-), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/search.pl b/search.pl
index 04a5b18c41..b24e95884c 100755
--- a/search.pl
+++ b/search.pl
@@ -26,7 +26,7 @@ use C4::Context;
use C4::Search;
use C4::Auth;
use C4::Output;
-use C4::Charset;
+use C4::Interface::CGI::Output;
my $query=new CGI;
my $type=$query->param('type');
@@ -200,8 +200,5 @@ if (C4::Context->preference('acquisitions') eq 'simple') {
}
# Print the page
-print $query->header(
- -type => guesstype($template->output),
- -cookie => $cookie
-), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/shelves.pl b/shelves.pl
index 4dc6e7167b..713da9a24b 100755
--- a/shelves.pl
+++ b/shelves.pl
@@ -83,7 +83,7 @@ SWITCH: {
$template->param(shelvesloop => \@shelvesloop);
}
-print $query->header(-cookie => $cookie), $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;
sub shelves {
@@ -151,6 +151,20 @@ sub viewshelf {
#
# $Log$
+# Revision 1.10 2003/02/02 07:18:37 acli
+# Moved C4/Charset.pm to C4/Interface/CGI/Output.pm
+#
+# Create output_html_with_http_headers function to contain the "print $query
+# ->header(-type => guesstype...),..." call. This is in preparation for
+# non-HTML output (e.g., text/xml) and charset conversion before output in
+# the future.
+#
+# Created C4/Interface/CGI/Template.pm to hold convenience functions specific
+# to the CGI interface using HTML::Template
+#
+# Modified moremembers.pl to make the "sex" field localizable for languages
+# where M and F doesn't make sense
+#
# Revision 1.9 2002/12/19 18:55:40 hdl
# Templating reservereport et shelves.
#
diff --git a/t/Charset.t b/t/Charset.t
index 167235a97f..d4105e5d70 100644
--- a/t/Charset.t
+++ b/t/Charset.t
@@ -1,5 +1,5 @@
use strict;
-use C4::Charset;
+use C4::Interface::CGI::Output;
use vars qw( @tests );
use vars qw( $loaded );
@@ -8,84 +8,84 @@ BEGIN {
@tests = (
[
'Normal HTML without meta tag',
- sub { C4::Charset::guesscharset($_[0]) },
+ sub { guesscharset($_[0]) },
undef,
<