cataloge subdir (and cataloguing) - Dates.pm integration and warnings fixes.
authorJoe Atzberger <joe.atzberger@liblime.com>
Tue, 4 Dec 2007 23:40:54 +0000 (17:40 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 5 Dec 2007 00:21:11 +0000 (18:21 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
catalogue/detailprint.pl
catalogue/dictionary.pl
catalogue/issuehistory.pl
catalogue/moredetail.pl
cataloguing/plugin_launcher.pl

index d9e3f39..6c4202d 100755 (executable)
@@ -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');
index e420fc7..6a767f3 100755 (executable)
@@ -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;
        
        #
index 2f0825a..fdb9fb1 100755 (executable)
@@ -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,
index c9cd847..c2f1841 100755 (executable)
@@ -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;
index 51189d3..a05a6cc 100755 (executable)
@@ -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;