Bugzilla – Attachment 7982 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 #4
0001-Bug-4969-deletion-of-suppliers.patch (text/plain), 3.27 KB, created by
Adrien SAURAT
on 2012-03-02 13:26:12 UTC
(
hide
)
Description:
proposed patch #4
Filename:
MIME Type:
Creator:
Adrien SAURAT
Created:
2012-03-02 13:26:12 UTC
Size:
3.27 KB
patch
obsolete
>From 333d9071448709e5778deb85105cc698ba124176 Mon Sep 17 00:00:00 2001 >From: Adrien Saurat <adrien.saurat@biblibre.com> >Date: Fri, 2 Mar 2012 14:23:17 +0100 >Subject: [PATCH] Bug 4969: deletion of suppliers > >If a vendor/bookseller has no basket/subscription link, it can now >be deleted (after a JS confirmation). >--- > C4/Bookseller.pm | 3 +++ > acqui/supplier.pl | 7 ++++++- > .../prog/en/includes/acquisitions-toolbar.inc | 4 ++++ > 3 files changed, 13 insertions(+), 1 deletions(-) > >diff --git a/C4/Bookseller.pm b/C4/Bookseller.pm >index 6a91f99..f14bd02 100644 >--- a/C4/Bookseller.pm >+++ b/C4/Bookseller.pm >@@ -84,6 +84,9 @@ sub GetBookSellerFromId { > ( $vendor->{basketcount} ) = $dbh->selectrow_array( > 'SELECT count(*) FROM aqbasket where booksellerid = ?', > {}, $id ); >+ ( $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 8896b3b..fdeef06 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($booksellerid); >+ # no further message needed for the user >+ # the DELETE button only appears in the template if basketcount == 0 >+ if ( $supplier->{'basketcount'} == 0 ) { >+ DelBookseller($booksellerid); >+ } > 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 37cdf7c..d8e2c1e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc >@@ -16,6 +16,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 +47,9 @@ > [% IF ( booksellerid ) %] > [% IF ( CAN_user_acquisition_vendors_manage ) %] > <li><a id="editsupplier" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]&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=[% booksellerid %]">New Contract</a></li> > <li><a id="editcontracts" href="/cgi-bin/koha/admin/aqcontract.pl?booksellerid=[% booksellerid %]">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