From 5b41a8e2622f5e921b9061646f3155ce5352bfdc Mon Sep 17 00:00:00 2001 From: tgarip1957 Date: Mon, 11 Sep 2006 17:41:54 +0000 Subject: [PATCH] New XML API --- admin/aqbookfund.pl | 88 +- admin/branches.pl | 2 +- catalogue/ISBDdetail.pl | 19 +- catalogue/catalogue-search.pl | 22 +- catalogue/moredetail.pl | 3 +- export/export.pl | 34 - export/marc.pl | 116 -- import/breeding.pl | 204 --- .../prog/en/admin/admin-home.tmpl | 94 +- .../prog/en/admin/aqbookfund.tmpl | 268 ++-- .../intranet-tmpl/prog/en/admin/aqbudget.tmpl | 8 +- .../en/admin/auth_subfields_structure.tmpl | 7 +- .../prog/en/admin/biblios_framework.tmpl | 131 ++ .../en/admin/biblios_subfields_structure.tmpl | 134 ++ .../prog/en/admin/bibliostagstructure.tmpl | 207 +++ .../prog/en/admin/checkmarc.tmpl | 108 +- .../admin/holdings_subfields_structure.tmpl | 131 ++ .../prog/en/admin/holdingstagstructure.tmpl | 205 +++ .../prog/en/admin/institutions-careers.tmpl | 126 ++ .../prog/en/admin/koha-electronic.tmpl | 113 ++ .../prog/en/admin/koha_attr.tmpl | 194 +++ .../prog/en/admin/stopwords.tmpl | 233 ++-- .../prog/en/admin/systempreferences.tmpl | 9 + .../prog/en/admin/thesaurus.tmpl | 44 +- .../intranet-tmpl/prog/en/admin/viewlog.tmpl | 90 +- .../prog/en/authorities/auth_finder.tmpl | 54 + .../prog/en/authorities/authorities-home.tmpl | 145 +-- .../prog/en/authorities/authorities.tmpl | 357 ++++-- .../blinddetail-biblio-search.tmpl | 41 + .../en/authorities/blinddetail-linker.tmpl | 40 +- .../prog/en/authorities/detail.tmpl | 77 +- .../en/authorities/linkresultlist-auth.tmpl | 22 +- .../en/authorities/searchresultlist-auth.tmpl | 95 ++ .../prog/en/authorities/searchresultlist.tmpl | 154 ++- .../prog/en/catalogue/ISBDdetail.tmpl | 68 +- .../prog/en/catalogue/MARCdetail.tmpl | 603 ++++----- .../prog/en/catalogue/catalogue_search.tmpl | 162 +++ .../en/catalogue/catalogue_searchresults.tmpl | 235 ++++ .../prog/en/catalogue/detail.tmpl | 283 ++--- .../prog/en/catalogue/detailprint.tmpl | 43 + .../prog/en/catalogue/moredetail.tmpl | 87 ++ .../prog/en/circ/branchtransfers.tmpl | 67 +- .../prog/en/circ/circulation.tmpl | 1024 ++++----------- .../intranet-tmpl/prog/en/circ/returns.tmpl | 95 +- .../prog/en/help/admin/aqbookfund.tmpl | 4 +- .../help/admin/auth_subfields_structure.tmpl | 3 +- .../prog/en/help/admin/authorised_values.tmpl | 4 +- .../prog/en/help/admin/authtypes.tmpl | 4 +- ..._framework.tmpl => biblios_framework.tmpl} | 4 +- .../prog/en/help/admin/branches.tmpl | 4 +- .../prog/en/help/admin/categorie.tmpl | 4 +- .../prog/en/help/admin/checkmarc.tmpl | 4 +- .../prog/en/help/admin/currency.tmpl | 4 +- .../admin/holdings_subfields_structure.tmpl | 33 + .../en/help/admin/holdingstagstructure.tmpl | 26 + .../prog/en/help/admin/issuingrules.tmpl | 4 +- .../prog/en/help/admin/itemtypes.tmpl | 4 +- .../prog/en/help/admin/koha2marclinks.tmpl | 4 +- .../help/admin/marc_subfields_structure.tmpl | 33 +- .../prog/en/help/admin/marctagstructure.tmpl | 4 +- .../prog/en/help/admin/printers.tmpl | 4 +- .../prog/en/help/admin/stopwords.tmpl | 4 +- .../prog/en/help/admin/systempreferences.tmpl | 6 +- .../prog/en/help/admin/z3950servers.tmpl | 4 +- .../prog/en/serials/acqui-search-result.tmpl | 2 +- .../prog/en/serials/acqui-search.tmpl | 4 +- .../intranet-tmpl/prog/en/serials/claims.tmpl | 6 +- .../prog/en/serials/distributedto.tmpl | 7 +- .../prog/en/serials/lateissues.tmpl | 4 +- .../prog/en/serials/printlist.tmpl | 4 +- .../en/serials/receipt-search-result.tmpl | 6 +- .../intranet-tmpl/prog/en/serials/result.tmpl | 86 ++ .../prog/en/serials/routing-preview.tmpl | 7 +- .../prog/en/serials/routing.tmpl | 10 +- .../prog/en/serials/serial-issues-full.tmpl | 12 +- .../prog/en/serials/serial-issues.tmpl | 25 +- .../prog/en/serials/serials-home.tmpl | 70 +- .../prog/en/serials/serials-receive.tmpl | 187 +++ .../prog/en/serials/subscription-add.tmpl | 923 ++++++++++++-- .../en/serials/subscription-bib-search.tmpl | 97 +- .../prog/en/serials/subscription-detail.tmpl | 426 +++++-- .../prog/en/serials/subscription-renew.tmpl | 2 +- .../prog/en/serials/viewalerts.tmpl | 28 + .../intranet-tmpl/prog/en/tools/export.tmpl | 39 +- .../prog/en/tools/koha-news.tmpl | 204 +-- .../en/value_builder/marc21_008_holdings.tmpl | 688 ++++++++++ .../en/value_builder/marc21_field_006.tmpl | 449 +++++++ .../en/value_builder/marc21_field_007.tmpl | 79 ++ .../en/value_builder/marc21_field_008.tmpl | 634 ++++++++++ .../prog/en/value_builder/marc21_leader.tmpl | 328 +++++ .../marc21_leader_authorities.tmpl | 117 ++ .../value_builder/marc21_leader_holdings.tmpl | 177 +++ .../prog/en/z3950/searchresult.tmpl | 80 +- reports/acquisitions_stats.pl | 1116 +++++++---------- reports/bor_issues_top.pl | 87 +- reports/borrowers_out.pl | 56 +- reports/borrowers_stats.pl | 44 +- reports/borrowers_stats.plugin | 183 +++ reports/cat_issues_top.pl | 84 +- reports/catalogue_out.pl | 60 +- reports/catalogue_stats.pl | 249 ++-- reports/inventory.pl | 95 +- reports/issues_avg_stats.pl | 10 +- reports/issues_by_borrower_category.plugin | 9 +- reports/issues_stats.pl | 44 +- reports/itemtypes.plugin | 16 +- reports/manager.pl | 9 +- reports/overdue.pl | 83 +- reports/reports-home.pl | 4 - reports/reservereport.pl | 88 +- reports/stats.pl | 46 +- reports/stats.print.pl | 25 +- reports/stats.screen.pl | 170 +-- reports/transfers.plugin | 105 ++ reserve/modrequest.pl | 8 +- reserve/placerequest.pl | 77 +- reserve/renewscript.pl | 69 - reserve/request.pl | 484 ++----- serials/serials-receive.pl | 1 - tools/export.pl | 101 +- tools/holidays.pl | 38 +- tools/import.pl | 335 +---- tools/koha-news.pl | 2 +- tools/newHolidays.pl | 8 +- tools/overduerules.pl | 7 +- 125 files changed, 9244 insertions(+), 5573 deletions(-) delete mode 100755 export/export.pl delete mode 100755 export/marc.pl delete mode 100755 import/breeding.pl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/admin/biblios_framework.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/admin/biblios_subfields_structure.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/admin/bibliostagstructure.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/admin/holdings_subfields_structure.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/admin/holdingstagstructure.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/admin/institutions-careers.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/admin/koha-electronic.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/admin/koha_attr.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/authorities/auth_finder.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/authorities/blinddetail-biblio-search.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/authorities/searchresultlist-auth.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/catalogue/catalogue_search.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/catalogue/catalogue_searchresults.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/catalogue/detailprint.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/catalogue/moredetail.tmpl rename koha-tmpl/intranet-tmpl/prog/en/help/admin/{biblio_framework.tmpl => biblios_framework.tmpl} (91%) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/help/admin/holdings_subfields_structure.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/help/admin/holdingstagstructure.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/serials/result.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/serials/serials-receive.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/serials/viewalerts.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_008_holdings.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_field_006.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_field_007.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_field_008.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_leader.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_leader_authorities.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_leader_holdings.tmpl create mode 100644 reports/borrowers_stats.plugin create mode 100644 reports/transfers.plugin delete mode 100755 reserve/renewscript.pl diff --git a/admin/aqbookfund.pl b/admin/aqbookfund.pl index 21de612ab6..bb2a297b31 100755 --- a/admin/aqbookfund.pl +++ b/admin/aqbookfund.pl @@ -41,22 +41,41 @@ use strict; use CGI; use C4::Auth; use C4::Context; -use C4::Output; +use C4::Acquisition; +use C4::Koha; use C4::Interface::CGI::Output; use C4::Search; use C4::Date; + sub StringSearch { - my ($env,$searchstring,$type)=@_; + my ($env,$searchstring,%branches)=@_; my $dbh = C4::Context->dbh; $searchstring=~ s/\'/\\\'/g; - my @data=split(' ',$searchstring); + my @data=split(' ',$searchstring) if ($searchstring ne ""); my $count=@data; - my $sth=$dbh->prepare("select bookfundid,bookfundname,bookfundgroup from aqbookfund where (bookfundname like ?) order by bookfundid"); - $sth->execute("%$data[0]%"); + my $strsth= "select bookfundid,bookfundname,bookfundgroup,branchcode from aqbookfund where 1 "; + $strsth.=" AND bookfundname like ? " if ($searchstring ne ""); + if (%branches){ + $strsth.= "AND (aqbookfund.branchcode is null " ; + foreach my $branchcode (keys %branches){ + $strsth .= "or aqbookfund.branchcode = '".$branchcode."' "; + } + $strsth .= ") "; + } + $strsth.= "order by aqbookfund.bookfundid"; +# warn "chaine de recherche : ".$strsth; + + my $sth=$dbh->prepare($strsth); + if ($searchstring){ + $sth->execute("%$data[0]%"); + } else { + $sth->execute; + } my @results; while (my $data=$sth->fetchrow_hashref){ push(@results,$data); +# warn "id ".$data->{bookfundid}." name ".$data->{bookfundname}." branchcode ".$data->{branchcode}; } # $sth->execute; $sth->finish; @@ -91,6 +110,26 @@ $template->param(script_name => $script_name, $template->param(action => $script_name); +my @select_branch; +my %select_branches; +my ($branches)=GetBranches(); + +push @select_branch,""; +$select_branches{""}=""; + +my $homebranch=C4::Context->userenv->{branch}; +foreach my $brnch (keys %$branches){ + push @select_branch, $branches->{$brnch}->{'branchcode'};# + $select_branches{$branches->{$brnch}->{'branchcode'}} = $branches->{$brnch}->{'branchname'}; +} + +my $CGIbranch=CGI::scrolling_list( -name => 'branchcode', + -values => \@select_branch, + -labels => \%select_branches, + -size => 1, + -multiple => 0 ); +$template->param(CGIbranch => $CGIbranch); + ################## ADD_FORM ################################## # called by default. Used to create form to add or modify a record if ($op eq 'add_form') { @@ -130,9 +169,15 @@ if ($op eq 'add_form') { my $sth=$dbh->prepare("delete from aqbookfund where bookfundid =?"); $sth->execute($bookfundid); $sth->finish; - my $sth=$dbh->prepare("replace aqbookfund (bookfundid,bookfundname) values (?,?)"); - $sth->execute($input->param('bookfundid'),$input->param('bookfundname')); - $sth->finish; + if ($input->param('branchcode') ne ""){ + my $sth=$dbh->prepare("replace aqbookfund (bookfundid,bookfundname,branchcode) values (?,?,?)"); + $sth->execute($input->param('bookfundid'),$input->param('bookfundname'),$input->param('branchcode')); + $sth->finish; + } else { + my $sth=$dbh->prepare("replace aqbookfund (bookfundid,bookfundname) values (?,?)"); + $sth->execute($input->param('bookfundid'),$input->param('bookfundname')); + $sth->finish; + } print "Content-Type: text/html\n\n"; exit; @@ -168,29 +213,50 @@ if ($op eq 'add_form') { $template->param(searchfield => $searchfield); } my $env; - my ($count,$results)=StringSearch($env,$searchfield,'web'); + my ($count,$results)=StringSearch($env,$searchfield,%select_branches); my $toggle="white"; my @loop_data =(); my $dbh = C4::Context->dbh; - my $sth2 = $dbh->prepare("Select aqbudgetid,startdate,enddate,budgetamount from aqbudget where bookfundid = ? order by bookfundid"); for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){ +# warn "i ".$i." offset".$offset." pagesize ".$pagesize." id ".$results->[$i]{bookfundid}." name ".$results->[$i]{bookfundname}." branchcode ".$results->[$i]{branchcode}; my %row_data; $row_data{bookfundid} =$results->[$i]{'bookfundid'}; $row_data{bookfundname} = $results->[$i]{'bookfundname'}; +# warn "".$results->[$i]{'bookfundid'}." ".$results->[$i]{'bookfundname'}." ".$results->[$i]{'branchcode'}; + $row_data{branchname} = $select_branches{$results->[$i]{'branchcode'}}; + my $strsth2="Select aqbudgetid,startdate,enddate,budgetamount from aqbudget where aqbudget.bookfundid = ?"; +# my $strsth2="Select aqbudgetid,startdate,enddate,budgetamount,branchcode from aqbudget where aqbudget.bookfundid = ?"; +# if ($homebranch){ +# $strsth2 .= " AND ((aqbudget.branchcode is null) OR (aqbudget.branchcode='') OR (aqbudget.branchcode= ".$dbh->quote($homebranch).")) " ; +# } else { +# $strsth2 .= " AND (aqbudget.branchcode='') " if ((C4::Context->userenv) && (C4::Context->userenv->{flags}>1)); +# } + $strsth2 .= " order by aqbudgetid"; +# warn "".$strsth2; + my $sth2 = $dbh->prepare($strsth2); $sth2->execute($row_data{bookfundid}); my @budget_loop; +# while (my ($aqbudgetid,$startdate,$enddate,$budgetamount,$branchcode) = $sth2->fetchrow) { while (my ($aqbudgetid,$startdate,$enddate,$budgetamount) = $sth2->fetchrow) { my %budgetrow_data; $budgetrow_data{aqbudgetid} = $aqbudgetid; $budgetrow_data{startdate} = format_date($startdate); $budgetrow_data{enddate} = format_date($enddate); $budgetrow_data{budgetamount} = $budgetamount; +# $budgetrow_data{branchcode} = $branchcode; push @budget_loop,\%budgetrow_data; } $row_data{budget} = \@budget_loop; push @loop_data,\%row_data; } + $template->param(max => (($count>$offset+$pagesize)?$offset+$pagesize:$count)); + $template->param(min => ($offset?$offset:1)); + $template->param(nbresults => $count); + $template->param(Next => ($count>$offset+$pagesize)) if ($count>$offset+$pagesize); $template->param(bookfund => \@loop_data); } #---- END $OP eq DEFAULT - +$template->param(intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), + intranetstylesheet => C4::Context->preference("intranetstylesheet"), + IntranetNav => C4::Context->preference("IntranetNav"), + ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/admin/branches.pl b/admin/branches.pl index 47322cab0c..98f1dd6b15 100755 --- a/admin/branches.pl +++ b/admin/branches.pl @@ -29,7 +29,7 @@ use C4::Search; # Fixed variables my $linecolor1='#ffffcc'; my $linecolor2='white'; -my $backgroundimage="/images/background-mem.gif"; + my $script_name="/cgi-bin/koha/admin/branches.pl"; my $pagesize=20; diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl index 681e48071d..e6b39e1078 100755 --- a/catalogue/ISBDdetail.pl +++ b/catalogue/ISBDdetail.pl @@ -43,18 +43,24 @@ use C4::Context; use C4::Output; use C4::Interface::CGI::Output; use CGI; -use C4::Koha; +use C4::Search; +use MARC::Record; use C4::Biblio; +use C4::Acquisition; +use HTML::Template; my $query=new CGI; my $dbh=C4::Context->dbh; -my $biblionumber=$query->param('biblionumber'); -my $itemtype = &MARCfind_frameworkcode($dbh,$biblionumber); +my $biblionumber=$query->param('bib'); +my $bibid = $query->param('bibid'); +$bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$biblionumber) unless $bibid; +$biblionumber = &MARCfind_oldbiblionumber_from_MARCbibid($dbh,$bibid) unless $biblionumber; +my $itemtype = &MARCfind_frameworkcode($dbh,$bibid); my $tagslib = &MARCgettagslib($dbh,1,$itemtype); -my $record =MARCgetbiblio($dbh,$biblionumber); +my $record =MARCgetbiblio($dbh,$bibid); # open template my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "catalogue/ISBDdetail.tmpl", @@ -129,13 +135,12 @@ sub get_authorised_value_desc ($$$$$) { #---- branch if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) { - return getbranchdetail($value)->{branchname}; + return getbranchname($value); } #---- itemtypes if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "itemtypes" ) { - my $itemtypedef = getitemtypeinfo($itemtype); - return $itemtypedef->{description}; + return ItemType($value); } #---- "true" authorized value diff --git a/catalogue/catalogue-search.pl b/catalogue/catalogue-search.pl index a583d78b22..0a5d9807a6 100644 --- a/catalogue/catalogue-search.pl +++ b/catalogue/catalogue-search.pl @@ -1,8 +1,7 @@ #!/usr/bin/perl use strict; -require Exporter; + use CGI; -#use C4::Interface::CGI::KOHACGI; use C4::Search; use C4::Auth; use C4::Interface::CGI::Output; @@ -12,7 +11,7 @@ use POSIX qw(ceil floor); my $query = new CGI; my $dbh = C4::Context->dbh; -$query->charset('UTF8'); + my $op = $query->param('op'); #show the search form or execute the search my $format=$query->param('MARC'); @@ -28,12 +27,29 @@ my $reorder=$query->param('reorder'); my $number_of_results=$query->param('number_of_results'); my $zoom=$query->param('zoom'); my $ascend=$query->param('asc'); + +my @marclist = $query->param('marclist'); # collect all the fields ... my %search; my @forminputs; #this is for the links to navigate among the results my (@searchdesc, %hashdesc); #this is to show the description of the current search my @fields = ('value', 'kohafield', 'and_or', 'relation','order','barcode','biblionumber','itemnumber','asc','from'); +###Collect all the marclist values coming from old Koha MARCdetails +## Although we can not search on all marc fields- if any is matched in Zebra we can use it it +my $sth=$dbh->prepare("Select marctokoha from koha_attr where tagfield=? and tagsubfield=? and intrashow=1"); +foreach my $marc (@marclist) { + if ($marc) { + $sth->execute(substr($marc,0,3),substr($marc,3,1)); + if ((my $kohafield)=$sth->fetchrow){ + push @kohafield,$kohafield; + push @and_or,"\@or"; + push @value,@value[0] if @kohafield>1; + push @relation ,"\@attr 5=1"; + } + } +} +#### Now normal search routine foreach my $field (@fields) { $search{$field} = $query->param($field); if ($search{$field}) { diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index e9975f8ab4..cbf800e608 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -26,7 +26,6 @@ use C4::Koha; use CGI; use C4::Search; use C4::Acquisition; -use C4::Output; # contains gettemplate use C4::Auth; use C4::Interface::CGI::Output; use C4::Date; @@ -34,7 +33,7 @@ use C4::Context; use C4::Biblio; use C4::Accounts2; use C4::Circulation::Circ2; -use MARC::Record; + my $dbh=C4::Context->dbh; my $query=new CGI; diff --git a/export/export.pl b/export/export.pl deleted file mode 100755 index 9ac7c83c5b..0000000000 --- a/export/export.pl +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/perl -## This script allows you to export a rel_2_2 bibliographic db in -#MARC21 format from the command line. -# -use HTML::Template; -use strict; -require Exporter; -use C4::Database; -use C4::Auth; -use C4::Interface::CGI::Output; -use C4::Output; # contains gettemplate -use C4::Biblio; -use CGI; -use C4::Auth; -my $outfile = $ARGV[0]; -open(OUT,">$outfile") or die $!; -my $query = new CGI; - my $start_bib = $query->param("start_bib"); - my $end_bib = $query->param("end_bib"); - my $dbh=C4::Context->dbh; - my $sth; - if ($start_bib && $end_bib) { - $sth=$dbh->prepare("select bibid from marc_biblio where bibid >=? and bibid <=? order by bibid"); - $sth->execute($start_bib,$end_bib); - } else { - $sth=$dbh->prepare("select bibid from marc_biblio order by bibid"); - $sth->execute(); - } - while (my ($bibid) = $sth->fetchrow) { - my $record = MARCgetbiblio($dbh,$bibid); - - print OUT $record->as_usmarc(); - } -close(OUT); diff --git a/export/marc.pl b/export/marc.pl deleted file mode 100755 index da8e8ee7ef..0000000000 --- a/export/marc.pl +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/perl -use HTML::Template; -use strict; -require Exporter; -use C4::Database; -use C4::Auth; -use C4::Interface::CGI::Output; -use C4::Output; # contains gettemplate -use C4::Biblio; -use CGI; -use C4::Koha; - -my $query = new CGI; -my $op=$query->param("op"); -my $dbh=C4::Context->dbh; - -if ($op eq "export") { - print $query->header( -type => 'application/octet-stream', - -attachment=>'koha.mrc'); - my $start_bib = $query->param("start_bib"); - my $end_bib = $query->param("end_bib"); - my $format = $query->param("format"); - my $branch = $query->param("branch"); - my $start_callnumber = $query->param("start_callnumber"); - my $end_callnumber = $query->param("end_callnumber"); - my $limit = $query->param("limit"); - my $strsth; - $strsth="select bibid from marc_biblio "; - if ($start_bib && $end_bib) { - $strsth.=" where biblionumber>=$start_bib and biblionumber<=$end_bib "; - }elsif ($format) { - if ($strsth=~/ where/){ - $strsth=~s/ where (.*)/,biblioitems where biblioitems.biblionumber=marc_biblio.biblionumber and biblioitems.itemtype=\'$format\' and $1/; - }else { - $strsth.=",biblioitems where biblioitems.biblionumber=marc_biblio.biblionumber and biblioitems.itemtype=\'$format\'"; - } - } elsif ($branch) { - if ($strsth=~/ where/){ - $strsth=~s/ where (.*)/,items where items.biblionumber=marc_biblio.biblionumber and items.homebranch=\'$branch\' and $1/; - }else { - $strsth.=",items where items.biblionumber=marc_biblio.biblionumber and items.homebranch=\'$branch\'"; - } - } elsif ($start_callnumber && $end_callnumber) { - $start_callnumber=~s/\*/\%/g; - $start_callnumber=~s/\?/\_/g; - $end_callnumber=~s/\*/\%/g; - $end_callnumber=~s/\?/\_/g; - if ($strsth=~/,items/){ - $strsth.=" and items.itemcallnumber between \'$start_callnumber\' and \'$end_callnumber\'"; - } else { - if ($strsth=~/ where/){ - $strsth=~s/ where (.*)/,items where items.biblionumber=marc_biblio.biblionumber and items.itemcallnumber between \'$start_callnumber\' and \'$end_callnumber\' and $1/; - }else { - $strsth=~",items where items.biblionumber=marc_biblio.biblionumber and items.itemcallnumber between \'$start_callnumber\' and \'$end_callnumber\' "; - } - } - } - $strsth.=" order by marc_biblio.biblionumber "; - $strsth.= "LIMIT 0,$limit " if ($limit); - warn "requête marc.pl : ".$strsth; - my $req=$dbh->prepare($strsth); - $req->execute; - while (my ($bibid) = $req->fetchrow) { - my $record = MARCgetbiblio($dbh,$bibid); - - print $record->as_usmarc(); - } -} else { - my $sth=$dbh->prepare("Select itemtype,description from itemtypes order by description"); - $sth->execute; - my @itemtype; - my %itemtypes; - push @itemtype, ""; - $itemtypes{''} = ""; - while (my ($value,$lib) = $sth->fetchrow_array) { - push @itemtype, $value; - $itemtypes{$value}=$lib; - } - - my $CGIitemtype=CGI::scrolling_list( -name => 'format', - -values => \@itemtype, - -default => '', - -labels => \%itemtypes, - -size => 1, - -tabindex=>'', - -multiple => 0 ); - $sth->finish; - - my $branches = getallbranches; - my @branchloop; - foreach my $thisbranch (keys %$branches) { -# my $selected = 1 if $thisbranch eq $branch; - my %row =(value => $thisbranch, -# selected => $selected, - branchname => $branches->{$thisbranch}->{'branchname'}, - ); - push @branchloop, \%row; - } - - my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "export/marc.tmpl", - query => $query, - type => "intranet", - authnotrequired => 0, - flagsrequired => {parameters => 1, management => 1, tools => 1}, - debug => 1, - }); - $template->param(branchloop=>\@branchloop, - CGIitemtype=>$CGIitemtype, - intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), - ); - output_html_with_http_headers $query, $cookie, $template->output; -} - diff --git a/import/breeding.pl b/import/breeding.pl deleted file mode 100755 index 97c2d6b9b0..0000000000 --- a/import/breeding.pl +++ /dev/null @@ -1,204 +0,0 @@ -#!/usr/bin/perl - -# $Id$ - -# Script for handling import of MARC data into Koha db -# and Z39.50 lookups - -# Koha library project www.koha.org - -# Licensed under the GPL - - -# Copyright 2000-2002 Katipo Communications -# -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA - -use strict; - -# standard or CPAN modules used -use CGI; - -# Koha modules used -use C4::Context; -use C4::Interface::CGI::Output; -use C4::Input; -use C4::Biblio; -use C4::Output; -use C4::Auth; -use C4::Breeding; - -#------------------ -# Constants - - - -# HTML colors for alternating lines -my $lc1='#dddddd'; -my $lc2='#ddaaaa'; - -#------------- -#------------- -# Initialize - -my $userid=$ENV{'REMOTE_USER'}; - -my $input = new CGI; -my $dbh = C4::Context->dbh; - -my $uploadmarc=$input->param('uploadmarc'); -my $overwrite_biblio = $input->param('overwrite_biblio'); -my $filename = $input->param('filename'); -my $syntax = $input->param('syntax'); -my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "import/breeding.tmpl", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => {parameters => 1, management => 1, tools => 1}, - debug => 1, - }); - -$template->param(SCRIPT_NAME => $ENV{'SCRIPT_NAME'}, - uploadmarc => $uploadmarc); -if ($uploadmarc && length($uploadmarc)>0) { - my $marcrecord=''; - while (<$uploadmarc>) { - $marcrecord.=$_; - } - my ($notmarcrecord,$alreadyindb,$alreadyinfarm,$imported) = ImportBreeding($marcrecord,$overwrite_biblio,$filename,$syntax,""); - - $template->param(imported => $imported, - alreadyindb => $alreadyindb, - alreadyinfarm => $alreadyinfarm, - notmarcrecord => $notmarcrecord, - total => $imported+$alreadyindb+$alreadyinfarm+$notmarcrecord, - ); - -} - -output_html_with_http_headers $input, $cookie, $template->output; -my $menu; -my $file; - - -#--------------- -# log cleared, as marcimport is (almost) rewritten from scratch. -# $Log$ -# Revision 1.6 2006/09/06 16:21:04 tgarip1957 -# Clean up before final commits -# -# Revision 1.2.4.1 2005/04/07 10:10:52 tipaul -# copying processz3950queue from 2.0 branch. The 2.2 version misses an important fix -# -# Revision 1.2 2003/10/06 09:10:38 slef -# Removing config info from z3950*sh and using C4::Context in processz3950queue (Fixed bug 39) -# -# Revision 1.1 2003/06/04 13:46:25 tipaul -# moving breeding farm import to parameters page (GUI) and to new import/ directory (code structure) -# -# Revision 1.33 2003/04/29 16:48:36 tipaul -# really proud of this commit :-) -# z3950 search and import seems to works fine. -# Let me explain how : -# * a "search z3950" button is added in the addbiblio template. -# * when clicked, a popup appears and z3950/search.pl is called -# * z3950/search.pl calls addz3950search in the DB -# * the z3950 daemon retrieve the records and stores them in z3950results AND in marc_breeding table. -# * as long as there as searches pending, the popup auto refresh every 2 seconds, and says how many searches are pending. -# * when the user clicks on a z3950 result => the parent popup is called with the requested biblio, and auto-filled -# -# Note : -# * character encoding support : (It's a nightmare...) In the z3950servers table, a "encoding" column has been added. You can put "UNIMARC" or "USMARC" in this column. Depending on this, the char_decode in C4::Biblio.pm replaces marc-char-encode by an iso 8859-1 encoding. Note that in the breeding import this value has been added too, for a better support. -# * the marc_breeding and z3950* tables have been modified : they have an encoding column and the random z3950 number is stored too for convenience => it's the key I use to list only requested biblios in the popup. -# -# Revision 1.32 2003/04/22 12:22:54 tipaul -# 1st draft for z3950 client import. -# moving Breeding farm script to a perl package C4/Breeding.pm -# -# Revision 1.31 2003/02/19 01:01:07 wolfpac444 -# Removed the unecessary $dbh argument from being passed. -# Resolved a few minor FIXMEs. -# -# Revision 1.30 2003/02/02 07:18:38 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.29 2003/01/28 15:28:31 tipaul -# removing use MARC::Charset -# Was a buggy test -# -# Revision 1.28 2003/01/28 15:00:31 tipaul -# user can now search in breeding farm with isbn/issn or title. Title/name are stored in breeding farm and showed when a search is done -# -# Revision 1.27 2003/01/26 23:21:49 acli -# Handle non-latin1 charsets -# -# Revision 1.26 2003/01/23 12:26:41 tipaul -# upgrading import in breeding farm (you can now search on ISBN or on title) AND character encoding. -# -# Revision 1.25 2003/01/21 08:13:50 tipaul -# character encoding ISO646 => 8859-1, first draft -# -# Revision 1.24 2003/01/14 16:41:17 tipaul -# bugfix : use gettemplate_and_user instead of gettemplate. -# fix a blank screen in 1.3.3 in "import in breeding farm" -# -# Revision 1.23 2003/01/06 13:06:28 tipaul -# removing trailing # -# -# Revision 1.22 2002/11/12 15:58:43 tipaul -# road to 1.3.2 : -# * many bugfixes -# * adding value_builder : you can map a subfield in the marc_subfield_structure to a sub stored in "value_builder" directory. In this directory you can create screen used to build values with any method. In this commit is a 1st draft of the builder for 100$a unimarc french subfield, which is composed of 35 digits, with 12 differents values (only the 4th first are provided for instance) -# -# Revision 1.21 2002/10/22 15:50:23 tipaul -# road to 1.3.2 : adding a biblio in MARC format. -# seems to work a few. -# still to do : -# * manage html checks (mandatory subfields...) -# * add list of acceptable values (authorities) -# * manage ## in MARC format -# * manage correctly repeatable fields -# and probably a LOT of bugfixes -# -# Revision 1.20 2002/10/16 12:46:19 arensb -# Added a FIXME comment. -# -# Revision 1.19 2002/10/15 10:14:44 tipaul -# road to 1.3.2. Full rewrite of marcimport.pl. -# The acquisition system in MARC version will work like this : -# * marcimport will put marc records into a "breeding farm" table. -# * when the user want to add a biblio, he enters first the ISBN/ISSN of the biblio. koha searches into breeding farm and if the record exists, it is shown to the user to help him adding the biblio. When the biblio is added, it's deleted from the breeding farm. -# -# This commit : -# * modify acqui.simple home page (addbooks.pl) -# * adds import into breeding farm -# -# Please note that : -# * z3950 functionnality is dropped from "marcimport" will be added somewhere else. -# * templates are in a new acqui.simple sub directory, and the marcimport template directory will become obsolete soon.I think this is more logic -# diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/admin-home.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/admin-home.tmpl index 40a2db0c67..115428f732 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/admin/admin-home.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/admin-home.tmpl @@ -3,8 +3,9 @@ -

Koha Administration

- +
+

NEULIS Administration

+ diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/aqbookfund.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/aqbookfund.tmpl index 3e1a3e3ee3..7ab1870e16 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/admin/aqbookfund.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/aqbookfund.tmpl @@ -1,98 +1,66 @@ - -Koha -- System Administration: Book Funds +Koha -- System Administration: Book Funds + +Data Recorded +Confirm Deletion of Fund '' +Data Deleted -

Book Fund Administration

- - - - - - - - + + + +
You Searched for
+ +
CodeNameBranchActions
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Book FundNameBranchEditDelete
?op=add_form&bookfundid= ">
" method="get">" />
" method="get">" />
 BudgetBranch
" />
  + - : + + + + +   + +
" />
" />
" method="post"> - - - - - - " /> - - - - - - - - -
- -
- - - - - - - - - - - - - - - - - None - - - - ?op=add_form&bookfundid=">Edit - ?op=delete_confirm&bookfundid=">Delete - ">Add budget - - ">Show budgets - - - - - - - -
- - -

- Add bookfund - Show all budgets -

- -
- +

+ + - +
" name="Aform" method="post"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Book fund - " /> - -
Book fund - -
Name - " - /> -
Branch -
- -

- - -

+ + +
+ + + + + + + + + +
Book fund" />
Book fund
Name" />
Select one if budget is branch-specific, otherwise, leave it blank.
+
+

" onclick="Check(this.form); return false;" class="submit" /> '; return false;" />

- +

Data Recorded

- -

- ">Return to fund list -

+
" method="post"> + +

Confirm Deletion of Fund

- - - - - - - - - - - - - -
Book fund
Name
Group
- -
" method="post"> - - " /> - -
- -
-
- -
" method="post"> - -
- +
+ + +
Book fund
Name
Group
" method="post">" />
" method="post">
+

Data Deleted

-
" method="post"> - -
- +
" method="post"> +
+ + diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/aqbudget.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/aqbudget.tmpl index 23371440dd..74ba3d8f3b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/admin/aqbudget.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/aqbudget.tmpl @@ -87,7 +87,7 @@ Koha -- System Administration: Budgets Calendar.setup( { inputField : "filter_startdate", - ifFormat : "", + ifFormat : "%Y-%m-%d",, button : "filter_startdate_button" } ); @@ -119,7 +119,7 @@ Koha -- System Administration: Budgets Calendar.setup( { inputField : "filter_enddate", - ifFormat : "", + ifFormat :"%Y-%m-%d", button : "filter_enddate_button" } ); @@ -256,7 +256,7 @@ Koha -- System Administration: Budgets Calendar.setup( { inputField : "startdate", - ifFormat : "", + ifFormat : "%Y-%m-%d", button : "startdate_button" } ); @@ -274,7 +274,7 @@ Koha -- System Administration: Budgets Calendar.setup( { inputField : "enddate", - ifFormat : "", + ifFormat : "%Y-%m-%d", button : "enddate_button" } ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/auth_subfields_structure.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/auth_subfields_structure.tmpl index 91c9b44e21..87ee6f2e16 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/admin/auth_subfields_structure.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/auth_subfields_structure.tmpl @@ -3,8 +3,7 @@ - -!-- TMPL_IF NAME="add_form" --> +

Edit MARC subfields constraints @@ -19,7 +18,6 @@ " name="seealso" value="" size="20" /> (example for 200a: '200c','200d','200e'...) - @@ -81,7 +79,6 @@

Authority MARC subfield structure admin for (authority: )

This screen shows the subfields associated with the selected tag. You can edit subfields or add a new one by clicking on edit.

-

The column Koha field shows that the subfield is linked with a Koha field. Koha can manage a MARC interface, and a Koha interface. This link ensures that both DB are synchronized

Editor constaints
@@ -104,7 +101,6 @@ subfield ignoredTab:, - | Koha field:, Repeatable, Not repeatable,Mandatory, Not mandatory, | See Also:, @@ -132,5 +128,4 @@ - diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/biblios_framework.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/biblios_framework.tmpl new file mode 100644 index 0000000000..bafec42ccd --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/biblios_framework.tmpl @@ -0,0 +1,131 @@ +Koha -- System Administration + + + + + + + + + " name="Aform" method="post"> + + +
+ + + + + + + + + + +
Modify framework textAdd framework
" />
+ " />
+

+ + + + +

Delete framework for ()?

+ +
This framework is used times
+ +

+

" method="post">" /> +
+
" method="post">
+

+ + + +

Biblio framework

+

Framework name, then go to MARC biblio to set MARC editor parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + +
CodeDescription EditDelete
 Default framework">MARC structure  
" >MARC structure?op=add_form&frameworkcode=">Edit?op=delete_confirm&frameworkcode=">Delete
+
" method="post"> + + + "><< Previous + ">Next >> +
+ + diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/biblios_subfields_structure.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/biblios_subfields_structure.tmpl new file mode 100644 index 0000000000..a0f73046f9 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/biblios_subfields_structure.tmpl @@ -0,0 +1,134 @@ +Koha -- System Administration: +Modify system preference ''Add a system preferenceData Added +Confirm Deletion of Parameter ''Parameter DeletedPreferences + + + + + + + +

+ Edit MARC subfields constraints +

+
" name="Aform" method="post"> + + " /> + +
">

Tag , Subfield

+ + + + + +
MARC constraints
" name="seealso" value="" size="20" /> (example for 200a: '200c','200d','200e'...)
+ + + + + + + + + + +
Editor constaints
" type="text" name="liblibrarian" value="" size="40" maxlength="80" />
" name="libopac" value="" size="40" maxlength="80" />
(ignore means that the subfield is NOT managed by Koha)
Opac: Intranet: Editor: (see online help)
(if checked, it means that the subfield is an URL and can be clicked
+
    +
  • Authorized Value:
  • +
  • Thesaurus:
  • +
  • Plugin:
  • +
  • Link: " size="10" maxlength="5" /> (exemple:200b)
  • +
+
+
+ + +

Note: in the last column, you can choose: +

  • An "authorised value": it refers to a list of authorised values for this subfield. See the corresponding admin table.
  • +
  • A "thesaurus category": it refers to a thesaurus category. See the corresponding admin table.
  • +
  • A "value builder": values builders are perl programs that help you select the value of the field. They are MARC-flavor dependant and sometimes fill another subfield automatically.
  • +
+

+
+ + + + +
+ + + + + + +
Confirm Deletion of Subfield ?
Subfield
Description
+
" method="post"> + " /> + " />" />" /> +
" method="post"> " /> " /> " /> " /> +
+ + + + + Data deleted +
" method="post">"> + +
+ + + + +

MARC subfield structure admin for (framework )

+

This screen shows the subfields associated with the selected tag. You can edit subfields or add a new one by clicking on edit.

+ + + + + + + + + + + + + + + + +
SubfieldTextConstraintsDelete
+ + + + + + + + subfield ignored + + Tab:, + Repeatable, Not repeatable, + Mandatory, Not mandatory, + | See Also: , + hidden, + is an url, + | Auth value:, + | Authority:, + | Plugin:, + | Link:, + + ">Delete
+
" method="get">" />" />
" />" />
+ + //images/1leftarrow.png" title="previous" alt="previous" border="0" > + + + + //images/1rightarrow.png" title="next" alt="next" border="0" /> + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/bibliostagstructure.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/bibliostagstructure.tmpl new file mode 100644 index 0000000000..b98b45a9f0 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/bibliostagstructure.tmpl @@ -0,0 +1,207 @@ +Koha -- System Administration: + +Confirm Deletion of Tag '' +Data Deleted +MARC tag Structure + + + + + +

MARC tag structure admin for ()default MARC framework

+ + + + +
" name="Aform" method="post"> + + " /> +
+ + + + + + + +
Modify tagAdd tag
" size="80" maxlength="100" />
" size="80" maxlength="100" />
(if you select a value here, the indicators will be limited to the authorised value list)
+

+

?frameworkcode='; return false;" />

+
+ + + + +
+ + + +
Confirm Deletion of Tag ?
Tag:
Description:
+
" method="post">" />" />
" method="post">
+ + + + +

Tag Deleted

+
" method="post">" /> + +
+ + + + +
" method="post"> + + " /> + Create framework for () using + + +
+ + + +
" method="post"> + + " size="5" /> + +

+ + + + +

+
+
NOTE : Framework consists of 2 parts biblio & holdings. This is for BIBLIOGRAPHIC definitions, and main framework definer
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TagLabelRepeatableMandatoryAuthorized valueSubfields 
YesNoYesNo">Edit Subfields">Edit Tag ">Delete Tag
+   + +
    + +
  • Tab: | $ + , repeatable, Mandatory, See , , , +
  • + +
+
YesNoYesNo">View Subfields">Edit Tag ">Delete Tag
+
+ +
" method="get"> + " name="offset" />" name="searchfield" />" name="frameworkcode" />
+ + +
" method="post"> + + " /> +
+ + +
" method="get">" />" /> + " />
+ +
+
+ + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/checkmarc.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/checkmarc.tmpl index c540746604..d68857c2ec 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/admin/checkmarc.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/checkmarc.tmpl @@ -1,76 +1,87 @@ Koha -- System Administration: MARC Check: errors foundConfiguration OK! - - + -

MARC Checks

- - + + + + + + + + + + + + - + - + - - + + - - + + - + - - - - - - - - - - - - - + + + + + + + + + + + + + - - + - + @@ -82,7 +93,7 @@ - @@ -93,35 +104,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -132,7 +114,7 @@
Test Result
biblionumberThe biblio.biblionumber and items.biblionumber fields MUST : +
  • each be mapped to a MARC field/subfield,
  • +
OKbiblionumber mapped correctly
itemnum
  • The field itemnum MUST be mapped
  • -
  • The correspounding subfield MUST be in with -1 (ignore) tab
  • The field itemnumber MUST be mapped
  • +
  • The corresponding fileld or subfield MUST be in tab 10 and may be hidden
OKitemnum : the field itemnumber is mapped to a field in tab -1The field itemnumber is mapped to a MARC field
item fieldsALL items fields MUST :
-
  • be mapped to the same tag,
  • -
  • and they must all be in the 10 (items) tab
itemnum
  • The field barcodde MUST be mapped
  • +
  • The corresponding field or subfield MUST be in tab 10 and may be hidden
OKAll item fields are in the same tag and in item tabThe field barcode is mapped to a MARC field
Item tagThere is more than 1 MARC tag related to items tab (10) :
OKOnly 1 MARC tag mapped to items
ISBN NOT mappedisbn MUST :
+
  • be mapped to a MARC subfield,
  • +
OKISBN defined
itemtype NOT mappedthe biblioitems.itemtype field MUST :
+
itemtype field MUST :
  • be mapped to a MARC subfield,
  • the correspounding subfield MUST have authorised_value=itemtype
OKbiblioitems.itemtype defineditemtype mapped
homebranch NOT mappedthe items.homebranch field MUST :
+
homebranch MUST :
  • be mapped to a MARC subfield,
  • -
  • the correspounding subfield MUST have authorised value=branches
holdingbranch NOT mappedthe items.holdingbranch field MUST :
+
the holdingbranch MUST :
  • be mapped to a MARC subfield,
  • the correspounding subfield MUST have authorised value=branches
biblio and biblionumberThe biblio.biblionumber and biblioitems.biblioitemnumber fields MUST : -
  • be mapped to a MARC subfield,
  • -
  • be in the SAME tag (for example : 090$a and 090$b)
  • -
  • be in tab -1
OKbiblionumber and biblioitemnumber mapped correctly
framework valuesthere is a null value in a frameworkcode. Check the following tables
-
  • select * from marc_subfield_structure where frameworkcode is NULL
  • -
  • select * from marc_tag_structure where frameworkcode is NULL
  • -
  • select * from marc_biblio where frameworkcode is NULL
  • OKno NULL value in frameworkcode
    -

    Configuration OK, you don't have errors in your MARC parameters table

    +

    Configuration OK, you don't have errors in your MARC parameters

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/holdings_subfields_structure.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/holdings_subfields_structure.tmpl new file mode 100644 index 0000000000..f9b41659e5 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/holdings_subfields_structure.tmpl @@ -0,0 +1,131 @@ +Koha -- System Administration: +Modify system preference ''Add a system preferenceData Added +Confirm Deletion of Parameter ''Parameter DeletedPreferences + + + + + +

    + Edit MARC subfields constraints +

    +
    " name="Aform" method="post"> + + " /> + +
    ">

    Tag , Subfield

    + + + + + +
    MARC constraints
    " name="seealso" value="" size="20" /> (example for 200a: '200c','200d','200e'...)
    + + + + + + + + + + +
    Editor constaints
    " type="text" name="liblibrarian" value="" size="40" maxlength="80" />
    " name="libopac" value="" size="40" maxlength="80" />
    (ignore means that the subfield is NOT managed by Koha)
    Opac: Intranet: Editor: (see online help)
    (if checked, it means that the subfield is an URL and can be clicked
    +
      +
    • Authorized Value:
    • +
    • Thesaurus:
    • +
    • Plugin:
    • +
    • Link: " size="10" maxlength="5" /> (exemple:200b)
    • +
    +
    +
    + + +

    Note: in the last column, you can choose: +

    • An "authorised value": it refers to a list of authorised values for this subfield. See the corresponding admin table.
    • +
    • A "thesaurus category": it refers to a thesaurus category. See the corresponding admin table.
    • +
    • A "value builder": values builders are perl programs that help you select the value of the field. They are MARC-flavor dependant and sometimes fill another subfield automatically.
    • +
    +

    +
    + + + + +
    + + + + + + +
    Confirm Deletion of Subfield ?
    Subfield
    Description
    +
    " method="post"> + " /> + " />" />" /> +
    " method="post"> " /> " /> " /> " /> +
    + + + + + Data deleted +
    " method="post">"> + +
    + + + + +

    Holdings MARC subfield structure admin for (framework )

    +

    This screen shows the subfields associated with the selected tag. You can edit subfields or add a new one by clicking on edit.

    + + + + + + + + + + + + + + + +
    SubfieldTextConstraintsDelete
    + + + + + + + + subfield ignored + + Tab:, + Repeatable, Not repeatable, + Mandatory, Not mandatory, + | See Also: , + hidden, + is an url, + | Auth value:, + | Authority:, + | Plugin:, + | Link:, + + ">Delete
    +
    " method="get">" />" />
    " />" />
    + + //images/1leftarrow.png" title="previous" alt="previous" border="0" > + + + + //images/1rightarrow.png" title="next" alt="next" border="0" /> + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/holdingstagstructure.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/holdingstagstructure.tmpl new file mode 100644 index 0000000000..4226a50293 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/holdingstagstructure.tmpl @@ -0,0 +1,205 @@ +Koha -- System Administration: + +Confirm Deletion of Tag '' +Data Deleted +MARC tag Structure + + + +

    Holdings MARC tag structure admin for ()default MARC framework

    + + + + +
    " name="Aform" method="post"> + + " /> +
    + + + + + + + +
    Modify tagAdd tag
    " size="80" maxlength="100" />
    " size="80" maxlength="100" />
    (if you select a value here, the indicators will be limited to the authorised value list)
    +

    +

    ?frameworkcode='; return false;" />

    +
    + + + + +
    + + + +
    Confirm Deletion of Tag ?
    Tag:
    Description:
    +
    " method="post">" />" />
    " method="post">
    + + + + +

    Tag Deleted

    +
    " method="post">" /> + +
    + + + + +
    " method="post"> + + " /> + Create framework for () using + + +
    + + + +
    " method="post"> + + " size="5" /> + +

    + + + + +

    +
    +
    NOTE : Framework consists of 2 parts biblio & holdings. This is for HOLDINGS definition.
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TagLabelRepeatableMandatoryAuthorized valueSubfields 
    YesNoYesNo">Edit Subfields">Edit Tag ">Delete Tag
    +   + +
      + +
    • Tab: | $ + , repeatable, Mandatory, See , , , +
    • + +
    +
    YesNoYesNo">View Subfields">Edit Tag ">Delete Tag
    +
    + +
    " method="get"> + " name="offset" />" name="searchfield" />" name="frameworkcode" />
    + + +
    " method="post"> + + " /> +
    + + +
    " method="get">" />" /> + " />
    + +
    +
    + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/institutions-careers.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/institutions-careers.tmpl new file mode 100644 index 0000000000..b19e17c4a5 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/institutions-careers.tmpl @@ -0,0 +1,126 @@ +System Administration + + + + +
    +

    Educational institutions (Courses)

    + + + +
    + "> + "> + Educational institution name:   + " +

    + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + ">//images/fileopen.png" border="0"> + + )" >//images/edittrash.png" border="0"> + + ">Add course +
    + ', this)" src="/images/more.gif"> Courses + +
    + " style="border-spacing:5px;border-collapse:separate;border:0;display:none"> + + + + + + + + + + + + + +
    +
    +
    + + + &id_institution=">Edit + + )" value="Delete"> +
    +
    +
    +
    +
    + Add educational institution + + + +
    + diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/koha-electronic.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/koha-electronic.tmpl new file mode 100644 index 0000000000..dd39f2c3da --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/koha-electronic.tmpl @@ -0,0 +1,113 @@ +System Administration + + +
    +

    OPAC Online Databases

    + + +
    + "> + "> + + + + + + + + + + + + + + + + + +
    Language + + + Section + +
    Title: + ">URL: + ">Resim: + ">
    Text
    + + +
    +
    + + + + + + +
    + Language: + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + LanguageimageURLTitleText
    " + ">//images/fileopen.png" border="0"> +
    + + +
    + +
    No databases loaded
    + + +
    + + +
    + + + + +
    + diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/koha_attr.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/koha_attr.tmpl new file mode 100644 index 0000000000..268403af37 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/koha_attr.tmpl @@ -0,0 +1,194 @@ +Koha -- System Administration: + +Confirm Deletion of attribute '' +Data Deleted +MARC tag Structure + + + +

    KOHA attr matching for biblios,holdings and authorities XML & MARC records

    + + + + +
    " name="Aform" method="post"> + + +
    + + + + + + + + + + + +
    Modify tagAdd tag
    " size="80" maxlength="100" />
    " size="40" maxlength="80" />Add all common attributes to field
    +

    +

    '; return false;" />

    +
    + + + + +
    + + + +
    Confirm Deletion of Field ?
    Kohafield:
    Description:
    +
    " method="post">
    " method="post">
    + + + + +

    Field Deleted

    +
    " method="post"> + +
    + + + + + +
    " method="post"> + + " size="60" /> + +

    + + + + +

    +
    +
    NOTE : if you change the link between a KOHA field and a Z39.50 attribute, ask your administrator to reindex ZEBRA with these attributes.
    + +
    + + + + + + + + + + + + + + + + + " /> + " /> + + + + + + + + + + + + + + + + + + + " /> + + + + + + + + + + + + + +
    Koha fieldAttributeMARC tag/subLabelSortsIntra ShowOpac ShowRelated record 
    YesNoYesNoYesNo">Edit Tag ">Delete Tag
    +   +
    YesNoYesNoYesNo">Edit Tag ">Delete Tag
    +
    + +
    " method="get"> + " name="offset" />" name="searchfield" />
    + + +
    " method="post"> + + + +
    + + +
    " method="get">" />" /> +
    + +
    +
    + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/stopwords.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/stopwords.tmpl index e998666bcf..d1b48cd5f0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/admin/stopwords.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/stopwords.tmpl @@ -1,97 +1,160 @@ - -Koha -- System Administration: Stop Words Administration +Koha -- System Administration: +Stop Words Administration +Modify Stop WordAdd Stop Word +Stop Word Added +Confirm Deletion of Stop Word '' +Stop Word Deleted + + + + +
    + + + + + +
    + + +

    Modify Stop Word

    + +

    Add Stop Word

    + + + + + + + + + + + + + +
    Stop Word +
    Stop Word: + +

    Update Stop WordAdd Stop Word " onclick="Check(this.form);" class="submit" /> ';" />

    +
    + - - - - - -

    Stop Words Administration

    - -
      - -
    • Stop Words Added
    • - - - -
    • Stop Words Deleted
    • - -
    - -
    + +

    Stop Word Added

    +
    " method="post"> + +
    + -
    - Confirm - -

    Confirm Deletion of the following Stop Words:

    -
      - -
    • - - " /> -
    • - -
    - -

    - - -

    -
    +

    Confirm Deletion of Stop Word

    + + + + +
    Stop Word:
    " method="post"> + + " /> +
    " method="post"> + +
    -
    - Add Stop Words - - - - - - -
    Stop Words - -
    - -

    - - -

    -
    - -
    - Stop Words selection + +

    Stop Word Deleted

    +
    " method="post"> + +
    + -

    - " /> - -

    + +

    Stop Words Administration

    +
    " method="post"> + " /> + +
    +
    + You searched for +
    + + + + + + + + + + + + +
    Word 
    ?op=delete_confirm&searchfield=">Delete
    + +
    +
    " method="get">" />
    +
    " method="post"> + +
    +
    " method="get">" />
    +
    + -
      - -
    • - -
    • - -
    + -
    + -

    - - -

    -
    - + +
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/systempreferences.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/systempreferences.tmpl index 3e54134dff..64eaeaeeda 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/admin/systempreferences.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/systempreferences.tmpl @@ -169,6 +169,15 @@ +
  • + + Intranet + + + Intranet + + +
  • Catalogue diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/thesaurus.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/thesaurus.tmpl index a814c62d19..0bdfec6be6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/admin/thesaurus.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/thesaurus.tmpl @@ -1,17 +1,19 @@ Koha -- System Administration: Thesaurus Management + + + - - - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/admin/viewlog.tmpl b/koha-tmpl/intranet-tmpl/prog/en/admin/viewlog.tmpl index 83da23b99e..8cea2c5dcb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/admin/viewlog.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/admin/viewlog.tmpl @@ -1,14 +1,15 @@ -Koha -- Log viewer +System Administration + + +
    - - -

    Koha : LogView for

    +

    Koha : için yapılan işlemler cetveli. Toplam:

    Filtered on

    @@ -16,58 +17,50 @@ function Dopop(link) {
    - +
    - - - - - - - - - - - - - - - - - - - @@ -89,19 +82,19 @@ function Dopop(link) { - - - - - - - @@ -133,18 +126,18 @@ function Dopop(link) {
    Timestamp + Modified on Firstname + Title Surname + Librarian Action + Action Info - Title - Author + Info
    +
    ()
    + , + - -
    Timestamp + Timestamp Firstname + Firstname Surname + Surname Action + Action Info + Info Title + Title Author + Author
    Timestamp + Timestamp Firstname + Firstname Surname + Surname Action + Action Info + Info Title + Title Author + Author
    - - - + + +
    On ModuleUser/Action FiltersObject FilterOn ModuleUser/Action FiltersObject Filter
    @@ -152,10 +145,10 @@ function Dopop(link) { Koha User :

    Action type :

    From @@ -220,8 +213,8 @@ function Dopop(link) {

    -
    -

    Output

    +
    +

    Output

    To screen into the browser
    To file into an application @@ -237,6 +230,3 @@ function Dopop(link) {
    - - - diff --git a/koha-tmpl/intranet-tmpl/prog/en/authorities/auth_finder.tmpl b/koha-tmpl/intranet-tmpl/prog/en/authorities/auth_finder.tmpl new file mode 100644 index 0000000000..1f7aa55ce3 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/authorities/auth_finder.tmpl @@ -0,0 +1,54 @@ +Koha -- Authorities + + + + +
    + +

    Authority search

    + +
    + "> + + + "> + "> +
    +

    Search on

    +

    + + + "> +

    +

    + "> + + + + + "> +

    +

    + + + + + + +

    +

    + +

    +
    +
    +
    + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/authorities/authorities-home.tmpl b/koha-tmpl/intranet-tmpl/prog/en/authorities/authorities-home.tmpl index a31895149f..ea4478aa24 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/authorities/authorities-home.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/authorities/authorities-home.tmpl @@ -1,105 +1,44 @@ - -Koha -- Authorities +Koha -- Authorities + + + + +
    + +
    + + + + " /> +
    + + + +
    Authority search
    " /> + + +
    "> + + +
    +

    + +

    +
    +
    + + - - - - - -
    - Add authority - -
    - - - - - -
    - - - -
    - -
    - -
    -
    -
    - - diff --git a/koha-tmpl/intranet-tmpl/prog/en/authorities/authorities.tmpl b/koha-tmpl/intranet-tmpl/prog/en/authorities/authorities.tmpl index 803b89a13f..2cb0d1c313 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/authorities/authorities.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/authorities/authorities.tmpl @@ -1,107 +1,183 @@ - -Koha -- Authority details - +NEULIS -- Authorities + + + + - - -
    - - Modify authority # () - - Adding authority () - -
    - - - "> - "> - -
    - - - - +/includes/marc-editor.css"> +
    + +
    + +
      +
    • Non UTF-8 characters present or malformed XML
    • +
    • Please correct and save.
    • +
    + +
    -
    - - -
    -

    Duplicate suspected with

    -

    You must either :

    - +&nonav=&linkid="+document.form.f.linkid.value > + +
    +

    Authority number

    +

    ">"> + + + "> + "> + + + + + + +

    +
    +
    + - - - -

    - "> - "> - style="display:none;" name="indicator" size="2" maxlength="2" value="" class="flat"> - + + + + + +

    XX" id="XX" class="tab" style="visibility:hidden"> - style="display:none;" name="indicator" value=""> - - ')">+ -

    +
    XX" id="XX" class="tab" style="visibility:visible"> -
    - -" onclick="unHideSubfield('subfield','label')"> - -
    -')">+ -"/> -" size="2" maxlength="1"/> -"/> -"/> -"/> -
    + + + + + + + +
    "> + +

    + "> + + "> + style="display:none;" name="indicator" size="2" maxlength="2" value="" class="flat"> - + + style="display:none;" name="indicator" value=""> + + + + + ')">+ +

    + + + + " onclick="unHideSubfield('subfield','label')"> + + + +
    +

    + + + + + + ')">+ + + "/> + " size="2" maxlength="1"/> + "/> + "/> +

    +
    + +
    + +
    -
    "> - "> + " value=""> "> - "> ">
    "> - "> + " value=""> "> - "> "> "> - "> + " value=""> "> + + "> + -
    - - - \ No newline at end of file + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/authorities/blinddetail-biblio-search.tmpl b/koha-tmpl/intranet-tmpl/prog/en/authorities/blinddetail-biblio-search.tmpl new file mode 100644 index 0000000000..addbf938a9 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/authorities/blinddetail-biblio-search.tmpl @@ -0,0 +1,41 @@ + + + + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/authorities/blinddetail-linker.tmpl b/koha-tmpl/intranet-tmpl/prog/en/authorities/blinddetail-linker.tmpl index 1fa973319e..f2d23a6949 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/authorities/blinddetail-linker.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/authorities/blinddetail-linker.tmpl @@ -13,46 +13,8 @@ i=index_start //opener.opener.document.f.linkid.value=""; // go forward, until reaching the end of the field. -while (i<=opener.opener.document.f.field_value.length) { - - - - if (opener.opener.document.f.tag[i].value == && opener.opener.document.f.subfield[i].value == '') - { opener.opener.document.f.field_value[i].value = ""; - } - if (opener.opener.document.f.tag[i].value == whichfield && opener.opener.document.f.subfield[i].value == '') - { - opener.opener.document.f.field_value[i].value = ""; - } - - - if (opener.opener.document.f.tag[i].value != whichfield) { - i=opener.opener.document.f.field_value.length; - } - i++; -} -// go backward until the beginning of the field -i=index_start -while (i>=0) { - - - - if (opener.opener.document.f.tag[i].value == && opener.opener.document.f.subfield[i].value == '') - { - opener.opener.document.f.field_value[i].value = ""; - } - if (opener.opener.document.f.tag[i].value == whichfield && opener.opener.document.f.subfield[i].value == '') - { - opener.opener.document.f.field_value[i].value = ""; - } - - - if (opener.opener.document.f.tag[i].value != whichfield) { - i=0; - } - i--; -} + opener.close(); self.close(); return false; diff --git a/koha-tmpl/intranet-tmpl/prog/en/authorities/detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/authorities/detail.tmpl index bdb0e8334c..ab0b7f19cc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/authorities/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/authorities/detail.tmpl @@ -1,53 +1,54 @@ - -Koha -- Authority details +Koha -- Authorities - - - - -

    Authority # ()

    - -
    - + + + + + +
    +/includes/marc-editor.css"> + -
    - - - - - - - - - - - -
    - + - - \ No newline at end of file + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/authorities/linkresultlist-auth.tmpl b/koha-tmpl/intranet-tmpl/prog/en/authorities/linkresultlist-auth.tmpl index a0dfcfddf5..70aa29e85a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/authorities/linkresultlist-auth.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/authorities/linkresultlist-auth.tmpl @@ -6,21 +6,21 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/authorities/searchresultlist-auth.tmpl b/koha-tmpl/intranet-tmpl/prog/en/authorities/searchresultlist-auth.tmpl new file mode 100644 index 0000000000..a14b9fa516 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/authorities/searchresultlist-auth.tmpl @@ -0,0 +1,95 @@ +Koha -- Authorities + + + + +
    + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/authorities/searchresultlist.tmpl b/koha-tmpl/intranet-tmpl/prog/en/authorities/searchresultlist.tmpl index 274f96ad43..aa8984bd00 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/authorities/searchresultlist.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/authorities/searchresultlist.tmpl @@ -1,64 +1,110 @@ - -Koha -- Authorities -- Search result list +Koha -- Authorities + + + - - +
    +

    Authority search results

    + +
    + + + + + + + + + "> + + + + + + + + +
    SummaryUsed inAuthid/Delete
    &op=do_search&zoom=1" class="button authority"> biblio(s)  + + ')">Delete + +
    +
    + +
    -

    Authority search results

    - -
    - -

    - - Results to of - - No results found. - -

    - -
    - - - - - - - - - - - - - - - - - - - -
    SummaryUsed inViewDelete
    - &operator==&value=&and_or=and&excluding=" class="button authority"> biblio(s) - - ">Authority number - - - )">Delete - -
    +From:  To: + +
    + -
    - - \ No newline at end of file +} + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/catalogue/ISBDdetail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/catalogue/ISBDdetail.tmpl index 9bb6bd9014..1712fc3227 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/catalogue/ISBDdetail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/catalogue/ISBDdetail.tmpl @@ -1,64 +1,18 @@ -Koha -- Catalogue MARC detail +Koha -- Catalog: ISBD View + + + - - +
    - -

    MARC biblio :

    - -
    - -
    +
    +" /> +
    " />" />" />" />
    " />'); return false;" />
    " name="bib" />
    " />
    -
    -
    - -
    -
    - -
    -
    "> - -
    -
    - -
    -
    - " /> - -
    -
    - " /> - -
    -
    - " /> - -
    -
    ')"> - -
    -
    ')"> - -
    - -
    "> - -
    - - - -
    "> - -
    - +
    +

    +
    - - diff --git a/koha-tmpl/intranet-tmpl/prog/en/catalogue/MARCdetail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/catalogue/MARCdetail.tmpl index 669a77ef22..8d587cf2ba 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/catalogue/MARCdetail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/catalogue/MARCdetail.tmpl @@ -1,425 +1,250 @@ -Koha -- Catalogue MARC detail +Koha -- Catalog: MARC Record View + +

    MARC Record for number :

    +
    " />
     
    " />
    +
    " />
    " />
    +
    " />
    " />
    " />
    " />
    - - -
    -
    -

    - Biblionumber : - With Framework : -

    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - I
    t
    e
    m
    s
    -
    - -
    - - -

    - -

    - -
    - - -

    - - - - &operator==&type=intranet&value="> + + + + + + + + + + + + + + +
      + &zoom=1&type=intranet&value="> //images/filefind.png" height="15" title="Search on "> - - - " class="button catalogue">Auth - -

    - - - - -
    - - -

    - -

    - -
    - - -

    - - - - &operator==&type=intranet&value="> +

    + + + + + + + + + + + + + + + + +
      + &zoom=1&type=intranet&value="> //images/filefind.png" height="15" title="Search on "> - - - " class="button catalogue">Auth - -

    - - - - -
    - - -

    - -

    - -
    - - -

    - - - - &operator==&type=intranet&value="> +

    + + + + + + + + + + + + + + + + +
      + &zoom=1&type=intranet&value="> //images/filefind.png" height="15" title="Search on "> - - - " class="button catalogue">Auth - -

    - - - - -
    - - -

    - -

    - -
    - - -

    - - - - &operator==&type=intranet&value="> +

    + + + + + + + + + + + + + + + + +
      + &zoom=1&type=intranet&value="> //images/filefind.png" height="15" title="Search on "> - - - " class="button catalogue">Auth - -

    - - - - -
    - - -

    - -

    - -
    - - -

    - - - - &operator==&type=intranet&value="> +

    + + + + + + + + + + + + + + + +
      + &zoom=1&type=intranet&value="> //images/filefind.png" height="15" title="Search on "> - - - " class="button catalogue">Auth - -

    - - - - -
    - - -

    - -

    - -
    - - -

    - - - - &operator==&type=intranet&value="> +

    + + + + + + + + + + + + + + + + +
      + &zoom=1&type=intranet&value="> //images/filefind.png" height="15" title="Search on "> - - - " class="button catalogue">Auth - -

    - - - - -
    - - -

    - -

    - -
    - - -

    - - - - &operator==&type=intranet&value="> +

    + + + + + + + + + + + + + + + + +
      + &zoom=1&type=intranet&value="> //images/filefind.png" height="15" title="Search on "> - - - " class="button catalogue">Auth - -

    - - - - -
    - - -

    - -

    - -
    - - -

    - - - - &operator==&type=intranet&value="> +

    + + + + + + + + + + + + + + + + +
      + &zoom=1&type=intranet&value="> //images/filefind.png" height="15" title="Search on "> - - - " class="button catalogue">Auth - -

    - - - - -
    - - -

    - -

    - -
    - - -

    - - - - &operator==&type=intranet&value="> +

    + + + + + + + + + + + + + + + + + +
      + &zoom=1&type=intranet&value="> //images/filefind.png" height="15" title="Search on "> - - - " class="button catalogue">Auth - -

    - - - - -
    - - -

    - -

    - -
    - - -

    - - - - &operator==&type=intranet&value="> +

    + + + + + + + + + + + + + + + + +
      + &zoom=1&type=intranet&value="> //images/filefind.png" height="15" title="Search on "> - - - " class="button catalogue">Auth - -

    - +
    + + + + + + + + + + + - - -
    -

    Items

    -
    -
    - - - - - - - - - - -
    - -
    -

    -
    -
    - -
    -
    - -
    -
    - " /> - -
    -
    - -
    -
    - " /> - -
    -
    - " /> - -
    -
    - " /> - -
    -
    ')"> - -
    -
    ')"> - -
    - -
    "> - -
    - - - -
    "> - -
    - -
    - - + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/catalogue/catalogue_search.tmpl b/koha-tmpl/intranet-tmpl/prog/en/catalogue/catalogue_search.tmpl new file mode 100644 index 0000000000..b67277f946 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/catalogue/catalogue_search.tmpl @@ -0,0 +1,162 @@ +Koha -- Catalog: Simple Search + + + + +

    Catalogue Search

    + + + + + +
    + style="background-color:orange"style="background-color:yellow"> + + style="background-color:orange"style="background-color:yellow" background-color="orange"> +
    +
    style="display:inline;"style="display:none;"> + + + + + + + + + + + + + + + + + + +style="display:inline;"style="display:none;"> + + + + +
    Format to displayMARCBriefDisplay per page:
    Search on:" >With
    +
    Search on:" >With
    Sort on: +
    + + + + + + + + + + + + + + + + +
    Format to displayMARCBrief
    Barcode" onchange="if(this.value != '') {this.form.itemnumber.value = ''; this.form.biblionumber.value = ''}">Item number" onchange="if(this.value != '') {this.form.biblionumber.value = ''; this.form.barcode.value = ''} ">Biblio Number" onchange="if(this.value != '') {this.form.barcode.value = ''; this.form.itemnumber.value = ''} ">
    +
    + +
    + + + + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/catalogue/catalogue_searchresults.tmpl b/koha-tmpl/intranet-tmpl/prog/en/catalogue/catalogue_searchresults.tmpl new file mode 100644 index 0000000000..37edc0b891 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/catalogue/catalogue_searchresults.tmpl @@ -0,0 +1,235 @@ +Koha -- Catalog: Simple Search + + + + + + + + +

    Catalogue search

    + + + + You searched: +
    |  +  |  +
    + + results + +
    + + + + + + + +
    + + + +
    + + + + +
    +
    + + /images/background-opac.gif"> + + + + + + + + + + + + + + bgcolor="#ffffcc"> + + + + + + + + + + + + + + + +
    &=">▼Title &=&reorder=title,1">▲ + &=&reorder=author,2 ">▼Author&=&reorder=author,1">▲ + + Publisher© &=&reorder=lcsort,2 ">▼LC &=&reorder=lcsort,1">▲ + Availability 
    +
    + +
    +
    + + + + ?biblionumber="> + +
    + +
    + ISBN: +
    +
    ">
    + + + ">
    + +
    +
    - + - On Loan
    + - Lost
    + -Withdrawn
    + + - Not available
    + + + + - + +
    + + - + + + Not reservable + + "> + Reserve + + + +
    +
    +
    +
    + + + + + + + + + + &=&pg=&reorder="> + + + + +
    +
    +
    Results - of records.
    + +
    0 records
    + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/catalogue/detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/catalogue/detail.tmpl index cbbedca3bf..fdaf06e623 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/catalogue/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/catalogue/detail.tmpl @@ -1,202 +1,103 @@ -Koha -- Catalogue MARC detail +Koha -- Catalog: Details for - -

    ()

    - -
    -

    biblio detail

    - -

    - - ; - -

    - - -

    - - -

    - - -

    - - -

    - - -

    - -

    - - - , -

    - -

    - - -

    - - -

    - - vol. - -

    - - -

    -

    - - "> - -
    - -

    - -

    - -

    ">,

    - - - -

    - - -

    -

    - -

    -

    - -

    - - -

    - - - -

    - - -

    - - -

    - - -

    - - ">  - -

    - -

    - - - - - -

    - -

    Total Number of Items:

    - -
    +

    ()

    + +
    +
    " />
    +
    " />" />" />
    +
    " />', 'popped'); return false;" />
    +
    " />','printview'); return false;" />
    +
    " name="biblionumber" />
    +
    +
    +.01.MZZZZZZZ.jpg" alt="Book Cover Image" /> +
    +
    + +
      +
    • Subtitle:
    • +
    • Author: &and_or=@and&order=author,1&zoom=1">
    • +
    • Additional Author:
    • +
    • ISBN:
    • +
    • Classification:
    • +
    • Series Title:
    • +
    • Subject:
    • +
    • Copyright:
    • +
    • Notes:
    • +
    • Unititle:
    • +
    • Serial:
    • +
    • URL: ">
    • + -
      -

      Items

      - +
    • Subjects: +
    • URLs: +
    • Abstract: + +
    • Biblio Record
    • +
    • Total Number of Items:
    • + + +
      +
      " /> +
      " /> +
      " /> +
      + + +
      + + + + + + + + + + + + - - - - - - - + + + + + + + + - - - - - - - - - - - - - - -
      Item TypeLC ClassifictionLocationDate DueLast SeenBarcodeVolume
      Item typeLocationStatusDate DueLast seenBarcodeVolume -&itemnumber=&biblionumber=&barcode="> 
      - - On issue to "> - - - - &item=&bib=&bi="> - &item=">Fix Itemtype -
      -
      + This record has no items. + +
    + + + + + + + + +
    Abstract
    + + -
    -
    - -
    -
    - -
    -
    "> - -
    -
    - -
    -
    - " /> - -
    -
    - " /> - -
    -
    - " /> - -
    -
    ')"> - -
    -
    ')"> - -
    - -
    "> - -
    - - - -
    "> - -
    - -
    + + + + + +
    Links to Associated Web Sites
    Title:
    +Description:
    +URL:">http:// +
    + - diff --git a/koha-tmpl/intranet-tmpl/prog/en/catalogue/detailprint.tmpl b/koha-tmpl/intranet-tmpl/prog/en/catalogue/detailprint.tmpl new file mode 100644 index 0000000000..cc73996dea --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/catalogue/detailprint.tmpl @@ -0,0 +1,43 @@ +Koha -- Catalog: Print View for + + +
    + + + + +  +  + + + + + + + + + + + + +
    Biblio Record Number:
    Author:
    Additional Author:
    Publisher:
    Publication Details: + , + ,
    Collection:
    Subject:
    Copyright Date:
    Notes:
    Unititle:
    Dewey:
    Classification:
    LCCN:
    URL: ">
    ISBN:
    + + + + + + + + + + + + + + +
    Item TypeCall NumberLocationDate DueLast SeenBarcode
    ,  
    + +
    + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/catalogue/moredetail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/catalogue/moredetail.tmpl new file mode 100644 index 0000000000..33c9580879 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/catalogue/moredetail.tmpl @@ -0,0 +1,87 @@ +Koha -- Catalog: Item Details for + + +
    + + +
    +
    +" /> +" /> +" /> +" /> + + +
    " />
    +
    + + +

    +, by

    +
    " name="biblionumber" />
    " />
    +" /> +
    +
    + + + + + + --> + + + + + + + + + + + +
    Bibliographic Details
    Biblionumber:
    Item Type:
    URL: -->
    Loan Length: days
    Classification:
    ISBN:
    Publisher:
    Place:
    Date:
    Volume:
    Pages:
    Illus:
    Size:
    Notes:
    No. of Items:
    + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    " id="">Barcode:
    Home Branch:
    Current Branch:
    Last seen:
    Item Status: Due (Issued to ">)
    Item StatusAvailable
    Last borrowed:
    Last Borrower 1: ">
    Last Borrower 2: ">
    Replacement Price: $
    Lost Status:LostNot Lost +
    " /> + +" /> + + +Make FoundMake Lost" />
    Withdrawn: YesNo +
    " /> + +" /> + + + +RestoreMake Withdrawn" />
    Paid for:
    Notes:
    Renewals:
    Accession Date: (&biblionumber=&invoice=&catview=yes">View Receipt Summary)
    Total Issues: (&itemnumber=">View Circulation History)
    + + + + +
    + diff --git a/koha-tmpl/intranet-tmpl/prog/en/circ/branchtransfers.tmpl b/koha-tmpl/intranet-tmpl/prog/en/circ/branchtransfers.tmpl index ffe3529f7d..25140d76e2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/circ/branchtransfers.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/circ/branchtransfers.tmpl @@ -1,19 +1,18 @@ -Circulation: Transfers +Koha -- Circulation: Transfers - -

    Circulation: Transfers

    -

    Reserve Found

    +

    Reserve Found

    +
    @@ -47,8 +46,9 @@ " /> " /> /> + /> - + @@ -62,13 +62,13 @@ " value="" /> " value="" /> - + -
    Reserve found for (">). Item is marked waiting at for (">).
    - Set reserve to waiting and transfer book to : + Set reserve to waiting and transfer book to : Cancel reservation and then attempt transfer: @@ -27,10 +26,10 @@ " /> " /> - + - +
    Cancel reservation and then attempt transfer:
    +
    - +
    Messages
    @@ -80,6 +80,7 @@ + No Item with barcode: @@ -93,19 +94,19 @@ Item was on loan to "> and has been returned. - + +
    -
    - +
    - - -
    Transfer
    Destination Branch: /> + - +
    Destination Branch:
    Enter Book Barcode
    Enter Book Barcode
    " /> @@ -113,25 +114,25 @@ " value="" /> " value="" /> - - - - - + + +
    - + - - - - - - + + + + + + -
    Transfered Items
    Bar CodeTitleAuthorTypeFromTo
    Bar CodeTitleFromTo
    - &type=intra">
    + &type=intra">
    - +
    +
    + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl index ad06472551..95e2f92e68 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/circ/circulation.tmpl @@ -1,803 +1,283 @@ -Koha -- Circulation - -: Issuing to , -() - - +Koha -- Circulation: Issuing to , () +

    Circulation: Issues

    -

    Circulation: Issues

    - - -
    Circulation Parameters
    - - - - -
    - Error Issuing Item - -
      - -
    • The due date is invalid
    • - - - -
    • The barcode was not found
    • - - - -
    • Item not for loan
    • - - - -
    • Item is cancelled
    • - - - -
    • Patron's address is in doubt
    • - - - -
    • Patron's card is lost
    • - - - -
    • Patron is debarred
    • - - - -
    • No more renewals possible
    • - - - -
    • Patron's card is expired
    • - -
    -
    - - - -
    - Please Confirm Issue - -
      - -
    • The patron has a debt of $
    • - - - -
    • Item is currently issued to this patron. Renew?
    • - - - -
    • Item is consigned for
    • - - - -
    • Item is on reserve for
    • - - - -
    • Item issued to . Return and issue?
    • - - - -
    • Too many issues (already issued / max : )
    • - -
    - -
    - - -

    - - -

    - - - -

    - - -

    - - - " /> - " /> - - " /> - " /> - " /> - -
    - -
    - -
    - -
    - " /> - -
    - -
    -
    - -
    - - - - -

    Item issued

    + + + + + + +
    +

    Error Issuing:

    +
      + +
    • Invalid date
    • + + + +
    • Too early to renew.
    • + + + +
    • Barcode Unkown
    • + + + +
    • NOT FOR LOAN
    • + + +
    • Item is cancelled
    • + + +
    • Patron's address is in doubt
    • + + +
    • Patron's card is lost
    • + + +
    • Patron is debarred
    • + + +
    • No more renewals possible
    • + + +
    • Borrower card expired
    • + + +
    • This is a Reserve Section book. Use Reserve issue
    • + +
    +
    + + + + +
    +

    Please Confirm Issue:

    + + +

    The patron has a debt of YTL

    + + +

    You are trying RE-ISSUE. USE RENEW

    + + +

    Succesfully renewd items

    + + +

    Item is consigned for

    + + +

    Item is on reserve for

    + + +

    Item issued to . Return and issue?

    + + +

    Too many issues (already issued / max : )

    + + +
    + +

    + + + + + +

    + + " /> + + + " /> + + " /> + " /> + " /> +
    " />
    +
    + + + + + +

    Item issued

    + + +
    + +
    + No patron matched Add a new patron +
    + + + +
    + " /> + " /> + + +

    +

    +

    Patron not found? Add a new patron

    +
    + + +
    + +
    + +

    ()

    +

        out, overdue


    +
    " alt="Photo" hspace="0" vspace="0" border="0" width="100px" heigth="100px" style="clear:both;float:right;position:relative;"> +
    + + + + + +
    + - -
    -
    - Borrower selection - - " /> - " /> - -

    - - -

    - -

    - -

    - Patron not found? - Add a new patron -

    -
    -
    - - - -
    - Borrower informations - -

    ()

    - -

    -     out - - , overdue - -

    - - - - -
      - -
    • Address: Patron's address in doubt
    • - - - -
    • Lost: Patron's card is lost
    • - - - -
    • - Debarred: Patron is debarred -
      - " /> - " /> - - - -
      - -
      -
      -
    • - - - -
    • - - Overdues: Patron has ITEMS OVERDUE See highlighted items below - -
    • - - - -
    • - Fines: Patron has - ">outstanding fines. - Make ">Payment -
    • - -
    - - - - - - - -
      -
    • Notes:
    • -
    - - - -
    - - - -
    - -
    - - +
    + + +
    Reserves waiting:
    +
    + + + +
    Notes:
    + +
    + + + +
    + + + " /> + " /> + +
    + + +
    -
    -
    - Issue an item - - - - - - - - - - - - - - - - - - - - -
    - +

    + + " /> + " /> + " /> + + + + " /> + +

    + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    />
    - - - - - " /> - " /> - " /> - - - - " /> - - -
    - -
    - -
    - - - -
    - Borrower current reserves + + +
    " />" /> - - - + + + - + + + - - "> - - - + + + + + + + + + + + - -
    - This document hasn't been transfered yet from library : - - - - - - + + + + + + + + + + + +
    Reserve dateBarcode
    Issues &print=page">(Print Page) &print=slip">(Print Slip)
    FormatDue Date Title AuthorLocalisationCall NoBarcodeRenew?
    - - - - &type=intra" onclick="openWindow(this, 'Item', 480, 640); return false;"> - - - Waiting position for this document : - - - - ( ) - - -
    - This document is available - - -
    - This document has been transfered from library : - the : - + + +
    &type=intra">
    &type=intra">
    " value="y" checked="checked" />
    -
    + +

    + - - - - -
    -
    - Borrower current issues - -

    - &print=page">Print Page - / &print=slip">Print Slip -

    - - - " /> - " /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Due DateTitleAuthorCall NoBarcodeRenew?
    Today Issues
    - &type=intra"> -
    -
    - " - - checked="checked" - - /> - " - checked="checked" - style="display: none;" - /> -
    - - - - - - - - - &type=intra"> -
    -
    - " - - checked="checked" - - /> - " - checked="checked" - style="display: none;" - /> -
    + +
    -
    - - -
    - - + - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl b/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl index 9edcd9721b..66d6a201a1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl @@ -1,15 +1,12 @@ -Koha -- Circulation: Returns: - +Koha -- Circulation: Returns: - - -

    Reserve Found (item is already consigned)

    +

    Reserve Found (item is already consigned)

    - +
    - + -
    ">">
    Patron:
    • ">
    • @@ -17,39 +14,27 @@

    • +
    Transfer to:
    - +
    + " value="" /> " value="" /> " value="" /> - - + - -

    This item must return to his homebranch :

    -

    The document () Must be returned to his homebranch() -

    - - " value=""> - " value=""> - " value=""> - - - -
    + - -

    Item Consigned:

    - +

    Item Consigned:


    +
    - + -
    ">">
    Patron:
    +
    " value="" /> @@ -64,20 +49,21 @@ - + + " value="" /> " value="" /> @@ -90,80 +76,85 @@

    Circulation: Returns

    - +
    - - + + " value="" /> " value="" /> " value="" /> - +
    No Item with barcode: Please return to + + + Issued from RESERVE Section- Use RESERVE return. + Not On Issue. - + Item was lost, now found. Item Cancelled - +
    - +
    - +
    Item InformationPatron Information
    - +
    "> , + ( -, -) +, +)
    - +
    - +
    - + + &type=intra">
    Returned Items
    Due DateBar CodeTitleAuthorTypePatron
    //Not on Issue.
    //Not on Issue. - &type=intra"> - Yes, duedate + "> - , + - Not on issue. + ">
    - +
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/aqbookfund.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/aqbookfund.tmpl index 4bf747a755..c36f410710 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/aqbookfund.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/aqbookfund.tmpl @@ -1,5 +1,5 @@ Online Help: System Preferences -- Book Fund Administration - +

    Book Fund Administration

    @@ -13,4 +13,4 @@

    Once you have set up a fund, you will see a link to a page for setting up the fund budget. Here you will enter the beginning and ending dates of your budget year and the amount of money in that particular budget line. Do not use any kind of currency notation (like "$") or commas when entering the number. (Commas will be converted to decimal points.) NOTE: Your dates will not saved correctly unless you have set your date format in the System Preferences section of the Parameters page -- DO THIS BEFORE setting budgets.)

    - \ No newline at end of file + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/auth_subfields_structure.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/auth_subfields_structure.tmpl index 68d3edae93..6c64947b1d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/auth_subfields_structure.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/auth_subfields_structure.tmpl @@ -23,10 +23,11 @@
  • thesaurus : shows the authority type
  • plugin : means the value is calculated or managed by a plugin. Plugins can do almost anything. For example, in UNIMARC there are plugins for every 1xx fields that are coded fields. The plugin is a huge help for cataloger ! There are also two plugins (unimarc_plugin_210c and unimarc_plugin_225a that can "magically" find the editor from an ISBN, and the collection list for the editor)
  • -
  • Example MARC21 Subject Headings Authority +
  • An Example MARC21 Subject Headings Authority
      Use field 035$a for your auth_header.authid and 035$8 for auth_header.authtypecode. Make sure your zebra authorities index these fields
      Use field 150 for your subject headings
      Use field 750$9 (add subfield if not present) for auth_header.linkid . Select Is a linking field. You may use any subfield for linking as $9 is not hardcoded +
        Make sure you defined these fields using Link MARC-ZEBRA in System Admin as well
          When you add or modify an authority clicking on ... that will appear next to 750$9 will let you search any authority and link it to this record. You may repeat tag 750 and add as many linkages as you like
        diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/authorised_values.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/authorised_values.tmpl index 525f08fbfc..3453af5ace 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/authorised_values.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/authorised_values.tmpl @@ -1,5 +1,5 @@ Online Help: System Preferences -- Authorised values management - +

        Authorised values management

        Koha allows you to restrict the values that catalogers can place in some MARC subfields to certain pre-defined "authorised" values. These authorised values are defined here.

        @@ -9,4 +9,4 @@
      • HINT2 : in the MARC editor, the list is ordered by Text, NOT by value. So you can define a default value by putting a space before the value you want to see first. For example, if your list is related to language, you can set "ENG" as authorised value and " English" as text. The space will order "ENG" as first default value, and the space won't be shown (because HTML automatically discard useless spaces). Super hint : you can put a value 1st with N spaces, then another one 2nd with N-1 space,..., a value in Nth position with 1 space. Don't abuse of this feature, it's easier to find a value in an alphabetical order. It should be used only to have a default value

      Koha automatically sets up authorised value categories for your item types and branch codes, and you can link these authorised values to MARC subfields when you set up your MARC tag structure.

      - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/authtypes.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/authtypes.tmpl index 3e9cb8fa90..f82730315f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/authtypes.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/authtypes.tmpl @@ -1,5 +1,5 @@ Online Help: System Preferences -- Authority types - +

      Authority types

      You can define as many Authority types as you want.

        @@ -16,4 +16,4 @@

        In the biblio framework, the reported tag MUST contain a $9 subfield, activated in the tab where the tag is, and hidden (hidden maybe omitted, but the field has no reason to appear anywhere). The $9 subfield in the biblio will contain the Authority number (the internal Koha number)

        - \ No newline at end of file + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/biblio_framework.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/biblios_framework.tmpl similarity index 91% rename from koha-tmpl/intranet-tmpl/prog/en/help/admin/biblio_framework.tmpl rename to koha-tmpl/intranet-tmpl/prog/en/help/admin/biblios_framework.tmpl index 1dd20d2bbb..09f6b4425c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/biblio_framework.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/biblios_framework.tmpl @@ -1,7 +1,7 @@ Online Help: System Preferences -- Biblio framework - +

        Biblio framework

        biblio frameworks are used to catalogue your biblios.

        Unlike Koha 2.0, in this version you can have more than 1 framework to catalogate differently various materials. You can, for example, define 1 framework for monographies, 1 framework for serials, 1 framework for URL...

        Once a framework type is created, you can clic on "MARC structure" to define the exact MARC structure. The first time, Koha will ask you to select an existing framework to copy into the new one. Thus, you don't have to define all the MARC structure

        - \ No newline at end of file + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/branches.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/branches.tmpl index 33c2cca2e8..9d8334dae0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/branches.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/branches.tmpl @@ -1,6 +1,6 @@ Online Help: System Preferences -- Branches - +

        Help: Library Branches

        Fill in information about your library service outlets on this page.

        @@ -9,4 +9,4 @@

        Now add the names and addresses, phone numbers, etc of your libraries in the "Branches" section. (All of your libraries should be described here, not just the branch libraries.) Give each library a unique and easily-remembered code (maximum of four characters). This code will be used in Koha's database to identify each library. When libraries are listed in Koha, they will be listed in alphabetical order by code. (Note that until you set your branch the first time you use a computer to circulate items in Koha, the branch will default to the first library in the alphabetical code list -- be careful to set the branch the first time you use Koha or whenever you add a new computer!)

        - \ No newline at end of file + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/categorie.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/categorie.tmpl index 8990fb5b81..41202655e2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/categorie.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/categorie.tmpl @@ -1,5 +1,5 @@ Online Help: System Preferences -- Borrower Categories - +

        Borrower Categories

        Here is where you define the types of users of your library and how they will be handled.

        @@ -23,4 +23,4 @@

        Overdue Notice Required

        Overdue Notice Required lets you bypass generating overdue notices for this user type.

        - \ No newline at end of file + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/checkmarc.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/checkmarc.tmpl index dfb84ef04b..745c9b17aa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/checkmarc.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/checkmarc.tmpl @@ -1,7 +1,7 @@ Online Help: System Preferences -- MARC Check - +

        MARC Check

        Once you have completed the process of setting up your MARC tag structure (MarcTagstruct) and checked your MARC to Koha mapping (Koha2MarcLinks), click on this link to activate a small program that checks for major errors in your MARC setup.

        This MARC check does not guarantee that you will like the first results of your efforts to set up your MARC displays, etc. -- it simply checks for major errors. You will probably revise your MARC setup several times before you are completely pleased with it. Be sure to run checkmarc after every revision.

        - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/currency.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/currency.tmpl index 041d12eb0c..e9442f2e2f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/currency.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/currency.tmpl @@ -1,7 +1,7 @@ Online Help: System Preferences -- Currencies administration - +

        Currencies administration

        Define the currencies you deal with here.

        You should at least define your local currency here, giving it a name (like US DOLLAR or EURO) and setting the "rate" at 1. If you do business with vendors who charge in a different currency, enter a name for that currency (e.g. PESO) and set the approximate exchange rate compared to your currency. (Note: names are limited to 10 characters or less.) The exchange rate is used to calculate the remain balances in your materials budgets when you purchase materials using "normal" acquisitions.

        - \ No newline at end of file + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/holdings_subfields_structure.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/holdings_subfields_structure.tmpl new file mode 100644 index 0000000000..c3d6f2c055 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/holdings_subfields_structure.tmpl @@ -0,0 +1,33 @@ +Online Help: System Preferences -- MARC tag structure administration +
        +

        MARC tag structure administration

        +

        Koha allows you to specify which MARC tags you want to use and which you want to ignore. When you downloaded and installed Koha, you also got the entire list of MARC21 tags and subfields in current use. Now you need to use the administration page to edit this list and tell Koha which tags you want to use and how you want to use them.

        +

        You can define as the marc tag structure for each biblio framework you have defined

        + +

        If you are CERTAIN that you will never use a MARC tag, then you can delete it, but since this will not result in any appreciable improvement in performance, it is probably better to leave it. There will be tags you want to add, however. If you are using older MARC tags that are not in the list of tags supplied with Koha, then use the MARC tag structure administration page to add them. Similarly, you will probably need to add the holdings tag you currently use, or at least check the subfield structure of the 852 tag if you use it for holdings.

        + +

        Editing the SubFields from the MARC tag structure page is very time-consuming, but also very important; be sure to click the subfield link for each tag in your MARC tag structure.

        +

        For each subfield you can set :

        +
          +
        • repeatable : wether it can be repeated or not. If it can be repeated, separate the values by a | in the MARC editor when you want to have the subfield twice
        • +
        • Mandatory : wether the field is mandatory or not. If mandatory, the cataloger can't validate the biblio if the subfield is empty.
        • +
        • Search also : This section is not implemented anymore-- will be depreceated --- Zebra indexing sets these fields
        • +
        • Koha link : very important. Koha is multi-MARC compliant. So, it does not know what the 245$a means, neither what 200$f (those 2 fields being both the title in MARC21 and UNIMARC !). So, in this list you can "map" a MARC subfield to it's meaning. Koha constantly maintains consistency between a subfield and it's meaning. When the user want to search on "title", this link is used to find what is searched (245 if you're MARC21, 200 if you're UNIMARC).
        • +
        • Text for librarian : what appears before the subfield in the librarian interface
        • +
        • Text for OPAC : what appears before the field in the OPAC. If empty, the text for librarian is used instead
        • +
        • Managed in tab : deals with the tab where the subfield is shown. Ignore means that the subfield is not managed. All subfields of a given field must be in the same tab or ignored : 1st it's more logic, 2nd, Koha would be confused to repeat repeatable fields otherwise !!!
        • +
        • hidden : You can choose whether this field will show in opac, intranet or editor separately. For editor an extra choice is to display the field collapsed.
        • + +
        • URL : if checked, the subfield is an URL, and can be clicked
        • +
        • Auth value : means the value is not free, but in the authorised value list of the selected type
        • +
        • thesaurus : means that the value is not free, but can be searched in authority/thesaurus of the selected category
        • +
        • plugin : means the value is calculated or managed by a plugin. Plugins can do almost anything. For example, in UNIMARC there are plugins for every 1xx fields that are coded fields. The plugin is a huge help for cataloger ! There are also two plugins (unimarc_plugin_210c and unimarc_plugin_225a that can "magically" find the editor from an ISBN, and the collection list for the editor)
        • +
        • link : If you enter a field/subfield here (200b), a little glass appears after the subfield. If the user clic on the glass, a search is done on the DB for the field/subfield with the same value. Can be used for 2 main topic : +
            +
          • on a field like author (200f in UNIMARC), put 200f here, you will be able to see all biblios with the same author
          • +
          • on a field that is a link (4xx) to reach another biblio. For example, put 011a in 464$x, will find the serial that was previously with this issn. With the 4xx pligin, you get a powerful tool to manage biblios connected to biblios
          • +
          +
        • +
        + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/holdingstagstructure.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/holdingstagstructure.tmpl new file mode 100644 index 0000000000..6473fdb1b9 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/holdingstagstructure.tmpl @@ -0,0 +1,26 @@ +Online Help: System Preferences -- MARC tag structure administration +
        +

        MARC tag structure administration

        +

        Koha allows you to specify which MARC tags you want to use and which you want to ignore. When you downloaded and installed Koha, you also got the entire list of MARC21 tags and subfields in current use. Now you need to use the administration page to edit this list and tell Koha which tags you want to use and how you want to use them.

        +

        You can define as the marc tag structure for each biblio framework you have defined

        + +

        If you are CERTAIN that you will never use a MARC tag, then you can delete it, but since this will not result in any appreciable improvement in performance, it is probably better to leave it. There will be tags you want to add, however. If you are using older MARC tags that are not in the list of tags supplied with Koha, then use the MARC tag structure administration page to add them. Similarly, you will probably need to add the holdings tag you currently use, or at least check the subfield structure of the 852 tag if you use it for holdings.

        + +

        Editing the SubFields from the MARC tag structure page is very time-consuming, but also very important; be sure to click the subfield link for each tag in your MARC tag structure.

        +

        For each subfield you can set :

        +
          +
        • repeatable : wether it can be repeated or not. If it can be repeated, separate the values by a | in the MARC editor when you want to have the subfield twice
        • +
        • Mandatory : wether the field is mandatory or not. If mandatory, the cataloger can't validate the biblio if the subfield is empty.
        • +
        • Search also : a list of field that Koha will also search on when the user do a search on the subfield
        • +
        • Koha link : very important. Koha is multi-MARC compliant. So, it does not know what the 245$a means, neither what 200$f (those 2 fields being both the title in MARC21 and UNIMARC !). So, in this list you can "map" a MARC subfield to it's meaning. Koha constantly maintains consistency between a subfield and it's meaning. When the user want to search on "title", this link is used to find what is searched (245 if you're MARC21, 200 if you're UNIMARC).
        • +
        • Text for librarian : what appears before the subfield in the librarian interface
        • +
        • Text for OPAC : what appears before the field in the OPAC. If empty, the text for librarian is used instead
        • +
        • Managed in tab : deals with the tab where the subfield is shown. Ignore means that the subfield is not managed. All subfields of a given field must be in the same tab or ignored : 1st it's more logic, 2nd, Koha would be confused to repeat repeatable fields otherwise !!!
        • +
        • hidden : means that the field is managed, but NOT shown in opac. It's usually for internal fields
        • +
        • URL : if checked, the subfield is an URL, and can be clicked
        • +
        • Auth value : means the value is not free, but in the authorised value list of the selected type
        • +
        • thesaurus : means that the value is not free, but can be searched in authority/thesaurus of the selected category
        • +
        • plugin : means the value is calculated or managed by a plugin. Plugins can do almost anything. For example, in UNIMARC there are plugins for every 1xx fields that are coded fields. The plugin is a huge help for cataloger ! There are also two plugins (unimarc_plugin_210c and unimarc_plugin_225a that can "magically" find the editor from an ISBN, and the collection list for the editor)
        • +
        • link : useless for instance
        • +
        + diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/issuingrules.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/issuingrules.tmpl index b3a794d051..2c6b582812 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/issuingrules.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/issuingrules.tmpl @@ -1,5 +1,5 @@ Online Help: System Preferences -- Issuing rules - +

        Issuing rules

        Issuing rules deals with 2 topics :

          @@ -17,4 +17,4 @@

          (Note : fines are calculated by the fines2.pl script, located in misc directory. Ask your system administrator to put this script in crontab, after midnight, to have fines calculated every night.)

          - \ No newline at end of file + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/itemtypes.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/itemtypes.tmpl index 410bdd7958..218b1d563a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/itemtypes.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/itemtypes.tmpl @@ -1,5 +1,5 @@ Online Help: System Preferences -- Item types management - +

          Item types management

          You can define as many itemtypes as you want.

          @@ -17,4 +17,4 @@
        • Issuing rules are set for item types (and for borrower types / branches)

        Setting up item types is one of the first things you should do after installing the Koha software.

        - \ No newline at end of file + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/koha2marclinks.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/koha2marclinks.tmpl index d3714698b4..3e1f839405 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/koha2marclinks.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/koha2marclinks.tmpl @@ -1,5 +1,5 @@ Online Help: System Preferences -- Koha 2 MARC links - +

        Koha 2 MARC links

        This page provides a simplified way to map your MARC tags and subfields to the non-MARC Koha database tables for default biblio framework. This can also be done while setting the MARC tag structure, but it is easier to see the relationship between the MARC database and the Koha database here.

        @@ -10,4 +10,4 @@

        This is a one-to-one mapping. In other words, a MARC tag/subfield can be mapped to one, and only one, Koha table.column.

        MARC data that is not mapped to a Koha table does not disappear -- it is simply not available for display on circulation screens and on some search results screens.

        - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/marc_subfields_structure.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/marc_subfields_structure.tmpl index 49622ab303..ec74649fca 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/marc_subfields_structure.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/marc_subfields_structure.tmpl @@ -1,5 +1,5 @@ Online Help: System Preferences -- MARC tag structure administration - +

        MARC tag structure administration

        Koha allows you to specify which MARC tags you want to use and which you want to ignore. When you downloaded and installed Koha, you also got the entire list of MARC21 tags and subfields in current use. Now you need to use the administration page to edit this list and tell Koha which tags you want to use and how you want to use them.

        You can define as the marc tag structure for each biblio framework you have defined

        @@ -16,7 +16,32 @@
      • Text for librarian : what appears before the subfield in the librarian interface
      • Text for OPAC : what appears before the field in the OPAC. If empty, the text for librarian is used instead
      • Managed in tab : deals with the tab where the subfield is shown. Ignore means that the subfield is not managed. All subfields of a given field must be in the same tab or ignored : 1st it's more logic, 2nd, Koha would be confused to repeat repeatable fields otherwise !!!
      • -
      • hidden : means that the field is managed, but NOT shown in opac. It's usually for internal fields
      • +
      • hidden : allows you to select from 19 possible visibility conditions, 17 of which are implemented. They are the following:
      • +
        +( ! means 'not visible' or in the case of Collapsed 'not +Collapsed') +

        + -9 => Future use
        + -8 => Flag
        + -7 => OPAC !Intranet !Editor Collapsed
        + -6 => OPAC Intranet !Editor !Collapsed
        + -5 => OPAC Intranet !Editor Collapsed
        + -4 => OPAC !Intranet !Editor !Collapsed
        + -3 => OPAC !Intranet Editor Collapsed
        + -2 => OPAC !Intranet Editor !Collapsed
        + -1 => OPAC Intranet Editor Collapsed
        + 0 => OPAC Intranet Editor !Collapsed
        + 1 => !OPAC Intranet Editor Collapsed
        + 2 => !OPAC !Intranet Editor !Collapsed
        + 3 => !OPAC !Intranet Editor Collapsed
        + 4 => !OPAC Intranet Editor !Collapsed
        + 5 => !OPAC !Intranet !Editor Collapsed
        + 6 => !OPAC Intranet !Editor !Collapsed
        + 7 => !OPAC Intranet !Editor Collapsed
        + 8 => !OPAC !Intranet !Editor !Collapsed
        + 9 => Future use
        +
        +
      • URL : if checked, the subfield is an URL, and can be clicked
      • Auth value : means the value is not free, but in the authorised value list of the selected type
      • thesaurus : means that the value is not free, but can be searched in authority/thesaurus of the selected category
      • @@ -25,8 +50,8 @@
        • on a field like author (200f in UNIMARC), put 200f here, you will be able to see all biblios with the same author
        • on a field that is a link (4xx) to reach another biblio. For example, put 011a in 464$x, will find the serial that was previously with this issn. With the 4xx pligin, you get a powerful tool to manage biblios connected to biblios
        • -
        +
    - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/marctagstructure.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/marctagstructure.tmpl index 1b42ae64b4..6473fdb1b9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/marctagstructure.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/marctagstructure.tmpl @@ -1,5 +1,5 @@ Online Help: System Preferences -- MARC tag structure administration - +

    MARC tag structure administration

    Koha allows you to specify which MARC tags you want to use and which you want to ignore. When you downloaded and installed Koha, you also got the entire list of MARC21 tags and subfields in current use. Now you need to use the administration page to edit this list and tell Koha which tags you want to use and how you want to use them.

    You can define as the marc tag structure for each biblio framework you have defined

    @@ -23,4 +23,4 @@
  • plugin : means the value is calculated or managed by a plugin. Plugins can do almost anything. For example, in UNIMARC there are plugins for every 1xx fields that are coded fields. The plugin is a huge help for cataloger ! There are also two plugins (unimarc_plugin_210c and unimarc_plugin_225a that can "magically" find the editor from an ISBN, and the collection list for the editor)
  • link : useless for instance
  • - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/printers.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/printers.tmpl index 86458e3240..67370fec04 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/printers.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/printers.tmpl @@ -1,9 +1,9 @@ Online Help: System Preferences -- Printer Administration - +

    Printer Administration

    If you are going to be using a printer (or several printers) that are attached to your Koha server for producing statistical and operations reports, then you need to give each printer a name and tell Koha how to access it. You do this by telling Koha which print queue to use.

    (In linux, each printer configuration in your printcap file defines a print queue. The default print queue is "lp," but if you use more than one printer you will have other queues, probably with names like "text" or "postscript." Tell Koha which printer queue(s) you want to use for printing reports directly from the server.)

    Note that you can always print Koha screens directly to a printer attached to your workstation just by using your web browser's Print function.

    - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/stopwords.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/stopwords.tmpl index 1ad6c6e9f9..753b179731 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/stopwords.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/stopwords.tmpl @@ -1,9 +1,9 @@ Online Help: System Preferences -- Stop word administration page - +

    Stop word administration page

    Here you should list all of the words you wish Koha to ignore when performing catalog searches or building the keyword index.

    Normally, you will not want Koha to save keyword references to articles like "The" and "A" and other very common words. Saving keyword references to these words does not help to limit a search and will make the keyword index very large and "cluttered" with words that are not really useful. The "stopwords" list defines these unnecessary words for your installation.

    (Hint: If you are proficient at MySQL, it is often faster and easier to find an existing stopwords list, edit it, put it in the correct format, and use the MySQL "Load Data Infile" command to import the list into the stopwords table. Many academic libraries publish their stopwords list on the Internet, or you can ask other Koha libraries if they would share their stopword list.)

    - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/systempreferences.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/systempreferences.tmpl index a31bb1ddfc..200aa00580 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/systempreferences.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/systempreferences.tmpl @@ -1,5 +1,5 @@ Online Help: System Preferences -- System preferences administration - +

    System preferences administration

    This page allows you to set the system preferences that control much of the basic behavior of Koha. These parameters should be set before any other parameters.

      @@ -26,7 +26,7 @@

      means the "block" 995 has <br>Items : BEFORE, then fields 995b, 995j and 995k, repeated for each item (995 is an UNIMARC standard), then nothing after the block.

      The # means "beginning of a block", the | is the separator of each part, the {} being used for each subfield. A subfield can have up to 3 digits BEFORE and up to 3 digits AFTER each subfield

      The UNIMARC (partial) definition for ISBD is

      -

      #700|<label>Titre/auteur</label>|{700a}{701a}{702a}| ; +

      #700||{700a}{701a}{702a}| ; #200||{200a}{ [200b] }{. 200c}{ : 200e}{. 200h}{. 200i}{ / 200f}{ ; 200g}|
      #230||{ ; 230a}|
      #205||{ ; 205a}{ , 205b}{ = 205d}{ / 205f}{ ; 205g}|
      @@ -68,4 +68,4 @@

    • timeout -- Inactivity timeout period (in seconds). If a workstation is idle for longer than this period, the user will have to login again.
    • virtualshelves -- Set virtual shelves management on or off ("1" or "0"). Users can set up and manage their own "virtual bookshelves" of favorite library items if this feature is turned on.
    - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/help/admin/z3950servers.tmpl b/koha-tmpl/intranet-tmpl/prog/en/help/admin/z3950servers.tmpl index 2e2444ed4d..e1017c6e1e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/help/admin/z3950servers.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/help/admin/z3950servers.tmpl @@ -1,5 +1,5 @@ Online Help: System Preferences -- Z39.50 servers administration - +

    Z39.50 servers administration

    Defines the Z39.50 servers you want Koha to search.

    @@ -13,4 +13,4 @@

    IMPORTANT NOTE : the z3950search will NOT work until your system administrator has not activated the z3950 client daemon on your server. The daemon is in KohaDirectory/script/z3950daemon. It should be added to rc.d to be launched during server boot.

    - \ No newline at end of file + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/acqui-search-result.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/acqui-search-result.tmpl index 6159cb8f94..51a44b0cd2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/serials/acqui-search-result.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/acqui-search-result.tmpl @@ -1,5 +1,5 @@ Koha -- Subscription edit -- Select supplier - +

    Supplier Search Results

    You searched on supplier , results found

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/acqui-search.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/acqui-search.tmpl index fe4f8a4d50..34e50c2d45 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/serials/acqui-search.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/acqui-search.tmpl @@ -1,5 +1,7 @@ Koha -- Subscription edit -- Search supplier - + + + - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/lateissues.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/lateissues.tmpl index e6d37333f2..5c88db10ee 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/serials/lateissues.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/lateissues.tmpl @@ -1,7 +1,7 @@ Koha -- Subscription edit - +

    Late issues

    @@ -84,6 +84,6 @@ name="subscriptionid" -->">Receive

    - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/printlist.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/printlist.tmpl index c8e95b4730..79849fb25f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/serials/printlist.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/printlist.tmpl @@ -1,5 +1,7 @@ - + + +

    Distribution list

    Title : ,

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/receipt-search-result.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/receipt-search-result.tmpl index 8e2581ddc4..2a372953fc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/serials/receipt-search-result.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/receipt-search-result.tmpl @@ -1,5 +1,7 @@ - - +Koha + + +

    Serial search results

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/result.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/result.tmpl new file mode 100644 index 0000000000..fe62d0a42d --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/result.tmpl @@ -0,0 +1,86 @@ +Koha + + + +

    Search results

    + +
    + + + + + + + + + + + +
    Summary 
    class="hilighted"> +

    +

    +

    + - + ; + - + : + ; +

    +
    class="hilighted"> + ','') ">Get it! +
    +
    + + + + + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/routing-preview.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/routing-preview.tmpl index b8a9b4fe66..1672fce524 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/serials/routing-preview.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/routing-preview.tmpl @@ -1,10 +1,7 @@ -Koha -- Subscription edit - +Koha - + -

    Preview Routing List

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/routing.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/routing.tmpl index 57fda83a88..d59606d61b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/serials/routing.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/routing.tmpl @@ -1,8 +1,8 @@ -Koha -- Subscription edit - +Koha - + + + -
    +

    Create Routing List

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/serial-issues-full.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/serial-issues-full.tmpl index 4f505404c3..57425835f6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/serials/serial-issues-full.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/serial-issues-full.tmpl @@ -1,5 +1,6 @@ - - +Koha + +

    Subscription information for biblio # with title :

    @@ -47,6 +48,7 @@
    +
    - - + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/serial-issues.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/serial-issues.tmpl index 16a13d2384..6a38f41700 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/serials/serial-issues.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/serial-issues.tmpl @@ -1,7 +1,6 @@ -Koha -- Subscription edit - +Koha - +

    Issues for a subscription

    @@ -71,7 +70,7 @@

    Last renewal of subscription was

    -

    This subscription is now ended. The last issue was recieved on

    +

    This subscription is now ended. The last issue was received on

    @@ -80,10 +79,10 @@

    - -

    Recieved issues

    + +

    received issues

    - +

    @@ -95,21 +94,13 @@
    -
    +
    - - " /> - - -
    - " /> - -
    +
    ">
    - diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/serials-home.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/serials-home.tmpl index 57600f6138..578d2564bb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/serials/serials-home.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/serials-home.tmpl @@ -1,8 +1,8 @@ -Koha -- Serials - +Koha +

    Serials

    Serials subscriptions

    @@ -11,7 +11,7 @@ - + @@ -39,75 +42,45 @@ - - - - + + + + - - + - - - - - - - - - - - - - - - +
    Biblionumber ISSN Title @@ -25,6 +25,9 @@ " /> + + " title="type biblionumber here to filter subscription"> + " title="type ISSN here to filter subscription">
    + +
    - +
    " class="button serial" title="Biblio"> - " class="button serial" title="Issues history"> + " class="button serial" title="Issues history"> - - + - + | - + - + () - - &op=new">Routing List - - - - " class="button serial" title="subscription detail">Detail - - - - " class="button serial" title="receive issues for this subscription">Receive - - - - " class="button serial" title="subscription detail">Detail - - - " class="button serial" title="receive issues for this subscription">Receive + " class="button serial" title="receive issues for this subscription">Receive
    @@ -121,5 +94,6 @@
    + diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/serials-receive.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/serials-receive.tmpl new file mode 100644 index 0000000000..8ce8e39653 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/serials-receive.tmpl @@ -0,0 +1,187 @@ +Koha + + + + + + + + +

    Subscription for

    +" class="button serial" title="detail of the subscription">Subscription +" class="button serial" title="all subscriptions on ">Subscriptions +" class="button serial" title="go to ">Back to biblio + +
    +

    waited or late numbers

    +
    + + "> + "> + "> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Numbered + + Published on + + Planned for + + Status + + Notes +
    + " size=30 maxlength=100> + + " size=10 maxlength=15> + + " size=10 maxlength=15> + + "> + + + " size=20 maxlength=255> + " name="itemnumber" value="" /> + " name="holdingbranch" value="" /> + ',)" name="addbutton" class="button serial" onblur="javascript:AddItemRefresh();">Add item + + ,'')" class="button serial">print +
    + Manual issue + + + + + + + + + + ',0)" name="addbutton" class="button serial" onblur="javascript:AddItemRefresh();">Add item +
    + + +

    Subscription has expired. Waited last issue status can't be changed. Renew your subscription

    + +
    +
    + +
    +

    Subscription summary

    +
    + + "> + "> + "> +

    +

    " READONLY>

    +

    " READONLY>

    +

    received issues

    +

     

    +

    Missing issues

    +

     

    + +

    Not issued

    +

     

    + +

    Opac's note

    +

     

    + +
    +
    + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-add.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-add.tmpl index bc68f03965..d887277f5d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-add.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-add.tmpl @@ -1,28 +1,664 @@ -Koha -- Subscription edit - +Koha -- Subscription edit - + + +/includes/calendar/calendar-system.css"> + + + + + + + + + + +

    Modify subscription

    - - " /> + + "> -

    Add a subscription

    +

    Add a subscription (Serial Holdings Record)

    + -
    + "> + + + +

    Subscription information

    - - " /> -

    Librarian

    -

    " size=4 /> (" disabled readonly />)...

    -

    " size=4 /> (" disabled readonly />)...

    -

    + + + + + + + + + + + -

    +

    -

    ...

    -

    warning

    + + + + + + + + + + + + +
    Librarian:
    " size="4"> (" disabled readonly>) Search for a Supplier
    " size="4"> (" disabled readonly>) Search for Biblio | Create Biblio
    " size="20">
    -

    +
    ...
    Warning:
      -
    • remember you must have created a biblio before creating a subscription
    • +
    • Remember you must have created a biblio before creating a subscription
    • You also must have selected a supplier if you want to ask for late issues
    • -
    +
    -
    +

    Planning

    -

    " size=13 maxlength=10 />

    -

    - " size=13 maxlength=10 id="acqui_date" style="border-width: 0px;"> + + + +

    + + -

    -

    - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +
    + + /includes/calendar/cal.gif" id="button1" style="cursor: pointer;" /> +" size=13 maxlength=10 id="beginning_date" style="border-width: 0px;"> + + + + +
    + + @@ -139,21 +881,21 @@ - -
    -
    + --> + +

    Subscription length

    -

    * fill 1 from :

    -
      -

      " />

      -

      " />

      -

      " />

      -
    +

    " size="3" onkeypress="return check_input(event)"> (*) (enter amount in numerals)

    +
    -
    +

    Numbering calculation

    -

    -

    Numbering formula: ">

    +

    Numbering formula: ">

    +
    - + - + -
    - + + + + - + + + + + + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-bib-search.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-bib-search.tmpl index e5cdc456ce..2ce8046069 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-bib-search.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-bib-search.tmpl @@ -1,53 +1,56 @@ -Koha -- Subscription edit +Koha -- Catalog Search +

    Catalogue search

    -

    Search on

    - - - "> -

    - - - - - - -

    -

    - - - "> - - - - - "> -

    -

    Results per page : - - Ordered by - -

    -

    - - Suggestions -

    + + + " /> +
    + + + + + +
    +
    +
    Search on
    + + + + +
    + + + "> + + + + + " /> +
    + + + +
    +

    + + +

    +
    - \ No newline at end of file +
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-detail.tmpl index 6ef4856d93..6609baa225 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-detail.tmpl @@ -1,31 +1,199 @@ -Koha -- Subscription detail - +Koha -- Subscription edit -

    Subscription for

    -
    + + + +

    Subscription Details for biblio :

    +
    + +" /> +
    + +
    +" /> +
    + +
    +" /> +
    + +
    +" /> +" value="Subscriptions" />
    + +
    +" /> +" value="View Biblio Record" />
    + +
    + +
    +" /> +
    + +
    +" /> + +
    + + + + +
    + +

    Subscription information

    -

    Librarian identity :

    -

    -

    -

    -

    ()

    -

    -

    - - - - Borrowers can't subscribe to issue alerts - -

    -

    -

    +


    + +

     

    + +

     

    + +

     

    + +

    ()


    +

     

    + +

    -
    + +
    +

    Planning

    -

    -

    +

    +

    +

    1/day @@ -60,108 +228,156 @@ 1/2 years

    -

    - - Monday +

    + + Number - - Tuesday + + Volume, Number, Issue - - Wednesday + + Volume, Number - - Thursday + + Volume, Issue - - Friday + + Number, Issue - - Saturday + + Seasonal only - - Sunday + + None of the above +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     

      + +   + +

       + +   + +
    + +

    +

    +

    + +

    + +

    +
    -
    +

    Subscription length

    -

    -

    -

    +

    +

    +

    -
    +

    Numbering calculation

    -

    -

    Numbering formula:

    - - - - - - +

    + +
    +
         X        Y        Z    
    + + + + + - - + - - - - - - + + + + - - + - - - - - - + + + + - - - - + + +
     XYZ
    Add + Add + +
    once everyonce every
    When more than
    +
    When more than
    (is )

    +

    (is )

    +

    (is )
    Set back toSet back to
    + Last value
    -
    +
    +

    Issues

    - +
    - - - - + + + - - - -
        Issue number        Planned date        Status        Note    Issue numberPlanned dateStatus
    + + + Waited @@ -174,58 +390,28 @@ Missing - - -
    +
    -
    -
    - " /> - - -
    -
    - " /> - -
    -
    - " /> - -
    -
    - " /> - -
    - -
    - " /> - -
    - -
    - " /> - -
    - -
    - -
    - -
    - - \ No newline at end of file + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-renew.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-renew.tmpl index a35b4f3aa4..0616369e05 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-renew.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-renew.tmpl @@ -1,5 +1,5 @@ -
    +

    subscription renewal for

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/serials/viewalerts.tmpl b/koha-tmpl/intranet-tmpl/prog/en/serials/viewalerts.tmpl new file mode 100644 index 0000000000..24c4ebb074 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/serials/viewalerts.tmpl @@ -0,0 +1,28 @@ + + +
    +

    Alert subscribers for

    + " class="button serial">subscription +
    + + + + + + + + + + + + + +
    Borrower name 
    " class="button serial">View
    + + Nobody + +
    + + +
    + diff --git a/koha-tmpl/intranet-tmpl/prog/en/tools/export.tmpl b/koha-tmpl/intranet-tmpl/prog/en/tools/export.tmpl index ec6be8fb51..97adfb4c46 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/tools/export.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/tools/export.tmpl @@ -1,29 +1,16 @@ - - -MARC biblio export +Cataloging: MARC Export -
    -

    Select biblios to export

    -
    -

    from biblio number : - to biblio number :

    -

    Document type :

    -

    Branch : -

    -

    from itemcallnumber : - to itemcallnumber :

    -

    Limit to first biblio

    -

    Note : the items are NOT exported by this tool

    - - -
    -
    -
    +

    MARC Export

    +

    Export in MARC format the following biblios (bibliographic records only):

    +
    +

    From biblio number: +to biblio number:

    +

    (leave blank to export every biblio)

    + + +
    +

    Note : Exporting all by this tool may take some time

    + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/tools/koha-news.tmpl b/koha-tmpl/intranet-tmpl/prog/en/tools/koha-news.tmpl index 6cab008a9e..7fba6f035a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/tools/koha-news.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/tools/koha-news.tmpl @@ -1,101 +1,103 @@ - - - - - - -
    -

    OPAC & KOHA News

    - -
    - " /> - " /> -

    - -

    -

    - - " /> -

    -

    News

    - -

    - - -

    -
    - -
    -
    - - - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - -
    LanguageDateTitleNews
    - " /> - - ">Edit -
    -

    - - -

    -
    - -

    No news loaded

    - -
    - - -
    -
    - - -
    - +System Administration + + +

    OPAC & KOHA News

    + + +
    + "> + "> + + + + + + + + + + + + + + + + + +
    Language + +
    Title">
    News
    + + +
    +
    + + + + + + +
    + Language: + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + +
    + LanguageDateTitleNews
    " + ">Edit +
    + + +
    + +
    No news loaded
    + + +
    + + +
    + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_008_holdings.tmpl b/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_008_holdings.tmpl new file mode 100644 index 0000000000..bee75b2c33 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_008_holdings.tmpl @@ -0,0 +1,688 @@ + + +Leader builder + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    0-5 Date entered on file(auto-filled)">
    06- Receive Status + + +
    7- Method of acquisition + +
    08-11 Expected acquisition end date (yymm)"/> + + +
    12- General retention Policy + +
    18-21 Illustrations (auto-filled from 300)"/>
    22- Target Audience + +
    23- Form of an item + +
    24-27 Nature of contents (Derived value) + "/>
    28- Government Publication + +
    29- Conference publication + +
    30- Festschrift + +
    31- Index + +
    32 Undefined
    33- Literary form + +
    34- Biography + +
    35-37 Language see MARC Code List for Languages + "/> +
    38- Modified Record + + +
    39- Cataloging source + +
    +
    + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_field_006.tmpl b/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_field_006.tmpl new file mode 100644 index 0000000000..5715fa48a1 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_field_006.tmpl @@ -0,0 +1,449 @@ + + +Leader builder + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    0 Form of material + +
    01-04 Illustrations (auto-filled from 300)"/>
    5- Target Audience + +
    06- Form of an item + +
    7-10 Nature of contents (Derived value) + "/>
    11- Government Publication + +
    12- Conference publication + +
    13- Festschrift + +
    14- Index + +
    15 Undefined
    16- Literary form + +
    17- Biography + +
    +
    + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_field_007.tmpl b/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_field_007.tmpl new file mode 100644 index 0000000000..d84eb48f88 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_field_007.tmpl @@ -0,0 +1,79 @@ + + +Leader builder + + +
    + + + + + + + + + + + + + +
    00 Category of material + +
    01 Specific material designation + +
    +
    + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_field_008.tmpl b/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_field_008.tmpl new file mode 100644 index 0000000000..a43c7713e5 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_field_008.tmpl @@ -0,0 +1,634 @@ + + +Leader builder + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    1-5 Date entered on file(auto-filled)">
    06- Type of date / Publication Status + + + +
    7-10 Date1 / Begininning date of publication + "/> +
    11-14 Date2 / ending date of publication + "/>
    15-17 Place of publication, production, or execution + "/> +
    18-21 Illustrations (auto-filled from 300)"/>
    22- Target Audience + +
    23- Form of an item + +
    24-27 Nature of contents (Derived value) + "/>
    28- Government Publication + +
    29- Conference publication + +
    30- Festschrift + +
    31- Index + +
    32 Undefined
    33- Literary form + +
    34- Biography + +
    35-37 Language see MARC Code List for Languages + "/> +
    38- Modified Record + + +
    39- Cataloging source + +
    +
    + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_leader.tmpl b/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_leader.tmpl new file mode 100644 index 0000000000..e8fe74fce0 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_leader.tmpl @@ -0,0 +1,328 @@ + + +Leader builder + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    0-4 Record size(auto-filled)
    5- Record status + +
    6- Type of record + +
    7- Bibliographic level + +
    8- Hierarchic level + +
    9- Encoding + +
    10-16 indicator/subfields/size(auto-filled)
    17- Encoding + +
    18 - Descriptive cataloging form + +
    19 - Linked record requirement + +
    20-23 entry map & lengths(auto-filled)
    +
    + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_leader_authorities.tmpl b/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_leader_authorities.tmpl new file mode 100644 index 0000000000..7d24f9db99 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_leader_authorities.tmpl @@ -0,0 +1,117 @@ + + +Leader builder + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    0-4 Record size(auto-filled)
    5- Record status + +
    6- Type of record + +
    9- Encoding + +
    17- Encoding level + +
    +
    + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_leader_holdings.tmpl b/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_leader_holdings.tmpl new file mode 100644 index 0000000000..b9832420dd --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/value_builder/marc21_leader_holdings.tmpl @@ -0,0 +1,177 @@ + + +Leader builder + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    0-4 Record size(auto-filled)
    5- Record status + +
    6- Type of record + +
    9- Encoding + +
    17- Encoding level + +
    18- Item information in record +
    +
    + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/z3950/searchresult.tmpl b/koha-tmpl/intranet-tmpl/prog/en/z3950/searchresult.tmpl index 973c20a44f..4204e8250f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/z3950/searchresult.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/z3950/searchresult.tmpl @@ -1,17 +1,42 @@ -Z39.50 Search Results -" /> - - - - - - -

    Z3950 Search Results

    - - +Koha -- Catalog: Advanced MARC Search + + + + + " /> + + +
    + +

    Select Search Libraries

    + + + + + + /> + /> + /> + /> +" /> + + + + + + + "> + + + + + + + + + @@ -20,27 +45,32 @@ - + + "> - + - - + + + -
    LibrarySelect
    checked="1" >
    Bibliographic Records Found
    Title Author   
    )">Import this biblio,)">Import
    -

    Nothing found

    + Nothing found -

    Still requests to go

    - +
    + - - \ No newline at end of file diff --git a/reports/acquisitions_stats.pl b/reports/acquisitions_stats.pl index 90225a341e..b715dc310a 100755 --- a/reports/acquisitions_stats.pl +++ b/reports/acquisitions_stats.pl @@ -19,15 +19,11 @@ # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA -# test comment - use strict; use C4::Auth; use CGI; use C4::Context; -use HTML::Template; use C4::Search; -use C4::Output; use C4::Koha; use C4::Interface::CGI::Output; use C4::Circulation::Circ2; @@ -43,21 +39,19 @@ plugin that shows a stats on borrowers =cut -my $input = new CGI; -my $do_it = $input->param('do_it'); +my $input = new CGI; +my $do_it=$input->param('do_it'); my $fullreportname = "reports/acquisitions_stats.tmpl"; -my $line = $input->param("Line"); -my $column = $input->param("Column"); -my @filters = $input->param("Filter"); -my $podsp = $input->param("PlacedOnDisplay"); -my $rodsp = $input->param("ReceivedOnDisplay"); -my $aodsp = $input->param("AcquiredOnDisplay"); ##added by mason. -my $calc = $input->param("Cellvalue"); -my $output = $input->param("output"); -my $basename = $input->param("basename"); -my $mime = $input->param("MIME"); -my $del = $input->param("sep"); - +my $line = $input->param("Line"); +my $column = $input->param("Column"); +my @filters = $input->param("Filter"); +my $podsp = $input->param("PlacedOnDisplay"); +my $rodsp = $input->param("ReceivedOnDisplay"); +my $calc = $input->param("Cellvalue"); +my $output = $input->param("output"); +my $basename = $input->param("basename"); +my $mime = $input->param("MIME"); +my $del = $input->param("sep"); #warn "calcul : ".$calc; my ($template, $borrowernumber, $cookie) = get_template_and_user({template_name => $fullreportname, @@ -67,669 +61,441 @@ my ($template, $borrowernumber, $cookie) flagsrequired => {editcatalogue => 1}, debug => 1, }); -$template->param(do_it => $do_it, - intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), - ); +$template->param(do_it => $do_it); if ($do_it) { - - #warn -"line=$line, col=$column, pod=$podsp, rod=$rodsp, aod=$aodsp, calc=$calc, filters=@filters\n"; - - my $results = - calculate( $line, $column, $podsp, $rodsp, $aodsp, $calc, \@filters ); - if ( $output eq "screen" ) { - $template->param( mainloop => $results ); - output_html_with_http_headers $input, $cookie, $template->output; - exit(1); - } - else { - print $input->header( - -type => 'application/vnd.sun.xml.calc', - -attachment => "$basename.csv", - -name => "$basename.csv" - ); - my $cols = @$results[0]->{loopcol}; - my $lines = @$results[0]->{looprow}; - my $sep; - $sep = C4::Context->preference("delimiter"); - print @$results[0]->{line} . "/" . @$results[0]->{column} . $sep; - foreach my $col (@$cols) { - print $col->{coltitle} . $sep; - } - print "Total\n"; - foreach my $line (@$lines) { - my $x = $line->{loopcell}; - print $line->{rowtitle} . $sep; - foreach my $cell (@$x) { - print $cell->{value} . $sep; - } - print $line->{totalrow}; - print "\n"; - } - print "TOTAL"; - $cols = @$results[0]->{loopfooter}; - foreach my $col (@$cols) { - print $sep. $col->{totalcol}; - } - print $sep. @$results[0]->{total}; - exit(1); - } -} -else { - my $dbh = C4::Context->dbh; - my @values; - my %labels; - my %select; - my $req; - $req = - $dbh->prepare( - "SELECT distinctrow id,name FROM aqbooksellers ORDER BY name"); - $req->execute; - my @select; - push @select, ""; - - # $select{""}=""; - while ( my ( $value, $desc ) = $req->fetchrow ) { - push @select, $desc; - - # $select{$value}=$desc; - } - my $CGIBookSellers = CGI::scrolling_list( - -name => 'Filter', - -id => 'Filter', - -values => \@select, - - # -labels => \%select, - -size => 1, - -multiple => 0 - ); - - $req = - $dbh->prepare( -"SELECT DISTINCTROW itemtype,description FROM itemtypes ORDER BY description" - ); - $req->execute; - undef @select; - undef %select; - push @select, ""; - $select{""} = ""; - while ( my ( $value, $desc ) = $req->fetchrow ) { - push @select, $value; - $select{$value} = $desc; - } - my $CGIItemTypes = CGI::scrolling_list( - -name => 'Filter', - -id => 'Filter', - -values => \@select, - -labels => \%select, - -size => 1, - -multiple => 0 - ); - - $req = - $dbh->prepare( -"SELECT DISTINCTROW bookfundid,bookfundname FROM aqbookfund ORDER BY bookfundname" - ); - $req->execute; - undef @select; - undef %select; - push @select, ""; - $select{""} = ""; - - while ( my ( $value, $desc ) = $req->fetchrow ) { - push @select, $value; - $select{$value} = $desc; - } - my $CGIBudget = CGI::scrolling_list( - -name => 'Filter', - -id => 'Filter', - -values => \@select, - -labels => \%select, - -size => 1, - -multiple => 0 - ); - - $req = - $dbh->prepare( -"SELECT DISTINCTROW sort1 FROM aqorders WHERE sort1 IS NOT NULL ORDER BY sort1" - ); - $req->execute; - undef @select; - push @select, ""; - my $hassort1; - while ( my ($value) = $req->fetchrow ) { - $hassort1 = 1 if ($value); - push @select, $value; - } - my $CGISort1 = CGI::scrolling_list( - -name => 'Filter', - -id => 'Filter', - -values => \@select, - -size => 1, - -multiple => 0 - ); - - $req = - $dbh->prepare( -"SELECT DISTINCTROW sort2 FROM aqorders WHERE sort2 IS NOT NULL ORDER BY sort2" - ); - $req->execute; - undef @select; - push @select, ""; - my $hassort2; - my $hglghtsort2; - - while ( my ($value) = $req->fetchrow ) { - $hassort2 = 1 if ($value); - $hglghtsort2 = !($hassort1); - push @select, $value; - } - my $CGISort2 = CGI::scrolling_list( - -name => 'Filter', - -id => 'Filter', - -values => \@select, - -size => 1, - -multiple => 0 - ); - - my @mime = ( C4::Context->preference("MIME") ); - foreach my $mime (@mime) { - - # warn "".$mime; - } - - my $CGIextChoice = CGI::scrolling_list( - -name => 'MIME', - -id => 'MIME', - -values => \@mime, - -size => 1, - -multiple => 0 - ); - - my @dels = ( C4::Context->preference("delimiter") ); - my $CGIsepChoice = CGI::scrolling_list( - -name => 'sep', - -id => 'sep', - -values => \@dels, - -size => 1, - -multiple => 0 - ); - - $template->param( - CGIBookSeller => $CGIBookSellers, - CGIItemType => $CGIItemTypes, - CGIBudget => $CGIBudget, - hassort1 => $hassort1, - hassort2 => $hassort2, - HlghtSort2 => $hglghtsort2, - CGISort1 => $CGISort1, - CGISort2 => $CGISort2, - CGIextChoice => $CGIextChoice, - CGIsepChoice => $CGIsepChoice - ); + my $results = calculate($line, $column, $podsp, $rodsp, $calc, \@filters); + if ($output eq "screen"){ + $template->param(mainloop => $results); + output_html_with_http_headers $input, $cookie, $template->output; + exit(1); + } else { + print $input->header(-type => 'application/vnd.sun.xml.calc', + -attachment=>"$basename.csv", + -name=>"$basename.csv" ); + my $cols = @$results[0]->{loopcol}; + my $lines = @$results[0]->{looprow}; + my $sep; + $sep =C4::Context->preference("delimiter"); + print @$results[0]->{line} ."/". @$results[0]->{column} .$sep; + foreach my $col ( @$cols ) { + print $col->{coltitle}.$sep; + } + print "Total\n"; + foreach my $line ( @$lines ) { + my $x = $line->{loopcell}; + print $line->{rowtitle}.$sep; + foreach my $cell (@$x) { + print $cell->{value}.$sep; + } + print $line->{totalrow}; + print "\n"; + } + print "TOTAL"; + $cols = @$results[0]->{loopfooter}; + foreach my $col ( @$cols ) { + print $sep.$col->{totalcol}; + } + print $sep.@$results[0]->{total}; + exit(1); + } +} else { + my $dbh = C4::Context->dbh; + my @values; + my %labels; + my %select; + my $req; + $req = $dbh->prepare("select distinctrow id,name from aqbooksellers order by name"); + $req->execute; + my @select; + push @select,""; +# $select{""}=""; + while (my ($value, $desc) =$req->fetchrow) { + push @select, $desc; +# $select{$value}=$desc; + } + my $CGIBookSellers=CGI::scrolling_list( -name => 'Filter', + -id => 'Filter', + -values => \@select, +# -labels => \%select, + -size => 1, + -multiple => 0 ); + + $req = $dbh->prepare( "select distinctrow bookfundid,bookfundname from aqbookfund order by bookfundname"); + $req->execute; + undef @select; + undef %select; + push @select,""; + $select{""}=""; + while (my ($value,$desc) =$req->fetchrow) { + push @select, $value; + $select{$value}=$desc; + } + my $CGIBudget=CGI::scrolling_list( -name => 'Filter', + -id => 'Filter', + -values => \@select, + -labels => \%select, + -size => 1, + -multiple => 0 ); + + $req = $dbh->prepare("select distinctrow sort1 from aqorders where sort1 is not null order by sort1"); + $req->execute; + undef @select; + push @select,""; + my $hassort1; + while (my ($value) =$req->fetchrow) { + $hassort1 =1 if ($value); + push @select, $value; + } + my $CGISort1=CGI::scrolling_list( -name => 'Filter', + -id => 'Filter', + -values => \@select, + -size => 1, + -multiple => 0 ); + + $req = $dbh->prepare("select distinctrow sort2 from aqorders where sort2 is not null order by sort2"); + $req->execute; + undef @select; + push @select,""; + my $hassort2; + my $hglghtsort2; + while (my ($value) =$req->fetchrow) { + $hassort2 =1 if ($value); + $hglghtsort2= !($hassort1); + push @select, $value; + } + my $CGISort2=CGI::scrolling_list( -name => 'Filter', + -id => 'Filter', + -values => \@select, + -size => 1, + -multiple => 0 ); + + my @mime = ( C4::Context->preference("MIME") ); + foreach my $mime (@mime){ +# warn "".$mime; + } + + my $CGIextChoice=CGI::scrolling_list( + -name => 'MIME', + -id => 'MIME', + -values => \@mime, + -size => 1, + -multiple => 0 ); + + my @dels = ( C4::Context->preference("delimiter") ); + my $CGIsepChoice=CGI::scrolling_list( + -name => 'sep', + -id => 'sep', + -values => \@dels, + -size => 1, + -multiple => 0 ); + + $template->param( + CGIBookSeller => $CGIBookSellers, + CGIBudget => $CGIBudget, + hassort1=> $hassort1, + hassort2=> $hassort2, + HlghtSort2 => $hglghtsort2, + CGISort1 => $CGISort1, + CGISort2 => $CGISort2, + CGIextChoice => $CGIextChoice, + CGIsepChoice => $CGIsepChoice + ); } output_html_with_http_headers $input, $cookie, $template->output; -sub calculate { - my ( $line, $column, $podsp, $rodsp, $aodsp, $process, $filters ) = @_; - my @mainloop; - my @loopfooter; - my @loopcol; - my @loopline; - my @looprow; - my %globalline; - my $grantotal = 0; - - # extract parameters - my $dbh = C4::Context->dbh; - - # Filters - # Checking filters - # - my @loopfilter; - for ( my $i = 0 ; $i <= 8 ; $i++ ) { - my %cell; - if ( @$filters[$i] ) { - if ( ( ( $i == 1 ) or ( $i == 3 ) ) and ( @$filters[ $i - 1 ] ) ) { - $cell{err} = 1 if ( @$filters[$i] < @$filters[ $i - 1 ] ); - } - $cell{filter} .= @$filters[$i]; - $cell{crit} .= "Placed On From" if ( $i == 0 ); - $cell{crit} .= "Placed On To" if ( $i == 1 ); - $cell{crit} .= "Received On From" if ( $i == 2 ); - $cell{crit} .= "Received On To" if ( $i == 3 ); - - $cell{crit} .= "Acquired On From" if ( $i == 4 ); - $cell{crit} .= "Acquired On To" if ( $i == 5 ); - - $cell{crit} .= "BookSeller" if ( $i == 6 ); - $cell{crit} .= "Doc Type" if ( $i == 7 ); - $cell{crit} .= "Budget" if ( $i == 8 ); - $cell{crit} .= "Sort1" if ( $i == 9 ); - $cell{crit} .= "Sort2" if ( $i == 10 ); - push @loopfilter, \%cell; - } - } - - my @linefilter; - - # warn "filtres ".@filters[0]; - # warn "filtres ".@filters[1]; - # warn "filtres ".@filters[2]; - # warn "filtres ".@filters[3]; - - $linefilter[0] = @$filters[0] if ( $line =~ /closedate/ ); - $linefilter[1] = @$filters[1] if ( $line =~ /closedate/ ); - $linefilter[0] = @$filters[2] if ( $line =~ /received/ ); - $linefilter[1] = @$filters[3] if ( $line =~ /received/ ); - - $linefilter[0] = @$filters[4] if ( $line =~ /acquired/ ); - $linefilter[1] = @$filters[5] if ( $line =~ /acquired/ ); - - $linefilter[0] = @$filters[6] if ( $line =~ /bookseller/ ); - $linefilter[0] = @$filters[7] if ( $line =~ /itemtype/ ); - $linefilter[0] = @$filters[8] if ( $line =~ /bookfund/ ); - $linefilter[0] = @$filters[9] if ( $line =~ /sort1/ ); - $linefilter[0] = @$filters[10] if ( $line =~ /sort2/ ); - - #warn "filtre lignes".$linefilter[0]." ".$linefilter[1]; - # - my @colfilter; - $colfilter[0] = @$filters[0] if ( $column =~ /closedate/ ); - $colfilter[1] = @$filters[1] if ( $column =~ /closedate/ ); - $colfilter[0] = @$filters[2] if ( $column =~ /received/ ); - $colfilter[1] = @$filters[3] if ( $column =~ /received/ ); - - $colfilter[0] = @$filters[4] if ( $column =~ /acquired/ ); - $colfilter[1] = @$filters[5] if ( $column =~ /acquired/ ); - - $colfilter[0] = @$filters[6] if ( $column =~ /bookseller/ ); - $colfilter[0] = @$filters[7] if ( $column =~ /itemtype/ ); - $colfilter[0] = @$filters[8] if ( $column =~ /bookfund/ ); - $colfilter[0] = @$filters[9] if ( $column =~ /sort1/ ); - $colfilter[0] = @$filters[10] if ( $column =~ /sort2/ ); - - #warn "filtre col ".$colfilter[0]." ".$colfilter[1]; - - #warn "line=$line, podsp=$podsp, rodsp=$rodsp, aodsp=$aodsp\n"; - - # 1st, loop rows. - my $linefield; - if ( ( $line =~ /closedate/ ) and ( $podsp == 1 ) ) { - - #Display by day - $linefield .= "dayname($line)"; - } - elsif ( ( $line =~ /closedate/ ) and ( $podsp == 2 ) ) { - - #Display by Month - $linefield .= "monthname($line)"; - } - elsif ( ( $line =~ /closedate/ ) and ( $podsp == 3 ) ) { - - #Display by Year - $linefield .= "Year($line)"; - - } - elsif ( ( $line =~ /received/ ) and ( $rodsp == 1 ) ) { - - #Display by day - $linefield .= "dayname($line)"; - } - elsif ( ( $line =~ /received/ ) and ( $rodsp == 2 ) ) { - - #Display by Month - $linefield .= "monthname($line)"; - } - elsif ( ( $line =~ /received/ ) and ( $rodsp == 3 ) ) { - - #Display by Year - $linefield .= "Year($line)"; - - } - elsif ( ( $line =~ /acquired/ ) and ( $aodsp == 1 ) ) { - - #Display by day - $linefield .= "dayname($line)"; - } - elsif ( ( $line =~ /acquired/ ) and ( $aodsp == 2 ) ) { - - #Display by Month - $linefield .= "monthname($line)"; - } - elsif ( ( $line =~ /acquired/ ) and ( $aodsp == 3 ) ) { - - #Display by Year - $linefield .= "Year($line)"; - - } - else { - $linefield .= $line; - } - my $strsth; - $strsth .= - "SELECT DISTINCTROW $linefield FROM (aqorders, aqbasket,aqorderbreakdown) - LEFT JOIN items ON (aqorders.biblioitemnumber= items.biblioitemnumber) - LEFT JOIN biblioitems ON (aqorders.biblioitemnumber= biblioitems.biblioitemnumber) - LEFT JOIN aqorderdelivery ON (aqorders.ordernumber =aqorderdelivery.ordernumber ) - LEFT JOIN aqbooksellers ON (aqbasket.booksellerid=aqbooksellers.id) WHERE (aqorders.basketno=aqbasket.basketno) - AND (aqorderbreakdown.ordernumber=aqorders.ordernumber) AND $line IS NOT NULL "; - if (@linefilter) { - if ( $linefilter[1] ) { - if ( $linefilter[0] ) { - $strsth .= " AND $line BETWEEN ? AND ? "; - } - else { - $strsth .= " AND $line < ? "; - } - } - elsif ( - ( $linefilter[0] ) - and ( ( $line =~ /closedate/ ) - or ( $line =~ /received/ ) - or ( $line =~ /acquired/ ) ) - ) - { - $strsth .= " AND $line > ? "; - } - elsif ( $linefilter[0] ) { - $linefilter[0] =~ s/\*/%/g; - $strsth .= " AND $line LIKE ? "; - } - } - $strsth .= " GROUP BY $linefield"; - $strsth .= " ORDER BY $linefield"; - - #warn "377:strsth= $strsth"; - - my $sth = $dbh->prepare($strsth); - if ( (@linefilter) and ( $linefilter[1] ) ) { - $sth->execute( "'" . $linefilter[0] . "'", "'" . $linefilter[1] . "'" ); - } - elsif ( $linefilter[0] ) { - $sth->execute( $linefilter[0] ); - } - else { - $sth->execute; - } - - while ( my ($celvalue) = $sth->fetchrow ) { - my %cell; - if ($celvalue) { - $cell{rowtitle} = $celvalue; - - # } else { - # $cell{rowtitle} = ""; - } - $cell{totalrow} = 0; - push @loopline, \%cell; - } - - #warn "column=$column, podsp=$podsp, rodsp=$rodsp, aodsp=$aodsp\n"; - - # 2nd, loop cols. - my $colfield; - if ( ( $column =~ /closedate/ ) and ( $podsp == 1 ) ) { - - #Display by day - $colfield .= "dayname($column)"; - } - elsif ( ( $column =~ /closedate/ ) and ( $podsp == 2 ) ) { - - #Display by Month - $colfield .= "monthname($column)"; - } - elsif ( ( $column =~ /closedate/ ) and ( $podsp == 3 ) ) { - - #Display by Year - $colfield .= "Year($column)"; - - } - elsif ( ( $column =~ /deliverydate/ ) and ( $rodsp == 1 ) ) { - - #Display by day - $colfield .= "dayname($column)"; - } - elsif ( ( $column =~ /deliverydate/ ) and ( $rodsp == 2 ) ) { - - #Display by Month - $colfield .= "monthname($column)"; - } - elsif ( ( $column =~ /deliverydate/ ) and ( $rodsp == 3 ) ) { - - #Display by Year - $colfield .= "Year($column)"; - - } - elsif ( ( $column =~ /dateaccessioned/ ) and ( $aodsp == 1 ) ) { - - #Display by day - $colfield .= "dayname($column)"; - } - elsif ( ( $column =~ /dateaccessioned/ ) and ( $aodsp == 2 ) ) { - - #Display by Month - $colfield .= "monthname($column)"; - } - elsif ( ( $column =~ /dateaccessioned/ ) and ( $aodsp == 3 ) ) { - - #Display by Year - $colfield .= "Year($column)"; - - } - else { - $colfield .= $column; - } - - my $strsth2; - $strsth2 .= - "SELECT distinctrow $colfield FROM (aqorders, aqbasket,aqorderbreakdown) - LEFT JOIN items ON (aqorders.biblioitemnumber= items.biblioitemnumber) - LEFT JOIN biblioitems ON (aqorders.biblioitemnumber= biblioitems.biblioitemnumber) - LEFT JOIN aqorderdelivery ON (aqorders.ordernumber =aqorderdelivery.ordernumber ) - LEFT JOIN aqbooksellers ON (aqbasket.booksellerid=aqbooksellers.id) - WHERE (aqorders.basketno=aqbasket.basketno) AND (aqorderbreakdown.ordernumber=aqorders.ordernumber) - AND $column IS NOT NULL"; - - if (@colfilter) { - if ( $colfilter[1] ) { - if ( $colfilter[0] ) { - $strsth2 .= " AND $column BETWEEN ? AND ? "; - } - else { - $strsth2 .= " AND $column < ? "; - } - } - elsif ( - ( $colfilter[0] ) - and ( ( $column =~ /closedate/ ) - or ( $line =~ /received/ ) - or ( $line =~ /acquired/ ) ) - ) - { - $strsth2 .= " AND $column > ? "; - } - elsif ( $colfilter[0] ) { - $colfilter[0] =~ s/\*/%/g; - $strsth2 .= " AND $column LIKE ? "; - } - } - $strsth2 .= " GROUP BY $colfield"; - $strsth2 .= " ORDER BY $colfield"; - - # warn "MASON:. $strsth2"; - - my $sth2 = $dbh->prepare($strsth2); - if ( (@colfilter) and ( $colfilter[1] ) ) { - - # warn "from : ".$colfilter[0]." To :".$colfilter[1]; - $sth2->execute( "'" . $colfilter[0] . "'", "'" . $colfilter[1] . "'" ); - } - elsif ( $colfilter[0] ) { - $sth2->execute( $colfilter[0] ); - } - else { - $sth2->execute; - } - - while ( my ($celvalue) = $sth2->fetchrow ) { - my %cell; - if ($celvalue) { - - # warn "coltitle :".$celvalue; - $cell{coltitle} = $celvalue; - } - push @loopcol, \%cell; - } - - # warn "fin des titres colonnes"; - - my $i = 0; - my @totalcol; - my $hilighted = -1; - - #Initialization of cell values..... - my %table; - - # warn "init table"; - foreach my $row (@loopline) { - foreach my $col (@loopcol) { - -# warn " init table : $row->{rowtitle} / $col->{coltitle} "; - $table{ $row->{rowtitle} }->{ $col->{coltitle} } = 0; - } - $table{ $row->{rowtitle} }->{totalrow} = 0; - } - - # preparing calculation - my $strcalc; - $strcalc .= "SELECT $linefield, $colfield, "; - $strcalc .= "COUNT( aqorders.ordernumber ) " if ( $process == 1 ); - $strcalc .= "SUM( aqorders.quantity * aqorders.listprice ) " - if ( $process == 2 ); - $strcalc .= "FROM (aqorders, aqbasket,aqorderbreakdown) - LEFT JOIN items ON (aqorders.biblioitemnumber= items.biblioitemnumber) - LEFT JOIN biblioitems ON (aqorders.biblioitemnumber= biblioitems.biblioitemnumber) - LEFT JOIN aqorderdelivery ON (aqorders.ordernumber =aqorderdelivery.ordernumber ) - LEFT JOIN aqbooksellers ON (aqbasket.booksellerid=aqbooksellers.id) WHERE (aqorders.basketno=aqbasket.basketno) - AND (aqorderbreakdown.ordernumber=aqorders.ordernumber) "; - - @$filters[0] =~ s/\*/%/g if ( @$filters[0] ); - $strcalc .= " AND aqbasket.closedate > '" . @$filters[0] . "'" - if ( @$filters[0] ); - @$filters[1] =~ s/\*/%/g if ( @$filters[1] ); - $strcalc .= " AND aqbasket.closedate < '" . @$filters[1] . "'" - if ( @$filters[1] ); - @$filters[2] =~ s/\*/%/g if ( @$filters[2] ); - $strcalc .= " AND aqorderdelivery.deliverydate > '" . @$filters[2] . "'" - if ( @$filters[2] ); - @$filters[3] =~ s/\*/%/g if ( @$filters[3] ); - $strcalc .= " AND aqorderdelivery.deliverydate < '" . @$filters[3] . "'" - if ( @$filters[3] ); - @$filters[4] =~ s/\*/%/g if ( @$filters[4] ); - $strcalc .= " AND aqbasket.closedate > '" . @$filters[4] . "'" - if ( @$filters[4] ); - @$filters[5] =~ s/\*/%/g if ( @$filters[5] ); - $strcalc .= " AND aqbasket.closedate < '" . @$filters[5] . "'" - if ( @$filters[5] ); - @$filters[6] =~ s/\*/%/g if ( @$filters[6] ); - $strcalc .= " AND aqbooksellers.name LIKE '" . @$filters[6] . "'" - if ( @$filters[6] ); - @$filters[7] =~ s/\*/%/g if ( @$filters[7] ); - $strcalc .= " AND biblioitems.itemtype LIKE '" . @$filters[7] . "'" - if ( @$filters[7] ); - @$filters[8] =~ s/\*/%/g if ( @$filters[8] ); - $strcalc .= " AND aqbookfund.bookfundid LIKE '" . @$filters[8] . "'" - if ( @$filters[8] ); - @$filters[9] =~ s/\*/%/g if ( @$filters[9] ); - $strcalc .= " AND aqorders.sort1 LIKE '" . @$filters[9] . "'" - if ( @$filters[9] ); - @$filters[10] =~ s/\*/%/g if ( @$filters[10] ); - $strcalc .= " AND aqorders.sort2 LIKE '" . @$filters[10] . "'" - if ( @$filters[10] ); - $strcalc .= " GROUP BY $linefield, $colfield ORDER BY $linefield,$colfield"; - - # warn "/n/n". $strcalc; - my $dbcalc = $dbh->prepare($strcalc); - $dbcalc->execute; - - # warn "filling table"; - my $emptycol; - while ( my ( $row, $col, $value ) = $dbcalc->fetchrow ) { - - # warn "filling table $row / $col / $value "; - $emptycol = 1 if ( $col eq undef ); - $col = "zzEMPTY" if ( $col eq undef ); - $row = "zzEMPTY" if ( $row eq undef ); - - $table{$row}->{$col} += $value; - $table{$row}->{totalrow} += $value; - $grantotal += $value; - } - - push @loopcol, { coltitle => "NULL" } if ($emptycol); - - foreach my $row ( sort keys %table ) { - my @loopcell; - - #@loopcol ensures the order for columns is common with column titles - # and the number matches the number of columns - foreach my $col (@loopcol) { - my $value = $table{$row}->{ - ( $col->{coltitle} eq "NULL" ) - ? "zzEMPTY" - : $col->{coltitle} - }; - push @loopcell, { value => $value }; - } - push @looprow, - { - 'rowtitle' => ( $row eq "zzEMPTY" ) ? "NULL" : $row, - 'loopcell' => \@loopcell, - 'hilighted' => ( $hilighted > 0 ), - 'totalrow' => $table{$row}->{totalrow} - }; - $hilighted = -$hilighted; - } - - # warn "footer processing"; - foreach my $col (@loopcol) { - my $total = 0; - foreach my $row (@looprow) { - $total += $table{ - ( $row->{rowtitle} eq "NULL" ) ? "zzEMPTY" - : $row->{rowtitle} - }->{ - ( $col->{coltitle} eq "NULL" ) ? "zzEMPTY" - : $col->{coltitle} - }; - -# warn "value added ".$table{$row->{rowtitle}}->{$col->{coltitle}}. "for line ".$row->{rowtitle}; - } - - # warn "summ for column ".$col->{coltitle}." = ".$total; - push @loopfooter, { 'totalcol' => $total }; - } - - # the header of the table - # $globalline{loopfilter}=\@loopfilter; - # the core of the table - $globalline{looprow} = \@looprow; - $globalline{loopcol} = \@loopcol; - - # # the foot (totals by borrower type) - $globalline{loopfooter} = \@loopfooter; - $globalline{total} = $grantotal; - $globalline{line} = $line; - $globalline{column} = $column; - push @mainloop, \%globalline; - return \@mainloop; +sub calculate { + my ($line, $column, $podsp, $rodsp, ,$process, $filters) = @_; + my @mainloop; + my @loopfooter; + my @loopcol; + my @loopline; + my @looprow; + my %globalline; + my $grantotal =0; +# extract parameters + my $dbh = C4::Context->dbh; + +# Filters +# Checking filters +# + my @loopfilter; + for (my $i=0;$i<=7;$i++) { + my %cell; + if ( @$filters[$i] ) { + if ((($i==1) or ($i==3)) and (@$filters[$i-1])) { + $cell{err} = 1 if (@$filters[$i]<@$filters[$i-1]) ; + } + $cell{filter} .= @$filters[$i]; + $cell{crit} .="Placed On From" if ($i==0); + $cell{crit} .="Placed On To" if ($i==1); + $cell{crit} .="Received On From" if ($i==2); + $cell{crit} .="Received On To" if ($i==3); + $cell{crit} .="BookSeller" if ($i==4); + $cell{crit} .="Budget" if ($i==5); + $cell{crit} .="Sort1" if ($i==6); + $cell{crit} .="Sort2" if ($i==7); + push @loopfilter, \%cell; + } + } + + my @linefilter; +# warn "filtres ".@filters[0]; +# warn "filtres ".@filters[1]; +# warn "filtres ".@filters[2]; +# warn "filtres ".@filters[3]; + + $linefilter[0] = @$filters[0] if ($line =~ /closedate/ ) ; + $linefilter[1] = @$filters[1] if ($line =~ /closedate/ ) ; + $linefilter[0] = @$filters[2] if ($line =~ /received/ ) ; + $linefilter[1] = @$filters[3] if ($line =~ /received/ ) ; + $linefilter[0] = @$filters[4] if ($line =~ /bookseller/ ) ; + $linefilter[0] = @$filters[5] if ($line =~ /bookfund/ ) ; + $linefilter[0] = @$filters[6] if ($line =~ /sort1/ ) ; + $linefilter[0] = @$filters[7] if ($line =~ /sort2/ ) ; +#warn "filtre lignes".$linefilter[0]." ".$linefilter[1]; +# + my @colfilter ; + $colfilter[0] = @$filters[0] if ($column =~ /closedate/ ) ; + $colfilter[1] = @$filters[1] if ($column =~ /closedate/ ) ; + $colfilter[0] = @$filters[2] if ($column =~ /received/ ) ; + $colfilter[1] = @$filters[3] if ($column =~ /received/ ) ; + $colfilter[0] = @$filters[4] if ($column =~ /bookseller/ ); + $colfilter[0] = @$filters[5] if ($column =~ /bookfund/ ) ; + $colfilter[0] = @$filters[6] if ($column =~ /sort1/ ) ; + $colfilter[0] = @$filters[7] if ($column =~ /sort2/ ) ; +#warn "filtre col ".$colfilter[0]." ".$colfilter[1]; + +# 1st, loop rows. + my $linefield; + if (($line =~/closedate/) and ($podsp == 1)) { + #Display by day + $linefield .="dayname($line)"; + } elsif (($line=~/closedate/) and ($podsp == 2)) { + #Display by Month + $linefield .="monthname($line)"; + } elsif (($line=~/closedate/) and ($podsp == 3)) { + #Display by Year + $linefield .="Year($line)"; + } elsif (($line =~/received/) and ($rodsp == 1)) { + #Display by day + $linefield .="dayname($line)"; + } elsif (($line=~/received/) and ($rodsp == 2)) { + #Display by Month + $linefield .="monthname($line)"; + } elsif (($line=~/received/) and ($rodsp == 3)) { + #Display by Year + $linefield .="Year($line)"; + } else { + $linefield .= $line; + } + + my $strsth; + $strsth .= "select distinctrow $linefield from aqorders, aqbasket,aqorderbreakdown left join aqorderdelivery on (aqorders.ordernumber =aqorderdelivery.ordernumber ) left join aqbooksellers on (aqbasket.booksellerid=aqbooksellers.id) where (aqorders.basketno=aqbasket.basketno) and (aqorderbreakdown.ordernumber=aqorders.ordernumber) and $line is not null "; + + if ( @linefilter ) { + if ($linefilter[1]){ + if ($linefilter[0]){ + $strsth .= " and $line between ? and ? " ; + } else { + $strsth .= " and $line < ? " ; + } + } elsif (($linefilter[0]) and (($line=~/closedate/) or ($line=~/received/))){ + $strsth .= " and $line > ? " ; + } elsif ($linefilter[0]) { + $linefilter[0] =~ s/\*/%/g; + $strsth .= " and $line LIKE ? " ; + } + } + $strsth .=" group by $linefield"; + $strsth .=" order by $linefield"; + warn "". $strsth; + + my $sth = $dbh->prepare( $strsth ); + if (( @linefilter ) and ($linefilter[1])){ + $sth->execute("'".$linefilter[0]."'","'".$linefilter[1]."'"); + } elsif ($linefilter[0]) { + $sth->execute($linefilter[0]); + } else { + $sth->execute; + } + + while ( my ($celvalue) = $sth->fetchrow) { + my %cell; + if ($celvalue) { + $cell{rowtitle} = $celvalue; +# } else { +# $cell{rowtitle} = ""; + } + $cell{totalrow} = 0; + push @loopline, \%cell; + } + +# 2nd, loop cols. + my $colfield; + if (($column =~/closedate/) and ($podsp == 1)) { + #Display by day + $colfield .="dayname($column)"; + } elsif (($column=~/closedate/) and ($podsp == 2)) { + #Display by Month + $colfield .="monthname($column)"; + } elsif (($column=~/closedate/) and ($podsp == 3)) { + #Display by Year + $colfield .="Year($column)"; + } elsif (($column =~/received/) and ($rodsp == 1)) { + #Display by day + $colfield .="dayname($column)"; + } elsif (($column=~/received/) and ($rodsp == 2)) { + #Display by Month + $colfield .="monthname($column)"; + } elsif (($column=~/received/) and ($rodsp == 3)) { + #Display by Year + $colfield .="Year($column)"; + } else { + $colfield .= $column; + } + + my $strsth2; + $strsth2 .= "select distinctrow $colfield from aqorders, aqbasket,aqorderbreakdown left join aqorderdelivery on (aqorders.ordernumber =aqorderdelivery.ordernumber ) left join aqbooksellers on (aqbasket.booksellerid=aqbooksellers.id) where (aqorders.basketno=aqbasket.basketno) and (aqorderbreakdown.ordernumber=aqorders.ordernumber) and $column is not null "; + + if ( @colfilter ) { + if ($colfilter[1]){ + if ($colfilter[0]){ + $strsth2 .= " and $column between ? and ? " ; + } else { + $strsth2 .= " and $column < ? " ; + } + } elsif (($colfilter[0]) and (($column=~/closedate/) or ($column=~/received/))){ + $strsth2 .= " and $column > ? " ; + } elsif ($colfilter[0]) { + $colfilter[0] =~ s/\*/%/g; + $strsth2 .= " and $column LIKE ? " ; + } + } + $strsth2 .=" group by $colfield"; + $strsth2 .=" order by $colfield"; + warn "". $strsth2; + + my $sth2 = $dbh->prepare( $strsth2 ); + if (( @colfilter ) and ($colfilter[1])){ + warn "from : ".$colfilter[0]." To :".$colfilter[1]; + $sth2->execute("'".$colfilter[0]."'","'".$colfilter[1]."'"); + } elsif ($colfilter[0]) { + $sth2->execute($colfilter[0]); + } else { + $sth2->execute; + } + + while (my ($celvalue) = $sth2->fetchrow) { + my %cell; + if ($celvalue){ +# warn "coltitle :".$celvalue; + $cell{coltitle} = $celvalue; + } + push @loopcol, \%cell; + } +# warn "fin des titres colonnes"; + + my $i=0; + my @totalcol; + my $hilighted=-1; + + #Initialization of cell values..... + my %table; +# warn "init table"; + foreach my $row ( @loopline ) { + foreach my $col ( @loopcol ) { +# warn " init table : $row->{rowtitle} / $col->{coltitle} "; + $table{$row->{rowtitle}}->{$col->{coltitle}}=0; + } + $table{$row->{rowtitle}}->{totalrow}=0; + } + +# preparing calculation + my $strcalc ; + $strcalc .= "SELECT $linefield, $colfield, "; + $strcalc .= "COUNT( aqorders.ordernumber ) " if ($process ==1); + $strcalc .= "SUM( aqorders.quantity * aqorders.listprice ) " if ($process ==2); + $strcalc .= "FROM aqorders, aqbasket,aqorderbreakdown left join aqorderdelivery on (aqorders.ordernumber =aqorderdelivery.ordernumber ) left join aqbooksellers on (aqbasket.booksellerid=aqbooksellers.id) where (aqorders.basketno=aqbasket.basketno) and (aqorderbreakdown.ordernumber=aqorders.ordernumber) "; + + @$filters[0]=~ s/\*/%/g if (@$filters[0]); + $strcalc .= " AND aqbasket.closedate > '" . @$filters[0] ."'" if ( @$filters[0] ); + @$filters[1]=~ s/\*/%/g if (@$filters[1]); + $strcalc .= " AND aqbasket.closedate < '" . @$filters[1] ."'" if ( @$filters[1] ); + @$filters[2]=~ s/\*/%/g if (@$filters[2]); + $strcalc .= " AND aqorderdelivery.deliverydate > '" . @$filters[2] ."'" if ( @$filters[2] ); + @$filters[3]=~ s/\*/%/g if (@$filters[3]); + $strcalc .= " AND aqorderdelivery.deliverydate < '" . @$filters[3] ."'" if ( @$filters[3] ); + @$filters[4]=~ s/\*/%/g if (@$filters[4]); + $strcalc .= " AND aqbooksellers.name like '" . @$filters[4] ."'" if ( @$filters[4] ); + @$filters[5]=~ s/\*/%/g if (@$filters[5]); + $strcalc .= " AND aqbookfund.bookfundid like '" . @$filters[5] ."'" if ( @$filters[5] ); + @$filters[6]=~ s/\*/%/g if (@$filters[6]); + $strcalc .= " AND aqorders.sort1 like '" . @$filters[6] ."'" if ( @$filters[6] ); + @$filters[7]=~ s/\*/%/g if (@$filters[7]); + $strcalc .= " AND aqorders.sort2 like '" . @$filters[7] ."'" if ( @$filters[7] ); + $strcalc .= " group by $linefield, $colfield order by $linefield,$colfield"; + warn "". $strcalc; + my $dbcalc = $dbh->prepare($strcalc); + $dbcalc->execute; + +# warn "filling table"; + my $emptycol; + while (my ($row, $col, $value) = $dbcalc->fetchrow) { +# warn "filling table $row / $col / $value "; + $emptycol = 1 if ($col eq undef); + $col = "zzEMPTY" if ($col eq undef); + $row = "zzEMPTY" if ($row eq undef); + + $table{$row}->{$col}+=$value; + $table{$row}->{totalrow}+=$value; + $grantotal += $value; + } + + push @loopcol,{coltitle => "NULL"} if ($emptycol); + + foreach my $row ( sort keys %table ) { + my @loopcell; + #@loopcol ensures the order for columns is common with column titles + # and the number matches the number of columns + foreach my $col ( @loopcol ) { + my $value =$table{$row}->{($col->{coltitle} eq "NULL")?"zzEMPTY":$col->{coltitle}}; + push @loopcell, {value => $value } ; + } + push @looprow,{ 'rowtitle' => ($row eq "zzEMPTY")?"NULL":$row, + 'loopcell' => \@loopcell, + 'hilighted' => ($hilighted >0), + 'totalrow' => $table{$row}->{totalrow} + }; + $hilighted = -$hilighted; + } + +# warn "footer processing"; + foreach my $col ( @loopcol ) { + my $total=0; + foreach my $row ( @looprow ) { + $total += $table{($row->{rowtitle} eq "NULL")?"zzEMPTY":$row->{rowtitle}}->{($col->{coltitle} eq "NULL")?"zzEMPTY":$col->{coltitle}}; +# warn "value added ".$table{$row->{rowtitle}}->{$col->{coltitle}}. "for line ".$row->{rowtitle}; + } +# warn "summ for column ".$col->{coltitle}." = ".$total; + push @loopfooter, {'totalcol' => $total}; + } + + + # the header of the table + $globalline{loopfilter}=\@loopfilter; + # the core of the table + $globalline{looprow} = \@looprow; + $globalline{loopcol} = \@loopcol; +# # the foot (totals by borrower type) + $globalline{loopfooter} = \@loopfooter; + $globalline{total}= $grantotal; + $globalline{line} = $line; + $globalline{column} = $column; + push @mainloop,\%globalline; + return \@mainloop; } -1; - +1; \ No newline at end of file diff --git a/reports/bor_issues_top.pl b/reports/bor_issues_top.pl index c318449ab5..c62aebefdb 100755 --- a/reports/bor_issues_top.pl +++ b/reports/bor_issues_top.pl @@ -23,14 +23,11 @@ use strict; use C4::Auth; use CGI; use C4::Context; -use HTML::Template; use C4::Search; -use C4::Output; use C4::Koha; use C4::Interface::CGI::Output; use C4::Circulation::Circ2; use Date::Manip; -use C4::Members; =head1 NAME @@ -62,11 +59,7 @@ my ($template, $borrowernumber, $cookie) flagsrequired => {editcatalogue => 1}, debug => 1, }); -$template->param(do_it => $do_it, - intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), - ); +$template->param(do_it => $do_it); if ($do_it) { # Displaying results my $results = calculate($limit, $column, \@filters); @@ -137,50 +130,10 @@ if ($do_it) { -values => \@dels, -size => 1, -multiple => 0 ); - #branch - my $branches = getallbranches; - my @branchloop; - foreach my $thisbranch (keys %$branches) { -# my $selected = 1 if $thisbranch eq $branch; - my %row =(value => $thisbranch, -# selected => $selected, - branchname => $branches->{$thisbranch}->{'branchname'}, - ); - push @branchloop, \%row; - } - - #doctype - my $itemtypes = GetItemTypes; - my @itemtypeloop; - foreach my $thisitemtype (keys %$itemtypes) { -# my $selected = 1 if $thisbranch eq $branch; - my %row =(value => $thisitemtype, -# selected => $selected, - description => $itemtypes->{$thisitemtype}->{'description'}, - ); - push @itemtypeloop, \%row; - } - - #borcat - my ($codes,$labels) = borrowercategories; - my @borcatloop; - foreach my $thisborcat (sort keys %$labels) { - # my $selected = 1 if $thisbranch eq $branch; - my %row =(value => $thisborcat, - # selected => $selected, - description => $labels->{$thisborcat}, - ); - push @borcatloop, \%row; - } - #Day - #Month $template->param( CGIextChoice => $CGIextChoice, - CGIsepChoice => $CGIsepChoice, - branchloop =>\@branchloop, - itemtypeloop =>\@itemtypeloop, - borcatloop =>\@borcatloop, + CGIsepChoice => $CGIsepChoice ); output_html_with_http_headers $input, $cookie, $template->output; } @@ -288,7 +241,7 @@ sub calculate { while (my ($celvalue) = $sth2->fetchrow) { my %cell; - $cell{'coltitle'} = ($celvalue?$celvalue:"NULL"); + $cell{coltitle} = $celvalue; push @loopcol, \%cell; } # warn "fin des titres colonnes"; @@ -341,29 +294,31 @@ sub calculate { $strcalc .= " group by borrowers.borrowernumber"; $strcalc .= ", $colfield" if ($column); - $strcalc .= " order by RANK DESC"; - $strcalc .= ",$colfield " if ($colfield); -# my $max; -# if (@loopcol) { -# $max = $line*@loopcol; -# } else { $max=$line;} -# $strcalc .= " LIMIT 0,$max"; + $strcalc .= " order by "; + $strcalc .= "$colfield, " if ($colfield); + $strcalc .= "RANK DESC "; + my $max; + if (@loopcol) { + $max = $line*@loopcol; + } else { $max=$line;} + $strcalc .= " LIMIT 0,$max"; warn "SQL :". $strcalc; my $dbcalc = $dbh->prepare($strcalc); $dbcalc->execute; # warn "filling table"; my $previous_col; - my %indice; + my $i=1; while (my @data = $dbcalc->fetchrow) { my ($row, $rank, $id, $col )=@data; $col = "zzEMPTY" if ($col eq undef); - $indice{$col}=1 if (not($indice{$col})); - $table[$indice{$col}]->{$col}->{'name'}=$row; - $table[$indice{$col}]->{$col}->{'count'}=$rank; - $table[$indice{$col}]->{$col}->{'link'}=$id; -# warn " ".$i." ".$col. " ".$row; - $indice{$col}++; + $i=1 if (($previous_col) and not($col eq $previous_col)); + $table[$i]->{$col}->{'name'}=$row; + $table[$i]->{$col}->{'count'}=$rank; + $table[$i]->{$col}->{'link'}=$id; + warn " ".$i." ".$col. " ".$row; + $i++; + $previous_col=$col; } push @loopcol,{coltitle => "Global"} if not($column); @@ -371,7 +326,7 @@ sub calculate { for ($i=1; $i<=$line;$i++) { my @loopcell; warn " $i"; - #@loborrowersopcol ensures the order for columns is common with column titles + #@loopcol ensures the order for columns is common with column titles # and the number matches the number of columns my $colcount=0; foreach my $col ( @loopcol ) { @@ -414,4 +369,4 @@ sub calculate { return \@mainloop; } -1; +1; \ No newline at end of file diff --git a/reports/borrowers_out.pl b/reports/borrowers_out.pl index c79426e23b..abbb99800d 100755 --- a/reports/borrowers_out.pl +++ b/reports/borrowers_out.pl @@ -23,14 +23,12 @@ use strict; use C4::Auth; use CGI; use C4::Context; -use HTML::Template; use C4::Search; -use C4::Output; use C4::Koha; use C4::Interface::CGI::Output; use C4::Circulation::Circ2; use Date::Manip; -use C4::Members; + =head1 NAME plugin that shows a stats on borrowers @@ -61,11 +59,7 @@ my ($template, $borrowernumber, $cookie) flagsrequired => {editcatalogue => 1}, debug => 1, }); -$template->param(do_it => $do_it, - intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), - ); +$template->param(do_it => $do_it); if ($do_it) { # Displaying results my $results = calculate($limit, $column, \@filters); @@ -137,22 +131,9 @@ if ($do_it) { -size => 1, -multiple => 0 ); - my ($codes,$labels) = borrowercategories; - my @borcatloop; - foreach my $thisborcat (sort keys %$labels) { - # my $selected = 1 if $thisbranch eq $branch; - my %row =(value => $thisborcat, - # selected => $selected, - description => $labels->{$thisborcat}, - ); - push @borcatloop, \%row; - } - - $template->param( CGIextChoice => $CGIextChoice, - CGIsepChoice => $CGIsepChoice, - borcatloop =>\@borcatloop, + CGIsepChoice => $CGIsepChoice ); output_html_with_http_headers $input, $cookie, $template->output; } @@ -176,7 +157,7 @@ sub calculate { # Checking filters # my @loopfilter; - for (my $i=0;$i<=2;$i++) { + for (my $i=0;$i<=6;$i++) { my %cell; if ( @$filters[$i] ) { if (($i==1) and (@$filters[$i-1])) { @@ -184,7 +165,6 @@ sub calculate { } $cell{filter} .= @$filters[$i]; $cell{crit} .="Bor Cat" if ($i==0); - $cell{crit} .="Without issues since" if ($i==1); push @loopfilter, \%cell; } } @@ -246,31 +226,13 @@ sub calculate { # preparing calculation my $strcalc ; -# Processing calculation +# Processing average loanperiods $strcalc .= "SELECT CONCAT( borrowers.surname , \"\\t\",borrowers.firstname, \"\\t\", borrowers.cardnumber)"; $strcalc .= " , $colfield " if ($colfield); - $strcalc .= " FROM borrowers "; - $strcalc .= "WHERE 1 "; + $strcalc .= " FROM borrowers LEFT JOIN issues ON issues.borrowernumber=borrowers.borrowernumber WHERE issues.borrowernumber is null"; @$filters[0]=~ s/\*/%/g if (@$filters[0]); $strcalc .= " AND borrowers.categorycode like '" . @$filters[0] ."'" if ( @$filters[0] ); - if (@$filters[1]){ - my $strqueryfilter="SELECT DISTINCT borrowernumber FROM issues where issues.timestamp> @$filters[1] "; - my $queryfilter = $dbh->prepare("SELECT DISTINCT borrowernumber FROM issues where issues.timestamp> @$filters[1] "); - $strcalc .= " AND borrowers.borrowernumber not in ($strqueryfilter)"; - -# $queryfilter->execute(@$filters[1]); -# while (my ($bornum)=$queryfilter->fetchrow){ -# $strcalc .= " AND borrowers.borrowernumber <> $bornum "; -# } - } else { - my $strqueryfilter="SELECT DISTINCT borrowernumber FROM issues "; - my $queryfilter = $dbh->prepare("SELECT DISTINCT borrowernumber FROM issues "); - $queryfilter->execute; - $strcalc .= " AND borrowers.borrowernumber not in ($strqueryfilter)"; -# while (my ($bornum)=$queryfilter->fetchrow){ -# $strcalc .= " AND borrowers.borrowernumber <> $bornum "; -# } - } + $strcalc .= " group by borrowers.borrowernumber"; $strcalc .= ", $colfield" if ($column); $strcalc .= " order by $colfield " if ($colfield); @@ -298,7 +260,7 @@ sub calculate { push @loopcol,{coltitle => "Global"} if not($column); - my $max =(($line)?$line:@table -1); + my $max =(($line)?$line:@table); for ($i=1; $i<=$max;$i++) { my @loopcell; #@loopcol ensures the order for columns is common with column titles @@ -336,4 +298,4 @@ sub calculate { return \@mainloop; } -1; +1; \ No newline at end of file diff --git a/reports/borrowers_stats.pl b/reports/borrowers_stats.pl index 5d37d55d44..d08842e66c 100755 --- a/reports/borrowers_stats.pl +++ b/reports/borrowers_stats.pl @@ -23,11 +23,8 @@ use strict; use C4::Auth; use CGI; use C4::Context; -use HTML::Template; use C4::Search; -use C4::Output; use C4::Koha; -use C4::Acquisition; use C4::Interface::CGI::Output; use C4::Circulation::Circ2; @@ -122,22 +119,6 @@ if ($do_it) { -size => 1, -multiple => 0 ); - my @branches; - my @select_branch; - my %select_branches; - my ($count2,@branches)=branches(); - push @select_branch,""; - $select_branches{''}=''; - for (my $i=0;$i<$count2;$i++){ - push @select_branch, $branches[$i]->{'branchcode'};# - $select_branches{$branches[$i]->{'branchcode'}} = $branches[$i]->{'branchname'}; - } - my $CGIbranch=CGI::scrolling_list( -name => 'pickup', - -values => \@select_branch, - -labels => \%select_branches, - -size => 1, - -multiple => 0 ); - $req = $dbh->prepare( "select distinctrow sort1 from borrowers order by sort1"); $req->execute; my @select_sort1; @@ -191,14 +172,13 @@ if ($do_it) { -values => \@dels, -size => 1, -multiple => 0 ); - $template->param(CGICatcode => $CGICatCode, + $template->param(CGICatCode => $CGICatCode, CGISort1 => $CGIsort1, hassort1 => $hassort1, CGISort2 => $CGIsort2, hassort2 => $hassort2, CGIextChoice => $CGIextChoice, - CGIsepChoice => $CGIsepChoice, - CGIBranch => $CGIbranch + CGIsepChoice => $CGIsepChoice ); } @@ -227,16 +207,14 @@ sub calculate { $linefilter = @$filters[0] if ($line =~ /categorycode/ ) ; $linefilter = @$filters[1] if ($line =~ /zipcode/ ) ; - $linefilter = @$filters[2] if ($line =~ /branccode/ ) ; - $linefilter = @$filters[3] if ($line =~ /sort1/ ) ; - $linefilter = @$filters[4] if ($line =~ /sort2/ ) ; + $linefilter = @$filters[2] if ($line =~ /sort1/ ) ; + $linefilter = @$filters[3] if ($line =~ /sort2/ ) ; # my $colfilter = ""; $colfilter = @$filters[0] if ($column =~ /categorycode/); $colfilter = @$filters[1] if ($column =~ /zipcode/); - $colfilter = @$filters[2] if ($column =~ /branchcode/); - $colfilter = @$filters[3] if ($column =~ /sort1/); - $colfilter = @$filters[4] if ($column =~ /sort2/); + $colfilter = @$filters[2] if ($column =~ /sort1/); + $colfilter = @$filters[3] if ($column =~ /sort2/); my @loopfilter; for (my $i=0;$i<=3;$i++) { @@ -245,9 +223,8 @@ sub calculate { $cell{filter} .= @$filters[$i]; $cell{crit} .="Cat Code " if ($i==0); $cell{crit} .="Zip Code" if ($i==1); - $cell{crit} .="Branchcode" if ($i==2); - $cell{crit} .="Sort1" if ($i==3); - $cell{crit} .="Sort2" if ($i==4); + $cell{crit} .="Sort1" if ($i==2); + $cell{crit} .="Sort2" if ($i==3); push @loopfilter, \%cell; } } @@ -301,10 +278,10 @@ sub calculate { $strsth2 .= "select distinctrow $colfield from borrowers where $column is not null"; if ( $colfilter ) { $strsth2 .= " and $colfield LIKE ? "; - } + } $strsth2 .= " and $status='1' " if ($status); $strsth2 .= " order by $colfield"; -# warn "". $strsth2; + warn "". $strsth2; my $sth2 = $dbh->prepare( $strsth2 ); if ($colfilter) { $sth2->execute($colfilter); @@ -408,3 +385,4 @@ sub calculate { return \@mainloop; } +1; \ No newline at end of file diff --git a/reports/borrowers_stats.plugin b/reports/borrowers_stats.plugin new file mode 100644 index 0000000000..3e677afb10 --- /dev/null +++ b/reports/borrowers_stats.plugin @@ -0,0 +1,183 @@ +#!/usr/bin/perl + +# $Id$ + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +use strict; +use C4::Auth; +use CGI; +use C4::Context; +use HTML::Template; +use C4::Search; +use C4::Output; +use C4::Koha; + +=head1 NAME + +plugin that shows a stats on borrowers + +=head1 DESCRIPTION + + +=over2 + +=cut + +sub set_parameters { + my ($template) = @_; + my $dbh = C4::Context->dbh; + return $template; +} + +sub calculate { + my ($line, $column, $filters) = @_; + my @results =(); + my @mainloop; + my @loopfooter; + my @loopcol; + my @looprow; + my %globalline; + my $grantotal =0; +# extract parameters + my $dbh = C4::Context->dbh; +# build the SQL query & execute it + my $linefilter = ""; + $linefilter = @$filters[0] if ($line =~ /categorycode/ ) ; + $linefilter = @$filters[4] if ($line =~ /zipcode/ ) ; + $linefilter = @$filters[2] if ($line =~ /sort1/ ) ; + $linefilter = @$filters[3] if ($line =~ /sort2/ ) ; + + my $colfilter = ""; + $colfilter = @$filters[0] if ($column =~ /categorycode/); + $colfilter = @$filters[4] if ($column =~ /zipcode/); + $colfilter = @$filters[2] if ($column =~ /sort1/); + $colfilter = @$filters[3] if ($column =~ /sort2/); + + my @loopfilter; + for (my $i=0;$i<=4;$i++) { + my %cell; + if ( @$filters[$i] ) { + $cell{filter} .= @$filters[$i]; + $cell{crit} .="Category Code " if ($i==0); + $cell{crit} .="Status" if ($i==1); + $cell{crit} .="Sort1" if ($i==2); + $cell{crit} .="Sort2" if ($i==3); + $cell{crit} .="Zip Code" if ($i==4); + push @loopfilter, \%cell; + } + } +# 1st, loop rows. +#problem with NULL Values. + my $strsth; + $strsth .= "select distinctrow $line from borrowers"; + $linefilter =~ s/\*/%/g; + if ( $linefilter ) { + $strsth .= " where $line LIKE ? and $line is not null" ; + } else { + $strsth .= " where $line is not null" ; + } + $strsth .=" order by $line"; + my $sth = $dbh->prepare( $strsth ); + if ( $linefilter ) { + $sth->execute($linefilter); + } else { + $sth->execute; + } + while ( my ($celvalue) = $sth->fetchrow) { + my %cell; + if ($celvalue) { + $cell{rowtitle} = $celvalue; + } else { + $cell{rowtitle} = ""; + } + $cell{totalrow} = 0; + push @looprow, \%cell; + } + +# 2nd, loop cols. + my $strsth2; + $colfilter =~ s/\*/%/g; + $strsth2 .= "select distinctrow $column from borrowers"; + if ( $colfilter ) { + $strsth2 .= " where $column LIKE ? and $column is not null"; + } else { + $strsth2 .= " where $column is not null"; + } + $strsth2 .= " order by $column"; + my $sth2 = $dbh->prepare( $strsth2 ); + if ($colfilter) { + $sth2->execute($colfilter); + } else { + $sth2->execute; + } + while (my ($celvalue) = $sth2->fetchrow) { + my %cell; + my %ft; + $cell{coltitle} = $celvalue; + $ft{totalcol} = 0; + push @loopcol, \%cell; + push @loopfooter, \%ft; + } +# now, parse each category. Before filling the result array, fill it with 0 to have every itemtype column. + my $strcalc .= "SELECT count( * ) FROM borrowers WHERE $line = ? and $column= ? "; + $strcalc .= " AND categorycode like '" . @$filters[1] ."%' " if ( @$filters[1] ); + $strcalc .= " AND sort1 like ' " . @$filters[2] ."%'" if ( @$filters[2] ); + $strcalc .= " AND sort2 like ' " . @$filters[3] ."%'" if ( @$filters[3] ); + $strcalc .= " AND zipcode like ' " . @$filters[4] ."%'" if ( @$filters[4] ); + my $dbcalc = $dbh->prepare($strcalc); + my $i=0; + my @totalcol; + my $hilighted=-1; + # for each line + for (my $i=0; $i<=$#looprow; $i++) { + my $row = $looprow[$i]->{'rowtitle'}; + my @loopcell; + my $totalrow=0; + # for each column + for (my $j=0;$j<=$#loopcol;$j++) { + my $col = $loopcol[$j]->{'coltitle'}; + $dbcalc->execute($row,$col); + my ($value) = $dbcalc->fetchrow; +# warn "$row / $col / $value"; + $totalrow += $value; + $grantotal += $value; + $loopfooter[$j]->{'totalcol'} +=$value; + push @loopcell,{value => $value}; + } + $looprow[$i]->{'totalrow'}=$totalrow; + $looprow[$i]->{'loopcell'}=\@loopcell; + $looprow[$i]->{'hilighted'} = 1 if $hilighted eq 1; + $hilighted = -$hilighted; + } + +# # the header of the table + $globalline{loopfilter}=\@loopfilter; + $globalline{looprow} = \@looprow; +# # the core of the table + $globalline{loopcol} = \@loopcol; +# # the foot (totals by borrower type) + $globalline{loopfooter} = \@loopfooter; + $globalline{total}= $grantotal; + $globalline{line} = $line; + $globalline{column} = $column; + push @mainloop,\%globalline; + return \@mainloop; +} + +1; \ No newline at end of file diff --git a/reports/cat_issues_top.pl b/reports/cat_issues_top.pl index f061793ac8..fddcf6d58b 100755 --- a/reports/cat_issues_top.pl +++ b/reports/cat_issues_top.pl @@ -30,7 +30,6 @@ use C4::Koha; use C4::Interface::CGI::Output; use C4::Circulation::Circ2; use Date::Manip; -use C4::Members; =head1 NAME @@ -62,11 +61,7 @@ my ($template, $borrowernumber, $cookie) flagsrequired => {editcatalogue => 1}, debug => 1, }); -$template->param(do_it => $do_it, - intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), - ); +$template->param(do_it => $do_it); if ($do_it) { # Displaying results my $results = calculate($limit, $column, \@filters); @@ -138,50 +133,10 @@ if ($do_it) { -values => \@dels, -size => 1, -multiple => 0 ); - #branch - my $branches = getallbranches; - my @branchloop; - foreach my $thisbranch (keys %$branches) { -# my $selected = 1 if $thisbranch eq $branch; - my %row =(value => $thisbranch, -# selected => $selected, - branchname => $branches->{$thisbranch}->{'branchname'}, - ); - push @branchloop, \%row; - } - - #doctype - my $itemtypes = GetItemTypes; - my @itemtypeloop; - foreach my $thisitemtype (keys %$itemtypes) { -# my $selected = 1 if $thisbranch eq $branch; - my %row =(value => $thisitemtype, -# selected => $selected, - description => $itemtypes->{$thisitemtype}->{'description'}, - ); - push @itemtypeloop, \%row; - } - - #borcat - my ($codes,$labels) = borrowercategories; - my @borcatloop; - foreach my $thisborcat (sort keys %$labels) { - # my $selected = 1 if $thisbranch eq $branch; - my %row =(value => $thisborcat, - # selected => $selected, - description => $labels->{$thisborcat}, - ); - push @borcatloop, \%row; - } - #Day - #Month $template->param( CGIextChoice => $CGIextChoice, - CGIsepChoice => $CGIsepChoice, - branchloop =>\@branchloop, - itemtypeloop =>\@itemtypeloop, - borcatloop =>\@borcatloop, + CGIsepChoice => $CGIsepChoice ); output_html_with_http_headers $input, $cookie, $template->output; } @@ -296,7 +251,10 @@ sub calculate { while (my ($celvalue) = $sth2->fetchrow) { my %cell; - $cell{coltitle} = ($celvalue?$celvalue:"NULL"); + # my %ft; + # warn "coltitle :".$celvalue; + $cell{coltitle} = $celvalue; + # $ft{totalcol} = 0; push @loopcol, \%cell; } # warn "fin des titres colonnes"; @@ -349,29 +307,31 @@ sub calculate { $strcalc .= " group by biblio.biblionumber"; $strcalc .= ", $colfield" if ($column); - $strcalc .= " order by RANK DESC"; - $strcalc .= ", $colfield " if ($colfield); -# my $max; -# if (@loopcol) { -# $max = $line*@loopcol; -# } else { $max=$line;} -# $strcalc .= " LIMIT 0,$max"; + $strcalc .= " order by "; + $strcalc .= "$colfield, " if ($colfield); + $strcalc .= "RANK DESC "; + my $max; + if (@loopcol) { + $max = $line*@loopcol; + } else { $max=$line;} + $strcalc .= " LIMIT 0,$max"; warn "SQL :". $strcalc; my $dbcalc = $dbh->prepare($strcalc); $dbcalc->execute; # warn "filling table"; my $previous_col; - my %indice; + my $i=1; while (my @data = $dbcalc->fetchrow) { my ($row, $rank, $id, $col )=@data; $col = "zzEMPTY" if ($col eq undef); - $indice{$col}=1 if (not($indice{$col})); - $table[$indice{$col}]->{$col}->{'name'}=$row; - $table[$indice{$col}]->{$col}->{'count'}=$rank; - $table[$indice{$col}]->{$col}->{'link'}=$id; + $i=1 if (($previous_col) and not($col eq $previous_col)); + $table[$i]->{$col}->{'name'}=$row; + $table[$i]->{$col}->{'count'}=$rank; + $table[$i]->{$col}->{'link'}=$id; # warn " ".$i." ".$col. " ".$row; - $indice{$col}++; + $i++; + $previous_col=$col; } push @loopcol,{coltitle => "Global"} if not($column); @@ -425,4 +385,4 @@ sub calculate { return \@mainloop; } -1; +1; \ No newline at end of file diff --git a/reports/catalogue_out.pl b/reports/catalogue_out.pl index 10b49bd5f5..3a7c2424d4 100755 --- a/reports/catalogue_out.pl +++ b/reports/catalogue_out.pl @@ -61,11 +61,7 @@ my ($template, $borrowernumber, $cookie) flagsrequired => {editcatalogue => 1}, debug => 1, }); -$template->param(do_it => $do_it, - intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), - ); +$template->param(do_it => $do_it); if ($do_it) { # Displaying results my $results = calculate($limit, $column, \@filters); @@ -136,35 +132,10 @@ if ($do_it) { -values => \@dels, -size => 1, -multiple => 0 ); - #doctype - my $itemtypes = GetItemTypes; - my @itemtypeloop; - foreach my $thisitemtype (keys %$itemtypes) { -# my $selected = 1 if $thisbranch eq $branch; - my %row =(value => $thisitemtype, -# selected => $selected, - description => $itemtypes->{$thisitemtype}->{'description'}, - ); - push @itemtypeloop, \%row; - } - - #branch - my $branches = getallbranches; - my @branchloop; - foreach my $thisbranch (keys %$branches) { -# my $selected = 1 if $thisbranch eq $branch; - my %row =(value => $thisbranch, -# selected => $selected, - branchname => $branches->{$thisbranch}->{'branchname'}, - ); - push @branchloop, \%row; - } $template->param( CGIextChoice => $CGIextChoice, - CGIsepChoice => $CGIsepChoice, - itemtypeloop =>\@itemtypeloop, - branchloop =>\@branchloop, + CGIsepChoice => $CGIsepChoice ); output_html_with_http_headers $input, $cookie, $template->output; } @@ -260,9 +231,9 @@ sub calculate { my $strcalc ; # Processing average loanperiods - $strcalc .= "SELECT items.barcode, biblio.title, biblio.biblionumber, biblio.author"; + $strcalc .= "SELECT CONCAT( items.itemnumber, \" \",biblioitems.biblioitemnumber)"; $strcalc .= " , $colfield " if ($colfield); - $strcalc .= " FROM (items LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber LEFT JOIN biblio ON biblio.biblionumber=items.biblionumber) LEFT JOIN issues ON issues.itemnumber=items.itemnumber WHERE issues.itemnumber is null"; + $strcalc .= " FROM (items LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber) LEFT JOIN issues ON issues.itemnumber=items.itemnumber WHERE issues.itemnumber is null"; # @$filters[0]=~ s/\*/%/g if (@$filters[0]); # $strcalc .= " AND issues.timestamp <= '" . @$filters[0] ."'" if ( @$filters[0] ); # @$filters[1]=~ s/\*/%/g if (@$filters[1]); @@ -292,13 +263,10 @@ sub calculate { my $previous_col; my $i=1; while (my @data = $dbcalc->fetchrow) { - my ($barcode,$title,$bibnum,$author, $col )=@data; + my ($row, $col )=@data; $col = "zzEMPTY" if ($col eq undef); $i=1 if (($previous_col) and not($col eq $previous_col)); - $table[$i]->{$col}->{'barcode'}=$barcode; - $table[$i]->{$col}->{'title'}=$title; - $table[$i]->{$col}->{'bibnum'}=$bibnum; - $table[$i]->{$col}->{'author'}=$author; + $table[$i]->{$col}=$row; # warn " ".$i." ".$col. " ".$row; $i++; $previous_col=$col; @@ -313,19 +281,13 @@ sub calculate { # and the number matches the number of columns my $colcount=0; foreach my $col ( @loopcol ) { - my ($barcode, $author, $title, $bibnum); + my $value; if (@loopcol){ - $barcode =$table[$i]->{(($col->{coltitle} eq "NULL") or ($col->{coltitle} eq "Global"))?"zzEMPTY":$col->{coltitle}}->{'barcode'}; - $title =$table[$i]->{(($col->{coltitle} eq "NULL") or ($col->{coltitle} eq "Global"))?"zzEMPTY":$col->{coltitle}}->{'title'}; - $author =$table[$i]->{(($col->{coltitle} eq "NULL") or ($col->{coltitle} eq "Global"))?"zzEMPTY":$col->{coltitle}}->{'author'}; - $bibnum =$table[$i]->{(($col->{coltitle} eq "NULL") or ($col->{coltitle} eq "Global"))?"zzEMPTY":$col->{coltitle}}->{'bibnum'}; + $value =$table[$i]->{(($col->{coltitle} eq "NULL") or ($col->{coltitle} eq "Global"))?"zzEMPTY":$col->{coltitle}}; } else { - $barcode =$table[$i]->{"zzEMPTY"}->{'barcode'}; - $title =$table[$i]->{"zzEMPTY"}->{'title'}; - $author =$table[$i]->{"zzEMPTY"}->{'author'}; - $bibnum =$table[$i]->{"zzEMPTY"}->{'bibnum'}; + $value =$table[$i]->{"zzEMPTY"}; } - push @loopcell, {author=> $author, title=>$title,bibnum=>$bibnum,barcode=>$barcode} ; + push @loopcell, {value => $value} ; } push @looprow,{ 'rowtitle' => $i , 'loopcell' => \@loopcell, @@ -350,4 +312,4 @@ sub calculate { return \@mainloop; } -1; +1; \ No newline at end of file diff --git a/reports/catalogue_stats.pl b/reports/catalogue_stats.pl index f22d371ecd..8a036b3d8d 100755 --- a/reports/catalogue_stats.pl +++ b/reports/catalogue_stats.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl - +## Will not work. Requires a complete re-write for ZEBRA # $Id$ # Copyright 2000-2002 Katipo Communications @@ -23,7 +23,6 @@ use strict; use C4::Auth; use CGI; use C4::Context; -use HTML::Template; use C4::Search; use C4::Output; use C4::Koha; @@ -32,7 +31,7 @@ use C4::Circulation::Circ2; =head1 NAME -plugin that shows a stats on borrowers +plugin that shows a stats on catalogue =head1 DESCRIPTION @@ -106,99 +105,66 @@ if ($do_it) { my %labels; my $count=0; my $req; - $req = $dbh->prepare("select count(dewey) from biblioitems "); - $req->execute; - my $hasdewey; - my @select; -# push @select,""; - while (my ($value) =$req->fetchrow) { - $hasdewey =1 if (($value>2) and (! $hasdewey)); - $count++ if (($value>2) and (! $hasdewey)); -# push @select, $value; +###Use mfield of koha_attr instead of dewey +my $sth = $dbh->prepare("select authorised_value from authorised_values where category='mfield' order by lib"); + $sth->execute; + my @authorised_values; + #push @authorised_values,""; + while ((my $category) = $sth->fetchrow_array) { + push @authorised_values, $category; } -# my $CGIdewey=CGI::scrolling_list( -name => 'Filter', -# -id => 'Filter', -# -values => \@select, -# -size => 1, -# -multiple => 0 ); +my $hasdewey; + my $CGIdewey=CGI::scrolling_list( -name => 'Filter', + -id => 'Filter', + -values => \@authorised_values, + -size => 1, + -multiple => 0 ); - $req = $dbh->prepare( "select count(lccn) from biblioitems "); - $req->execute; -# undef @select; -# push @select,""; - my $haslccn; - my $hlghtlccn; - while (my ($value) =$req->fetchrow) { - $hlghtlccn = !($hasdewey); - $haslccn =1 if (($value>2) and (! $haslccn)); - $count++ if (($value) and (! $haslccn)); -# push @select, $value; + + my $haslccn=1; + my $hlghtlccn=1; + my @select; + for my $value ("A".."Z") { + push @select, $value; } -# my $CGIlccn=CGI::scrolling_list( -name => 'Filter', -# -id => 'Filter', -# -values => \@select, -# -size => 1, -# -multiple => 0 ); + my $CGIlccn=CGI::scrolling_list( -name => 'Filter', + -id => 'Filter', + -values => \@select, + -size => 1, + -multiple => 0 ); - $req = $dbh->prepare("select count(itemcallnumber) from items"); - $req->execute; -# undef @select; -# push @select,""; my $hascote; my $hlghtcote; - while (my ($value) =$req->fetchrow) { - $hascote =1 if (($value>2) and (! $hascote)); - $count++ if (($value) and (! $hascote)); - $hlghtcote = (($hasdewey) and ($haslccn)) or (!($hasdewey) and !($haslccn)); -# push @select, $value; - } -# my $CGIcote=CGI::scrolling_list( -name => 'Filter', -# -id => 'Filter', -# -values => \@select, -# -size => 1, -# -multiple => 0 ); $count++; my $hglghtDT =$count % 2; -# warn "highlightDT ".$hglghtDT; $count++; my $hglghtPub =$count % 2; -# warn "highlightPub ".$hglghtPub; $count++; my $hglghtPY =$count % 2; -# warn "highlightPY ".$hglghtPY; $count++; my $hglghtHB =$count % 2; -# warn "highlightHB ".$hglghtHB; $count++; my $hglghtLOC =$count % 2; -# warn "highlightLOC ".$hglghtLOC; + my $hglghtSTACK =$count % 2; - - $req = $dbh->prepare("select distinctrow itemtype from biblioitems order by itemtype"); - $req->execute; + my $itemtypes = GetItemTypes; undef @select; push @select,""; - while (my ($value) =$req->fetchrow) { - push @select, $value; - } + my %select_item; + $select_item{""} = ""; +foreach my $thisitemtype (sort keys %$itemtypes) { + push @select,$thisitemtype; + $select_item{$thisitemtype}=$itemtypes->{$thisitemtype}->{'description'}; + +} + my $CGIitemtype=CGI::scrolling_list( -name => 'Filter', -id => 'itemtype', -values => \@select, + -labels=>\%select_item, -size => 1, -multiple => 0 ); -# $req = $dbh->prepare("select distinctrow left(publishercode,75) from biblioitems order by publishercode"); -# $req->execute; -# undef @select; -# push @select,""; -# while (my ($value) =$req->fetchrow) { -# push @select, $value; -# } -# my $CGIpublisher=CGI::scrolling_list( -name => 'Filter', -# -id => 'Filter', -# -values => \@select, -# -size => 1, -# -multiple => 0 ); undef @select; push @select,""; @@ -215,14 +181,28 @@ if ($do_it) { -labels => \%select_branches, -size => 1, -multiple => 0 ); - - $req = $dbh->prepare("select distinctrow holdingbranch from items order by holdingbranch"); + + my $CGIholdingbranch=CGI::scrolling_list( -name => 'Filter', + -id => 'holdingbranch', + -values => \@select, + -labels => \%select_branches, + -size => 1, + -multiple => 0 ); + $req = $dbh->prepare("select authorised_value,lib from authorised_values where category='sections'"); $req->execute; undef @select; push @select,""; - my $CGIlocation=CGI::scrolling_list( -name => 'Filter', - -id => 'holdingbranch', + my %desc; + $desc{""}=""; + while (my ($value,$desc) =$req->fetchrow) { + push @select, $value; + $desc{$value}=$desc; + } + + my $CGISTACK=CGI::scrolling_list( -name => 'Filter', + -id => 'shelf', -values => \@select, + -labels =>\%desc, -size => 1, -multiple => 0 ); @@ -247,12 +227,12 @@ if ($do_it) { -multiple => 0 ); $template->param(hasdewey=>$hasdewey, -# CGIFromDeweyClass => $CGIdewey, -# CGIToDeweyClass => $CGIdewey, + CGIFromDeweyClass => $CGIdewey, + CGIToDeweyClass => $CGIdewey, haslccn=> $haslccn, hlghtlccn => $hlghtlccn, -# CGIFromLoCClass => $CGIlccn, -# CGIToLoCClass => $CGIlccn, + CGIFromLoCClass => $CGIlccn, + CGIToLoCClass => $CGIlccn, hascote=> $hascote, hlghtcote => $hlghtcote, hglghtDT => $hglghtDT, @@ -260,14 +240,11 @@ if ($do_it) { hglghtPY => $hglghtPY, hglghtHB => $hglghtHB, hglghtLOC => $hglghtLOC, -# CGIFromCoteClass => $CGIcote, -# CGIToCoteClass => $CGIcote, + hglghtSTACK => $hglghtSTACK, CGIItemType => $CGIitemtype, -# CGIFromPublicationYear => $CGIpublicationyear, -# CGIToPublicationYear => $CGIpublicationyear, -# CGIPublisher => $CGIpublisher, CGIBranch => $CGIbranch, - CGILocation => $CGIlocation, + CGILocation => $CGIbranch, + CGISTACK => $CGISTACK, CGIextChoice => $CGIextChoice, CGIsepChoice => $CGIsepChoice ); @@ -302,16 +279,17 @@ sub calculate { $cell{filter} .= @$filters[$i]; $cell{crit} .="Dewey Classification From" if ($i==0); $cell{crit} .="Dewey Classification To" if ($i==1); - $cell{crit} .="Lccn Classification From" if ($i==2); - $cell{crit} .="Lccn Classification To" if ($i==3); - $cell{crit} .="Cote Classification From" if ($i==4); - $cell{crit} .="Cote Classification To" if ($i==5); + $cell{crit} .="Classification From" if ($i==2); + $cell{crit} .="Classification To" if ($i==3); + $cell{crit} .="Call Number From" if ($i==4); + $cell{crit} .="Call Number To" if ($i==5); $cell{crit} .="Document type" if ($i==6); $cell{crit} .="Publisher" if ($i==7); $cell{crit} .="Publication year From" if ($i==8); $cell{crit} .="Publication year To" if ($i==9); $cell{crit} .="Branch :" if ($i==10); $cell{crit} .="Location:" if ($i==11); + $cell{crit} .="Shelving:" if ($i==12); push @loopfilter, \%cell; } } @@ -324,46 +302,47 @@ sub calculate { $linefilter[0] = @$filters[0] if ($line =~ /dewey/ ) ; $linefilter[1] = @$filters[1] if ($line =~ /dewey/ ) ; - $linefilter[0] = @$filters[2] if ($line =~ /lccn/ ) ; - $linefilter[1] = @$filters[3] if ($line =~ /lccn/ ) ; - $linefilter[0] = @$filters[4] if ($line =~ /items.itemcallnumber/ ) ; - $linefilter[1] = @$filters[5] if ($line =~ /items.itemcallnumber/ ) ; + $linefilter[0] = @$filters[2] if ($line =~ /classification/ ) ; + $linefilter[1] = @$filters[3] if ($line =~ /classification/ ) ; + $linefilter[0] = @$filters[4] if ($line =~ /itemcallnumber/ ) ; + $linefilter[1] = @$filters[5] if ($line =~ /itemcallnumber/ ) ; $linefilter[0] = @$filters[6] if ($line =~ /itemtype/ ) ; $linefilter[0] = @$filters[7] if ($line =~ /publishercode/ ) ; $linefilter[0] = @$filters[8] if ($line =~ /publicationyear/ ) ; $linefilter[1] = @$filters[9] if ($line =~ /publicationyear/ ) ; - @linefilter[0] = @$filters[10] if ($line =~ /items.homebranch/ ) ; - @linefilter[0] = @$filters[11] if ($line =~ /items.holdingbranch/ ) ; + $linefilter[0] = @$filters[10] if ($line =~ /homebranch/ ) ; + $linefilter[0] = @$filters[11] if ($line =~ /holdingbranch/ ) ; + $linefilter[0] = @$filters[12] if ($line =~ /shelf/ ) ; # my @colfilter ; $colfilter[0] = @$filters[0] if ($column =~ /dewey/ ) ; $colfilter[1] = @$filters[1] if ($column =~ /dewey/ ) ; - $colfilter[0] = @$filters[2] if ($column =~ /lccn/ ) ; - $colfilter[1] = @$filters[3] if ($column =~ /lccn/ ) ; + $colfilter[0] = @$filters[2] if ($column =~ /classification/ ) ; + $colfilter[1] = @$filters[3] if ($column =~ /classification/ ) ; $colfilter[0] = @$filters[4] if ($column =~ /itemcallnumber/ ) ; $colfilter[1] = @$filters[5] if ($column =~ /itemcallnumber/ ) ; $colfilter[0] = @$filters[6] if ($column =~ /itemtype/ ) ; $colfilter[0] = @$filters[7] if ($column =~ /publishercode/ ) ; $colfilter[0] = @$filters[8] if ($column =~ /publicationyear/ ) ; $colfilter[1] = @$filters[9] if ($column =~ /publicationyear/ ) ; - @colfilter[0] = @$filters[10] if ($column =~ /items.homebranch/ ) ; - @colfilter[0] = @$filters[11] if ($column =~ /items.holdingbranch/ ) ; - + $colfilter[0] = @$filters[10] if ($column =~ /homebranch/ ) ; + $colfilter[0] = @$filters[11] if ($column =~ /holdingbranch/ ) ; + $colfilter[0] = @$filters[12] if ($column =~ /shelf/ ) ; # 1st, loop rows. my $linefield; if (($line =~/dewey/) and ($deweydigits)) { $linefield .="left($line,$deweydigits)"; - } elsif (($line=~/lccn/) and ($lccndigits)) { + } elsif (($line=~/classification/) and ($lccndigits)) { $linefield .="left($line,$lccndigits)"; - } elsif (($line=~/items.itemcallnumber/) and ($cotedigits)) { + } elsif (($line=~/itemcallnumber/) and ($cotedigits)) { $linefield .="left($line,$cotedigits)"; }else { $linefield .= $line; } - +warn $linefield,$colfilter[0],$linefilter[0],$line; my $strsth; - $strsth .= "select distinctrow $linefield from biblioitems left join items on (items.biblioitemnumber = biblioitems.biblioitemnumber) where $line is not null "; + $strsth .= "select distinctrow $linefield from biblio left join items on (items.biblionumber = biblio.biblionumber) where $line is not null "; if ( @linefilter ) { if ($linefilter[1]){ $strsth .= " and $line >= ? " ; @@ -399,7 +378,7 @@ sub calculate { my $colfield; if (($column =~/dewey/) and ($deweydigits)) { $colfield .="left($column,$deweydigits)"; - }elsif (($column=~/lccn/) and ($lccndigits)) { + }elsif (($column=~/classification/) and ($lccndigits)) { $colfield .="left($column,$lccndigits)"; }elsif (($column=~/itemcallnumber/) and ($cotedigits)) { $colfield .="left($column,$cotedigits)"; @@ -408,7 +387,7 @@ sub calculate { } my $strsth2; - $strsth2 .= "select distinctrow $colfield from biblioitems left join items on (items.biblioitemnumber = biblioitems.biblioitemnumber) where $column is not null "; + $strsth2 .= "select distinctrow $colfield from biblio left join items on (items.biblionumber = biblio.biblionumber) where $column is not null "; if (( @colfilter ) and ($colfilter[1])) { $strsth2 .= " and $column> ? and $column< ?"; }elsif ($colfilter[0]){ @@ -452,45 +431,83 @@ sub calculate { } $table{$row->{rowtitle}}->{totalrow}=0; } - -# preparing calculation +my @kohafield; +my @values; +my @and_or; +my @relations; +# preparing calculation in zebra my $strcalc .= "SELECT $linefield, $colfield, count( * ) FROM biblioitems LEFT JOIN items ON (items.biblioitemnumber = biblioitems.biblioitemnumber) WHERE 1"; if (@$filters[0]){ @$filters[0]=~ s/\*/%/g; $strcalc .= " AND dewey >" . @$filters[0] .""; + push @and_or, "\@and"; + push @relations "\@attr 2=5"; + push @kohafield, "dewey"; + push @values, @$filters[0] ; + } if (@$filters[1]){ @$filters[1]=~ s/\*/%/g ; $strcalc .= " AND dewey <" . @$filters[1] .""; + push @and_or, "\@and"; + push @relations "\@attr 2=1"; + push @kohafield, "dewey"; + push @values, @$filters[1] ; + } if (@$filters[2]){ @$filters[2]=~ s/\*/%/g ; - $strcalc .= " AND lccn >" . @$filters[2] ."" ; + $strcalc .= " AND classification >=" .$dbh->quote(@$filters[2]) ."" ; + push @and_or, "\@and"; + push @relations "\@attr 2=4"; + push @kohafield, "classification"; + push @values, @$filters[2]; + } if (@$filters[3]){ @$filters[3]=~ s/\*/%/g; - $strcalc .= " AND lccn <" . @$filters[3] ."" ; + $strcalc .= " AND classification <=" . $dbh->quote(@$filters[3]) ."" ; + push @and_or, "\@and"; + push @relations "\@attr 2=2"; + push @kohafield, "classification"; + push @values, @$filters[3] ; } if (@$filters[4]){ @$filters[4]=~ s/\*/%/g ; $strcalc .= " AND items.itemcallnumber >=" . $dbh->quote(@$filters[4]) ."" ; + push @and_or, "\@and"; + push @relations "\@attr 2=4"; + push @kohafield, "itemcallnumber"; + push @values, @$filters[4] ; } if (@$filters[5]){ @$filters[5]=~ s/\*/%/g; $strcalc .= " AND items.itemcallnumber <=" . $dbh->quote(@$filters[5]) ."" ; + push @and_or, "\@and"; + push @relations "\@attr 2=2"; + push @kohafield, "itemcallnumber"; + push @values, @$filters[5] ; } if (@$filters[6]){ @$filters[6]=~ s/\*/%/g; $strcalc .= " AND biblioitems.itemtype like '" . @$filters[6] ."'"; + push @and_or, "\@and"; + push @relations "\@attr 2=3"; + push @kohafield, "itemtype"; + push @values, @$filters[6] ; } if (@$filters[7]){ @$filters[7]=~ s/\*/%/g; @$filters[7].="%" unless @$filters[7]=~/%/; $strcalc .= " AND biblioitems.publishercode like \"" . @$filters[7] ."\""; + push @and_or, "\@and"; + push @relations "\@attr 2=3"; + push @kohafield, "publishercode"; + push @values, @$filters[7]; } if (@$filters[8]){ @$filters[8]=~ s/\*/%/g; @@ -508,11 +525,14 @@ sub calculate { @$filters[11]=~ s/\*/%/g; $strcalc .= " AND items.holdingbranch like '" . @$filters[11] ."'" if ( @$filters[11] ); } - + if (@$filters[12]){ + @$filters[12]=~ s/\*/%/g; + $strcalc .= " AND items.stack like '" . @$filters[12] ."'" if ( @$filters[12] ); + } $strcalc .= " group by $linefield, $colfield order by $linefield,$colfield"; warn "". $strcalc; my $dbcalc = $dbh->prepare($strcalc); - $dbcalc->execute; +# $dbcalc->execute; # warn "filling table"; my $emptycol; @@ -527,11 +547,6 @@ sub calculate { $grantotal += $value; } -# my %cell = {rowtitle => 'zzROWEMPTY'}; -# push @loopline,\%cell; -# undef %cell; -# my %cell; -# %cell = {coltitle => "zzEMPTY"}; push @loopcol,{coltitle => "NULL"} if ($emptycol); foreach my $row ( sort keys %table ) { diff --git a/reports/inventory.pl b/reports/inventory.pl index 1f32ec91ca..d6c3be5fec 100755 --- a/reports/inventory.pl +++ b/reports/inventory.pl @@ -24,8 +24,7 @@ use C4::Context; use C4::Output; use C4::Interface::CGI::Output; use C4::Circulation::Circ2; -use C4::Date; -use HTML::Template; +use C4::Biblio; # Fixed variables my $linecolor1='#ffffcc'; @@ -39,16 +38,14 @@ my $pagepagesize=20; # Main loop.... my $input = new CGI; my $minlocation=$input->param('minlocation'); -my $maxlocation=$input->param('maxlocation'); -$maxlocation=$minlocation.'Z' unless $maxlocation; +#my $maxlocation=$input->param('maxlocation'); +#$maxlocation=$minlocation.'Z' unless $maxlocation; my $datelastseen = $input->param('datelastseen'); my $offset = $input->param('offset'); my $markseen = $input->param('markseen'); $offset=0 unless $offset; my $pagesize = $input->param('pagesize'); $pagesize=20 unless $pagesize; -my $uploadbarcodes = $input->param('uploadbarcodes'); -# warn "uploadbarcodes : ".$uploadbarcodes; my ($template, $borrowernumber, $cookie) = get_template_and_user({template_name => "reports/inventory.tmpl", @@ -59,70 +56,42 @@ my ($template, $borrowernumber, $cookie) debug => 1, }); $template->param(minlocation => $minlocation, - maxlocation => $maxlocation, + offset => $offset, pagesize => $pagesize, datelastseen => $datelastseen, - intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), ); -if ($uploadbarcodes && length($uploadbarcodes)>0){ - my $dbh=C4::Context->dbh; - my $date=format_date($input->param('setdate')); - $date = format_date("today") unless $date; -# warn "$date"; - my $strsth="update items set (datelastseen = $date) where items.barcode =?"; - my $qupdate = $dbh->prepare($strsth); - my $strsth="select * from issues, items where items.itemnumber=issues.itemnumber and items.barcode =? and issues.returndate is null"; - my $qonloan = $dbh->prepare($strsth); - my $strsth="select * from items where items.barcode =? and issues.wthdrawn=1"; - my $qwthdrawn = $dbh->prepare($strsth); - my @errorloop; - my $count=0; - while (my $barcode=<$uploadbarcodes>){ - chomp $barcode; -# warn "$barcode"; - if ($qwthdrawn->execute($barcode) &&$qwthdrawn->rows){ - push @errorloop, {'barcode'=>$barcode,'ERR_WTHDRAWN'=>1}; - }else{ - $qupdate->execute($barcode); - $count += $qupdate->rows; -# warn "$count"; - if ($count){ - $qonloan->execute($barcode); - if ($qonloan->rows){ - my $data = $qonloan->fetchrow_hashref; - my ($doreturn, $messages, $iteminformation, $borrower) =returnbook($barcode, $data->{homebranch}); - if ($doreturn){push @errorloop, {'barcode'=>$barcode,'ERR_ONLOAN_RET'=>1}} - else {push @errorloop, {'barcode'=>$barcode,'ERR_ONLOAN_NOT_RET'=>1}} - } - } else { - push @errorloop, {'barcode'=>$barcode,'ERR_BARCODE'=>1}; - } +if ($markseen) { + foreach my $field ($input->param) { + if ($field =~ /SEEN-(.*)/) { + &itemseen($1); + &returnbook($1,"MAIN"); } } - $qupdate->finish; - $qonloan->finish; - $qwthdrawn->finish; - $template->param(date=>$date,Number=>$count); -# $template->param(errorfile=>$errorfile) if ($errorfile); - $template->param(errorloop=>\@errorloop) if (@errorloop); -}else{ - if ($markseen) { - foreach my $field ($input->param) { - if ($field =~ /SEEN-(.*)/) { - &itemseen($1); - } +} +if ($minlocation) { + my @results = listitemsforinventory($minlocation,$datelastseen,$offset,$pagesize); +## @results is now a hash of kohaxml +## convert to normal koha hash for the templates +my @res; +my $i=0; +foreach my $xml(@results) { + + my @kohafields; ## just parse the fields required + push @kohafields,"title","author","biblionumber","itemnumber","barcode","itemcallnumber"; + my $dbh=C4::Context->dbh; + my ($biblio,@itemrecords) = XMLmarc2koha($dbh,$xml,"",@kohafields); + foreach my $data(@itemrecords){ + $data->{title}=$biblio->{title}; + $data->{author}=$biblio->{author}; + push @res,$data; + } - } - if ($minlocation) { - my $res = C4::Circulation::Circ2::listitemsforinventory($minlocation,$maxlocation,$datelastseen,$offset,$pagesize); - $template->param(loop =>$res, - nextoffset => ($offset+$pagesize), - prevoffset => ($offset?$offset-$pagesize:0), - ); - } +} + $template->param(loop =>\@res, + nextoffset => ($offset+$pagesize), + prevoffset => ($offset?$offset-$pagesize:0), + ); } output_html_with_http_headers $input, $cookie, $template->output; diff --git a/reports/issues_avg_stats.pl b/reports/issues_avg_stats.pl index f05abfc60c..8721230972 100755 --- a/reports/issues_avg_stats.pl +++ b/reports/issues_avg_stats.pl @@ -64,11 +64,7 @@ my ($template, $borrowernumber, $cookie) flagsrequired => {editcatalogue => 1}, debug => 1, }); -$template->param(do_it => $do_it, - intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), - ); +$template->param(do_it => $do_it); if ($do_it) { # Displaying results my $results = calculate($line, $column, $rodsp, $podsp, $calc, \@filters); @@ -161,7 +157,7 @@ if ($do_it) { $hassort1 =1 if ($value); push @select, $value; } - my $branches=GetBranches(); + my $branches=getbranches(); my @select_branch; my %select_branches; push @select_branch,""; @@ -593,4 +589,4 @@ sub calculate { return \@mainloop; } -1; +1; \ No newline at end of file diff --git a/reports/issues_by_borrower_category.plugin b/reports/issues_by_borrower_category.plugin index 80cd0a30a2..9b3d542a82 100644 --- a/reports/issues_by_borrower_category.plugin +++ b/reports/issues_by_borrower_category.plugin @@ -23,7 +23,6 @@ use strict; use C4::Auth; use CGI; use C4::Context; -use HTML::Template; use C4::Search; use C4::Output; use C4::Koha; @@ -63,7 +62,7 @@ the hashes are then translated to hash / arrays to be returned to manager.pl & s sub set_parameters { my ($template) = @_; my $dbh = C4::Context->dbh; - my $branches=getbranches(); + my $branches=GetBranches(); my @branches; my @select_branch; my %select_branches; @@ -101,13 +100,13 @@ sub calculate { } # now, parse each category. Before filling the result array, fill it with 0 to have every itemtype column. my $strsth="SELECT itemtype, count( * ) - FROM issues, borrowers, biblioitems, items + FROM issues, borrowers, biblio, items WHERE issues.borrowernumber = borrowers.borrowernumber AND items.itemnumber = issues.itemnumber - AND biblioitems.biblionumber = items.biblionumber + AND biblio.biblionumber = items.biblionumber AND borrowers.categorycode = ?"; $strsth.= " AND borrowers.branchcode = ".$dbh->quote($branch) if ($branch); - $strsth .= " GROUP BY biblioitems.itemtype"; + $strsth .= " GROUP BY biblio.itemtype"; my $sth = $dbh->prepare($strsth); my $sthcategories = $dbh->prepare("select categorycode,description from categories"); $sthcategories->execute; diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl index c75e342594..d39b48987e 100755 --- a/reports/issues_stats.pl +++ b/reports/issues_stats.pl @@ -23,9 +23,7 @@ use strict; use C4::Auth; use CGI; use C4::Context; -use HTML::Template; use C4::Search; -use C4::Output; use C4::Koha; use C4::Interface::CGI::Output; use C4::Circulation::Circ2; @@ -68,11 +66,7 @@ my ($template, $borrowernumber, $cookie) flagsrequired => {editcatalogue => 1}, debug => 1, }); -$template->param(do_it => $do_it, - intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), - ); +$template->param(do_it => $do_it); if ($do_it) { # Displaying results my $results = calculate($line, $column, $podsp, $type, $daysel, $monthsel, $calc, \@filters); @@ -311,7 +305,7 @@ sub calculate { my $linefield; if (($line =~/datetime/) and ($dsp == 1)) { #Display by day - $linefield .="dayname($line)"; + $linefield .="concat(weekday($line),' ',dayname($line))"; } elsif (($line=~/datetime/) and ($dsp == 2)) { #Display by Month $linefield .="monthname($line)"; @@ -324,9 +318,7 @@ sub calculate { $linefield .= $line; } my $lineorder = $linefield; - $lineorder = "weekday($line)" if $linefield =~ /dayname/; - $lineorder = "month($line)" if $linefield =~ "^month"; - $lineorder = $linefield if (not ($linefield =~ "^month") and not($linefield =~ /dayname/)); + $lineorder = "weekday($line)" if $lineorder =~ "^dayname"; my $strsth; $strsth .= "select distinctrow $linefield from statistics, borrowers where (statistics.borrowernumber=borrowers.borrowernumber) and $line is not null "; @@ -371,8 +363,7 @@ sub calculate { } # 2nd, loop cols. - my $colfield; - my $colorder; + my $colfield; if (($column =~/datetime/) and ($dsp == 1)) { #Display by day $colfield .="dayname($column)"; @@ -387,9 +378,6 @@ sub calculate { } else { $colfield .= $column; } - $colorder = "weekday($line)" if $colfield =~ "^dayname"; - $colorder = "month($line)" if $colfield =~ "^month"; - $colorder = $colfield if (not ($colfield =~ "^month") and not($colfield =~ "^dayname")); my $strsth2; $strsth2 .= "select distinctrow $colfield from statistics, borrowers where (statistics.borrowernumber=borrowers.borrowernumber) and $column is not null "; @@ -410,7 +398,7 @@ sub calculate { $strsth2 .= " and $column LIKE ? " ; } $strsth2 .=" group by $colfield"; - $strsth2 .=" order by $colorder"; + $strsth2 .=" order by $colfield"; # warn "". $strsth2; my $sth2 = $dbh->prepare( $strsth2 ); @@ -453,17 +441,11 @@ sub calculate { $strcalc .= "SELECT $linefield, $colfield, "; $strcalc .= "COUNT( * ) " if ($process ==1); - if ($process ==2){ - $strcalc .= "(COUNT(DISTINCT borrowers.borrowernumber))" ; - } if ($process ==3){ - $strcalc .= "(COUNT(DISTINCT issues.itemnumber))" ; - } - if ($process ==4){ my $rqbookcount = $dbh->prepare("SELECT count(*) FROM items"); $rqbookcount->execute; my ($bookcount) = $rqbookcount->fetchrow; - $strcalc .= "100*(COUNT(DISTINCT issues.itemnumber))/ $bookcount " ; + $strcalc .= "100*(COUNT(itemnumber))/ $bookcount " ; } $strcalc .= "FROM statistics,borrowers where (statistics.borrowernumber=borrowers.borrowernumber) "; @@ -485,14 +467,14 @@ sub calculate { $strcalc .= " AND monthname(datetime) like '" . $monthsel ."'" if ( $monthsel ); $strcalc .= " AND statistics.type like '" . $type ."'" if ( $type ); - $strcalc .= " group by $linefield, $colfield order by $lineorder,$colorder"; + $strcalc .= " group by $linefield, $colfield order by $lineorder,$colfield"; warn "". $strcalc; my $dbcalc = $dbh->prepare($strcalc); $dbcalc->execute; # warn "filling table"; my $emptycol; while (my ($row, $col, $value) = $dbcalc->fetchrow) { - warn "filling table $row / $col / $value "; +# warn "filling table $row / $col / $value "; $emptycol = 1 if ($col eq undef); $col = "zzEMPTY" if ($col eq undef); $row = "zzEMPTY" if ($row eq undef); @@ -503,18 +485,18 @@ sub calculate { } push @loopcol,{coltitle => "NULL"} if ($emptycol); - foreach my $row (@loopline) { + foreach my $row ( sort keys %table ) { my @loopcell; #@loopcol ensures the order for columns is common with column titles # and the number matches the number of columns foreach my $col ( @loopcol ) { - my $value =$table{($row->{rowtitle} eq "NULL")?"zzEMPTY":$row->{rowtitle}}->{($col->{coltitle} eq "NULL")?"zzEMPTY":$col->{coltitle}}; + my $value =$table{$row}->{($col->{coltitle} eq "NULL")?"zzEMPTY":$col->{coltitle}}; push @loopcell, {value => $value } ; } - push @looprow,{ 'rowtitle' => ($row->{rowtitle} eq "NULL")?"zzEMPTY":$row->{rowtitle}, + push @looprow,{ 'rowtitle' => ($row eq "zzEMPTY")?"NULL":$row, 'loopcell' => \@loopcell, 'hilighted' => ($hilighted >0), - 'totalrow' => $table{($row->{rowtitle} eq "NULL")?"zzEMPTY":$row->{rowtitle}}->{totalrow} + 'totalrow' => $table{$row}->{totalrow} }; $hilighted = -$hilighted; } @@ -545,4 +527,4 @@ sub calculate { return \@mainloop; } -1; +1; \ No newline at end of file diff --git a/reports/itemtypes.plugin b/reports/itemtypes.plugin index 05f98a3c17..078df00b50 100644 --- a/reports/itemtypes.plugin +++ b/reports/itemtypes.plugin @@ -23,7 +23,6 @@ use strict; use C4::Auth; use CGI; use C4::Context; -use HTML::Template; use C4::Search; use C4::Output; use C4::Koha; @@ -35,7 +34,7 @@ use C4::Koha; sub set_parameters { my ($template) = @_; my $dbh = C4::Context->dbh; - my $branches=getbranches(); + my $branches=GetBranches(); my @branches; my @select_branch; my %select_branches; @@ -61,15 +60,14 @@ sub calculate { my $dbh = C4::Context->dbh; my $sth; if ($branch) { - $sth = $dbh->prepare("select description, biblioitems.itemtype, count(*) as total from itemtypes, biblioitems, items - where biblioitems.itemtype=itemtypes.itemtype - and items.biblioitemnumber=biblioitems.biblioitemnumber + $sth = $dbh->prepare("select description, biblio.itemtype, count(*) as total from itemtypes, biblio, items + where biblio.itemtype=itemtypes.itemtype + and items.biblionumber=biblio.biblionumber and items.holdingbranch=? - group by biblioitems.itemtype"); + group by biblio.itemtype"); $sth->execute($branch); } else { - $sth = $dbh->prepare("select description, biblioitems.itemtype, count(*) as total from itemtypes, biblioitems,items where biblioitems.itemtype=itemtypes.itemtype - and biblioitems.biblioitemnumber = items.biblioitemnumber group by biblioitems.itemtype"); + $sth = $dbh->prepare("select description, biblio.itemtype, count(*) as total from itemtypes, biblio where biblio.itemtype=itemtypes.itemtype group by biblio.itemtype"); $sth->execute; } my ($description,$biblioitems,$total); @@ -97,4 +95,4 @@ sub calculate { return \@mainloop; } -1; +1; \ No newline at end of file diff --git a/reports/manager.pl b/reports/manager.pl index 22a21df6d8..bdd4a461c8 100755 --- a/reports/manager.pl +++ b/reports/manager.pl @@ -21,10 +21,9 @@ use strict; use CGI; use C4::Auth; use C4::Context; -use C4::Output; use C4::Interface::CGI::Output; use C4::Circulation::Circ2; -use HTML::Template; + my $input = new CGI; my $report_name=$input->param("report_name"); @@ -40,11 +39,7 @@ my ($template, $borrowernumber, $cookie) debug => 1, }); $template->param(do_it => $do_it, - report_name => $report_name, - intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), - ); + report_name => $report_name); my $cgidir = C4::Context->config('intranetdir')."/cgi-bin/reports/"; unless (opendir(DIR, "$cgidir")) { $cgidir = C4::Context->intranetdir."/reports/"; diff --git a/reports/overdue.pl b/reports/overdue.pl index 05a4ad6fe7..fd8723d274 100755 --- a/reports/overdue.pl +++ b/reports/overdue.pl @@ -21,18 +21,21 @@ use strict; use C4::Context; -use C4::Output; use CGI; -use HTML::Template; -use C4::Auth; +use C4::Auth; +use C4::Date; +use C4::Biblio; +use C4::Search; +use C4::Interface::CGI::Output; +use C4::Date; my $input = new CGI; my $type=$input->param('type'); my $theme = $input->param('theme'); # only used if allowthemeoverride is set my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "overdue.tmpl", + = get_template_and_user({template_name => "reports/overdue.tmpl", query => $input, type => "intranet", authnotrequired => 0, @@ -41,11 +44,13 @@ my ($template, $loggedinuser, $cookie) }); my $duedate; my $bornum; -my $itemnum; +my $itemnumber; +my $barcode; my $data1; my $data2; my $data3; my $name; +my $categorycode; my $phone; my $email; my $biblionumber; @@ -53,53 +58,69 @@ my $title; my $author; my @datearr = localtime(time()); my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]); - +my $dateformatted= sprintf ("%0.2d", $datearr[3]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.(1900+$datearr[5]); my $dbh = C4::Context->dbh; +my $count=0; +my @results; +my @kohafields; +my @values; +my @relations; +my $sort; +my @and_or; +push @kohafields, "date_due","date_due"; +push @values,$todaysdate,"0000-00-00"; +push @relations ,"\@attr 2=1","\@attr 2=5"; ## +push @and_or,"\@and"; + ($count,@results)=ZEBRAsearch_kohafields(\@kohafields,\@values,\@relations,$sort,\@and_or); + -my $sth=$dbh->prepare("select date_due,borrowernumber,itemnumber from issues where isnull(returndate) && date_dueexecute($todaysdate); my @overduedata; -while (my $data=$sth->fetchrow_hashref) { - $duedate=$data->{'date_due'}; +foreach my $xml(@results) { +my @kohafields; ## just parse the fields required +push @kohafields,"title","author","biblionumber","itemnumber","barcode","date_due","borrowernumber"; +my ($biblio,@itemrecords) = XMLmarc2koha($dbh,$xml,"",@kohafields); + foreach my $data(@itemrecords){ + if ($data->{'date_due'} lt $todaysdate && $data->{'date_due'} gt "0000-00-00" ){ + $duedate=format_date($data->{'date_due'}); $bornum=$data->{'borrowernumber'}; - $itemnum=$data->{'itemnumber'}; + $itemnumber=$data->{'itemnumber'}; + $biblionumber=$data->{'biblionumber'}; + $barcode=$data->{'barcode'}; - my $sth1=$dbh->prepare("select concat(firstname,' ',surname),phone,emailaddress from borrowers where borrowernumber=?"); + my $sth1=$dbh->prepare("select concat(firstname,' ',surname),phone,emailaddress,categorycode from borrowers where borrowernumber=?"); $sth1->execute($bornum); $data1=$sth1->fetchrow_hashref; $name=$data1->{'concat(firstname,\' \',surname)'}; $phone=$data1->{'phone'}; + $categorycode=$data1->{'categorycode'}; $email=$data1->{'emailaddress'}; $sth1->finish; - my $sth2=$dbh->prepare("select biblionumber from items where itemnumber=?"); - $sth2->execute($itemnum); - $data2=$sth2->fetchrow_hashref; - $biblionumber=$data2->{'biblionumber'}; - $sth2->finish; - - my $sth3=$dbh->prepare("select title,author from biblio where biblionumber=?"); - $sth3->execute($biblionumber); - $data3=$sth3->fetchrow_hashref; - $title=$data3->{'title'}; - $author=$data3->{'author'}; - $sth3->finish; - push (@overduedata, { duedate => $duedate, + + + + + $title=$biblio->{'title'}; + $author=$biblio->{'author'}; + push (@overduedata, { duedate => format_date($duedate), bornum => $bornum, - itemnum => $itemnum, + itemnum => $itemnumber, name => $name, + categorycode => $categorycode, phone => $phone, email => $email, biblionumber => $biblionumber, + + barcode =>$barcode, title => $title, author => $author }); + }## if overdue -} - -$sth->finish; + }##foreach item +}## for each biblio -$template->param( todaysdate => $todaysdate, +$template->param( dateformatted => $dateformatted, count=>$count, overdueloop => \@overduedata ); -print "Content-Type: text/html\n\n", $template->output; +output_html_with_http_headers $input, $cookie, $template->output; diff --git a/reports/reports-home.pl b/reports/reports-home.pl index bf5ce35c17..a220183ca2 100644 --- a/reports/reports-home.pl +++ b/reports/reports-home.pl @@ -17,8 +17,4 @@ my ($template, $loggedinuser, $cookie) flagsrequired => {catalogue => 1}, debug => 1, }); -$template->param(intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), - ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/reports/reservereport.pl b/reports/reservereport.pl index fcbaa28de1..347b6b4601 100755 --- a/reports/reservereport.pl +++ b/reports/reservereport.pl @@ -20,30 +20,16 @@ # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA -# script now takes a branchcode arg -# eg: http://koha.rangitikei.katipo.co.nz/cgi-bin/koha/reports/reservereport.pl?branch=BL - use strict; use C4::Stats; use C4::Date; use CGI; use C4::Output; -use HTML::Template; use C4::Auth; use C4::Interface::CGI::Output; -use C4::Koha; - my $input = new CGI; my $time = $input->param('time'); -my $branch = $input->param('branch'); -my $sort = $input->param('sort'); - -if (!$branch) { - $branch = "ALL"; -} - -my $branches=GetBranches(); my ( $template, $borrowernumber, $cookie ) = get_template_and_user( { @@ -56,21 +42,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( } ); -# building up branches dropdown box - -my %branchall; -my $branchcount=0; -my @branchloop; - -foreach my $br (keys %$branches) { - $branchcount++; - my %branch1; - $branch1{name}=$branches->{$br}->{'branchname'}; - $branch1{value}=$br; - push(@branchloop,\%branch1); - } - -my ( $count, $data ) = unfilledreserves($branch); +my ( $count, $data ) = unfilledreserves(); my @dataloop; my $toggle; @@ -80,71 +52,21 @@ for ( my $i = 0 ; $i < $count ; $i++ ) { $line{'borrowernumber'} = $data->[$i]->{'borrowernumber'}; $line{'surname'} = $data->[$i]->{'surname'}; $line{'firstname'} = $data->[$i]->{'firstname'}; - $line{'sortdate'} = $data->[$i]->{'reservedate'}; - $line{'reservedate'} = format_date($data->[$i]->{'reservedate'}); + $line{'reservedate'} = format_date($data->[$i]->{'reservedate'}); $line{'biblionumber'} = $data->[$i]->{'biblionumber'}; $line{'title'} = $data->[$i]->{'title'}; $line{'classification'} = $data->[$i]->{'classification'}; $line{'dewey'} = $data->[$i]->{'dewey'}; - $line{'status'} = $data->[$i]->{'found'}; - $line{'branchcode'} = $data->[$i]->{'branchcode'}; + $line{'status'} = $data->[$i]->{'found'}; $line{'toggle'} = $toggle; - if ( $line{'status'} ne 'W' ) { - - # its not waiting, we need to find if its on issue, or on the shelf - # FIXME still need to shift the text to the template so its translateable - if ( $data->[$i]) { - # find if its on issue - my @items = &ItemInfo( undef, $line{'biblionumber'}, 'intra' ); - my $onissue = 0; - foreach my $item (@items) { - if ( $item->{'datedue'} eq 'Reserved' ) { - $onissue = 0; - if ($item->{'branchname'} eq ''){ - $line{'status'}='In Transit'; - } - else { - $line{'status'} = "On shelf at $item->{'branchname'}"; - } - - } - - else { - $onissue = 1; - } - } - if ($onissue) { - $line{'status'} = 'On Issue'; - } - } - else { - $line{'status'}="Waiting for pickup"; - - } - } + push( @dataloop, \%line ); } -if ($sort eq 'name'){ - @dataloop = sort {$a->{'surname'} cmp $b->{'surname'}} @dataloop; -} -elsif ($sort eq 'date'){ - @dataloop = sort {$a->{'sortdate'} cmp $b->{'sortdate'}} @dataloop; -} -elsif ($sort eq 'title'){ - @dataloop = sort {$a->{'title'} cmp $b->{'title'}} @dataloop; -} -else { - @dataloop = sort {$a->{'status'} cmp $b->{'status'}} @dataloop; -} - $template->param( count => $count, - dataloop => \@dataloop, - branchcode => $branch, - branchloop => \@branchloop - + dataloop => \@dataloop ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/reports/stats.pl b/reports/stats.pl index a11be08023..d3e47f8612 100755 --- a/reports/stats.pl +++ b/reports/stats.pl @@ -26,7 +26,6 @@ use strict; use CGI; use C4::Output; -use HTML::Template; use C4::Auth; use C4::Interface::CGI::Output; use C4::Context; @@ -35,7 +34,8 @@ use C4::Stats; my $input=new CGI; my $time=$input->param('time'); - +my $date=$input->param('from'); +my $date2=$input->param('to'); my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "stats.tmpl", query => $input, @@ -45,33 +45,8 @@ my ($template, $loggedinuser, $cookie) debug => 1, }); -my $date; -my $date2; -if ($time eq 'yesterday'){ - $date=ParseDate('yesterday'); - $date2=ParseDate('today'); -} -if ($time eq 'today'){ - $date=ParseDate('today'); - $date2=ParseDate('tomorrow'); -} -if ($time eq 'daybefore'){ - $date=ParseDate('2 days ago'); - $date2=ParseDate('yesterday'); -} -if ($time eq 'month') { - $date = ParseDate('1 month ago'); - $date2 = ParseDate('today'); - warn "d : $date // d2 : $date2"; -} -if ($time=~ /\//){ - $date=ParseDate($time); - $date2=ParseDateDelta('+ 1 day'); - $date2=DateCalc($date,$date2); -} -$date=UnixDate($date,'%Y-%m-%d'); -$date2=UnixDate($date2,'%Y-%m-%d'); - warn "d : $date // d2 : $date2"; + + my @payments=TotalPaid($date,$date2); my $count=@payments; my $total=0; @@ -81,20 +56,22 @@ my @loop; my %row; my $i=0; while ($i<$count){ - warn " pay : ".$payments[$i]{'timestamp'}; +# warn " pay : ".$payments[$i]{'timestamp'}; my $time=$payments[$i]{'datetime'}; my $payments=$payments[$i]{'value'}; my $charge=0; my @temp=split(/ /,$payments[$i]{'datetime'}); - my $date=$temp[0]; - my @charges=getcharges($payments[$i]{'borrowernumber'},$payments[$i]{'timestamp'}); - my $count=@charges; + my $date=$payments[$i]{'date'}; + + my @charges=getcharges($payments[$i]{'borrowernumber'},$payments[$i]{'date'}); + my $count2=@charges; +warn "$count2"; my $temptotalf=0; my $temptotalr=0; my $temptotalres=0; my $temptotalren=0; my $temptotalw=0; - for (my $i2=0;$i2<$count;$i2++){ + for (my $i2=0;$i2<$count2;$i2++){ $charge+=$charges[$i2]->{'amount'}; %row = ( name => $charges[$i2]->{'description'}, type => $charges[$i2]->{'accounttype'}, @@ -149,6 +126,7 @@ while ($i<$count){ $bornum=$payments[$i]{'borrowernumber'}; $i++; } + } $template->param( loop1 => \@loop, diff --git a/reports/stats.print.pl b/reports/stats.print.pl index 1f1947d409..2a6df6aa6b 100755 --- a/reports/stats.print.pl +++ b/reports/stats.print.pl @@ -23,7 +23,6 @@ my $csv = Text::CSV_XS->new( my $input=new CGI; my $time=$input->param('time'); -my $time2=$input->param('time2'); my @loop1; my @loop2; @@ -57,10 +56,6 @@ if ($time eq ''){ $date2=ParseDate('tomorrow'); } -if ($time2 ne ''){ - $date=ParseDate($time); - $date2=ParseDate($time2); -} my $date=UnixDate($date,'%Y-%m-%d'); my $date2=UnixDate($date2,'%Y-%m-%d'); @@ -99,8 +94,7 @@ while ($i<$count ){ my $sec=substr($payments[$i]{'timestamp'},12,2); my $time="$hour:$min:$sec"; my $time2="$payments[$i]{'date'}"; -# my $branch=Getpaidbranch($time2,$payments[$i]{'borrowernumber'}); - my $branch=$payments[$i]{'branch'}; + my $branch=Getpaidbranch($time2,$payments[$i]{'borrowernumber'}); my @rows1 = ($branch, # lets build up a row $payments[$i]->{'datetime'}, @@ -108,19 +102,17 @@ while ($i<$count ){ $payments[$i]->{'firstname'}, $charges[$i2]->{'description'}, $charges[$i2]->{'accounttype'}, - # rounding amounts to 2dp and adding dollar sign to make excel read it as currency format - "\$".sprintf("%.2f", $charges[$i2]->{'amount'}), + sprintf("%.2f", $charges[$i2]->{'amount'}), # rounding amounts to 2dp $payments[$i]->{'type'}, - "\$".$payments[$i]->{'value'}); + $payments[$i]->{'value'}); push (@loop1, \@rows1); - $totalpaid = $totalpaid + $payments[$i]->{'value'}; } } else { ++$totalwritten; } - $i++; #increment the while loop + $totalpaid = $totalpaid + $payments[$i]->{'value'}; } #get credits and append to the bottom of payments @@ -137,11 +129,11 @@ while ($i<$count ){ $credits[$i]->{'firstname'}, $credits[$i]->{'description'}, $credits[$i]->{'accounttype'}, - "\$".$credits[$i]->{'amount'}); + $credits[$i]->{'amount'}); push (@loop2, \@rows2); - $totalcredits = $totalcredits + $credits[$i]->{'amount'}; $i++; + $totalcredits = $totalcredits + $credits[$i]->{'amount'}; } #takes off first char minus sign "-100.00" @@ -149,9 +141,9 @@ $totalcredits = substr($totalcredits, 1); print $input->header( -type => 'application/vnd.ms-excel', - -attachment => "stats.csv", + -attachment => "moo.csv", ); -print "Branch, Datetime, Surname, Firstnames, Description, Type, Invoice amount, Payment type, Payment Amount\n"; +print "Branch, Datetime, Surame, Firstnames, Description, Type, Invoice amount, Payment type, Payment Amount\n"; for my $row ( @loop1 ) { @@ -175,4 +167,3 @@ print ",,,,,,,\n"; print ",,Total Amount Paid, $totalpaid\n"; print ",,Total Number Written, $totalwritten\n"; print ",,Total Amount Credits, $totalcredits\n"; - diff --git a/reports/stats.screen.pl b/reports/stats.screen.pl index 0cfabcde9c..dfa6e71fbc 100755 --- a/reports/stats.screen.pl +++ b/reports/stats.screen.pl @@ -8,86 +8,41 @@ use C4::Auth; use C4::Interface::CGI::Output; use C4::Context; use Date::Manip; +use C4::Date; use C4::Stats; -use Data::Dumper; - &Date_Init("DateFormat=non-US"); # set non-USA date, eg:19/08/2005 my $input=new CGI; my $time=$input->param('time'); -my $time2=$input->param('time2'); - - -if($input->param('submit') eq "To Excel" || $input->param('submit_x') eq "To Excel"){ - print $input->redirect("/cgi-bin/koha/stats.print.pl?time=$time&time2=$time2"); -} - +my $date=$input->param('from'); +my $date2=$input->param('to'); my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "stats_screen.tmpl", + = get_template_and_user({template_name => "reports/stats.screen.tmpl", query => $input, type => "intranet", - authnotrequired => 1, + authnotrequired => 0, flagsrequired => {borrowers => 1}, debug => 1, }); -my $date; -my $date2; -if ($time eq 'yesterday'){ - $date=ParseDate('yesterday'); - $date2=ParseDate('today'); -} -if ($time eq 'today'){ - $date=ParseDate('today'); - $date2=ParseDate('tomorrow'); -} -if ($time eq 'daybefore'){ - $date=ParseDate('2 days ago'); - $date2=ParseDate('yesterday'); -} -if ($time eq 'month') { - $date = ParseDate('1 month ago'); - $date2 = ParseDate('today'); - -} -if ($time=~ /\//){ - $date=ParseDate($time); - $date2=ParseDateDelta('+ 1 day'); - $date2=DateCalc($date,$date2); -} -# if time is blank -if ($time eq ''){ - $date=ParseDate('today'); - $date2=ParseDate('tomorrow'); -} - -# if script is called with a start and finsh date range... -if ($time ne '' && $time2 ne ''){ - $date=ParseDate($time); - $date2=ParseDate($time2); -} - - -my $date=UnixDate($date,'%Y-%m-%d'); -my $date2=UnixDate($date2,'%Y-%m-%d'); -# warn "MASON: TIME: $time, $time2"; -# warn "MASON: DATE: $date, $date2"; - -# get a list of every payment -my @payments=TotalPaid($date,$date2,0); +#get a list of every payment +my @payments=TotalPaid($date,$date2); my $count=@payments; -# print "MASON: number of payments=$count\n"; +# warn "number of payments=$count\n"; my $i=0; my $totalcharges=0; my $totalcredits=0; my $totalpaid=0; my $totalwritten=0; +my $totalwrittenamount=0; +my $totalinvoicesamount=0; +my $totalinvoices=0; my @loop1; my @loop2; - +my @loop3; # lets get a a list of all individual item charges paid for by that payment while ($i<$count ){ @@ -95,47 +50,38 @@ while ($i<$count ){ my $count; my @charges; - - if ($payments[$i]{'type'} ne 'writeoff'){ - -# warn Dumper $payments[$i]; - - @charges=getcharges($payments[$i]{'borrowernumber'}, $payments[$i]{'timestamp'}, $payments[$i]{'proccode'}); + if ($payments[$i]->{'accounttype'} ne 'W'){ # lets ignore writeoff payments!. + @charges=getcharges($payments[$i]{'borrowernumber'}, $payments[$i]{'offset'}, $payments[$i]{'accountno'}); $totalcharges++; $count=@charges; # getting each of the charges and putting them into a array to be printed out #this loops per charge per person for (my $i2=0;$i2<$count;$i2++){ - my $hour=substr($payments[$i]{'timestamp'},8,2); - my $min=substr($payments[$i]{'timestamp'},10,2); - my $sec=substr($payments[$i]{'timestamp'},12,2); - my $time="$hour:$min:$sec"; + my $time2="$payments[$i]{'date'}"; # my $branch=Getpaidbranch($time2,$payments[$i]{'borrowernumber'}); - my $branch=$payments[$i]{'branch'}; -# if ($payments[$i]{'borrowernumber'} == 18265){ -# warn "$payments[$i]{'branch'} $branch $payments[$i]{'borrowernumber'}";# -# } + # lets build up a row - my %rows1 = (branch => $branch, - datetime => $payments[$i]->{'datetime'}, + my %rows1 = ( datetime => $payments[$i]->{'timestamp'}, surname => $payments[$i]->{'surname'}, firstname => $payments[$i]->{'firstname'}, - description => $charges[$i2]->{'description'}, + description => $payments[$i]->{'description'}, accounttype => $charges[$i2]->{'accounttype'}, - amount => sprintf("%.2f", $charges[$i2]->{'amount'}), # rounding amounts to 2dp - type => $payments[$i]->{'type'}, - value => sprintf("%.2f", $payments[$i]->{'value'})); # rounding amounts to 2dp + amount => sprintf("%.2f", $charges[$i2]->{'amount'}), # rounding amounts to 2dp + type => $payments[$i]->{'accounttype'}, + value => sprintf("%.2f", $payments[$i]->{'amount'}*(-1))); # rounding amounts to 2dp push (@loop1, \%rows1); - $totalpaid = $totalpaid + $payments[$i]->{'value'}; + $totalpaid = sprintf("%.2f",$totalpaid + $payments[$i]->{'amount'}*(-1)); } } else { +$totalwrittenamount= sprintf("%.2f",$totalwrittenamount + $payments[$i]->{'amount'}*(-1)); ++$totalwritten; } - - $i++; #increment the while loop + + + $i++; #increment the while loop } #get credits and append to the bottom of payments @@ -146,59 +92,51 @@ my $i=0; while ($i<$count ){ - my %rows2 = (creditbranch => $credits[$i]->{'branchcode'}, - creditdate => $credits[$i]->{'date'}, + my %rows2 = (creditdate => format_date($credits[$i]->{'date'}), creditsurname => $credits[$i]->{'surname'}, creditfirstname => $credits[$i]->{'firstname'}, creditdescription => $credits[$i]->{'description'}, creditaccounttype => $credits[$i]->{'accounttype'}, - creditamount => sprintf("%.2f", $credits[$i]->{'amount'}) - ); + creditamount => sprintf("%.2f",$credits[$i]->{'amount'}*(-1))); push (@loop2, \%rows2); - $totalcredits = $totalcredits + $credits[$i]->{'amount'}; - $i++; #increment the while loop + + $totalcredits =sprintf("%.2f", $totalcredits + $credits[$i]->{'amount'}); + $i++; #increment the while loop + } + #takes off first char minus sign "-100.00" $totalcredits = substr($totalcredits, 1); -my $totalrefunds=0; -my @loop3; -my @refunds=getrefunds($date,$date2); -$count=@refunds; -$i=0; +my @invoices=getinvoices($date,$date2); +my $count=@invoices; +my $i=0; while ($i<$count ){ - my %rows2 = (refundbranch => $refunds[$i]->{'branchcode'}, - refunddate => $refunds[$i]->{'date'}, - refundsurname => $refunds[$i]->{'surname'}, - refundfirstname => $refunds[$i]->{'firstname'}, - refunddescription => $refunds[$i]->{'description'}, - refundaccounttype => $refunds[$i]->{'accounttype'}, - refundamount => sprintf("%.2f", $refunds[$i]->{'amount'}) - ); - - push (@loop3, \%rows2); - $totalrefunds = $totalrefunds + $refunds[$i]->{'amount'}; - $i++; #increment the while loop -} - -my $totalcash=$totalpaid-$totalrefunds; + my %rows3 = (invoicesdate => format_date($invoices[$i]->{'date'}), + invoicessurname => $invoices[$i]->{'surname'}, + invoicesfirstname => $invoices[$i]->{'firstname'}, + invoicesdescription => $invoices[$i]->{'description'}, + invoicesaccounttype => $invoices[$i]->{'accounttype'}, + invoicesamount => sprintf("%.2f",$invoices[$i]->{'amount'}), + invoicesamountremaining=>sprintf("%.2f",$invoices[$i]->{'amountoutstanding'})); + push (@loop3, \%rows3); + $totalinvoicesamount =sprintf("%.2f", $totalinvoicesamount + $invoices[$i]->{'amountoutstanding'}); + $totalinvoices =sprintf("%.2f", $totalinvoices + $invoices[$i]->{'amount'}); + $i++; #increment the while loop - -$template->param( date => $time, - date2 => $time2, - loop1 => \@loop1, +} +$template->param( loop1 => \@loop1, loop2 => \@loop2, - loop3 => \@loop3, + loop3 => \@loop3, totalpaid => $totalpaid, totalcredits => $totalcredits, - totalwritten => $totalwritten, - totalrefund => $totalrefunds, - totalcash => $totalcash); + totalcreditsamount => sprintf("%.2f",$totalcredits-$totalwrittenamount), + totalwrittenamount => $totalwrittenamount, + totalwritten => $totalwritten , + totalinvoices=>$totalinvoices, totalinvoicesamount=>$totalinvoicesamount ); output_html_with_http_headers $input, $cookie, $template->output; - - diff --git a/reports/transfers.plugin b/reports/transfers.plugin new file mode 100644 index 0000000000..246e1a27d6 --- /dev/null +++ b/reports/transfers.plugin @@ -0,0 +1,105 @@ +#!/usr/bin/perl + +# $Id$ + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +use strict; +use C4::Auth; +use CGI; +use C4::Context; +use C4::Search; +use C4::Output; +use C4::Koha; + +=head1 + +=cut + +sub set_parameters { + my ($template) = @_; + my $dbh = C4::Context->dbh; + my $branches=GetBranches(); + my @branches; + my @select_branch; + my %select_branches; + push @select_branch,""; + $select_branches{""} = ""; + foreach my $branch (keys %$branches) { + push @select_branch, $branch; + $select_branches{$branch} = $branches->{$branch}->{'branchname'}; + } + my $CGIbranch=CGI::scrolling_list( -name => 'value', + -id => 'value', + -values => \@select_branch, + -labels => \%select_branches, + -size => 1, + -multiple => 0 ); + $template->param(CGIbranch => $CGIbranch); + return $template; +} +sub calculate { + my ($parameters) = @_; + my @results =(); + my $branch = @$parameters[0]; + my $dbh = C4::Context->dbh; + my $sth; + if ($branch) { + $sth = $dbh->prepare("SELECT i.itemnumber,i.barcode,i.biblionumber,ms.tobranch,ms.frombranch,ms.datearrived,ms.comments FROM `items` i + left join branchtransfers as ms on i.itemnumber=ms.itemnumber + where ms.frombranch=? order by ms.datearrived desc"); + $sth->execute($branch); + } else { + $sth = $dbh->prepare("SELECT i.itemnumber,i.barcode,i.biblionumber,ms.tobranch,ms.frombranch,ms.datearrived,ms.comments FROM `items` i, branchtransfers as ms + where i.itemnumber=ms.itemnumber and ms.itemnumber is not null order by ms.datearrived desc"); + $sth->execute; + } + + my ($itemnumber,$barcode,$biblionumber,$currentbranch,$origbranch,$date,$by); + my $nbresult=$dbh->prepare("SELECT FOUND_ROWS()"); + $nbresult->execute; + my $grantotal = $nbresult->fetchrow; + my $count = 0; + while (($itemnumber,$barcode,$biblionumber,$currentbranch,$origbranch,$date,$by) = $sth->fetchrow) { + my %line; + if($count % 2){ + $line{toggle} = 1; + } else { + $line{toggle} = 0; + } + $line{itemnumber} = $itemnumber; + $line{barcode} = $barcode; + $line{biblionumber} = $biblionumber; + + $line{currentb} = $currentbranch; + $line{origb} = $origbranch; + $line{date} = $date; + $line{by} = $by; + push @results,\%line; + $count ++; + } + my @mainloop; + my %globalline; + $globalline{loopitemtype} = \@results; + $globalline{total} = $grantotal; + $globalline{branch} = $branch; + push @mainloop,\%globalline; + return \@mainloop; +} + +1; \ No newline at end of file diff --git a/reserve/modrequest.pl b/reserve/modrequest.pl index a319214ca1..0d74f7edca 100755 --- a/reserve/modrequest.pl +++ b/reserve/modrequest.pl @@ -28,7 +28,7 @@ use C4::Search; use CGI; use C4::Output; use C4::Reserves2; - +use C4::Members; my $input = new CGI; #print $input->header; @@ -39,16 +39,16 @@ my @biblionumber=$input->param('biblionumber'); my @borrower=$input->param('borrowernumber'); my @branch=$input->param('pickup'); my $count=@rank; - +my $cataloger=$input->param('loggedinuser'); # goes through and manually changes the reserves record.... # no attempt is made to check consistency. for (my $i=0;$i<$count;$i++){ - UpdateReserve($rank[$i],$biblionumber[$i],$borrower[$i],$branch[$i]); #from C4::Reserves2 + UpdateReserves($rank[$i],$biblionumber[$i],$borrower[$i],$branch[$i],$cataloger); #from C4::Reserves2 } my $from=$input->param('from'); if ($from eq 'borrower'){ print $input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$borrower[0]"); } else { - print $input->redirect("/cgi-bin/koha/reserve/request.pl?bib=$biblionumber[0]"); + print $input->redirect("/cgi-bin/koha/reserve/request.pl?biblionumber=$biblionumber[0]"); } diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl index e7716ad8c5..eaafca19f8 100755 --- a/reserve/placerequest.pl +++ b/reserve/placerequest.pl @@ -24,19 +24,16 @@ use strict; #use DBI; use C4::Search; -use C4::Biblio; use CGI; use C4::Output; use C4::Reserves2; -use C4::Circulation::Circ2; use C4::Members; - my $input = new CGI; #print $input->header; - +my $itemnumber=$input->param('itemnumber'); my @bibitems=$input->param('biblioitem'); my @reqbib=$input->param('reqbib'); -my $biblio=$input->param('biblio'); +my $biblionumber=$input->param('biblionumber'); my $borrower=$input->param('member'); my $notes=$input->param('notes'); my $branch=$input->param('pickup'); @@ -44,53 +41,37 @@ my @rank=$input->param('rank-request'); my $type=$input->param('type'); my $title=$input->param('title'); my $bornum=borrdata($borrower,''); -my $checkitem=$input->param('checkitem'); -# my $priority; -my $found; +my $cataloger=$input->param('loggedinuser'); -#new op : if we have an item selectionned, and the pickup branch is the same as the holdingbranch of the document, we force the value $rank and $found . -if ($checkitem ne ''){ - $rank[0] = '0'; - my %env; - my $item = $checkitem; - $item = getiteminformation(\%env,$item); - if ( $item->{'holdingbranch'} eq $branch ){ - $found = 'W'; - } +if ($type eq 'str8' && $bornum ne ''){ + my $count=@bibitems; + @bibitems=sort @bibitems; + my $i2=1; + my @realbi; + $realbi[0]=$bibitems[0]; +for (my $i=1;$i<$count;$i++){ + my $i3=$i2-1; + if ($realbi[$i3] ne $bibitems[$i]){ + $realbi[$i2]=$bibitems[$i]; + $i2++; + } +} +my $env; -} +my $const; -# END of new op . -if ($type eq 'str8' && $bornum ne ''){ - my $count=@bibitems; - @bibitems=sort @bibitems; - my $i2=1; - my @realbi; - $realbi[0]=$bibitems[0]; - for (my $i=1;$i<$count;$i++) { - my $i3=$i2-1; - if ($realbi[$i3] ne $bibitems[$i]) { - $realbi[$i2]=$bibitems[$i]; - $i2++; - } - } - my $env; - my $const; - if ($input->param('request') eq 'any'){ - $const='a'; - CreateReserve(\$env,$branch,$bornum->{'borrowernumber'},$biblio,$const,\@realbi,$rank[0],$notes,$title,$checkitem,$found); - } elsif ($reqbib[0] ne ''){ - $const='o'; - CreateReserve(\$env,$branch,$bornum->{'borrowernumber'},$biblio,$const,\@reqbib,$rank[0],$notes,$title,$checkitem, $found); - } else { - CreateReserve(\$env,$branch,$bornum->{'borrowernumber'},$biblio,'a',\@realbi,$rank[0],$notes,$title,$checkitem, $found); - } - -print $input->redirect("request.pl?bib=$biblio"); +for (my $i=0; $i<@reqbib; $i++){ +if ($reqbib[$i] ne ''){ + $const='o'; + CreateReserve(\$env,$bornum->{'borrowernumber'},$cataloger,$biblionumber,'','',$branch,$const,$rank[0],$notes,$title,"",$reqbib[$i]); +} +} + +print $input->redirect("request.pl?biblionumber=$biblionumber"); } elsif ($bornum eq ''){ - print $input->header(); - print "Invalid card number please try again"; - print $input->Dump; + print $input->header(); + print "Invalid card number please try again"; + print $input->Dump; } diff --git a/reserve/renewscript.pl b/reserve/renewscript.pl deleted file mode 100755 index f22215c563..0000000000 --- a/reserve/renewscript.pl +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/perl - -# $Id$ - -#written 18/1/2000 by chris@katipo.co.nz -#script to renew items from the web - - -# Copyright 2000-2002 Katipo Communications -# -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA - -use CGI; -use C4::Circulation::Circ2; - -my $input = new CGI; - -# -# find items to renew, all items or a selection of items -# - -my @data; -if ($input->param('renew_all')) { - @data = $input->param('all_items[]'); -} -else { - @data = $input->param('items[]'); -} - -# -# renew items -# -my %env; -my $cardnumber = $input->param("cardnumber"); -my $bornum = $input->param("bornum"); - -foreach my $itemno (@data) { - #check status before renewing issue - if (renewstatus(\%env,$bornum,$itemno)){ - renewbook(\%env,$bornum,$itemno); - } -} - -# -# redirection to the referrer page -# -if ($input->param('destination') eq "circ"){ - print $input->redirect( - '/cgi-bin/koha/circ/circulation.pl?findborrower='.$cardnumber - ); -} -else { - print $input->redirect( - '/cgi-bin/koha/members/moremember.pl?bornum='.$bornum - ); -} diff --git a/reserve/request.pl b/reserve/request.pl index 899c1e627e..03d59a0161 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -24,13 +24,6 @@ # Suite 330, Boston, MA 02111-1307 USA use strict; -use HTML::Template; -use CGI; -use Date::Manip; -use List::MoreUtils qw/uniq/; -use Data::Dumper; -use Date::Calc qw/Today/; - use C4::Search; use C4::Output; use C4::Interface::CGI::Output; @@ -39,383 +32,174 @@ use C4::Reserves2; use C4::Biblio; use C4::Koha; use C4::Circulation::Circ2; -# FIXME Is there utility to use Acquisition.pm ???? -# use C4::Acquisition; +use C4::Acquisition; +use CGI; use C4::Date; -use C4::Members; -my $dbh = C4::Context->dbh; -my $sth; my $input = new CGI; -my ($template, $borrowernumber, $cookie) - = get_template_and_user({ - template_name => "reserve/request.tmpl", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => {reserveforothers => 1}, - }); - +my $dbh=C4::Context->dbh; # get biblio information.... -my $bib = $input->param('bib'); -my $dat = bibdata($bib); - -# Select borrowers infos -my $findborrower = $input->param('findborrower'); -$findborrower =~ s|,| |g; -my $cardnumber = $input->param('cardnumber'); -my %env; -my $borrowerslist; -my $messageborrower; - -# my $date = today(); -my $date= sprintf('%04d-%02d-%02d', Today()); - -if ($findborrower) { - my ($count,$borrowers) = BornameSearch(\%env, $findborrower, 'cardnumber', 'web'); - - my @borrowers = @$borrowers; - - if ($#borrowers == -1) { - $input->param('findborrower', ''); - $messageborrower = "'$findborrower'"; - } - elsif ($#borrowers == 0) { - $input->param('cardnumber', $borrowers[0]->{'cardnumber'}); - $cardnumber = $borrowers[0]->{'cardnumber'}; - } - else { - $borrowerslist = \@borrowers; - } -} - -if ($cardnumber) { - my $borrowerinfo = getpatroninformation (\%env,0,$cardnumber); - my $expiry; - my $diffbranch; - my @getreservloop; - my $count_reserv = 0; - my $maxreserves; - -# we check the reserves of the borrower, and if he can reserv a document -# FIXME At this time we have a simple count of reservs, but, later, we could improve the infos "title" ... - - my $number_reserves = - GetNumberReservesFromBorrower($borrowerinfo->{'borrowernumber'}); - - if ($number_reserves > C4::Context->preference('maxreserves')) { - $maxreserves = 1; - } - -# we check the date expiricy of the borrower - my $warning=Date_Cmp(ParseDate("today"),format_date($borrowerinfo->{'dateexpiry'})); - if ( $warning > 0) { - $expiry = 1; - } - -# check if the borrower make the reserv in a different branch - if ($borrowerinfo->{'branchcode'} ne C4::Context->userenv->{'branch'}) { - $diffbranch = 1; - } - - $template->param( - borrowersurname => $borrowerinfo->{'surname'}, - borrowerfirstname => $borrowerinfo->{'firstname'}, - borrowerreservs => $count_reserv, - maxreserves => $maxreserves, - expiry => $expiry, - diffbranch => $diffbranch - ); -} - -$template->param( - messageborrower => $messageborrower -); - -my $CGIselectborrower; -if ($borrowerslist) { - my @values; - my %labels; - - foreach my $borrower ( - sort {$a->{surname}.$a->{firstname} cmp $b->{surname}.$b->{firstname}} - @{$borrowerslist} - ) { - push @values, $borrower->{cardnumber}; - - $labels{ $borrower->{cardnumber} } = sprintf( - '%s, %s ... (%s - %s) ... %s', - $borrower->{surname}, - $borrower->{firstname}, - $borrower->{cardnumber}, - $borrower->{categorycode}, - $borrower->{streetaddress}, - ); - } - - $CGIselectborrower = CGI::scrolling_list( - -name => 'cardnumber', - -values => \@values, - -labels => \%labels, - -size => 7, - -multiple => 0, - ); -} - +my $biblionumber = $input->param('biblionumber'); +my ($record) = XMLgetbiblio($dbh,$biblionumber); +$record=XML_xml2hash_onerecord($record); +my $dat=XMLmarc2koha_onerecord($dbh,$record,"biblios"); # get existing reserves ..... -my ($count, $reserves) = FindReserves($bib, undef); +my ($count,$reserves) = FindReserves($biblionumber); my $totalcount = $count; -my $alreadyreserved; - -# FIXME launch another time getpatroninformation perhaps until -my $borrowerinfo = getpatroninformation (\%env,0,$cardnumber); - foreach my $res (@$reserves) { - if (($res->{found} eq 'W') or ($res->{priority} == 0)) { + if ($res->{'found'} eq 'W') { $count--; } - - if ($borrowerinfo->{borrowernumber} eq $res->{borrowernumber}) { - $alreadyreserved = 1; - } } -$template->param(alreadyreserved => $alreadyreserved); # make priorities options -my @optionloop; -for (1 .. $count + 1) { - push( - @optionloop, - { - num => $_, - selected => ($_ == $count + 1), - } - ); -} - -my @branchcodes; -my %itemnumbers_of_biblioitem; -my @itemnumbers = @{get_itemnumbers_of($bib)->{$bib}}; -my $iteminfos_of = get_iteminfos_of(@itemnumbers); - -foreach my $itemnumber (@itemnumbers) { - push( - @branchcodes, - $iteminfos_of->{$itemnumber}->{homebranch}, - $iteminfos_of->{$itemnumber}->{holdingbranch} - ); - - my $biblioitemnumber = $iteminfos_of->{$itemnumber}->{biblioitemnumber}; - push( - @{ $itemnumbers_of_biblioitem{$biblioitemnumber} }, - $itemnumber - ); -} - -@branchcodes = uniq @branchcodes; - -my @biblioitemnumbers = keys %itemnumbers_of_biblioitem; - -my $branchinfos_of = get_branchinfos_of(@branchcodes); -my $notforloan_label_of = get_notforloan_label_of(); -my $biblioiteminfos_of = get_biblioiteminfos_of(@biblioitemnumbers); +my $num = $count + 1; -my @itemtypes; -foreach my $biblioitemnumber (@biblioitemnumbers) { - push @itemtypes, $biblioiteminfos_of->{$biblioitemnumber}{itemtype}; +#priorityoptions building +my @optionloop; +for (my $i=1; $i<=$num; $i++){ + my %option; + $option{num}=$i; + $option{selected}=($i==$num); + push(@optionloop, \%option); } -my $itemtypeinfos_of = get_itemtypeinfos_of(@itemtypes); - -my $return_date_of = get_current_return_date_of(@itemnumbers); +# todays date +my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =localtime(time); +$year=$year+1900; +$mon++; +my $date=format_date("$year-$mon-$mday"); my @bibitemloop; -foreach my $biblioitemnumber (@biblioitemnumbers) { - my $biblioitem = $biblioiteminfos_of->{$biblioitemnumber}; - - $biblioitem->{description} = - $itemtypeinfos_of->{ $biblioitem->{itemtype} }{description}; - - foreach my $itemnumber (@{$itemnumbers_of_biblioitem{$biblioitemnumber}}) { - my $item = $iteminfos_of->{$itemnumber}; - - $item->{homebranchname} = - $branchinfos_of->{ $item->{homebranch} }{branchname}; - - # if the holdingbranch is different than the homebranch, we show the - # holdingbranch of the document too - if ($item->{homebranch} ne $item->{holdingbranch}) { - $item->{holdingbranchname} = - $branchinfos_of->{ $item->{holdingbranch} }{branchname}; - } - - # if the item is currently on loan, we display its return date and - # change the background color - my $date_due; - - if (defined $return_date_of->{$itemnumber}) { - $date_due = format_date($return_date_of->{$itemnumber}); - $item->{date_due} = $date_due; - $item->{backgroundcolor} = 'onloan'; - } - - # checking reserve - my $reservedate = GetFirstReserveDateFromItem($itemnumber); - - if (defined $reservedate) { - $item->{backgroundcolor} = 'reserved'; - $item->{reservedate} = format_date($reservedate); - } - - # Management of the notforloan document - if ($item->{notforloan}) { - $item->{backgroundcolor} = 'other'; - $item->{notforloanvalue} = - $notforloan_label_of->{ $item->{notforloan} }; - } - - # Management of lost or long overdue items - if ($item->{itemlost}) { + my %abibitem; + my @barcodeloop; + my @barcodes = barcodes($biblionumber); +#warn @barcodes; + foreach my $num (@barcodes) { + my %barcode; + $barcode{'date_due'}=$num->{'date_due'} if $num->{'date_due'} gt "0000-00-00" ; + $barcode{'barcode'}=$num->{'barcode'}; + $barcode{'itemnumber'}=$num->{'itemnumber'}; + $barcode{'message'}=$num->{'itemlost'} == 1 ? "(lost)" : + $num->{'itemlost'} == 2 ? "(long overdue)" : ""; + $barcode{'class'}=$num->{'itemcallnumber'}; + $abibitem{'itemlost'}=(($num->{'notforloan'})|| ($num->{'itemlost'} == 1)) ; + $abibitem{'itemlost'}=($num->{'wthdrawn'}) ; + push(@barcodeloop, \%barcode); + } +# + $abibitem{'class'}="$dat->{'classification'}$dat->{'dewey'}$dat->{'subclass'}"; + $abibitem{'biblionumber'}=$dat->{'biblionumber'}; + $abibitem{'description'}=$dat->{'itemtype'}; + $abibitem{'volumeddesc'}=$dat->{'volumeddesc'}; + $abibitem{'publicationyear'}=$dat->{'publicationyear'}; - # FIXME localized strings should never be in Perl code - $item->{message} = $item->{itemlost} == 1 - ? "(lost)" - : $item->{itemlost} == 2 - ? "(long overdue)" - : ""; - $item->{backgroundcolor} = 'other'; - } + $abibitem{'barcodeloop'}=\@barcodeloop; + push(@bibitemloop,\%abibitem); - # Check of the transfered documents - my ($transfertwhen,$transfertfrom,$transfertto) = - get_transfert_infos($itemnumber); - if ($transfertwhen ne '') { - $item->{transfertwhen} = format_date($transfertwhen); - $item->{transfertfrom} = - $branchinfos_of->{$transfertfrom}{branchname}; - $item->{transfertto} = - $branchinfos_of->{$transfertto}{branchname}; - } - # If there is no loan, return and transfer, we show a checkbox. - $item->{notforloan} = $item->{notforloan} || 0; - # An item is available only if: - if (not defined $reservedate # not reserved yet - and $date_due eq '' # not currently on loan - and not $item->{itemlost} # not lost - and not $item->{notforloan} # not forbidden to loan - and $transfertwhen eq '' # not currently on transfert - ) { - $item->{available} = 1; - } +#existingreserves building +my @reserveloop; +my $branches = GetBranches(); + +foreach my $res (sort {$a->{'found'} cmp $b->{'found'}} @$reserves){ + my %reserve; +if ($res->{'priority'}>$totalcount){$totalcount=$res->{'priority'};} +# my $prioropt = priorityoptions($totalcount, $res->{'priority'}); + my @optionloop; + for (my $i=1; $i<=$totalcount; $i++){ + my %option; + $option{num}=$i; + $option{selected}=($i==$res->{'priority'}); + push(@optionloop, \%option); + } + my @branchloop; - push @{$biblioitem->{itemloop}}, $item; - } + foreach my $br (keys %$branches) { - push @bibitemloop, $biblioitem; -} -# existingreserves building -my @reserveloop; -my $branches = GetBranches('RE'); -foreach my $res (sort {$a->{found} cmp $b->{found}} @$reserves){ - my %reserve; - my @optionloop; - for (my $i=1; $i <= $totalcount; $i++) { - push( - @optionloop, - { - num => $i, - selected => ($i == $res->{priority}), - } - ); - } - my @branchloop; - foreach my $br (keys %$branches) { - my %abranch; - $abranch{'selected'}=($br eq $res->{'branchcode'}); - $abranch{'branch'}=$br; - $abranch{'branchname'}=$branches->{$br}->{'branchname'}; - push(@branchloop,\%abranch); - } + (next) unless $branches->{$br}->{'IS'}; - if (($res->{'found'} eq 'W') or ($res->{'priority'} eq '0')) { - my %env; - my $item = $res->{'itemnumber'}; - $item = getiteminformation(\%env,$item); - $reserve{'holdingbranch'}=$item->{'holdingbranch'}; - $reserve{'barcode'}=$item->{'barcode'}; - $reserve{'biblionumber'}=$item->{'biblionumber'}; - $reserve{'wbrcode'} = $res->{'branchcode'}; - $reserve{'wbrname'} = $branches->{$res->{'branchcode'}}->{'branchname'}; - if($reserve{'holdingbranch'} eq $reserve{'wbrcode'}){ - $reserve{'atdestination'} = 1; - } + # Only branches with the 'IS' branchrelation + # can issue books + my %abranch; + $abranch{'selected'}=($br eq $res->{'branchcode'}); + $abranch{'branch'}=$br; + $abranch{'branchname'}=$branches->{$br}->{'branchname'}; + push(@branchloop,\%abranch); + } +my %env; +# my $item = $res->{'itemnumber'}; +# $item = getiteminformation(\%env,$item); + + if ($res->{'found'} eq 'W') { + + $reserve{'holdingbranch'}=$res->{'holdingbranch'}; + $reserve{'barcode'}=$res->{'barcode'}; + $reserve{'biblionumber'}=$res->{'biblionumber'}; + $reserve{'wbrcode'} = $res->{'branchcode'}; + $reserve{'wbrname'} = $branches->{$res->{'branchcode'}}->{'branchname'}; + if($reserve{'holdingbranch'} eq $reserve{'wbrcode'}){ + $reserve{'atdestination'} = 1; + } } - - $reserve{'date'} = format_date($res->{'reservedate'}); - $reserve{'borrowernumber'}=$res->{'borrowernumber'}; - $reserve{'biblionumber'}=$res->{'biblionumber'}; - $reserve{'bornum'}=$res->{'borrowernumber'}; - $reserve{'firstname'}=$res->{'firstname'}; - $reserve{'surname'}=$res->{'surname'}; - $reserve{'bornum'}=$res->{'borrowernumber'}; - $reserve{'notes'}=$res->{'reservenotes'}; - $reserve{'wait'}=(($res->{'found'} eq 'W') or ($res->{'priority'} eq '0')); - $reserve{'constrainttypea'}=($res->{'constrainttype'} eq 'a'); - $reserve{'constrainttypeo'}=($res->{'constrainttype'} eq 'o'); - $reserve{'voldesc'}=$res->{'volumeddesc'}; - $reserve{'itemtype'}=$res->{'itemtype'}; - $reserve{'branchloop'}=\@branchloop; - $reserve{'optionloop'}=\@optionloop; - - push(@reserveloop,\%reserve); + $reserve{'barcode'}=$res->{'barcode'}; + $reserve{'date'} = format_date($res->{'reservedate'}); + $reserve{'borrowernumber'}=$res->{'borrowernumber'}; + $reserve{'biblionumber'}=$res->{'biblionumber'}; + $reserve{'bornum'}=$res->{'borrowernumber'}; + $reserve{'firstname'}=$res->{'firstname'}; + $reserve{'surname'}=$res->{'surname'}; + $reserve{'bornum'}=$res->{'borrowernumber'}; + $reserve{'notes'}=$res->{'reservenotes'}; + $reserve{'wait'}=($res->{'found'} eq 'W'); + $reserve{'constrainttypea'}=($res->{'constrainttype'} eq 'a'); + $reserve{'constrainttypeo'}=($res->{'constrainttype'} eq 'o'); + $reserve{'voldesc'}=$res->{'volumeddesc'}; + $reserve{'itemtype'}=$res->{'itemtype'}; + $reserve{'branchloop'}=\@branchloop; + $reserve{'optionloop'}=\@optionloop; + push(@reserveloop,\%reserve); } -my $default = C4::Context->userenv->{branch}; -my @values; -my %label_of; +my @branches; +my @select_branch; +my %select_branches; +my $branches=GetBranches; +#my $count2=scalar(@branches); +foreach my $br (keys %$branches) { -foreach my $branchcode (keys %{$branches}) { - push @values, $branchcode; - $label_of{$branchcode} = $branches->{$branchcode}->{branchname}; + push @select_branch, $br; + $select_branches{$br}= $branches->{$br}->{'branchname'}; } -my $CGIbranch = CGI::scrolling_list( - -name => 'pickup', - -values => \@values, - -default => $default, - -labels => \%label_of, - -size => 1, - -multiple => 0, -); +my $CGIbranch=CGI::scrolling_list( -name => 'pickup', + -values => \@select_branch, + -labels => \%select_branches, + -size => 1, + -multiple => 0 ); -# get the time for the form name... +#get the time for the form name... my $time = time(); -$template->param( - CGIbranch => $CGIbranch, - reserveloop => \@reserveloop, - time => $time, -); - -# setup colors -$template->param( - optionloop =>\@optionloop, - bibitemloop => \@bibitemloop, - date => $date, - bib => $bib, - findborrower => $findborrower, - cardnumber => $cardnumber, - CGIselectborrower => $CGIselectborrower, - title =>$dat->{title}, -); - +#setup colours +my ($template, $borrowernumber, $cookie) + = get_template_and_user({template_name => "reserve/request.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {borrowers => 1}, + }); +$template->param( optionloop =>\@optionloop, + CGIbranch => $CGIbranch, + reserveloop => \@reserveloop, + 'time' => $time, + bibitemloop => \@bibitemloop, + date => $date, + biblionumber => $biblionumber, + title =>$dat->{title}); # printout the page -print $input->header( - -type => C4::Interface::CGI::Output::guesstype($template->output), - -expires=>'now' -), $template->output; +output_html_with_http_headers $input, $cookie, $template->output; \ No newline at end of file diff --git a/serials/serials-receive.pl b/serials/serials-receive.pl index 8c43faddc0..8a1c1b11b3 100755 --- a/serials/serials-receive.pl +++ b/serials/serials-receive.pl @@ -99,7 +99,6 @@ my $abouttoexpire = abouttoexpire($subscriptionid); my @itemnumbers=$query->param('itemnumber'); my $subscription=GetSubscription($subscriptionid); - $hassubscriptionexpired=1 ; my $auser = $subscription->{'librarian'}; # bob my $routing = check_routing($subscriptionid); # to see if routing list exists my $manualdate =''; diff --git a/tools/export.pl b/tools/export.pl index e4cf7cd1b7..0abad2fb50 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -1,109 +1,46 @@ #!/usr/bin/perl -use HTML::Template; use strict; -require Exporter; -use C4::Database; + use C4::Auth; use C4::Interface::CGI::Output; -use C4::Output; # contains gettemplate use C4::Biblio; use CGI; -use C4::Koha; - +use C4::Auth; +use MARC::Record; +use MARC::File::XML; my $query = new CGI; my $op=$query->param("op"); -my $dbh=C4::Context->dbh; - if ($op eq "export") { print $query->header('Content-Type: text/marc'); my $start_bib = $query->param("start_bib"); my $end_bib = $query->param("end_bib"); - my $format = $query->param("format"); - my $branch = $query->param("branch"); - my $start_callnumber = $query->param("start_callnumber"); - my $end_callnumber = $query->param("end_callnumber"); - my $limit = $query->param("limit"); - my $strsth; - $strsth="select bibid from marc_biblio "; + my $dbh=C4::Context->dbh; + my $sth; if ($start_bib && $end_bib) { - $strsth.=" where biblionumber>=$start_bib and biblionumber<=$end_bib "; - }elsif ($format) { - if ($strsth=~/ where/){ - $strsth=~s/ where (.*)/,biblioitems where biblioitems.biblionumber=marc_biblio.biblionumber and biblioitems.itemtype=\'$format\' and $1/; - }else { - $strsth.=",biblioitems where biblioitems.biblionumber=marc_biblio.biblionumber and biblioitems.itemtype=\'$format\'"; - } - } elsif ($branch) { - if ($strsth=~/ where/){ - $strsth=~s/ where (.*)/,items where items.biblionumber=marc_biblio.biblionumber and items.homebranch=\'$branch\' and $1/; - }else { - $strsth.=",items where items.biblionumber=marc_biblio.biblionumber and items.homebranch=\'$branch\'"; - } - } elsif ($start_callnumber && $end_callnumber) { - $start_callnumber=~s/\*/\%/g; - $start_callnumber=~s/\?/\_/g; - $end_callnumber=~s/\*/\%/g; - $end_callnumber=~s/\?/\_/g; - if ($strsth=~/,items/){ - $strsth.=" and items.itemcallnumber between \'$start_callnumber\' and \'$end_callnumber\'"; - } else { - if ($strsth=~/ where/){ - $strsth=~s/ where (.*)/,items where items.biblionumber=marc_biblio.biblionumber and items.itemcallnumber between \'$start_callnumber\' and \'$end_callnumber\' and $1/; - }else { - $strsth=~",items where items.biblionumber=marc_biblio.biblionumber and items.itemcallnumber between \'$start_callnumber\' and \'$end_callnumber\' "; - } - } - } - $strsth.=" order by marc_biblio.biblionumber "; - $strsth.= "LIMIT 0,$limit " if ($limit); - warn "requête marc.pl : ".$strsth; - my $req=$dbh->prepare($strsth); - $req->execute; - while (my ($bibid) = $req->fetchrow) { - my $record = MARCgetbiblio($dbh,$bibid); - - print $record->as_usmarc(); - } -} else { - my $sth=$dbh->prepare("Select itemtype,description from itemtypes order by description"); - $sth->execute; - my @itemtype; - my %itemtypes; - push @itemtype, ""; - $itemtypes{''} = ""; - while (my ($value,$lib) = $sth->fetchrow_array) { - push @itemtype, $value; - $itemtypes{$value}=$lib; + $sth=$dbh->prepare("select marcxml from biblio where biblionumber >=? and biblionumber <=? order by biblionumber"); + $sth->execute($start_bib,$end_bib); + } elsif ($start_bib ) { + $sth=$dbh->prepare("select marcxml from biblio where biblionumber >=? order by biblionumber"); + $sth->execute($start_bib); + }else { + $sth=$dbh->prepare("select marcxml from biblio order by biblionumber"); + $sth->execute(); } + while (my ($marc) = $sth->fetchrow) { +my $record=MARC::Record->new_from_xml($marc,"UTF-8"); - my $CGIitemtype=CGI::scrolling_list( -name => 'format', - -values => \@itemtype, - -default => '', - -labels => \%itemtypes, - -size => 1, - -multiple => 0 ); - $sth->finish; + print $record->as_usmarc;; - my $branches = getallbranches; - my @branchloop; - foreach my $thisbranch (keys %$branches) { -# my $selected = 1 if $thisbranch eq $branch; - my %row =(value => $thisbranch, -# selected => $selected, - branchname => $branches->{$thisbranch}->{'branchname'}, - ); - push @branchloop, \%row; } - +} else { my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "tools/export.tmpl", + = get_template_and_user({template_name => "tools/marc.tmpl", query => $query, type => "intranet", authnotrequired => 0, flagsrequired => {parameters => 1, management => 1, tools => 1}, debug => 1, }); - $template->param(branchloop=>\@branchloop,CGIitemtype=>$CGIitemtype); output_html_with_http_headers $query, $cookie, $template->output; } diff --git a/tools/holidays.pl b/tools/holidays.pl index f4b5c7909a..e8561d8b13 100755 --- a/tools/holidays.pl +++ b/tools/holidays.pl @@ -1,28 +1,18 @@ #!/usr/bin/perl -#####Sets holiday periods for each branch. Datedues will be extended if branch is closed -TG + use strict; use CGI; use C4::Auth; -use C4::Output; + use C4::Interface::CGI::Output; -use C4::Database; -use HTML::Template; -use C4::Calendar; + +use C4::Calendar::Calendar; my $input = new CGI; -#my $branch = $input->param('branch'); -my $branch=C4::Context->preference('defaultbranch') || $input->param('branch'); +my $branch = $input->param('branch'); +my $branch=C4::Context->preference('defaultbranch') unless $branch; my $dbh = C4::Context->dbh(); -# Get the template to use -my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "tools/holidays.tmpl", - type => "intranet", - query => $input, - authnotrequired => 0, - flagsrequired => {parameters => 1}, - debug => 1, - }); # Set all the branches. my $branches = $dbh->prepare("select branchcode, branchname from branches"); @@ -48,12 +38,10 @@ my $branchesList = CGI::scrolling_list(-name => 'branch', $branches->finish; # Get all the holidays -warn "BRANCH : $branch"; -my $calendar = C4::Calendar->new(branchcode => $branch); +my $calendar = C4::Calendar::Calendar->new(branchcode => $branch); my $week_days_holidays = $calendar->get_week_days_holidays(); my @week_days; foreach my $weekday (keys %$week_days_holidays) { -warn "WEEK DAY : $weekday"; my %week_day; %week_day = (KEY => $weekday, TITLE => $week_days_holidays->{$weekday}{title}, @@ -91,6 +79,16 @@ foreach my $yearMonthDay (keys %$single_holidays) { push @holidays, \%holiday; } +# Get the template to use +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "tools/holidays.tmpl", + type => "intranet", + query => $input, + authnotrequired => 0, + flagsrequired => {parameters => 1}, + debug => 1, + }); + # Replace the template values with the real ones $template->param(BRANCHES => $branchesList); $template->param(WEEK_DAYS_LOOP => \@week_days); @@ -100,4 +98,4 @@ $template->param(DAY_MONTH_HOLIDAYS_LOOP => \@day_month_holidays); $template->param(branch => $branch); # Shows the template with the real values replaced -output_html_with_http_headers $input, $cookie, $template->output; +output_html_with_http_headers $input, $cookie, $template->output; \ No newline at end of file diff --git a/tools/import.pl b/tools/import.pl index 2a19412af2..1f4f66d166 100755 --- a/tools/import.pl +++ b/tools/import.pl @@ -31,240 +31,17 @@ use strict; # standard or CPAN modules used use CGI; -use DBI; # Koha modules used use C4::Context; -use C4::Output; use C4::Interface::CGI::Output; -use C4::Input; -use C4::Biblio; -use MARC::File::USMARC; -use HTML::Template; -use C4::Output; use C4::Auth; use C4::Breeding; #------------------ # Constants -my $includes = C4::Context->config('includes') || - "/usr/local/www/hdl/htdocs/includes"; -# HTML colors for alternating lines -my $lc1='#dddddd'; -my $lc2='#ddaaaa'; - -#------------- -#------------- -# Initialize - -my $userid=$ENV{'REMOTE_USER'}; - -my $input = new CGI; -my $dbh = C4::Context->dbh; - -my $uploadmarc=$input->param('uploadmarc'); -my $overwrite_biblio = $input->param('overwrite_biblio'); -my $filename = $input->param('filename'); -my $syntax = $input->param('syntax'); -my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "tools/import.tmpl", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => {parameters => 1, management => 1, tools => 1}, - debug => 1, - }); - -$template->param(SCRIPT_NAME => $ENV{'SCRIPT_NAME'}, - uploadmarc => $uploadmarc); -if ($uploadmarc && length($uploadmarc)>0) { - my $marcrecord=''; - while (<$uploadmarc>) { - $marcrecord.=$_; - } - my ($notmarcrecord,$alreadyindb,$alreadyinfarm,$imported) = ImportBreeding($marcrecord,$overwrite_biblio,$filename,$syntax,int(rand(99999))); - - $template->param(imported => $imported, - alreadyindb => $alreadyindb, - alreadyinfarm => $alreadyinfarm, - notmarcrecord => $notmarcrecord, - total => $imported+$alreadyindb+$alreadyinfarm+$notmarcrecord, - ); - -} - -output_html_with_http_headers $input, $cookie, $template->output; -my $menu; -my $file; - - -#--------------- -# log cleared, as marcimport is (almost) rewritten from scratch. -# $Log$ -# Revision 1.1 2006/02/24 11:52:38 hdl -# Adding tools directory template and scripts -# Changing barcodes, export and import and letters directory. -# Changing export script name (marc.pl) to export.pl -# Changing import script name (breeding.pl) to import.pl -# -# Revision 1.4 2005/05/04 08:52:13 tipaul -# synch'ing 2.2 and head -# -# Revision 1.3 2005/03/23 09:57:47 doxulting -# Adding a parameter to allow acces to people with management/tools flags -# -# Revision 1.2 2003/10/06 09:10:38 slef -# Removing config info from z3950*sh and using C4::Context in processz3950queue (Fixed bug 39) -# -# Revision 1.1 2003/06/04 13:46:25 tipaul -# moving breeding farm import to parameters page (GUI) and to new import/ directory (code structure) -# -# Revision 1.33 2003/04/29 16:48:36 tipaul -# really proud of this commit :-) -# z3950 search and import seems to works fine. -# Let me explain how : -# * a "search z3950" button is added in the addbiblio template. -# * when clicked, a popup appears and z3950/search.pl is called -# * z3950/search.pl calls addz3950search in the DB -# * the z3950 daemon retrieve the records and stores them in z3950results AND in marc_breeding table. -# * as long as there as searches pending, the popup auto refresh every 2 seconds, and says how many searches are pending. -# * when the user clicks on a z3950 result => the parent popup is called with the requested biblio, and auto-filled -# -# Note : -# * character encoding support : (It's a nightmare...) In the z3950servers table, a "encoding" column has been added. You can put "UNIMARC" or "USMARC" in this column. Depending on this, the char_decode in C4::Biblio.pm replaces marc-char-encode by an iso 8859-1 encoding. Note that in the breeding import this value has been added too, for a better support. -# * the marc_breeding and z3950* tables have been modified : they have an encoding column and the random z3950 number is stored too for convenience => it's the key I use to list only requested biblios in the popup. -# -# Revision 1.32 2003/04/22 12:22:54 tipaul -# 1st draft for z3950 client import. -# moving Breeding farm script to a perl package C4/Breeding.pm -# -# Revision 1.31 2003/02/19 01:01:07 wolfpac444 -# Removed the unecessary $dbh argument from being passed. -# Resolved a few minor FIXMEs. -# -# Revision 1.30 2003/02/02 07:18:38 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.29 2003/01/28 15:28:31 tipaul -# removing use MARC::Charset -# Was a buggy test -# -# Revision 1.28 2003/01/28 15:00:31 tipaul -# user can now search in breeding farm with isbn/issn or title. Title/name are stored in breeding farm and showed when a search is done -# -# Revision 1.27 2003/01/26 23:21:49 acli -# Handle non-latin1 charsets -# -# Revision 1.26 2003/01/23 12:26:41 tipaul -# upgrading import in breeding farm (you can now search on ISBN or on title) AND character encoding. -# -# Revision 1.25 2003/01/21 08:13:50 tipaul -# character encoding ISO646 => 8859-1, first draft -# -# Revision 1.24 2003/01/14 16:41:17 tipaul -# bugfix : use gettemplate_and_user instead of gettemplate. -# fix a blank screen in 1.3.3 in "import in breeding farm" -# -# Revision 1.23 2003/01/06 13:06:28 tipaul -# removing trailing # -# -# Revision 1.22 2002/11/12 15:58:43 tipaul -# road to 1.3.2 : -# * many bugfixes -# * adding value_builder : you can map a subfield in the marc_subfield_structure to a sub stored in "value_builder" directory. In this directory you can create screen used to build values with any method. In this commit is a 1st draft of the builder for 100$a unimarc french subfield, which is composed of 35 digits, with 12 differents values (only the 4th first are provided for instance) -# -# Revision 1.21 2002/10/22 15:50:23 tipaul -# road to 1.3.2 : adding a biblio in MARC format. -# seems to work a few. -# still to do : -# * manage html checks (mandatory subfields...) -# * add list of acceptable values (authorities) -# * manage ## in MARC format -# * manage correctly repeatable fields -# and probably a LOT of bugfixes -# -# Revision 1.20 2002/10/16 12:46:19 arensb -# Added a FIXME comment. -# -# Revision 1.19 2002/10/15 10:14:44 tipaul -# road to 1.3.2. Full rewrite of marcimport.pl. -# The acquisition system in MARC version will work like this : -# * marcimport will put marc records into a "breeding farm" table. -# * when the user want to add a biblio, he enters first the ISBN/ISSN of the biblio. koha searches into breeding farm and if the record exists, it is shown to the user to help him adding the biblio. When the biblio is added, it's deleted from the breeding farm. -# -# This commit : -# * modify acqui.simple home page (addbooks.pl) -# * adds import into breeding farm -# -# Please note that : -# * z3950 functionnality is dropped from "marcimport" will be added somewhere else. -# * templates are in a new acqui.simple sub directory, and the marcimport template directory will become obsolete soon.I think this is more logic -# -#!/usr/bin/perl - -# $Id$ - -# Script for handling import of MARC data into Koha db -# and Z39.50 lookups - -# Koha library project www.koha.org - -# Licensed under the GPL - - -# Copyright 2000-2002 Katipo Communications -# -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA - -use strict; - -# standard or CPAN modules used -use CGI; -use DBI; - -# Koha modules used -use C4::Context; -use C4::Output; -use C4::Interface::CGI::Output; -use C4::Input; -use C4::Biblio; -use MARC::File::USMARC; -use HTML::Template; -use C4::Output; -use C4::Auth; -use C4::Breeding; - -#------------------ -# Constants - -my $includes = C4::Context->config('includes') || - "/usr/local/www/hdl/htdocs/includes"; # HTML colors for alternating lines my $lc1='#dddddd'; @@ -284,7 +61,7 @@ my $overwrite_biblio = $input->param('overwrite_biblio'); my $filename = $input->param('filename'); my $syntax = $input->param('syntax'); my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "import/breeding.tmpl", + = get_template_and_user({template_name => "tools/breeding.tmpl", query => $input, type => "intranet", authnotrequired => 0, @@ -299,7 +76,7 @@ if ($uploadmarc && length($uploadmarc)>0) { while (<$uploadmarc>) { $marcrecord.=$_; } - my ($notmarcrecord,$alreadyindb,$alreadyinfarm,$imported) = ImportBreeding($marcrecord,$overwrite_biblio,$filename,$syntax,int(rand(99999))); + my ($notmarcrecord,$alreadyindb,$alreadyinfarm,$imported) = ImportBreeding($marcrecord,$overwrite_biblio,$filename,$syntax,""); $template->param(imported => $imported, alreadyindb => $alreadyindb, @@ -318,113 +95,9 @@ my $file; #--------------- # log cleared, as marcimport is (almost) rewritten from scratch. # $Log$ -# Revision 1.1 2006/02/24 11:52:38 hdl -# Adding tools directory template and scripts -# Changing barcodes, export and import and letters directory. -# Changing export script name (marc.pl) to export.pl -# Changing import script name (breeding.pl) to import.pl -# -# Revision 1.4 2005/05/04 08:52:13 tipaul -# synch'ing 2.2 and head +# Revision 1.2 2006/09/11 17:41:56 tgarip1957 +# New XML API # # Revision 1.2.4.1 2005/04/07 10:10:52 tipaul # copying processz3950queue from 2.0 branch. The 2.2 version misses an important fix # -# Revision 1.2 2003/10/06 09:10:38 slef -# Removing config info from z3950*sh and using C4::Context in processz3950queue (Fixed bug 39) -# -# Revision 1.1 2003/06/04 13:46:25 tipaul -# moving breeding farm import to parameters page (GUI) and to new import/ directory (code structure) -# -# Revision 1.33 2003/04/29 16:48:36 tipaul -# really proud of this commit :-) -# z3950 search and import seems to works fine. -# Let me explain how : -# * a "search z3950" button is added in the addbiblio template. -# * when clicked, a popup appears and z3950/search.pl is called -# * z3950/search.pl calls addz3950search in the DB -# * the z3950 daemon retrieve the records and stores them in z3950results AND in marc_breeding table. -# * as long as there as searches pending, the popup auto refresh every 2 seconds, and says how many searches are pending. -# * when the user clicks on a z3950 result => the parent popup is called with the requested biblio, and auto-filled -# -# Note : -# * character encoding support : (It's a nightmare...) In the z3950servers table, a "encoding" column has been added. You can put "UNIMARC" or "USMARC" in this column. Depending on this, the char_decode in C4::Biblio.pm replaces marc-char-encode by an iso 8859-1 encoding. Note that in the breeding import this value has been added too, for a better support. -# * the marc_breeding and z3950* tables have been modified : they have an encoding column and the random z3950 number is stored too for convenience => it's the key I use to list only requested biblios in the popup. -# -# Revision 1.32 2003/04/22 12:22:54 tipaul -# 1st draft for z3950 client import. -# moving Breeding farm script to a perl package C4/Breeding.pm -# -# Revision 1.31 2003/02/19 01:01:07 wolfpac444 -# Removed the unecessary $dbh argument from being passed. -# Resolved a few minor FIXMEs. -# -# Revision 1.30 2003/02/02 07:18:38 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.29 2003/01/28 15:28:31 tipaul -# removing use MARC::Charset -# Was a buggy test -# -# Revision 1.28 2003/01/28 15:00:31 tipaul -# user can now search in breeding farm with isbn/issn or title. Title/name are stored in breeding farm and showed when a search is done -# -# Revision 1.27 2003/01/26 23:21:49 acli -# Handle non-latin1 charsets -# -# Revision 1.26 2003/01/23 12:26:41 tipaul -# upgrading import in breeding farm (you can now search on ISBN or on title) AND character encoding. -# -# Revision 1.25 2003/01/21 08:13:50 tipaul -# character encoding ISO646 => 8859-1, first draft -# -# Revision 1.24 2003/01/14 16:41:17 tipaul -# bugfix : use gettemplate_and_user instead of gettemplate. -# fix a blank screen in 1.3.3 in "import in breeding farm" -# -# Revision 1.23 2003/01/06 13:06:28 tipaul -# removing trailing # -# -# Revision 1.22 2002/11/12 15:58:43 tipaul -# road to 1.3.2 : -# * many bugfixes -# * adding value_builder : you can map a subfield in the marc_subfield_structure to a sub stored in "value_builder" directory. In this directory you can create screen used to build values with any method. In this commit is a 1st draft of the builder for 100$a unimarc french subfield, which is composed of 35 digits, with 12 differents values (only the 4th first are provided for instance) -# -# Revision 1.21 2002/10/22 15:50:23 tipaul -# road to 1.3.2 : adding a biblio in MARC format. -# seems to work a few. -# still to do : -# * manage html checks (mandatory subfields...) -# * add list of acceptable values (authorities) -# * manage ## in MARC format -# * manage correctly repeatable fields -# and probably a LOT of bugfixes -# -# Revision 1.20 2002/10/16 12:46:19 arensb -# Added a FIXME comment. -# -# Revision 1.19 2002/10/15 10:14:44 tipaul -# road to 1.3.2. Full rewrite of marcimport.pl. -# The acquisition system in MARC version will work like this : -# * marcimport will put marc records into a "breeding farm" table. -# * when the user want to add a biblio, he enters first the ISBN/ISSN of the biblio. koha searches into breeding farm and if the record exists, it is shown to the user to help him adding the biblio. When the biblio is added, it's deleted from the breeding farm. -# -# This commit : -# * modify acqui.simple home page (addbooks.pl) -# * adds import into breeding farm -# -# Please note that : -# * z3950 functionnality is dropped from "marcimport" will be added somewhere else. -# * templates are in a new acqui.simple sub directory, and the marcimport template directory will become obsolete soon.I think this is more logic -# diff --git a/tools/koha-news.pl b/tools/koha-news.pl index ccf455d26b..605a86bca6 100755 --- a/tools/koha-news.pl +++ b/tools/koha-news.pl @@ -30,7 +30,7 @@ use C4::Context; use C4::Output; use C4::Interface::CGI::Output; use C4::NewsChannels; -use HTML::Template; + my $cgi = new CGI; diff --git a/tools/newHolidays.pl b/tools/newHolidays.pl index 9a8345c985..e8fefe43b2 100755 --- a/tools/newHolidays.pl +++ b/tools/newHolidays.pl @@ -6,9 +6,7 @@ use CGI; use C4::Auth; use C4::Output; use C4::Interface::CGI::Output; -use C4::Database; -use HTML::Template; -use C4::Calendar; +use C4::Calendar::Calendar; my $input = new CGI; my $dbh = C4::Context->dbh(); @@ -21,7 +19,7 @@ my $year = $input->param('newYear'); my $title = $input->param('newTitle'); my $description = $input->param('newDescription'); -my $calendar = C4::Calendar->new(branchcode => $branchcode); +my $calendar = C4::Calendar::Calendar->new(branchcode => $branchcode); if ($input->param('newOperation') eq 'weekday') { $calendar->insert_week_day_holiday(weekday => $weekday, @@ -40,4 +38,4 @@ if ($input->param('newOperation') eq 'weekday') { description => $description); } -print $input->redirect("/cgi-bin/koha/tools/holidays.pl?branch=$branchcode"); +print $input->redirect("/cgi-bin/koha/tools/holidays.pl?branch=$branchcode"); \ No newline at end of file diff --git a/tools/overduerules.pl b/tools/overduerules.pl index c863775cce..c12b9f0ce4 100755 --- a/tools/overduerules.pl +++ b/tools/overduerules.pl @@ -20,13 +20,10 @@ use strict; use CGI; use C4::Context; -use C4::Output; -use C4::Database; use C4::Auth; -use C4::Output; use C4::Koha; use C4::Interface::CGI::Output; -use HTML::Template; + my $input = new CGI; my $dbh = C4::Context->dbh; @@ -121,7 +118,7 @@ if ($op eq 'save') { } unless ($err) {$template->param(datasaved=>1);} } -my $branches = GetBranches; +my $branches = getbranches; my @branchloop; foreach my $thisbranch (keys %$branches) { my $selected = 1 if $thisbranch eq $branch; -- 2.39.2