Bugzilla – Attachment 21575 Details for
Bug 10240
Offline circulation using HTML5 and IndexedDB
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10240 follow-up: don't delete transactions if auth fails
Bug-10240-follow-up-dont-delete-transactions-if-au.patch (text/plain), 2.68 KB, created by
Chris Cormack
on 2013-09-29 05:25:27 UTC
(
hide
)
Description:
Bug 10240 follow-up: don't delete transactions if auth fails
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2013-09-29 05:25:27 UTC
Size:
2.68 KB
patch
obsolete
>From 0a74168ad991faf885aa4c1018eed453fceed7f7 Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Wed, 10 Jul 2013 15:51:50 -0400 >Subject: [PATCH] Bug 10240 follow-up: don't delete transactions if auth fails > >When uploading transactions, we were not checking that authentication >had succeeded before deleting the transactions from the local database. >That was bad. With this patch, we check. That is good. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > .../intranet-tmpl/prog/en/modules/circ/offline.tt | 30 ++++++++++++++-------- > 1 file changed, 20 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt >index f2e4544..608db2a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt >@@ -111,16 +111,26 @@ function synchronize() { > $('#upload-transactions').click(function () { > $('.loading-overlay div').text(_("Uploading transactions, please wait...")); > $('.loading-overlay').show(); >- var uploadIter = $.indexedDB("koha").objectStore("transactions").each(uploadTransaction); >- uploadIter.done(function() { >- $.indexedDB("koha").transaction(["transactions"]).then(function(){ >- }, function(err, e){ >- }, function(transaction){ >- transaction.objectStore("transactions").clear(); >- }); >- $('.loading-overlay').hide(); >- kohadb.saveSetting("dirty", false); >- $('#upload-message').text(NO_UPLOAD_PENDING_MESSAGE); >+ $.ajax({ >+ type: "GET", >+ url: "/cgi-bin/koha/offline_circ/service.pl", >+ }).done(function (data) { >+ if (data) { >+ $('.loading-overlay').hide(); >+ alert(_("Please log in to Koha and try again. (Error: '" + data + "')")); >+ } else { >+ var uploadIter = $.indexedDB("koha").objectStore("transactions").each(uploadTransaction); >+ uploadIter.done(function() { >+ $.indexedDB("koha").transaction(["transactions"]).then(function(){ >+ }, function(err, e){ >+ }, function(transaction){ >+ transaction.objectStore("transactions").clear(); >+ }); >+ $('.loading-overlay').hide(); >+ kohadb.saveSetting("dirty", false); >+ $('#upload-message').text(NO_UPLOAD_PENDING_MESSAGE); >+ }); >+ } > }); > }); > >-- >1.8.4.rc3
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 10240
:
18406
|
18448
|
19005
|
19065
|
19204
|
19328
|
19346
|
19347
|
19353
|
19528
|
20554
|
20555
|
20556
|
20762
|
20995
|
21157
|
21158
|
21159
|
21160
|
21161
|
21495
|
21496
|
21497
|
21498
|
21499
|
21500
|
21552
|
21553
|
21554
|
21555
|
21556
|
21557
|
21558
|
21559
|
21560
|
21573
|
21574
|
21575
|
21576
|
21577
|
21578
|
21579
|
21718
|
21719
|
21720
|
21721
|
21722
|
21723
|
21724
|
21725
|
21726