From c52e5b61dd0a7e0679c912cf50e57835bbe44771 Mon Sep 17 00:00:00 2001 From: tipaul Date: Thu, 4 Aug 2005 14:10:52 +0000 Subject: [PATCH] synch'ing 2.2 and head --- .../opac-tmpl/css/en/includes/opac-top.inc | 2 +- .../opac-tmpl/css/en/opac-MARCdetail.tmpl | 20 +-- koha-tmpl/opac-tmpl/css/en/opac-detail.tmpl | 125 ++++++++++++------ koha-tmpl/opac-tmpl/css/en/opac-main.tmpl | 3 +- koha-tmpl/opac-tmpl/css/en/opac-passwd.tmpl | 40 ++++++ members/member.pl | 4 +- members/memberentry.pl | 47 +++---- members/moremember.pl | 2 +- misc/koha.mysql | 4 +- misc/migration_tools/buildLANG.pl | 44 +++++- misc/migration_tools/bulkmarcimport.pl | 1 + opac/opac-ISBDdetail.pl | 2 +- opac/opac-account.pl | 15 ++- opac/opac-addbookbybiblionumber.pl | 2 +- opac/opac-detail.pl | 11 +- opac/opac-passwd.pl | 88 ++++++++++++ opac/opac-readingrecord.pl | 43 +++++- opac/opac-reserve.pl | 5 +- updater/updatedatabase | 84 ++++++++++++ value_builder/marc21_leader.pl | 105 +++++++++++++++ value_builder/unimarc_leader.pl | 105 +++++++++++++++ 21 files changed, 638 insertions(+), 114 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/css/en/opac-passwd.tmpl create mode 100755 opac/opac-passwd.pl create mode 100644 value_builder/marc21_leader.pl create mode 100644 value_builder/unimarc_leader.pl diff --git a/koha-tmpl/opac-tmpl/css/en/includes/opac-top.inc b/koha-tmpl/opac-tmpl/css/en/includes/opac-top.inc index c2a51d32bd..0bee1ef53a 100644 --- a/koha-tmpl/opac-tmpl/css/en/includes/opac-top.inc +++ b/koha-tmpl/opac-tmpl/css/en/includes/opac-top.inc @@ -32,7 +32,7 @@
- " height="50" alt="koha logo"/> + " height="65" alt="koha logo"/> /images/front-background-small.gif" height="50" alt="koha logo"/> diff --git a/koha-tmpl/opac-tmpl/css/en/opac-MARCdetail.tmpl b/koha-tmpl/opac-tmpl/css/en/opac-MARCdetail.tmpl index 1ab6d5f26b..ecaf6612ab 100644 --- a/koha-tmpl/opac-tmpl/css/en/opac-MARCdetail.tmpl +++ b/koha-tmpl/opac-tmpl/css/en/opac-MARCdetail.tmpl @@ -76,7 +76,7 @@ - &operator==&type=intranet&value="> + &operator==&type=intranet&value="> ///images/filefind.png" height="15" title="Search on "> @@ -100,7 +100,7 @@ - &operator==&type=intranet&value="> + &operator==&type=intranet&value="> ///images/filefind.png" height="15" title="Search on "> @@ -124,7 +124,7 @@ - &operator==&type=intranet&value="> + &operator==&type=intranet&value="> ///images/filefind.png" height="15" title="Search on "> @@ -148,7 +148,7 @@ - &operator==&type=intranet&value="> + &operator==&type=intranet&value="> ///images/filefind.png" height="15" title="Search on "> @@ -172,7 +172,7 @@ - &operator==&type=intranet&value="> + &operator==&type=intranet&value="> ///images/filefind.png" height="15" title="Search on "> @@ -196,7 +196,7 @@ - &operator==&type=intranet&value="> + &operator==&type=intranet&value="> ///images/filefind.png" height="15" title="Search on "> @@ -220,7 +220,7 @@ - &operator==&type=intranet&value="> + &operator==&type=intranet&value="> ///images/filefind.png" height="15" title="Search on "> @@ -244,7 +244,7 @@ - &operator==&type=intranet&value="> + &operator==&type=intranet&value="> ///images/filefind.png" height="15" title="Search on "> @@ -268,7 +268,7 @@ - &operator==&type=intranet&value="> + &operator==&type=intranet&value="> ///images/filefind.png" height="15" title="Search on "> @@ -292,7 +292,7 @@ - &operator==&type=intranet&value="> + &operator==&type=intranet&value="> ///images/filefind.png" height="15" title="Search on "> diff --git a/koha-tmpl/opac-tmpl/css/en/opac-detail.tmpl b/koha-tmpl/opac-tmpl/css/en/opac-detail.tmpl index 9f3614d3a8..d1faf59a73 100644 --- a/koha-tmpl/opac-tmpl/css/en/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/css/en/opac-detail.tmpl @@ -53,24 +53,54 @@

