From 566f12b4557958262934ec385aa2faa27739143b Mon Sep 17 00:00:00 2001 From: tipaul Date: Thu, 15 Jul 2004 09:46:31 +0000 Subject: [PATCH] Acquisition & Suggestion : * acquisition rewritte : create a aqbasket table to deal with "bookseller order header". * add "close basket" feature : a closed basket can't be modified * suggestion feature : manage suggestions in acquisition (after suggestion filled in OPAC) --- .../default/en/acqui/acqui-home.tmpl | 10 ++ .../default/en/acqui/basket.tmpl | 131 ++++++++++-------- .../default/en/acqui/newbiblio.tmpl | 71 +++++----- .../intranet-tmpl/default/en/acqui/order.tmpl | 107 +++++++------- .../default/en/acqui/suggestion-select.tmpl | 61 ++++++++ koha-tmpl/opac-tmpl/css/en/opac-main.tmpl | 2 +- .../opac-tmpl/css/en/opac-suggestions.tmpl | 8 +- updater/updatedatabase | 65 ++++++++- 8 files changed, 315 insertions(+), 140 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/default/en/acqui/suggestion-select.tmpl diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui/acqui-home.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui/acqui-home.tmpl index 9eb4367a4d..d8f37f7ed9 100644 --- a/koha-tmpl/intranet-tmpl/default/en/acqui/acqui-home.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/acqui/acqui-home.tmpl @@ -24,6 +24,16 @@ + +
+

Suggestions to check

+ suggestions waiting Manage + + No suggestions waiting + +
+
diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui/basket.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui/basket.tmpl index 8efd6b54a0..31c294d75d 100644 --- a/koha-tmpl/intranet-tmpl/default/en/acqui/basket.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/acqui/basket.tmpl @@ -1,62 +1,81 @@
-

Shopping Basket for >


- Our Reference: , # authorised by
-

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

New shopping Basket for >


+
+

Basket info

+

+

+

+

+

+ " class="button acquisition">Close +
+
+

Order

+ +
OrderPublisherIsbnTitleAuthor$ rrp$estQtyTotal
&id=&basket=">
+ + + + + + + + + + - - > - "> - - - - - - - - - - - - - - - - - -
OrderPublisherIsbnTitleAuthor$ rrp$estQtyTotal
-   - SubTotal
GST
TOTAL
- - "> - "> - Add order : enter keyword or title: - -
- + + "> + + + + &booksellerid=&basketno="> + + + + + + + + > + "> + + +   + + SubTotal + + + + GST + + + + TOTAL + + + + +

Basket empty

+ +
+
diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl index b7fad3ac06..e4d31a72e5 100644 --- a/koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/acqui/newbiblio.tmpl @@ -53,106 +53,113 @@ win.document.write("");
--> - "> - "> - "> - "> - "> - "> - "> - "> - "> - "> + "> + "> + "> + "> + "> + "> + "> + "> + "> + "> + "> " value=""> - View Basket -

- Order Details

+

