Bugzilla – Attachment 88817 Details for
Bug 22779
Simplify add serials form to single page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22779: WIP POC combining the page and making the prediction automatic
Bug-22779-WIP-POC-combining-the-page-and-making-th.patch (text/plain), 7.36 KB, created by
Nick Clemens
on 2019-04-25 20:25:40 UTC
(
hide
)
Description:
Bug 22779: WIP POC combining the page and making the prediction automatic
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2019-04-25 20:25:40 UTC
Size:
7.36 KB
patch
obsolete
>From 58adf92e663a59aaaf41bc72e31df7fb0f2b839c Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 25 Apr 2019 20:25:20 +0000 >Subject: [PATCH] Bug 22779: WIP POC combining the page and making the > prediction automatic > >--- > .../prog/en/modules/serials/subscription-add.tt | 21 +++++-------- > .../intranet-tmpl/prog/js/subscription-add.js | 34 ++++++++++++---------- > 2 files changed, 26 insertions(+), 29 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >index 0f056f0bd1..25308b6996 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >@@ -33,7 +33,7 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ > <div class="main container-fluid"> > <div class="row"> > <div class="col-sm-12"> >- <h1>[% IF ( modify ) %] Modify subscription for <i>[% bibliotitle | html %]</i>[% ELSE %]Add a new subscription[% END %] (<span id="page_number">1/2</span>)</h1> >+ <h1>[% IF ( modify ) %] Modify subscription for <i>[% bibliotitle | html %]</i>[% ELSE %]Add a new subscription[% END %]</h1> > </div> > <form method="post" id="subscription_add_form" name="f" action="/cgi-bin/koha/serials/subscription-add.pl" class="validated"> > [% IF ( modify ) %] >@@ -45,8 +45,7 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ > <input type="hidden" name="user" value="[% logged_in_user.userid | html %]" /> > <input type="hidden" name="irreg_check" value="0" /> > >- <div id="page_1"> >- <div class="col-md-6"> >+ <div id="section_1"> > <fieldset id="subscription_add_information" class="rows"> > <legend>Subscription details</legend> > <ol> >@@ -209,14 +208,9 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ > </li> > </ol> > </fieldset> >- <fieldset class="action"> >- <input type="button" value="Next >>" id="subscription_add_next" style="float:right;" /> >- </fieldset> >- </div> > </div> > >- <div id="page_2"> >- <div class="col-md-6"> >+ <div id="section_2"> > [% IF ( Koha.Preference('Mana') == 1) && !mana_url %] > <fieldset> > <p><center>The Mana Knowledge Base can be used to import subscription patterns submitted by other libraries and save you extra work. Ask your system administrator to configure this service and complete the configuration, or remove this message by disabling the system preference >@@ -469,15 +463,14 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ > <input type="hidden" id="unitsperissue" name="unitsperissue" value=""/> > <input type="hidden" id="issuesperunit" name="issuesperunit" value=""/> > <fieldset class="action"> >- <input type="button" id="subscription_add_previous" value="<< Previous" style="float:left;"/> >- <input id="testpatternbutton" type="button" value="Test prediction pattern" /> > <input id="save-subscription" type="submit" value="Save subscription" style="float:right;" accesskey="w"/> > </fieldset> > </div> >- </div> >- <div class="col-md-6"> >+ <fieldset id="pattern_error_box"> >+ Cannot predict pattern due to issues below: >+ <ul id="pattern_errors"></ul> >+ </fieldset> > <li id="displayexample"></li> >- </div> > </div> > </form> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js >index d82b875dbf..2fd6c2ac8a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js >@@ -45,7 +45,7 @@ function Clear(id) { > $("#"+id).val(''); > } > >-function Check_page1() { >+function Check_page(){ > if ( $("#aqbooksellerid").val().length == 0) { > input_box = confirm( MSG_LINK_TO_VENDOR ); > if (input_box==false) { >@@ -57,10 +57,6 @@ function Check_page1() { > return false; > } > >- return true; >-} >- >-function Check_page2(){ > if( more_than_one_serial == "" ){ > if($("#acqui_date").val().length == 0){ > alert( MSG_REQUIRED_PUB_DATE ); >@@ -260,25 +256,31 @@ function testPredictionPattern() { > var error = 0; > var error_msg = ""; > if(frequencyid == undefined || frequencyid == ""){ >- error_msg += "- " + MSG_FREQUENCY_UNDEFINED + "\n"; >+ error_msg += "<li>" + MSG_FREQUENCY_UNDEFINED + "</li>"; > error ++; > } > acquidate = $("#acqui_date").val(); > if(acquidate == undefined || acquidate == ""){ >- error_msg += "-" + MSG_PUB_DATE_UNDEFINED + "\n"; >+ error_msg += "<li>" + MSG_PUB_DATE_UNDEFINED + "</li>"; > error ++; > } > if( more_than_one_serial !== "" ){ > var nextacquidate = $("#nextacquidate").val(); > if(nextacquidate == undefined || nextacquidate == ""){ >- error_msg += "-" + MSG_NEXT_ISSUE_UNDEFINED + "\n"; >+ error_msg += "<li>" + MSG_NEXT_ISSUE_UNDEFINED + "</li>"; > error ++; > } > } > > if(error){ >- alert( MSG_PATTERN_TEST_FAILED.format(error_msg) ); >+ $("#pattern_error_box").show(); >+ $("#pattern_errors").html( error_msg ); >+ $("#displayexample").hide(); >+ // alert( MSG_PATTERN_TEST_FAILED.format(error_msg) ); > return false; >+ } else { >+ $("#pattern_error_box").hide(); >+ $("#pattern_errors").html(""); > } > > var custompattern = 0; >@@ -382,7 +384,6 @@ function saveAdvancedPattern() { > function show_page_1() { > $("#page_1").show(); > $("#page_2").hide(); >- $("#page_number").text("1/2"); > } > > function show_page_2() { >@@ -615,11 +616,12 @@ $(document).ready(function() { > }); > } > >- $("#mana_search").hide(); >+ //$("#mana_search").hide(); > >- show_page_1(); >+ //show_page_1(); >+ testPredictionPattern(); > $("#subscription_add_form").on("submit",function(){ >- return Check_page2(); >+ return Check_page(); > }); > $("#vendor_search").on("click",function(e){ > e.preventDefault(); >@@ -665,8 +667,10 @@ $(document).ready(function() { > e.preventDefault(); > saveAdvancedPattern(); > }); >- $("#testpatternbutton").on("click",function(e){ >- e.preventDefault(); >+ $("#frequency, #acqui_date, #nextacquidate, #numberpattern, #moreoptionst input").on("change input",function(e){ >+ console.log("trig"); >+ //e.preventDefault(); >+ numberpatternload(); > testPredictionPattern(); > }); > $('#save-subscription').on("click", function(e){ >-- >2.11.0
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 22779
: 88817