-

+

- - , + +

+

+

+ ,

-

vol.

-

- -

">,

+

vol.

+ +

+

+ + "> + +
+ +

+ +

+ +

">,

+

-

+ +

+

+ +

-

+ +

+ +

+

+

-

">

+ +

+ + ">  + +

+

@@ -79,38 +109,12 @@

-

Total Number of Items:

+

Total Number of Items:

- - - - - - - - - - - -
Detailed notes: -
    - - -
    - -
-
Related links: - -
@@ -157,15 +161,50 @@ + -

- This is a serial subscription (we have subscriptions). You can see which - " class="button catalogue" title="Serial issues"> - Issues - we have and don't have -

- +
+

This is a serial subscription (we have subscription(s) associated with this title).

+

Below is a list of the three latest issues related to those subscription(s) :

+ +

Subscription #

+

+ + + + + + + + + + +
Issue numberDateStatus
+ + + + + Waited + + Arrived + + Late + + Missing + + Not Issued + + + + + +
+ + +

" title="Serial issues">Click here for more information on subscription(s) history

+
+ diff --git a/koha-tmpl/opac-tmpl/css/en/opac-main.tmpl b/koha-tmpl/opac-tmpl/css/en/opac-main.tmpl index a40dcce775..e78594c25f 100644 --- a/koha-tmpl/opac-tmpl/css/en/opac-main.tmpl +++ b/koha-tmpl/opac-tmpl/css/en/opac-main.tmpl @@ -63,8 +63,9 @@ View & manage suggestions - home + My personnal details + My reading history Log Out diff --git a/koha-tmpl/opac-tmpl/css/en/opac-passwd.tmpl b/koha-tmpl/opac-tmpl/css/en/opac-passwd.tmpl new file mode 100644 index 0000000000..4340535ea6 --- /dev/null +++ b/koha-tmpl/opac-tmpl/css/en/opac-passwd.tmpl @@ -0,0 +1,40 @@ + +
+ + +

There was a problem with your submission

+

+ + Passwords do not match. Please re-type your new password. + + + Your new password must be at least 6 characters long + + + Your current password was entered incorrectly. If this problem persists, please ask a librarian to re-set your password for you. +

+ + + +

Change your Password

+
+

+

+

+

+ + + +

Password Updated

+ Your password has been changed + + " /> +

