Bugzilla – Attachment 7830 Details for
Bug 4969
Vendors can not be deleted / show only active vendors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch #3
0001-Bug-4969-deletion-of-booksellers.patch (text/plain), 3.62 KB, created by
Adrien SAURAT
on 2012-02-23 14:22:55 UTC
(
hide
)
Description:
proposed patch #3
Filename:
MIME Type:
Creator:
Adrien SAURAT
Created:
2012-02-23 14:22:55 UTC
Size:
3.62 KB
patch
obsolete
>From 8ab68a03f218cacab976d8d1dbdc93a526fb2c1d Mon Sep 17 00:00:00 2001 >From: Adrien Saurat <adrien.saurat@biblibre.com> >Date: Thu, 23 Feb 2012 15:18:48 +0100 >Subject: [PATCH] Bug 4969: deletion of booksellers > >Is a vendor has no basket/subscription link, it can now >be deleted (after a JS confirmation). >--- > C4/Bookseller.pm | 5 +++++ > acqui/supplier.pl | 7 ++++++- > .../prog/en/includes/acquisitions-toolbar.inc | 11 +++++++++++ > 3 files changed, 22 insertions(+), 1 deletions(-) > >diff --git a/C4/Bookseller.pm b/C4/Bookseller.pm >index 6a91f99..a36c909 100644 >--- a/C4/Bookseller.pm >+++ b/C4/Bookseller.pm >@@ -85,6 +85,11 @@ sub GetBookSellerFromId { > 'SELECT count(*) FROM aqbasket where booksellerid = ?', > {}, $id ); > } >+ if ($vendor) { >+ ( $vendor->{subscriptioncount} ) = $dbh->selectrow_array( >+ 'SELECT count(*) FROM subscription WHERE aqbooksellerid = ?', >+ {}, $id ); >+ } > return $vendor; > } > >diff --git a/acqui/supplier.pl b/acqui/supplier.pl >index 3faa560..ef6eedd 100755 >--- a/acqui/supplier.pl >+++ b/acqui/supplier.pl >@@ -114,10 +114,15 @@ if ( $op eq 'display' ) { > GST => $tax_rate, > default_tax => defined($seller_gstrate), > basketcount => $supplier->{'basketcount'}, >+ subscriptioncount => $supplier->{'subscriptioncount'}, > contracts => $contracts, > ); > } elsif ( $op eq 'delete' ) { >- DelBookseller($id); >+ # no further message needed for the user >+ # the DELETE button only appears in the template if basketcount == 0 >+ if ( $supplier->{'basketcount'} == 0 ) { >+ DelBookseller($id); >+ } > print $query->redirect('/cgi-bin/koha/acqui/acqui-home.pl'); > exit; > } else { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc >index f81b303..baa1909 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc >@@ -1,6 +1,13 @@ > <div id="toolbar"><script type="text/javascript"> > //<![CDATA[ > >+function confirm_deletion() { >+ var is_confirmed = window.confirm(_('Are you sure you want to delete this bookseller? This cannot be undone.')); >+ if (is_confirmed) { >+ window.location='/cgi-bin/koha/acqui/supplier.pl?supplierid=[% id %]&op=delete'; >+ } >+} >+ > // prepare DOM for YUI Toolbar > > $(document).ready(function() { >@@ -16,6 +23,7 @@ > new YAHOO.widget.Button("newsupplier"); > new YAHOO.widget.Button("newbasket"); > new YAHOO.widget.Button("editsupplier"); >+ new YAHOO.widget.Button("deletesupplier"); > new YAHOO.widget.Button("receive"); > new YAHOO.widget.Button("newcontract"); > new YAHOO.widget.Button("editcontracts"); >@@ -46,6 +54,9 @@ > [% IF ( id ) %] > [% IF ( CAN_user_acquisition_vendors_manage ) %] > <li><a id="editsupplier" href="/cgi-bin/koha/acqui/supplier.pl?supplierid=[% id %]&op=enter">Edit</a></li> >+ [% UNLESS ( basketcount OR subscriptioncount ) %] >+ <li><a id="deletesupplier" href="javascript:confirm_deletion()">Delete</a></li> >+ [% END %] > <li><a id="newcontract" href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&booksellerid=[% id %]">New Contract</a></li> > <li><a id="editcontracts" href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% id %]">Contracts</a></li> > [% UNLESS ( basketcount ) %] >-- >1.7.4.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 4969
:
7398
|
7532
|
7830
|
7982
|
8071
|
8072
|
60803
|
60807
|
60893
|
60894
|
60895
|
60896