Bugzilla – Attachment 11600 Details for
Bug 7992
new plugin about Automatic Number incrementing inventory. Prefix management from a authorised values list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7992: Followup use ajax with jQuery instead of YUI
Bug-7992-Followup-use-ajax-with-jQuery-instead-of-.patch (text/plain), 2.66 KB, created by
Jonathan Druart
on 2012-08-14 10:18:17 UTC
(
hide
)
Description:
Bug 7992: Followup use ajax with jQuery instead of YUI
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-08-14 10:18:17 UTC
Size:
2.66 KB
patch
obsolete
>From a17f7df40957ac3daac71b6536b0afbab35b7252 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 14 Aug 2012 12:17:50 +0200 >Subject: [PATCH] Bug 7992: Followup use ajax with jQuery instead of YUI > >--- > cataloguing/value_builder/stocknumberam123.pl | 25 ++++++++++++++----------- > 1 files changed, 14 insertions(+), 11 deletions(-) > >diff --git a/cataloguing/value_builder/stocknumberam123.pl b/cataloguing/value_builder/stocknumberam123.pl >index dc589b8..f2de8c1 100755 >--- a/cataloguing/value_builder/stocknumberam123.pl >+++ b/cataloguing/value_builder/stocknumberam123.pl >@@ -17,8 +17,7 @@ > # with Koha; if not, write to the Free Software Foundation, Inc., > # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > >-use strict; >-use warnings; >+use Modern::Perl; > use C4::Auth; > use CGI; > use C4::Context; >@@ -42,7 +41,7 @@ sub plugin_parameters { > > sub plugin_javascript { > my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; >- my $res=" >+ my $res = qq{ > <script type='text/javascript'> > function Focus$field_number() { > return 1; >@@ -54,19 +53,22 @@ sub plugin_javascript { > > function Clic$field_number() { > var code = document.getElementById('$field_number'); >- var url = '../cataloguing/plugin_launcher.pl?plugin_name=stocknumberam123.pl&code=' + code.value; >- var blurcallbackstocknumber = { >- success: function(o) { >+ \$.ajax({ >+ url: '/cgi-bin/koha/cataloguing/plugin_launcher.pl', >+ type: 'POST', >+ data: { >+ 'plugin_name': 'stocknumberam123.pl', >+ 'code' : code.value, >+ }, >+ success: function(data){ > var field = document.getElementById('$field_number'); >- field.value = o.responseText; >+ field.value = data; > return 1; > } >- } >- var transaction = YAHOO.util.Connect.asyncRequest('GET',url, blurcallbackstocknumber, null); >- return 1; >+ }); > } > </script> >- "; >+ }; > > return ($field_number,$res); > } >@@ -88,6 +90,7 @@ sub plugin { > my $dbh = C4::Context->dbh; > > # If a prefix is submited, we look for the highest stocknumber with this prefix, and return it incremented >+ $code =~ s/ *$//g; > if ( $code =~ m/^[A-Z]+$/ ) { > my $sth = $dbh->prepare("SELECT lib FROM authorised_values WHERE category='INVENTORY' AND authorised_value=?"); > $sth->execute( $code); >-- >1.7.7.3
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 7992
:
9402
|
9868
|
11600
|
11893
|
11895
|
11896
|
11897