From cf802b5ad8c82f261838063712fca31d830b32ea Mon Sep 17 00:00:00 2001 From: tipaul Date: Mon, 8 Dec 2003 16:27:10 +0000 Subject: [PATCH] new feature : recent acquisition in opac. --- C4/Search.pm | 32 ++- koha-tmpl/opac-tmpl/default/en/opac-main.tmpl | 191 ++++++++--------- .../default/en/opac-searchresults.tmpl | 6 +- koha-tmpl/opac-tmpl/default/fr/opac-auth.tmpl | 6 +- .../opac-tmpl/default/fr/opac-detail.tmpl | 24 +-- koha-tmpl/opac-tmpl/default/fr/opac-main.tmpl | 193 ++++++++---------- .../opac-tmpl/default/fr/opac-moredetail.tmpl | 58 +++--- .../opac-tmpl/default/fr/opac-reserve.tmpl | 20 +- .../opac-tmpl/default/fr/opac-search.tmpl | 6 +- .../default/fr/opac-searchresults.tmpl | 8 +- koha-tmpl/opac-tmpl/default/fr/opac-user.tmpl | 6 +- .../opac-tmpl/default/fr/opac-userupdate.tmpl | 2 +- koha-tmpl/opac-tmpl/default/fr/subject.tmpl | 2 +- opac/opac-main.pl | 25 ++- opac/opac-new.pl | 79 +++++++ 15 files changed, 369 insertions(+), 289 deletions(-) create mode 100755 opac/opac-new.pl diff --git a/C4/Search.pm b/C4/Search.pm index 6dad7400ba..2625a288e3 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -56,7 +56,9 @@ on what is passed to it, it calls the appropriate search function. =cut @ISA = qw(Exporter); -@EXPORT = qw(&CatSearch &BornameSearch &ItemInfo &KeywordSearch &subsearch +@EXPORT = qw( +&newsearch +&CatSearch &BornameSearch &ItemInfo &KeywordSearch &subsearch &itemdata &bibdata &GetItems &borrdata &itemnodata &itemcount &borrdata2 &NewBorrowerNumber &bibitemdata &borrissues &getboracctrecord &ItemType &itemissues &subject &subtitle @@ -65,6 +67,34 @@ on what is passed to it, it calls the appropriate search function. &isbnsearch &breedingsearch &getallthemes &getalllanguages &getbranchname &getborrowercategory); # make all your functions, whether exported or not; + +=item newsearch + my (@results) = newsearch($itemtype,$duration,$number_of_results,$startfrom); +c find biblio acquired recently (last 30 days) +=cut +sub newsearch { + my ($itemtype,$duration,$num,$offset)=@_; + + my $dbh = C4::Context->dbh; + my $sth=$dbh->prepare("SELECT to_days( now( ) ) - to_days( dateaccessioned ) AS duration, biblio.biblionumber, barcode, title, author, classification, itemtype, dewey, dateaccessioned, price, replacementprice + FROM items, biblio, biblioitems + WHERE biblio.biblionumber = biblioitems.biblionumber AND + items.biblionumber = biblio.biblionumber AND + to_days( now( ) ) - to_days( dateaccessioned ) < ? and itemtype=? + ORDER BY duration ASC "); + $sth->execute($duration,$itemtype); + my $i=0; + my @result; + while (my $line = $sth->fetchrow_hashref) { + if ($i>=$offset && $i+$offset<$num) { + push @result,$line; + } + $i++ + } + return(@result); + +} + =item findguarantees ($num_children, $children_arrayref) = &findguarantees($parent_borrno); diff --git a/koha-tmpl/opac-tmpl/default/en/opac-main.tmpl b/koha-tmpl/opac-tmpl/default/en/opac-main.tmpl index 450051cb1f..802ca29ca1 100644 --- a/koha-tmpl/opac-tmpl/default/en/opac-main.tmpl +++ b/koha-tmpl/opac-tmpl/default/en/opac-main.tmpl @@ -6,6 +6,15 @@ @@ -14,121 +23,85 @@ input{font-size:16px}
- - - - +
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
 - Koha
- Free Software ILS

- Koha : a gift, a contribution
in Maori
-
Search the catalogue
   
- -
- - Type in the box and press the enter key.
- - - -Advanced Search, More Options
- -  -

- -

Logged in as: [Members Home][Log Out]

- -

Log In to Koha

- -
- -
-

diff --git a/koha-tmpl/opac-tmpl/default/en/opac-searchresults.tmpl b/koha-tmpl/opac-tmpl/default/en/opac-searchresults.tmpl index c82a5ce031..d22202166e 100644 --- a/koha-tmpl/opac-tmpl/default/en/opac-searchresults.tmpl +++ b/koha-tmpl/opac-tmpl/default/en/opac-searchresults.tmpl @@ -12,7 +12,11 @@ You searched on - You did not specify any seach criteria
+ + acquired in the last days
+ + You did not specify any seach criteria
+
results found diff --git a/koha-tmpl/opac-tmpl/default/fr/opac-auth.tmpl b/koha-tmpl/opac-tmpl/default/fr/opac-auth.tmpl index d572141c8d..56d68594d0 100755 --- a/koha-tmpl/opac-tmpl/default/fr/opac-auth.tmpl +++ b/koha-tmpl/opac-tmpl/default/fr/opac-auth.tmpl @@ -1,7 +1,7 @@ -

INTERDIT

+

Désolé, je pense que vous n'avez pas les permissions suffisantes.

@@ -34,8 +34,8 @@ - - + +
Identifiant Koha
N° de carte
Mot de passe :
N° de carte:
Mot de passe ::
diff --git a/koha-tmpl/opac-tmpl/default/fr/opac-detail.tmpl b/koha-tmpl/opac-tmpl/default/fr/opac-detail.tmpl index 96fc447c6c..fa63564d85 100755 --- a/koha-tmpl/opac-tmpl/default/fr/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/default/fr/opac-detail.tmpl @@ -1,7 +1,7 @@ -

Connecté en tant que : [Accueil lecteur][Déconnecter]

+

Connecté en tant que: [Accueil lecteur][Déconnecter]

S'identifier à Koha

@@ -25,22 +25,22 @@ - Sous-titre - Auteur ">
- Autres auteurs
- Publié par + Sous-titre: + Auteur: ">
+ Autres auteurs:
+ Publié par : dans , ,
Collection:
- Sujet :
+ Sujet:
Année :
- Notes
- Titre unifié
- Périodique
+ Notes:
+ Titre unifié:
+ Périodique:
Dewey:
- URL ">
- Nombre total d'exemplaires + URL: ">
+ Nombre total d'exemplaires:
@@ -48,7 +48,7 @@ - + diff --git a/koha-tmpl/opac-tmpl/default/fr/opac-main.tmpl b/koha-tmpl/opac-tmpl/default/fr/opac-main.tmpl index 7422de8cf1..3df50b3980 100755 --- a/koha-tmpl/opac-tmpl/default/fr/opac-main.tmpl +++ b/koha-tmpl/opac-tmpl/default/fr/opac-main.tmpl @@ -1,11 +1,20 @@ -Bienvenue dans l'OPAC de Koha +WELCOME TO THE KOHA OPAC @@ -14,121 +23,85 @@ input{font-size:16px}
Type d'ouvrageType d'ouvrage : Classe Localisation Date retour
- - - - +
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
 - Koha
- SIGB sous licence libre

- Koha : un don, une contribution
en langue Maori
-
Chercher dans le catalogue
   
- -
- - Saisissez et validez avec Entrée
- - - -Recherche avancée
- -  -

- -

Connecté en tant que : [Accueil lecteur][Déconnecter]

- -

S'identifier

- -
- -
-

diff --git a/koha-tmpl/opac-tmpl/default/fr/opac-moredetail.tmpl b/koha-tmpl/opac-tmpl/default/fr/opac-moredetail.tmpl index 5bc13c1535..a4f8244c9a 100755 --- a/koha-tmpl/opac-tmpl/default/fr/opac-moredetail.tmpl +++ b/koha-tmpl/opac-tmpl/default/fr/opac-moredetail.tmpl @@ -1,7 +1,7 @@

-

Connecté en tant que : [Accueil lecteur][Déconnecter]

+

Connecté en tant que: [Accueil lecteur][Déconnecter]

S'identifier à Koha

@@ -29,26 +29,26 @@ href=/cgi-bin/koha/detail.pl?bib=&type=intra> - +
-Numéro notice :
-Type d'ouvrage :
-URL
-Durée prêt
-Coût du prêt
+Numéro notice ::
+Type d'ouvrage ::
+URL:
+Durée prêt:
+Coût du prêt:
Classification:
ISBN:
-Editions
-Place:
+Editions:
+Placer:
Date:
Volume:
Pages:
Illus:
-Taille
-Notes
-N° ouvrage +Taille:
+Notes:
+N° ouvrage:
@@ -70,31 +70,31 @@ BORDER=0 src="/images/delete-mem.gif"> > - +
-Annexe propriétaire
-Vu :
-Dernier prêt
+Annexe propriétaire:
+Vu:
+Dernier prêt:
on issue bit -Dernier emprunteur 1
-Dernier emprunteur 2
-Annexe
-Coût de remplacement
-Ouvrage perdu
-Payé pour :
-Notes
-Renouvellements
+Dernier emprunteur 1:
+Dernier emprunteur 2:
+Annexe:
+Coût de remplacement:
+Ouvrage perdu:
+Payé pour ::
+Notes:
+Renouvellements:
&biblio=&invoice=&catview=yes"> Accession Date:
-Annul?
+Annul?:
&bi=&itm=>Total Issues:
-Numéro groupe :
-Notice biblio :
+Groupe numéro:
+Notice biblio ::
diff --git a/koha-tmpl/opac-tmpl/default/fr/opac-reserve.tmpl b/koha-tmpl/opac-tmpl/default/fr/opac-reserve.tmpl index fc8deb5b15..10d2397ee5 100755 --- a/koha-tmpl/opac-tmpl/default/fr/opac-reserve.tmpl +++ b/koha-tmpl/opac-tmpl/default/fr/opac-reserve.tmpl @@ -3,7 +3,7 @@
-

Connecté en tant que : [Accueil lecteur][Déconnecter]

+

Connecté en tant que: [Accueil lecteur][Déconnecter]

S'identifier à Koha

@@ -12,7 +12,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/koha-tmpl/opac-tmpl/default/fr/opac-searchresults.tmpl b/koha-tmpl/opac-tmpl/default/fr/opac-searchresults.tmpl index 8214e0d436..cf41844797 100755 --- a/koha-tmpl/opac-tmpl/default/fr/opac-searchresults.tmpl +++ b/koha-tmpl/opac-tmpl/default/fr/opac-searchresults.tmpl @@ -3,7 +3,7 @@
-

Connecté en tant que : [Accueil lecteur][Déconnecter]

+

Connecté en tant que: [Accueil lecteur][Déconnecter]

S'identifier à Koha

@@ -12,7 +12,11 @@ Recherche effectuée sur - Vous n'avez pas spécifié de critère
+ + acquis dans les derniers jours
+ + Vous n'avez pas spécifié de critère
+
Réponses trouvées diff --git a/koha-tmpl/opac-tmpl/default/fr/opac-user.tmpl b/koha-tmpl/opac-tmpl/default/fr/opac-user.tmpl index 274e1a87e0..315eee8fac 100755 --- a/koha-tmpl/opac-tmpl/default/fr/opac-user.tmpl +++ b/koha-tmpl/opac-tmpl/default/fr/opac-user.tmpl @@ -7,7 +7,7 @@
- @@ -75,7 +75,7 @@ diff --git a/koha-tmpl/opac-tmpl/default/fr/opac-userupdate.tmpl b/koha-tmpl/opac-tmpl/default/fr/opac-userupdate.tmpl index ce80496d48..8cf3b0c83e 100755 --- a/koha-tmpl/opac-tmpl/default/fr/opac-userupdate.tmpl +++ b/koha-tmpl/opac-tmpl/default/fr/opac-userupdate.tmpl @@ -1,7 +1,7 @@ -

Connecté en tant que : [Déconnecter]

+

Connecté en tant que: [Déconnecter]

S'identifier à Koha

diff --git a/koha-tmpl/opac-tmpl/default/fr/subject.tmpl b/koha-tmpl/opac-tmpl/default/fr/subject.tmpl index c0d23f9d3b..06ab01f54c 100755 --- a/koha-tmpl/opac-tmpl/default/fr/subject.tmpl +++ b/koha-tmpl/opac-tmpl/default/fr/subject.tmpl @@ -2,7 +2,7 @@ -

Connecté en tant que : [Déconnecter]

+

Connecté en tant que: [Déconnecter]

S'identifier à Koha

diff --git a/opac/opac-main.pl b/opac/opac-main.pl index 9e253058b0..ec22c7f1fd 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -7,14 +7,31 @@ use HTML::Template; use C4::Auth; # get_template_and_user use C4::Interface::CGI::Output; -my $query = new CGI; +my $input = new CGI; +my $dbh = C4::Context->dbh; +my $query="Select itemtype,description from itemtypes order by description"; +my $sth=$dbh->prepare($query); +$sth->execute; +my @itemtype; +my %itemtypes; +while (my ($value,$lib) = $sth->fetchrow_array) { + push @itemtype, $value; + $itemtypes{$value}=$lib; +} -my ($template, $borrowernumber, $cookie) +my $CGIitemtype=CGI::scrolling_list( -name => 'itemtype', + -values => \@itemtype, + -labels => \%itemtypes, + -size => 1, + -multiple => 0 ); +$sth->finish; +my ($template, $borrowernumber, $cookie) = get_template_and_user({template_name => "opac-main.tmpl", - query => $query, type => "opac", + query => $input, authnotrequired => 1, flagsrequired => {borrow => 1}, }); -output_html_with_http_headers $query, $cookie, $template->output; +$template->param(CGIitemtype => $CGIitemtype); +output_html_with_http_headers $input, $cookie, $template->output; diff --git a/opac/opac-new.pl b/opac/opac-new.pl new file mode 100755 index 0000000000..4449e57636 --- /dev/null +++ b/opac/opac-new.pl @@ -0,0 +1,79 @@ +#!/usr/bin/perl +use strict; +require Exporter; +use CGI; +use C4::Search; +use C4::Auth; +use C4::Interface::CGI::Output; +use HTML::Template; + +my $query=new CGI; +my ($template, $borrowernumber, $cookie) + = get_template_and_user({template_name => "opac-searchresults.tmpl", + query => $query, + type => "opac", + authnotrequired => 1, + flagsrequired => {borrow => 1}, + }); + + + + +my $itemtype=$query->param('itemtype'); +my $duration =$query->param('duration'); +my $number_of_results = 20; + +my $startfrom = $query->param('startfrom'); +($startfrom) || ($startfrom=0); +my $subjectitems=$query->param('subjectitems'); +my (@results) = newsearch($itemtype,$duration,$number_of_results,$startfrom); +my $count= $#results+1; +my $num = 1; +foreach my $res (@results) { + my @items = ItemInfo(undef, $res->{'biblionumber'}, "intra"); + my $norequests = 1; + foreach my $itm (@items) { + $norequests = 0 unless $itm->{'notforloan'}; + } + $res->{'norequests'} = $norequests; + # set up the even odd elements.... + $res->{'even'} = 1 if $num % 2 == 0; + $res->{'odd'} = 1 if $num % 2 == 1; + $num++; +} + +my $resultsarray=\@results; +($resultsarray) || (@$resultsarray=()); + +# sorting out which results to display. +$template->param(startfrom => $startfrom+1); +($startfrom+$num<=$count) ? ($template->param(endat => $startfrom+$num)) : ($template->param(endat => $count)); +$template->param(numrecords => $count); +my $nextstartfrom=($startfrom+$num<$count) ? ($startfrom+$num) : (-1); +my $prevstartfrom=($startfrom-$num>=0) ? ($startfrom-$number_of_results) : (-1); +my $displaynext=($nextstartfrom==-1) ? 0 : 1; +my $displayprev=($prevstartfrom==-1) ? 0 : 1; +$template->param(nextstartfrom => $nextstartfrom, + displaynext => $displaynext, + displayprev => $displayprev, + prevstartfrom => $prevstartfrom, + searchnew => 1, + itemtype => ItemType($itemtype), + duration => $duration); + +$template->param(SEARCH_RESULTS => $resultsarray); + +my $numbers; +@$numbers = (); +if ($count>$number_of_results) { + for (my $i=1; $i<$count/$number_of_results+1; $i++) { + my $highlight=0; + my $themelang = $template->param('themelang'); + ($startfrom==($i-1)*$number_of_results+1) && ($highlight=1); + push @$numbers, { number => $i, highlight => $highlight , startfrom => ($i-1)*$number_of_results+1 }; + } +} + +$template->param(numbers => $numbers); + +output_html_with_http_headers $query, $cookie, $template->output; -- 2.20.1
- Vous ne pouvez réserver parce que vous devez .
+ Sorry, you cannot make reserves because you owe .
Impossible de faire plus de Réservations
Vous avez déjà placé une réservation sur cet exemplaire
Vous devez sélectionner au moins 1 type d'exemplaire
@@ -21,7 +21,7 @@ -

Réservation de l'ouvrage : ( )

+

Réservation de l'ouvrage :: ( )

Il y a Réservations déjà faites sur cet ouvrage

Sélectionnez les types d'ouvrages souhaités. Le premier disponible sera gardé pour vous.

@@ -31,7 +31,7 @@ - + @@ -47,12 +47,12 @@
ReserverType d'ouvrageType d'ouvrage : Copies

- Sélectionnez l'annexe ou vous prendrez l'ouvrage + Sélectionnez l'annexe ou vous prendrez l'ouvrage:

- + @@ -64,7 +64,7 @@ - + @@ -83,7 +83,7 @@ -

Confirmez que vous souhaitez réserver un ouvrage :

+

Confirmez que vous souhaitez réserver un ouvrage ::

@@ -92,7 +92,7 @@

Réserver à cette date :Réserver à cette date ::
Annuler réservation à cette dateAnnuler réservation à cette date:
- + @@ -101,7 +101,7 @@
Type d'ouvrageType d'ouvrage :
- Qui sera retiré ? .
+ Qui sera retiré à .

Il y aura des frais de réservation de $
diff --git a/koha-tmpl/opac-tmpl/default/fr/opac-search.tmpl b/koha-tmpl/opac-tmpl/default/fr/opac-search.tmpl index 44f9060d45..148b4b9e38 100755 --- a/koha-tmpl/opac-tmpl/default/fr/opac-search.tmpl +++ b/koha-tmpl/opac-tmpl/default/fr/opac-search.tmpl @@ -1,7 +1,7 @@ -

Connecté en tant que : [Accueil lecteur][Déconnecter]

+

Connecté en tant que: [Accueil lecteur][Déconnecter]

S'identifier à Koha

@@ -19,7 +19,7 @@
OUOU :
Sujet
OU un ou plus de :OU un ou plus de : :
Est-ce correct?
Carte lecteur
+
Carte lecteur:
()
,
(hm)
@@ -67,7 +67,7 @@
- Vouas avez des réservations en attente + Vous avez des réservations en attente:

- Prendre à : + Prendre à ::