+
+ + + + + + + diff --git a/members/member.pl b/members/member.pl index 9feb25c96c..45948e2355 100755 --- a/members/member.pl +++ b/members/member.pl @@ -89,7 +89,7 @@ for (my $i=0; $i < $count; $i++){ my %row = ( background => $background, - count => $i + 1, + count => $i+1, borrowernumber => $results->[$i]{'borrowernumber'}, cardnumber => $results->[$i]{'cardnumber'}, surname => $results->[$i]{'surname'}, @@ -106,7 +106,7 @@ for (my $i=0; $i < $count; $i++){ $template->param( member => $member, - numresults => $count, + numresults => $count, resultsloop => \@resultsdata ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/memberentry.pl b/members/memberentry.pl index 62f2002f44..3fdae88bec 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -60,8 +60,6 @@ my $op=$input->param('op'); my $categorycode=$input->param('categorycode'); my $destination=$input->param('destination'); - - my $nok; # if a add or modify is requested => check validity of data. if ($op eq 'add' or $op eq 'modify') { @@ -143,25 +141,7 @@ if ($op eq 'add' or $op eq 'modify') { } } if ($delete){ - my @errors; - my $nok; - my $branch =$input->param('branchcode'); - if (C4::Context->preference("IndependantBranches")) { - my $userenv = C4::Context->userenv; - if ($userenv->{flags} == 1){ - if ($userenv->{branch} eq $branch){ - print $input->redirect("/cgi-bin/koha/deletemem.pl?member=$borrowernumber"); - } else { - push @errors, "ERROR_branch"; - $nok=1; - print $input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$borrowernumber"); - } - } else { - print $input->redirect("/cgi-bin/koha/deletemem.pl?member=$borrowernumber"); - } - } else { - print $input->redirect("/cgi-bin/koha/deletemem.pl?member=$borrowernumber"); - } + print $input->redirect("/cgi-bin/koha/deletemem.pl?member=$borrowernumber"); } else { # this else goes down the whole script if ($actionType eq 'Add'){ $template->param( addAction => 1); @@ -178,16 +158,6 @@ if ($delete){ } else { $data=borrdata('',$borrowernumber); } - if (C4::Context->preference("IndependantBranches")) { - my $userenv = C4::Context->userenv; - unless ($userenv->{flags} == 1){ - warn "userenv=".$userenv->{'branch'}." member branch :".$data->{'branchcode'}; - unless ($userenv->{'branch'} eq $data->{'branchcode'}){ - print $input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$borrowernumber"); - exit 1; - } - } - } if ($actionType eq 'Add'){ $template->param( updtype => 'I'); } else { @@ -288,7 +258,20 @@ if ($delete){ -labels => \%select_branches, -size => 1, -multiple => 0 ); - + + my $CGIsort1 = buildCGIsort("Bsort1","sort1",$data->{'sort1'}); + if ($CGIsort1) { + $template->param(CGIsort1 => $CGIsort1); + } else { + $template->param( sort1 => $data->{'sort1'}); + } + + my $CGIsort2 = buildCGIsort("Bsort2","sort2",$data->{'sort2'}); + if ($CGIsort2) { + $template->param(CGIsort2 =>$CGIsort2); + } else { + $template->param( sort2 => $data->{'sort2'}); + } my $CGIsort1 = buildCGIsort("Bsort1","sort1",$data->{'sort1'}); if ($CGIsort1) { diff --git a/members/moremember.pl b/members/moremember.pl index 5b7ae1dcb3..e66fc1188f 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -175,7 +175,7 @@ for (my $i=0;$i<$count;$i++){ # charge, for that matter). my ($charge,$itemtype)=calc_charges($dbh,$issue->[$i]{'itemnumber'},$bornum); $row{'itemtype'}=&ItemType($itemtype); - $row{'charge'}=$charge; + $row{'charge'}= sprintf("%.2f",$charge); #check item is not reserved my ($restype,$reserves)=CheckReserves($issue->[$i]{'itemnumber'}); diff --git a/misc/koha.mysql b/misc/koha.mysql index 8a52d28248..bd64390e83 100644 --- a/misc/koha.mysql +++ b/misc/koha.mysql @@ -365,7 +365,7 @@ CREATE TABLE biblioitems ( itemtype varchar(4) default NULL, isbn varchar(14) default NULL, issn varchar(9) default NULL, - dewey varchar(14) default NULL, + dewey varchar(50) default NULL, subclass char(3) default NULL, publicationyear smallint(6) default NULL, publishercode varchar(255) default NULL, @@ -641,7 +641,7 @@ CREATE TABLE deletedbiblioitems ( itemtype varchar(4) default NULL, isbn varchar(14) default NULL, issn varchar(9) default NULL, - dewey double(8,6) default NULL, + dewey varchar(50) default NULL, subclass char(3) default NULL, publicationyear smallint(6) default NULL, publishercode varchar(255) default NULL, diff --git a/misc/migration_tools/buildLANG.pl b/misc/migration_tools/buildLANG.pl index 0e28493b55..2503940b28 100755 --- a/misc/migration_tools/buildLANG.pl +++ b/misc/migration_tools/buildLANG.pl @@ -42,7 +42,7 @@ If the complete language name is unknown, the code is used instead and you will SAMPLES : ./buildLANG -d -s "('101a','101b')" EOF -;# +;#/ exit; } @@ -59,6 +59,11 @@ my %codesiso; 'mul' => 'multilingue', 'ger' => 'allemand', 'eng' => 'anglais', + 'afr' => 'afrikaans', + 'akk' => 'akkadien', + 'amh' => 'amharique', + 'ang' => 'anglo-saxon (ca. 450-1100)', + 'arc' => 'araméen', 'ara' => 'arabe', 'arm' => 'arménien', 'baq' => 'basque', @@ -67,34 +72,61 @@ my %codesiso; 'bul' => 'bulgare', 'cat' => 'catalan', 'chi' => 'chinois', + 'cop' => 'copte', 'cro' => 'croate', + 'cze' => 'tchèque', 'dan' => 'danois', + 'dum' => 'néerlandais moyen (ca. 1050-1350)', + 'dut' => 'néerlandais', 'spa' => 'espagnol', + 'egy' => 'egyptien', 'esp' => 'espéranto', 'fin' => 'finnois', 'fra' => 'français ancien', 'fre' => 'français', - 'wel' => 'gallois', + 'frm' => 'français moyen (ca. 1400-1600)', + 'fro' => 'français ancien (842-ca. 1400)', + 'gmh' => 'allemand, moyen haut (ca. 1050-1500)', + 'got' => 'gothique', 'grc' => 'grec classique', 'gre' => 'grec moderne', 'heb' => 'hébreu', + 'hin' => 'hindi', 'hun' => 'hongrois', + 'ind' => 'indonésien', + 'ine' => 'indo-européennes, autres', 'ita' => 'italien', 'jap' => 'japonais', + 'jpn' => 'japonais', + 'kor' => 'coréen', + 'lan' => 'occitan (post 1500)', 'lat' => 'latin', - 'dut' => 'néerlandais', + 'map' => 'malayo-polynésiennes, autres', + 'mla' => 'malgache', + 'nic' => 'nigéro-congolaises, autres', 'nor' => 'norvégien', + 'per' => 'persan', + 'pro' => 'provencal ancien (jusqu\'à 1500)', 'pol' => 'polonais', 'por' => 'portugais', + 'rom' => 'tzigane', 'rum' => 'roumain', 'rus' => 'russe', + 'sam' => 'samaritain', + 'san' => 'sanskrit', + 'scr' => 'serbo-croate', + 'sem' => 'sémitique, autres langues', 'ser' => 'serbe', + 'sla' => 'slave, autres langues', + 'slo' => 'slovène', + 'syr' => 'syriaque', 'swe' => 'suedois', - 'cze' => 'tchèque', + 'tib' => 'tibétain', 'tur' => 'turc', + 'uga' => 'ougaritique', 'ukr' => 'ukraine', - 'slo' => 'slovène', - 'scr' => 'serbo-croate', + 'wel' => 'gallois', + 'yid' => 'yiddish', ) if $language eq 'fr'; my $dbh = C4::Context->dbh; diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl index c1410cea53..ac754f993c 100644 --- a/misc/migration_tools/bulkmarcimport.pl +++ b/misc/migration_tools/bulkmarcimport.pl @@ -82,6 +82,7 @@ while ( my $record = $batch->next() ) { ## create an empty record object to populate my $newRecord = MARC::Record->new(); + $newRecord->leader($record->leader()); # go through each field in the existing record foreach my $oldField ( $record->fields() ) { diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index 0ea8c20b14..de47723c1a 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -114,7 +114,7 @@ my $res; my $subfieldcode = $subf[$i][0]; my $subfieldvalue = get_authorised_value_desc($tag, $subf[$i][0], $subf[$i][1], '', $dbh); my $tagsubf = $tag.$subfieldcode; - $calculated =~ s/\{(.?.?.?)$tagsubf(.*?)\}/$1$subfieldvalue\{$1$tagsubf$2\}$2/g; + $calculated =~ s/\{(.?.?.?)$tagsubf(.*?)\}/$1$subfieldvalue$2\{$1$tagsubf$2\}/g; } # field builded, store the result if ($calculated && !$hasputtextbefore) { # put textbefore if not done diff --git a/opac/opac-account.pl b/opac/opac-account.pl index 3216281e29..755a9f0afb 100755 --- a/opac/opac-account.pl +++ b/opac/opac-account.pl @@ -36,8 +36,15 @@ $template->param( BORROWER_INFO => \@bordat ); my ($numaccts,$accts,$total) = getboracctrecord(undef,$borr); for (my $i=0;$i<$numaccts;$i++){ - $accts->[$i]{'amount'}+=0.00; - $accts->[$i]{'amountoutstanding'}+=0.00; + $accts->[$i]{'date'} = format_date($accts->[$i]{'date'}); + $accts->[$i]{'amount'} = sprintf("%.2f", $accts->[$i]{'amount'}); + if($accts->[$i]{'amount'} >= 0){ + $accts->[$i]{'amountcredit'} = 1; + } + $accts->[$i]{'amountoutstanding'} =sprintf("%.2f", $accts->[$i]{'amountoutstanding'}); + if($accts->[$i]{'amountoutstanding'} >= 0){ + $accts->[$i]{'amountoutstandingcredit'} = 1; + } if ($accts->[$i]{'accounttype'} ne 'F' && $accts->[$i]{'accounttype'} ne 'FU'){ $accts->[$i]{'print_title'}; } @@ -54,9 +61,11 @@ foreach my $row (@$accts) { $template->param( ACCOUNT_LINES => $accts, LibraryName => C4::Context->preference("LibraryName"), + suggestion => C4::Context->preference("suggestion"), + virtualshelves => C4::Context->preference("virtualshelves") ); -$template->param( total => $total ); +$template->param( total => sprintf("%.2f",$total) ); #$template->param(loggeninuser => $loggedinuser); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/opac/opac-addbookbybiblionumber.pl b/opac/opac-addbookbybiblionumber.pl index 0f5ae1dc63..5da57cdb81 100755 --- a/opac/opac-addbookbybiblionumber.pl +++ b/opac/opac-addbookbybiblionumber.pl @@ -83,7 +83,7 @@ if ($shelfnumber) { output_html_with_http_headers $query, $cookie, $template->output; } # $Log$ -# Revision 1.2 2005/05/04 09:02:38 tipaul +# Revision 1.3 2005/08/04 14:19:50 tipaul # synch'ing 2.2 and head # # Revision 1.1.2.2 2005/03/25 17:04:27 tipaul diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 3341e63c54..d8a4715fff 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -75,15 +75,17 @@ $template->param(norequests => $norequests); ## get notes and subjects from MARC record my $marc = C4::Context->preference("marc"); -if ($marc eq "yes") { +my @results = ($dat,); +if (C4::Boolean::true_p($marc)) { my $dbh = C4::Context->dbh; my $bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$biblionumber); my $marcflavour = C4::Context->preference("marcflavour"); my $marcnotesarray = &getMARCnotes($dbh,$bibid,$marcflavour); + $results[0]->{MARCNOTES} = $marcnotesarray; my $marcsubjctsarray = &getMARCsubjects($dbh,$bibid,$marcflavour); - - $template->param(MARCNOTES => $marcnotesarray); - $template->param(MARCSUBJCTS => $marcsubjctsarray); + $results[0]->{MARCSUBJCTS} = $marcsubjctsarray; +# $template->param(MARCNOTES => $marcnotesarray); +# $template->param(MARCSUBJCTS => $marcsubjctsarray); } my @results = ($dat,); @@ -157,3 +159,4 @@ $template->param( REVIEWS => \@reviews ); ## End of Amazon Stuff =cut output_html_with_http_headers $query, $cookie, $template->output; + diff --git a/opac/opac-passwd.pl b/opac/opac-passwd.pl new file mode 100755 index 0000000000..a1440c952d --- /dev/null +++ b/opac/opac-passwd.pl @@ -0,0 +1,88 @@ +#!/usr/bin/perl +# This script lets the users change the passwords by themselves. +# +# (c) 2005 Universidad ORT Uruguay. +# +# This file is part of the extensions and enhacments made to koha by Universidad ORT Uruguay +# +# 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; +require Exporter; +use CGI; + +use C4::Auth; # checkauth, getborrowernumber. +use C4::Context; +use Digest::MD5 qw(md5_base64); +use C4::Circulation::Circ2; +use HTML::Template; +use C4::Interface::CGI::Output; + +my $query = new CGI; +my $dbh = C4::Context->dbh; + +my ($template, $borrowernumber, $cookie) + = get_template_and_user({template_name => "opac-passwd.tmpl", + query => $query, + type => "opac", + authnotrequired => 0, + flagsrequired => {borrow => 1}, + debug => 1, + }); + +# get borrower information .... +my ($borr, $flags) = getpatroninformation(undef, $borrowernumber); +my $sth = $dbh->prepare("UPDATE borrowers SET password = ? WHERE borrowernumber=?"); + +if ( $query->param('Oldkey') && $query->param('Newkey') && $query->param('Confirm') ){ + if ( goodkey($dbh,$borrowernumber, $query->param('Oldkey')) ){ + if ( $query->param('Newkey') eq $query->param('Confirm') && + length($query->param('Confirm')) > 5 ){ # Record password + my $clave = md5_base64($query->param('Newkey')); + $sth->execute($clave,$borrowernumber); + $template->param('password_updated' => '1'); + $template->param('borrowernumber' => $borrowernumber); + }elsif ( $query->param('Newkey') ne $query->param('Confirm') ){ + $template->param('Ask_data' => '1'); + $template->param('Error_messages' => '1'); + $template->param('PassMismatch' => '1'); + }elsif (length($query->param('Confirm')) <= 5 ){ + $template->param('Ask_data' => '1'); + $template->param('Error_messages' => '1'); + $template->param('ShortPass' => '1'); + }else{ + $template->param('Error_messages' => '1'); + } + }else{ + $template->param('Ask_data' => '1'); + $template->param('Error_messages' => '1'); + $template->param('WrongPass' => '1'); + } +}else { +# Called Empty, Ask for data. + $template->param('Ask_data' => '1'); +} +output_html_with_http_headers $query, $cookie, $template->output; + + +sub goodkey { +my ($dbh, $borrowernumber, $key) = @_; + + my $sth=$dbh->prepare("SELECT password FROM borrowers WHERE borrowernumber=?"); + $sth->execute($borrowernumber); + if ($sth->rows){ + my ($md5password) = $sth->fetchrow; + if (md5_base64($key) eq $md5password) { return 1; } else { return 0; } + }else{ return 0; } +} diff --git a/opac/opac-readingrecord.pl b/opac/opac-readingrecord.pl index 4afae6e658..1604585843 100755 --- a/opac/opac-readingrecord.pl +++ b/opac/opac-readingrecord.pl @@ -6,6 +6,7 @@ use CGI; use C4::Auth; use C4::Koha; use C4::Circulation::Circ2; +use C4::Date; use C4::Search; use HTML::Template; use C4::Interface::CGI::Output; @@ -31,7 +32,17 @@ my $order=$query->param('order'); my $order2=$order; if ($order2 eq ''){ $order2="date_due desc"; + $template->param(orderbydate => 1); } + +if($order2 eq 'title'){ + $template->param(orderbytitle => 1); + } + +if($order2 eq 'author'){ + $template->param(orderbyauthor => 1); +} + my $limit=$query->param('limit'); if ($limit eq 'full'){ $limit=0; @@ -41,15 +52,35 @@ if ($limit eq 'full'){ my ($count,$issues)=allissues($borrowernumber,$order2,$limit); # add the row parity -my $num = 0; -foreach my $row (@$issues) { - $row->{'even'} = 1 if $num % 2 == 0; - $row->{'odd'} = 1 if $num % 2 == 1; - $num++; +#my $num = 0; +#foreach my $row (@$issues) { +# $row->{'even'} = 1 if $num % 2 == 0; +# $row->{'odd'} = 1 if $num % 2 == 1; +# $num++; +#} + +my @loop_reading; + +for (my $i=0;$i<$count;$i++){ + my %line; + if($i%2){ + $line{'toggle'} = 1; + } + $line{biblionumber}=$issues->[$i]->{'biblionumber'}; + $line{title}=$issues->[$i]->{'title'}; + $line{author}=$issues->[$i]->{'author'}; + $line{classification} = $issues->[$i]->{'classification'}; + $line{date_due}=format_date($issues->[$i]->{'date_due'}); + $line{returndate}=format_date($issues->[$i]->{'returndate'}); + $line{volumeddesc}=$issues->[$i]->{'volumeddesc'}; + $line{counter} = $i + 1; + push(@loop_reading,\%line); } $template->param(count => $count); -$template->param(READING_RECORD => $issues, +$template->param(READING_RECORD => \@loop_reading, + limit => $limit, + showfulllink => ($count > 50), LibraryName => C4::Context->preference("LibraryName"), suggestion => C4::Context->preference("suggestion"), virtualshelves => C4::Context->preference("virtualshelves"), diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 154b8f66e9..e72fa7b714 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -211,10 +211,13 @@ if ($query->param('item_types_selected')) { $fee = sprintf "%.02f", $fee; $template->param(fee => $fee,istherefee => $fee>0?1:0); $template->param(item_types_selected => 1); + warn "Branch is ==$branch=="; + $template->param(no_branch_selected => 1) unless ($branch!=''); } else { $template->param(message => 1); $template->param(no_items_selected => 1) unless ($proceed); - $template->param(no_branch_selected =>1) unless ($branch); + $template->param(no_branch_selected => 1) unless ($branch); + warn "Branch is ==$branch=="; } } elsif ($query->param('place_reserve')) { # here we actually do the reserveration. Stage 3. diff --git a/updater/updatedatabase b/updater/updatedatabase index 149298d0c4..57ba62b356 100755 --- a/updater/updatedatabase +++ b/updater/updatedatabase @@ -140,6 +140,84 @@ my %tabledata = ( explanation => 'If Yes, Returndate on issuing can\'t be after borrower card expiry', type => 'YesNo', }, + { + uniquefieldrequired => 'variable', + variable => 'opacstylesheet', + value => '', + forceupdate => { 'explanation' => 1, + 'type' => 1}, + explanation => 'Enter a complete URL to use an alternate stylesheet in OPAC', + type => 'free', + }, + { + uniquefieldrequired => 'variable', + variable => 'opacsmallimage', + value => '', + forceupdate => { 'explanation' => 1, + 'type' => 1}, + explanation => 'Enter a complete URL to an image, will be on top/left instead of the Koha logo', + type => 'free', + }, + { + uniquefieldrequired => 'variable', + variable => 'opaclargeimage', + value => '', + forceupdate => { 'explanation' => 1, + 'type' => 1}, + explanation => 'Enter a complete URL to an image, will be on the main page, instead of the Koha logo', + type => 'free', + }, + { + uniquefieldrequired => 'variable', + variable => 'delimiter', + value => ';', + forceupdate => { 'explanation' => 1, + 'type' => 1}, + explanation => 'separator for reports exported to spreadsheet', + type => 'free', + }, + { + uniquefieldrequired => 'variable', + variable => 'MIME', + value => 'OPENOFFICE.ORG', + forceupdate => { 'explanation' => 1, + 'type' => 1, + 'options' => 1}, + explanation => 'Define the default application for report exportations into files', + type => 'Choice', + options => 'EXCEL|OPENOFFICE.ORG' + }, + { + uniquefieldrequired => 'variable', + variable => 'Delimiter', + value => ';', + forceupdate => { 'explanation' => 1, + 'type' => 1, + 'options' => 1}, + explanation => 'Define the default separator character for report exportations into files', + type => 'Choice', + options => ';|tabulation|,|/|\|#' + }, + { + uniquefieldrequired => 'variable', + variable => 'SubscriptionHistory', + value => ';', + forceupdate => { 'explanation' => 1, + 'type' => 1, + 'options' => 1}, + explanation => 'Define the information level for serials history in OPAC', + type => 'Choice', + options => 'simplified|full' + }, + { + uniquefieldrequired => 'variable', + variable => 'hidelostitems', + value => 'No', + forceupdate => { 'explanation' => 1, + 'type' => 1}, + explanation => 'show or hide "lost" items in OPAC.', + type => 'YesNo', + }, ], ); @@ -368,6 +446,9 @@ $sth->finish; exit; # $Log$ +# Revision 1.117 2005/08/04 14:24:39 tipaul +# synch'ing 2.2 and head +# # Revision 1.116 2005/08/04 08:55:54 tipaul # Letters / alert system, continuing... # @@ -765,6 +846,9 @@ $sth->finish; exit; # $Log$ +# Revision 1.117 2005/08/04 14:24:39 tipaul +# synch'ing 2.2 and head +# # Revision 1.116 2005/08/04 08:55:54 tipaul # Letters / alert system, continuing... # diff --git a/value_builder/marc21_leader.pl b/value_builder/marc21_leader.pl new file mode 100644 index 0000000000..e8b1b81f86 --- /dev/null +++ b/value_builder/marc21_leader.pl @@ -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 HTML::Template; +use C4::Search; +use C4::Output; + +=head1 + +plugin_parameters : other parameters added when the plugin is called by the dopop function + +=cut +sub plugin_parameters { +my ($dbh,$record,$tagslib,$i,$tabloop) = @_; +return ""; +} + +sub plugin_javascript { +my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; +my $function_name= "100".(int(rand(100000))+1); +my $res=" + +"; + +return ($function_name,$res); +} +sub plugin { +my ($input) = @_; + my %env; + +# my $input = new CGI; + my $index= $input->param('index'); + my $result= $input->param('result'); + + + my $dbh = C4::Context->dbh; + +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "value_builder/marc21_leader.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {parameters => 1}, + debug => 1, + }); + $result = " nam " unless $result; + my $f5 = substr($result,5,1); + my $f6 = substr($result,6,1); + my $f7 = substr($result,7,1); + my $f8 = substr($result,8,1); + my $f9 = substr($result,9,1); + my $f17 = substr($result,17,1); + my $f18 = substr($result,18,1); + my $f19 = substr($result,19,1); + + $template->param(index => $index, + "f5$f5" => 1, + "f6$f6" => 1, + "f7$f7" => 1, + "f8$f8" => 1, + "f9$f9" => 1, + "f17$f17" => 1, + "f18$f18" => 1, + "f19$f19" => 1, + ); + print $input->header(-cookie => $cookie),$template->output; +} + +1; diff --git a/value_builder/unimarc_leader.pl b/value_builder/unimarc_leader.pl new file mode 100644 index 0000000000..7b9abe4d50 --- /dev/null +++ b/value_builder/unimarc_leader.pl @@ -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 HTML::Template; +use C4::Search; +use C4::Output; + +=head1 + +plugin_parameters : other parameters added when the plugin is called by the dopop function + +=cut +sub plugin_parameters { +my ($dbh,$record,$tagslib,$i,$tabloop) = @_; +return ""; +} + +sub plugin_javascript { +my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; +my $function_name= "100".(int(rand(100000))+1); +my $res=" + +"; + +return ($function_name,$res); +} +sub plugin { +my ($input) = @_; + my %env; + +# my $input = new CGI; + my $index= $input->param('index'); + my $result= $input->param('result'); + + + my $dbh = C4::Context->dbh; + +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "value_builder/unimarc_leader.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {parameters => 1}, + debug => 1, + }); + $result = " nam " unless $result; + my $f5 = substr($result,5,1); + my $f6 = substr($result,6,1); + my $f7 = substr($result,7,1); + my $f8 = substr($result,8,1); + my $f9 = substr($result,9,1); + my $f17 = substr($result,17,1); + my $f18 = substr($result,18,1); + my $f19 = substr($result,19,1); + + $template->param(index => $index, + "f5$f5" => 1, + "f6$f6" => 1, + "f7$f7" => 1, + "f8$f8" => 1, + "f9$f9" => 1, + "f17$f17" => 1, + "f18$f18" => 1, + "f19$f19" => 1, + ); + print $input->header(-cookie => $cookie),$template->output; +} + +1; -- 2.20.1