+ + Modify order details (line #) + + New order + + (defined from suggestion #) +

Shopping Basket For

catalogue details

- + ">

- + " >

- + " >

- + ">

- +

- + ">

- + ">

- +

Accounting details

- + " onchange='update(this.form)' >

- +

- + " onchange='update(this.form)'>

- + " onchange='update(this.form)'>

- + " onchange='update(this.form)'>

- +

- +

- +

- +

- + ">

The 2 following fields are available for your own usage. They can be useful for stat purposes

- + ">

- + ">

diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui/order.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui/order.tmpl index ae54538070..7547462d91 100644 --- a/koha-tmpl/intranet-tmpl/default/en/acqui/order.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/acqui/order.tmpl @@ -1,53 +1,64 @@

-

Supplier Search Results

-
-

You searched on supplier , results found

- - - - - - - - - > - - - - + + + + + + + +
OrderReceiveCompany - - - - - - - -
BasketItemsStaffDate
- -
- - /images/mail_send.png" title="Add order" ALT="Add" BORDER=0 > - - Inactive - - - /images/mail_get.png" title="receive" ALT="Add" BORDER=0 > - - - +

Supplier Search Results

+
+

You searched on supplier , results found

+
+ + + + + + + + + + + + + + + + + - -
OrderReceiveSupplier +   +
+ + /images/mail_send.png" title="Add order" ALT="Add" BORDER=0 > + + Inactive + + + /images/mail_get.png" title="receive" ALT="Add" BORDER=0 > + + - - - - + + + + + - -
">BasketItemsCreated byDate 
-
- -
-Add supplier + +
+ + closed on + + " class="button acquisition">modify + +
+ + + +
+ Add supplier +
diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui/suggestion-select.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui/suggestion-select.tmpl new file mode 100644 index 0000000000..4fa8155691 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/default/en/acqui/suggestion-select.tmpl @@ -0,0 +1,61 @@ + +
+ + +

Suggestions

+ + + + + + + + + + + + + + + + + + + + + + + +
SuggestionSuggested byAccepted by 
+

Filter on : + title: "> + author: "> + publisher: "> +

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

-

+

+ copy. year: + volume: + ISBN : +
published by: + in + at +

()

+
class="hilighted"> + , + class="hilighted"> + , + class="hilighted"> + &basket=&suggestionid=" class="button acquisition">Order +
+
+ + +
+ \ No newline at end of file diff --git a/koha-tmpl/opac-tmpl/css/en/opac-main.tmpl b/koha-tmpl/opac-tmpl/css/en/opac-main.tmpl index 61db69172a..8a13f96a19 100644 --- a/koha-tmpl/opac-tmpl/css/en/opac-main.tmpl +++ b/koha-tmpl/opac-tmpl/css/en/opac-main.tmpl @@ -9,7 +9,7 @@
- koha + koha
diff --git a/koha-tmpl/opac-tmpl/css/en/opac-suggestions.tmpl b/koha-tmpl/opac-tmpl/css/en/opac-suggestions.tmpl index 9e5bfcd3a3..e8c766c327 100644 --- a/koha-tmpl/opac-tmpl/css/en/opac-suggestions.tmpl +++ b/koha-tmpl/opac-tmpl/css/en/opac-suggestions.tmpl @@ -8,8 +8,12 @@

-

-

+

+

+

+

+

+

diff --git a/updater/updatedatabase b/updater/updatedatabase index 26d9aed7ba..d712e437d9 100755 --- a/updater/updatedatabase +++ b/updater/updatedatabase @@ -286,7 +286,7 @@ my %requiretables = ( KEY sndx_word (sndx_word) )", suggestions => "( - suggestionnumber int(8) NOT NULL auto_increment, + suggestionid int(8) NOT NULL auto_increment, suggestedby int(11) NOT NULL default '0', managedby int(11) default NULL, status varchar(10) NOT NULL default '', @@ -296,11 +296,23 @@ my %requiretables = ( copyrightdate smallint(6) default NULL, publishercode varchar(255) default NULL, date timestamp(8) NOT NULL, + volumedesc char(255) default NULL, + publicationyear smallint(6) default NULL, + place char(255) default NULL, + isbn char(10) default NULL, mailoverseeing smallint(1) default 0, PRIMARY KEY (suggestionnumber), KEY suggestedby (suggestedby), KEY managedby (managedby) )", + aqbasket => "(basketno int(11) NOT NULL auto_increment, + creationdate date, + closedate date, + booksellerid varchar(10), + authorisedby varchar(10), + booksellerinvoicenumber text, + PRIMARY KEY (basketno) + )", ); my %requirefields = ( @@ -369,6 +381,14 @@ my %dropable_table = ( serialissues => 'serialissues', ); +my %uselessfields = ( + aqorders => "requisitionedby,authorisedby,booksellerid, + deliverydays,followupdays, + numberfollowupsallowed,numberfollowupssent, + dateprinted,sourced,quantityreceiveddamaged, + subscriptionfrom,subscriptionto + " + ); # the other hash contains other actions that can't be done elsewhere. they are done # either BEFORE of AFTER everything else, depending on "when" entry (default => AFTER) @@ -1200,6 +1220,26 @@ if ($marc_word{subfieldid}) { } # Populate tables with required data +# fill aqbasket if it's empty and aqorder is not +# => it means it has just been created & must be filled +$sth = $dbh->prepare("select count(*) from aqbasket"); +$sth->execute; +if ($sth->fetchrow == 0) { + $sth = $dbh->prepare("select count(*) from aqorders"); + $sth->execute; + if ($sth->fetchrow >0) { + print "Populating new table aqbasket\n"; + print "IMPORTANT NOTE: error message \"Duplicate entry 'X' for key 1\" may appear. it should not be a real trouble\n"; + $sth=$dbh->prepare("select distinct basketno,booksellerid,authorisedby,entrydate,booksellerinvoicenumber from aqorders"); + $sth->execute; + my ($basketno,$booksellerid,$authorisedby,$entrydate,$booksellerinvoicenumber); + my $sth2 = $dbh->prepare("insert into aqbasket (basketno,creationdate,booksellerid,authorisedby,booksellerinvoicenumber) values (?,?,?,?,?)"); + while (($basketno,$booksellerid,$authorisedby,$entrydate,$booksellerinvoicenumber) = $sth->fetchrow) { + print "$basketno,$entrydate,$booksellerid,$authorisedby,$booksellerinvoicenumber\n"; + $sth2->execute($basketno,$entrydate,$booksellerid,$authorisedby,$booksellerinvoicenumber); + } + } +} foreach my $table ( keys %tabledata ) { print "Checking for data required in table $table...\n" unless $silent; my $tablerows = $tabledata{$table}; @@ -1244,11 +1284,34 @@ foreach my $table ( keys %tabledata ) { } } +# at last, remove useless fields +foreach $table ( keys %uselessfields ) { + my @fields = split /,/,$uselessfields{$table}; + foreach my $fieldtodrop (@fields) { + $fieldtodrop =~ s/\t//g; + $fieldtodrop =~ s/\n//g; + print "deleting $fieldtodrop field in $table...\n" unless $silent; + my $sth = $dbh->prepare("alter table $table drop $fieldtodrop"); + $sth->execute; + if ( $sth->err ) { + print "Error : $sth->errstr \n"; + $sth->finish; + } # if error + } +} # foreach + + $sth->finish; exit; # $Log$ +# Revision 1.91 2004/07/15 09:52:28 tipaul +# Acquisition & Suggestion : +# * acquisition rewritte : create a aqbasket table to deal with "bookseller order header". +# * add "close basket" feature : a closed basket can't be modified +# * suggestion feature : manage suggestions in acquisition (after suggestion filled in OPAC) +# # Revision 1.90 2004/07/06 08:24:18 tipaul # adding 2 free fields that can be used for sorting purposes # -- 2.39.5