Bugzilla – Attachment 11799 Details for
Bug 8428
can't save contracts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8428 - can't save contracts
Bug-8428---cant-save-contracts.patch (text/plain), 4.01 KB, created by
Owen Leonard
on 2012-08-23 17:06:26 UTC
(
hide
)
Description:
Bug 8428 - can't save contracts
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2012-08-23 17:06:26 UTC
Size:
4.01 KB
patch
obsolete
>From ae45b12dba758aaab8f0397ec38bd75d4f0fddbf Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 23 Aug 2012 13:01:02 -0400 >Subject: [PATCH] Bug 8428 - can't save contracts >Content-Type: text/plain; charset="utf-8" > >When I replaced the old calendar widget with the jQueryUI version >we lost a JavaScript function which is required by a couple of >pages: Date_from_syspref. This patch adds the function back >to the calendar include and corrects variables in the two >affected templates to make it work again. > >To test: > >- create a new contract. Submitting should work properly and > without JavaScript errors. >- Open the serials claims page (serials/claims.pl) and filter > the results by date. Submitting the filter form should > work properly and without JavaScript errors. >--- > .../intranet-tmpl/prog/en/includes/calendar.inc | 21 ++++++++++++++++++++ > .../prog/en/modules/admin/aqcontract.tt | 4 ++-- > .../prog/en/modules/serials/claims.tt | 4 ++-- > 3 files changed, 25 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index d77e9e0..fc8a1a3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -1,5 +1,26 @@ > <script type="text/javascript"> > //<![CDATA[ >+ >+var debug = "[% debug %]"; >+var dformat = "[% dateformat %]"; >+var sentmsg = 0; >+if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");} >+ >+function Date_from_syspref(dstring) { >+ var dateX = dstring.split(/[-/]/); >+ if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));} >+ if (dformat === "iso") { >+ return new Date(dateX[0], (dateX[1] - 1), dateX[2]); // YYYY-MM-DD to (YYYY,m(0-11),d) >+ } else if (dformat === "us") { >+ return new Date(dateX[2], (dateX[0] - 1), dateX[1]); // MM/DD/YYYY to (YYYY,m(0-11),d) >+ } else if (dformat === "metric") { >+ return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD/MM/YYYY to (YYYY,m(0-11),d) >+ } else { >+ if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);} >+ return 0; >+ } >+} >+ > /* Instead of including multiple localization files as you would normally see with > jQueryUI we expose the localization strings in the default configuration */ > jQuery(function($){ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt >index 7103971..e723ed4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt >@@ -22,8 +22,8 @@ function Check(ff) { > ok=1; > _alertString += _("- Name missing") + "\n"; > } >- var startDate = Date_from_syspref($("#contractstartdate").val()); >- var endDate = Date_from_syspref($("#contractenddate").val()); >+ var startDate = Date_from_syspref($("#from").val()); >+ var endDate = Date_from_syspref($("#to").val()); > if (!parseInt(startDate.getTime())) { > ok=1; > _alertString += _("- Start date missing or invalid.") + "\n"; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt >index b47b51b..5d9f7a9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt >@@ -92,8 +92,8 @@ > } > // Filter by date > function filterByDate() { >- var beginDate = Date_from_syspref($("#begindate").val()).getTime(); >- var endDate = Date_from_syspref($("#enddate").val()).getTime(); >+ var beginDate = Date_from_syspref($("#from").val()).getTime(); >+ var endDate = Date_from_syspref($("#to").val()).getTime(); > > // Checks if the beginning date is valid > if (!parseInt(beginDate)) { >-- >1.7.9.5
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 8428
:
11799
|
11800
|
11801