From fe00a94164fe3619943efcf29d8d3d294b7fcc9c Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Tue, 4 Dec 2007 17:40:54 -0600 Subject: [PATCH] cataloge subdir (and cataloguing) - Dates.pm integration and warnings fixes. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- catalogue/detailprint.pl | 2 +- catalogue/dictionary.pl | 8 +++---- catalogue/issuehistory.pl | 41 +++++++++++++++++----------------- catalogue/moredetail.pl | 2 +- cataloguing/plugin_launcher.pl | 3 ++- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/catalogue/detailprint.pl b/catalogue/detailprint.pl index d9e3f39ec9..6c4202d408 100755 --- a/catalogue/detailprint.pl +++ b/catalogue/detailprint.pl @@ -24,7 +24,7 @@ use CGI; use C4::Auth; use C4::Biblio; use C4::Output; -use C4::Date; +use C4::Dates; my $query = new CGI; my $type = $query->param('type'); diff --git a/catalogue/dictionary.pl b/catalogue/dictionary.pl index e420fc7c52..6a767f3902 100755 --- a/catalogue/dictionary.pl +++ b/catalogue/dictionary.pl @@ -110,7 +110,7 @@ if ($op eq "do_search") { $sth=$dbh->prepare($strsth); $sth->execute($value); - my $total; + $total=0; my @catresults; my $javalue; while (my ($value,$ctresults)=$sth->fetchrow) { @@ -127,7 +127,7 @@ if ($op eq "do_search") { } - my $strsth="Select distinct authtypecode from marc_subfield_structure where ("; + $strsth="Select distinct authtypecode from marc_subfield_structure where ("; foreach my $listtags (@tags){ my @taglist=split /,/,$listtags; foreach my $curtag (@taglist){ @@ -137,9 +137,9 @@ if ($op eq "do_search") { } $strsth=~s/ OR$/)/; - my $strsth = $strsth." and authtypecode is not NULL"; + $strsth .= " and authtypecode is not NULL"; # warn $strsth; - my $sth=$dbh->prepare($strsth); + $sth=$dbh->prepare($strsth); $sth->execute; # diff --git a/catalogue/issuehistory.pl b/catalogue/issuehistory.pl index 2f0825a2ae..fdb9fb1246 100755 --- a/catalogue/issuehistory.pl +++ b/catalogue/issuehistory.pl @@ -24,7 +24,7 @@ use C4::Output; use C4::Circulation; # GetBiblioIssues use C4::Biblio; # GetBiblio GetBiblioFromItemNumber -use C4::Date; +use C4::Dates; my $query = new CGI; my ( $template, $borrowernumber, $cookie ) = get_template_and_user( @@ -41,33 +41,32 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( my $params = $query->Vars; my $biblionumber = $params->{'biblionumber'}; -my $itemnumber = $params->{'itemnumber'}; +my $itemnumber = $params->{'itemnumber'}; my $title = $params->{'title'}; my $author = $params->{'author'}; -my ($issues,$biblio,$title,$author,$barcode); +my ($issues,$biblio,$barcode); if ($itemnumber){ -$issues=GetItemIssues($itemnumber); -$biblio=GetBiblioFromItemNumber($itemnumber); -$biblionumber=$biblio->{biblionumber}; -$barcode=$issues->[0]->{barcode}; -$template->param( - %$biblio, - barcode=> $barcode, -); + $issues=GetItemIssues($itemnumber); + $biblio=GetBiblioFromItemNumber($itemnumber); + $biblionumber=$biblio->{biblionumber}; + $barcode=$issues->[0]->{barcode}; + $template->param( + %$biblio, + barcode=> $barcode, + ); } else { -my @biblio; -$issues = GetBiblioIssues($biblionumber); -my (undef,@biblio)=GetBiblio($biblionumber); -my $total = scalar @$issues; -$template->param( - %{$biblio[0]}, -); + $issues = GetBiblioIssues($biblionumber); + my (undef,@biblio)=GetBiblio($biblionumber); + my $total = scalar @$issues; + $template->param( + %{$biblio[0]}, + ); } foreach (@$issues){ - $_->{date_due}=format_date($_->{date_due}); - $_->{issuedate}=format_date($_->{issuedate}); - $_->{returndate}=format_date($_->{returndate}); + $_->{date_due} = format_date($_->{date_due}); + $_->{issuedate} = format_date($_->{issuedate}); + $_->{returndate} = format_date($_->{returndate}); } $template->param( total => scalar @$issues, diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index c9cd8475c3..c2f1841d93 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -26,7 +26,7 @@ use C4::Biblio; # to use &GetBiblioItemData &GetItemsByBiblioitemnum use C4::Acquisition; use C4::Output; # contains gettemplate use C4::Auth; -use C4::Date; +use C4::Dates; use C4::Circulation; # to use itemissues my $query=new CGI; diff --git a/cataloguing/plugin_launcher.pl b/cataloguing/plugin_launcher.pl index 51189d3db8..a05a6cc1e5 100755 --- a/cataloguing/plugin_launcher.pl +++ b/cataloguing/plugin_launcher.pl @@ -29,7 +29,8 @@ my $plugin_name="cataloguing/value_builder/".$input->param("plugin_name"); # opening plugin. Just check wether we are on a developper computer on a production one # (the cgidir differs) my $cgidir = C4::Context->intranetdir ."/cgi-bin"; -unless (opendir(DIR, "$cgidir/cataloguing/value_builder")) { +my $vbdir = "$cgidir/cataloguing/value_builder"; +unless (-r $vbdir and -d $vbdir) { $cgidir = C4::Context->intranetdir; } do $cgidir."/".$plugin_name; -- 2.39.5