Bug 14963 - Add the ability to suggest purchase from existing titles
Summary: Add the ability to suggest purchase from existing titles
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 14973
Blocks: 23590 24344 24345
  Show dependency treegraph
 
Reported: 2015-10-06 12:17 UTC by Iming Chan
Modified: 2020-05-18 11:34 UTC (History)
5 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
This enhancement adds the ability to create a new purchase suggestion from an existing catalogue record.
Version(s) released in:
20.05.00


Attachments
Bug 14963: Add the ability to suggest purchase on existing title (6.54 KB, patch)
2019-11-07 15:13 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14963: Set status=ORDERED for suggestions created from existing record (1.49 KB, patch)
2019-11-07 17:19 UTC, Jonathan Druart
Details | Diff | Splinter Review
Tiny gap before the new "Suggestion" link (20.33 KB, image/png)
2019-11-07 17:53 UTC, Séverine Queune
Details
Bug 14963: Fix ergonomic issue on small screen (730 bytes, patch)
2019-11-07 18:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14973: Check existing biblio when submitting a purchase suggestion (opac side) (18.14 KB, patch)
2019-11-08 11:10 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 14973: Check existing biblio when submitting a purchase suggestion (staff side) (10.15 KB, patch)
2019-11-08 11:10 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 14973: Do not skip validation step when submiting a suggestion - OPAC (1.49 KB, patch)
2019-11-08 11:10 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 14973: Remove double textarea for notes (1.95 KB, patch)
2019-11-08 11:10 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 14973: Remove double declaration of suggestions_loop (1.17 KB, patch)
2019-11-08 11:10 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 14973: Add missing filters in templates (13.84 KB, patch)
2019-11-08 11:10 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 14963: Add the ability to suggest purchase on existing title (6.66 KB, patch)
2019-11-08 11:10 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 14963: Set status=ORDERED for suggestions created from existing record (1.63 KB, patch)
2019-11-08 11:11 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 14963: Fix ergonomic issue on small screen (872 bytes, patch)
2019-11-08 11:11 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 14963: Add the ability to suggest purchase on existing title (6.73 KB, patch)
2019-11-08 11:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14963: Set status=ORDERED for suggestions created from existing record (1.68 KB, patch)
2019-11-08 11:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14963: Fix ergonomic issue on small screen (923 bytes, patch)
2019-11-08 11:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14963: Add the ability to suggest purchase on existing title (6.79 KB, patch)
2019-12-16 12:41 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 14963: Set status=ORDERED for suggestions created from existing record (1.73 KB, patch)
2019-12-16 12:41 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 14963: Fix ergonomic issue on small screen (980 bytes, patch)
2019-12-16 12:41 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Iming Chan 2015-10-06 12:17:41 UTC
Expand the existing Purchase Suggestion to cater for titles already found in the library catalogue.  Currently, it is impossible to link a suggestion to a matching catalogue record.  Some catalogue records may no longer have items/holdings attached (as they could have been deleted earlier).

