Browse Source

Bug 3928: Modification of date for serials.

When a serial status is changed to "Arrived" or "Claimed", the "Expected on"
date is changed to the current date.

A bit of rewriting to get it to apply on master - chris@bigballowax.co.nz

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
3.2.x
J. David Bavousett 14 years ago
committed by Galen Charlton
parent
commit
f0528664ee
  1. 10
      koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl
  2. 3
      serials/serials-edit.pl

10
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl

@ -81,6 +81,10 @@ function HideItems(index,labelindex) {
label = document.getElementById(labelindex);
label.style.display='block';
}
function changeDate(adate) {
var elem = document.getElementById("expecteddate");
elem.value = adate;
}
function CloneSubfield(index){
var original = document.getElementById(index); //original <div>
var clone = original.cloneNode(true);
@ -210,7 +214,7 @@ function CloneSubfield(index){
<input type="text" name="publisheddate" value="<!-- TMPL_VAR name="publisheddate" -->" size="10" maxlength="15" />
</td>
<td>
<input type="text" name="planneddate" value="<!-- TMPL_VAR name="planneddate" -->" size="10" maxlength="15" />
<input type="text" id="expecteddate" name="planneddate" value="<!-- TMPL_VAR name="planneddate" -->" size="10" maxlength="15" />
</td>
<td>
<!--TMPL_IF name="editdisable"-->
@ -218,9 +222,9 @@ function CloneSubfield(index){
<select name="status" size="1" disabled="disabled">
<!--TMPL_ELSE-->
<!--TMPL_IF Name="serialsadditems"-->
<select name="status" size="1" id="status<!-- TMPL_VAR NAME="serialid" -->" onchange="if (this.value==2){unHideItems('items'+<!-- TMPL_VAR NAME="subscriptionid" -->+<!-- TMPL_VAR NAME="serialid" -->,'label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->', '<!--TMPL_VAR Name="serialid"-->')} else { HideItems('items'+<!-- TMPL_VAR NAME="subscriptionid" -->+<!-- TMPL_VAR NAME="serialid" -->,'label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->')}" >
<select name="status" size="1" id="status<!-- TMPL_VAR NAME="serialid" -->" onchange="if (this.value==2){unHideItems('items'+<!-- TMPL_VAR NAME="subscriptionid" -->+<!-- TMPL_VAR NAME="serialid" -->,'label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->'); changeDate('<!-- TMPL_VAR NAME="arriveddate" -->')} else if (this.value==7){changeDate('<!-- TMPL_VAR NAME="arriveddate" -->')} else { HideItems('items'+<!-- TMPL_VAR NAME="subscriptionid" -->+<!-- TMPL_VAR NAME="serialid" -->,'label<!-- TMPL_VAR NAME="subscriptionid" --><!--TMPL_VAR Name="serialid"-->'); changeDate('<!-- TMPL_VAR NAME="planneddate" -->')}" >
<!--TMPL_ELSE -->
<select name="status" size="1" id="status<!-- TMPL_VAR NAME="serialid" -->" >
<select name="status" size="1" id="status<!-- TMPL_VAR NAME="serialid" -->" onchange="if (this.value==2 || this.value==7){changeDate('<!-- TMPL_VAR NAME="arriveddate" -->')} else {changeDate('<!-- TMPL_VAR NAME="planneddate" -->')}" >
<!--/TMPL_IF-->
<!--/TMPL_IF-->
<!--TMPL_IF name="status1" -->

3
serials/serials-edit.pl

@ -121,6 +121,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
my @serialdatalist;
my %processedserialid;
my $today = C4::Dates->new();
foreach my $tmpserialid (@serialids) {
#filtering serialid for duplication
@ -132,6 +134,7 @@ foreach my $tmpserialid (@serialids) {
my $data = GetSerialInformation($tmpserialid);
$data->{publisheddate} = format_date( $data->{publisheddate} );
$data->{planneddate} = format_date( $data->{planneddate} );
$data->{arriveddate}=$today->output('us');
$data->{'editdisable'} = (
(
HasSubscriptionExpired( $data->{subscriptionid} )

Loading…
Cancel
Save