[Koha-patches] [PATCH] Alter js weeks calculation to start from the first issue date, not today.
Ryan Higgins
rch at liblime.com
Sun Jul 27 20:27:28 CEST 2008
---
.../prog/en/modules/serials/subscription-add.tmpl | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl
index fabdaf6..b7b4265 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl
@@ -92,7 +92,7 @@ function IrregularPattern() {
this.numskipped = 0;
// init:
var irregular = '<!-- TMPL_VAR NAME="irregularity" -->';
- var periodicity = document.f.periodicity.value;
+ // var periodicity = document.f.periodicity.value;
this.skipped = irregular.split(',');
}
@@ -102,11 +102,13 @@ IrregularPattern.prototype.update = function() {
// daily periodicity, we interpret irregular array as which days of week to skip.
// else irregular array is list of issues to skip
var summary_str = '';
- for( var i in document.f.irregularity_select.options ) {
- if( document.f.irregularity_select.options[i].selected ) {
- this.skipped[cnt] = document.f.irregularity_select.options[i].value ;
- summary_str += document.f.irregularity_select.options[i].text + "\n" ;
+ this.numskipped = 0;
+ for( var i in document.f.irregularity_select.options ) {
+ if( document.f.irregularity_select.options[i].selected ) {
+ this.skipped[cnt] = document.f.irregularity_select.options[i].value ;
+ summary_str += document.f.irregularity_select.options[i].text + "\n" ;
cnt++;
+ this.numskipped++;
}
}
var summary = document.getElementById("irregularity_summary");
@@ -665,7 +667,9 @@ function irregular_options(periodicity){
expected = 52;
titles = irregular_issues.weeks;
<!-- TMPL_IF NAME="weekno" -->
- count = <!-- TMPL_VAR NAME="weekno" -->;
+ count = 1; // This doesn't make sense given the behavior of the script.
+ // we should count from the first serial date, not from this week!
+ // <!-- TMPL_VAR NAME="weekno" -->;
<!-- TMPL_ELSE -->
count = 1;
<!-- /TMPL_IF -->
--
1.5.5.GIT
More information about the Koha-patches
mailing list