Also it will be nice that titles accepted for purchase, also appear in OPAC with a similar remark to items on order (i.e. 1 item accepted for purchase).  This will prevent repeated suggestions of the same title from different users!
Comment 1 Séverine Queune 2019-09-11 13:07:05 UTC
The BULAC (http://www.bulac.fr/) would like to sponsore this development.

As long as “Change sponsored?” is set on “Seeking developer”, anyone wanting to quote us for the development of such a feature or just ask for more information is welcome to write to us: <sigb@bulac.fr>.
Comment 2 Jonathan Druart 2019-11-07 15:13:21 UTC Comment hidden (obsolete)
Comment 3 Séverine Queune 2019-11-07 17:04:02 UTC
Hi Jonathan,

I found 2 issues.

I have this software error : "Tag "" is not a valid tag. at /var/repositories/koha/C4/Suggestions.pm line 690." when I want to add a suggestion using the empty form (opac & staff client) and saving a suggestion modification on staff client (no problem using the checkbox and drop-down menu).

For suggestions made from an existing notice, suggestion status is not update after the adding to a basket (no problem for suggestions made from the empty form, and for the "Available" status after the receipt).

Except these point, everything seems very clear to me and respond to our needs, so thanks a lot !
Icon on opac is ok for me.
Comment 4 Jonathan Druart 2019-11-07 17:19:02 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2019-11-07 17:22:01 UTC
(In reply to Séverine Queune from comment #3)
> Hi Jonathan,
> 
> I found 2 issues.
> 
> I have this software error : "Tag "" is not a valid tag. at
> /var/repositories/koha/C4/Suggestions.pm line 690." when I want to add a
> suggestion using the empty form (opac & staff client) and saving a
> suggestion modification on staff client (no problem using the checkbox and
> drop-down menu).

I do not understand that one. There are 2 bugs opened with this error but no idea where the error comes from. Can you detail a bit more?
Reading the code it seems related to the item type.

(for the record)
685     my ($it_tag, $it_subfield) = GetMarcFromKohaField('biblioitems.itemtype', '');
686     if ($record->field( $it_tag )) {
687         $record->field( $it_tag )->add_subfields( $it_subfield => $suggestion->{itemtype} );
688     }
689     else {
690         $record->append_fields(
691             MARC::Field->new($it_tag, ' ', ' ', $it_subfield => $suggestion->{itemtype})
692         );
693     }



> For suggestions made from an existing notice, suggestion status is not
> update after the adding to a basket (no problem for suggestions made from
> the empty form, and for the "Available" status after the receipt).

Fixed!

> Except these point, everything seems very clear to me and respond to our
> needs, so thanks a lot !
> Icon on opac is ok for me.

Thanks!
Comment 6 Séverine Queune 2019-11-07 17:52:18 UTC
(In reply to Jonathan Druart from comment #5)
> (In reply to Séverine Queune from comment #3)
> > Hi Jonathan,
> > 
> > I found 2 issues.
> > 
> > I have this software error : "Tag "" is not a valid tag. at
> > /var/repositories/koha/C4/Suggestions.pm line 690." when I want to add a
> > suggestion using the empty form (opac & staff client) and saving a
> > suggestion modification on staff client (no problem using the checkbox and
> > drop-down menu).
> 
> I do not understand that one. There are 2 bugs opened with this error but no
> idea where the error comes from. Can you detail a bit more?
> Reading the code it seems related to the item type.
> 
> (for the record)
> 685     my ($it_tag, $it_subfield) =
> GetMarcFromKohaField('biblioitems.itemtype', '');
> 686     if ($record->field( $it_tag )) {
> 687         $record->field( $it_tag )->add_subfields( $it_subfield =>
> $suggestion->{itemtype} );
> 688     }
> 689     else {
> 690         $record->append_fields(
> 691             MARC::Field->new($it_tag, ' ', ' ', $it_subfield =>
> $suggestion->{itemtype})
> 692         );
> 693     }

Oh... Weird... In my instance, there is no field mapped to biblioitems.itemtype, but if  I add one, I can save the suggestion correctly.
Is it the expected / future behaviour ?
This a problem we don't have with 18.05.00 so we'll have to be be aware about adding a mapping for biblioitems.itemtype if so.

My second try was an on different computer with a different resolution screen, I noticed a tiny display issu with the new link in OPAC (see attachement). Sorry I missed that on first test.
Comment 7 Séverine Queune 2019-11-07 17:53:29 UTC
Created attachment 95174 [details]
Tiny gap before the new "Suggestion" link
Comment 8 Jonathan Druart 2019-11-07 18:15:31 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2019-11-07 18:19:15 UTC
(In reply to Séverine Queune from comment #6)
> (In reply to Jonathan Druart from comment #5)
> > (In reply to Séverine Queune from comment #3)
> > > Hi Jonathan,
> > > 
> > > I found 2 issues.
> > > 
> > > I have this software error : "Tag "" is not a valid tag. at
> > > /var/repositories/koha/C4/Suggestions.pm line 690." when I want to add a
> > > suggestion using the empty form (opac & staff client) and saving a
> > > suggestion modification on staff client (no problem using the checkbox and
> > > drop-down menu).
> > 
> > I do not understand that one. There are 2 bugs opened with this error but no
> > idea where the error comes from. Can you detail a bit more?
> > Reading the code it seems related to the item type.
> > 
> > (for the record)
> > 685     my ($it_tag, $it_subfield) =
> > GetMarcFromKohaField('biblioitems.itemtype', '');
> > 686     if ($record->field( $it_tag )) {
> > 687         $record->field( $it_tag )->add_subfields( $it_subfield =>
> > $suggestion->{itemtype} );
> > 688     }
> > 689     else {
> > 690         $record->append_fields(
> > 691             MARC::Field->new($it_tag, ' ', ' ', $it_subfield =>
> > $suggestion->{itemtype})
> > 692         );
> > 693     }
> 
> Oh... Weird... In my instance, there is no field mapped to
> biblioitems.itemtype, but if  I add one, I can save the suggestion correctly.
> Is it the expected / future behaviour ?
> This a problem we don't have with 18.05.00 so we'll have to be be aware
> about adding a mapping for biblioitems.itemtype if so.

I am not sure, but the code that is exploding comes from bug 14973 (so not pushed yet). Do you know why you do not have this mapping? Discussion should continue on bug 14973 if needed.

> My second try was an on different computer with a different resolution
> screen, I noticed a tiny display issu with the new link in OPAC (see
> attachement). Sorry I missed that on first test.

Fixed.
You will need to regenerate the CSS file to see the changes: yarn build --view opac
Comment 10 Séverine Queune 2019-11-08 11:10:37 UTC Comment hidden (obsolete)
Comment 11 Séverine Queune 2019-11-08 11:10:41 UTC Comment hidden (obsolete)
Comment 12 Séverine Queune 2019-11-08 11:10:44 UTC Comment hidden (obsolete)
Comment 13 Séverine Queune 2019-11-08 11:10:48 UTC Comment hidden (obsolete)
Comment 14 Séverine Queune 2019-11-08 11:10:51 UTC Comment hidden (obsolete)
Comment 15 Séverine Queune 2019-11-08 11:10:55 UTC Comment hidden (obsolete)
Comment 16 Séverine Queune 2019-11-08 11:10:59 UTC Comment hidden (obsolete)
Comment 17 Séverine Queune 2019-11-08 11:11:04 UTC Comment hidden (obsolete)
Comment 18 Séverine Queune 2019-11-08 11:11:08 UTC Comment hidden (obsolete)
Comment 19 Séverine Queune 2019-11-08 11:12:48 UTC
I'm sorry Jonathan, I missed everything with bug 14973 when I signed the present one...
#shameonme...
Comment 20 Jonathan Druart 2019-11-08 11:25:04 UTC
(In reply to Séverine Queune from comment #19)
> I'm sorry Jonathan, I missed everything with bug 14973 when I signed the
> present one...
> #shameonme...

I will fix that :)
Comment 21 Jonathan Druart 2019-11-08 11:27:22 UTC Comment hidden (obsolete)
Comment 22 Jonathan Druart 2019-11-08 11:27:27 UTC Comment hidden (obsolete)
Comment 23 Jonathan Druart 2019-11-08 11:27:33 UTC Comment hidden (obsolete)
Comment 24 Nick Clemens 2019-12-16 12:41:00 UTC
Created attachment 96322 [details] [review]
Bug 14963: Add the ability to suggest purchase on existing title

This patch adds the ability to create a new purchase suggestion from an
existing title. This will prevent the creation of bibliographic records
that already exist in the catalogue. Also it will ease the process
during acquisition.

Test plan:
- Login at the OPAC and go to the detail of a bibliographic record.
- Note that there is a new link "New purchase suggestion for this title"
on the right of the screen
- Please suggest an other icon if that one is not appropriated
- Click on it and submit your new suggestion
=> You should not get the confirmation screen (introduced by bug 14973)
warning you that the title already exists.
- Login staff side and order from this suggestion.
- Receive items and confirm that a new bibliographic record is not
created.

Sponsored-by: BULAC - http://www.bulac.fr/

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 25 Nick Clemens 2019-12-16 12:41:03 UTC
Created attachment 96323 [details] [review]
Bug 14963: Set status=ORDERED for suggestions created from existing record

Sponsored-by: BULAC - http://www.bulac.fr/

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 26 Nick Clemens 2019-12-16 12:41:05 UTC
Created attachment 96324 [details] [review]
Bug 14963: Fix ergonomic issue on small screen

Sponsored-by: BULAC - http://www.bulac.fr/

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 27 Martin Renvoize 2020-01-02 13:16:03 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 28 Katrin Fischer 2020-01-02 22:10:08 UTC
What do you think of using a little 'present' icon instead of the money (bill) icon?

Also we could slightly rephrase it to make it shorter: 

Currently:
New purchase suggestion for this title

Suggestion:
Suggest for purchase
Comment 29 Owen Leonard 2020-01-04 23:16:05 UTC
Bug 24344
Comment 30 Joy Nelson 2020-01-12 21:08:28 UTC
New feature.  Not backported to 19.11.x