View | Details | Raw Unified | Return to bug 11001
Collapse All | Expand All

(-)a/acqui/neworderempty.pl (-1 / +7 lines)
Lines 240-246 foreach my $thisbranch ( sort {$branches->{$a}->{'branchname'} cmp $branches->{$ Link Here
240
        value      => $thisbranch,
240
        value      => $thisbranch,
241
        branchname => $branches->{$thisbranch}->{'branchname'},
241
        branchname => $branches->{$thisbranch}->{'branchname'},
242
    );
242
    );
243
    $row{'selected'} = 1 if( $thisbranch && $data->{branchcode} && $thisbranch eq $data->{branchcode}) ;
243
    if ( $data->{branchcode} ) {
244
        $row{'selected'} = 1
245
            if $thisbranch && $thisbranch eq $data->{branchcode};
246
    } else {
247
        $row{selected} = 1
248
            if $thisbranch && $thisbranch eq C4::Context->userenv->{branch};
249
    }
244
    push @branchloop, \%row;
250
    push @branchloop, \%row;
245
}
251
}
246
$template->param( branchloop => \@branchloop );
252
$template->param( branchloop => \@branchloop );
(-)a/installer/data/mysql/kohastructure.sql (-1 / +3 lines)
Lines 2933-2938 CREATE TABLE `aqorders` ( -- information related to the basket line items Link Here
2933
  `claimed_date` date default NULL, -- last date a claim was generated
2933
  `claimed_date` date default NULL, -- last date a claim was generated
2934
  `subscriptionid` int(11) default NULL, -- links this order line to a subscription (subscription.subscriptionid)
2934
  `subscriptionid` int(11) default NULL, -- links this order line to a subscription (subscription.subscriptionid)
2935
  parent_ordernumber int(11) default NULL, -- ordernumber of parent order line, or same as ordernumber if no parent
2935
  parent_ordernumber int(11) default NULL, -- ordernumber of parent order line, or same as ordernumber if no parent
2936
  branchcode varchar(10) default NULL, -- library where the order will be sent
2936
  PRIMARY KEY  (`ordernumber`),
2937
  PRIMARY KEY  (`ordernumber`),
2937
  KEY `basketno` (`basketno`),
2938
  KEY `basketno` (`basketno`),
2938
  KEY `biblionumber` (`biblionumber`),
2939
  KEY `biblionumber` (`biblionumber`),
Lines 2940-2946 CREATE TABLE `aqorders` ( -- information related to the basket line items Link Here
2940
  CONSTRAINT `aqorders_ibfk_1` FOREIGN KEY (`basketno`) REFERENCES `aqbasket` (`basketno`) ON DELETE CASCADE ON UPDATE CASCADE,
2941
  CONSTRAINT `aqorders_ibfk_1` FOREIGN KEY (`basketno`) REFERENCES `aqbasket` (`basketno`) ON DELETE CASCADE ON UPDATE CASCADE,
2941
  CONSTRAINT `aqorders_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
2942
  CONSTRAINT `aqorders_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
2942
  CONSTRAINT aqorders_ibfk_3 FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE SET NULL ON UPDATE CASCADE,
2943
  CONSTRAINT aqorders_ibfk_3 FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE SET NULL ON UPDATE CASCADE,
2943
  CONSTRAINT `aqorders_subscriptionid` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`) ON DELETE CASCADE ON UPDATE CASCADE
2944
  CONSTRAINT `aqorders_subscriptionid` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`) ON DELETE CASCADE ON UPDATE CASCADE,
2945
  CONSTRAINT `aqorders_branchcode` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
2944
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2946
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2945
2947
2946
2948
(-)a/installer/data/mysql/updatedatabase.pl (+17 lines)
Lines 7162-7167 if ( CheckVersion($DBversion) ) { Link Here
7162
    SetVersion($DBversion);
7162
    SetVersion($DBversion);
7163
}
7163
}
7164
7164
7165
7166
7167
7168
$DBversion = "3.13.00.XXX";
7169
if ( CheckVersion($DBversion) ) {
7170
    $dbh->do(q|
7171
        ALTER TABLE aqorders ADD COLUMN branchcode VARCHAR(10)
7172
    |);
7173
    $dbh->do(q|
7174
        ALTER TABLE aqorders ADD CONSTRAINT aqorders_branchcode FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE
7175
    |);
7176
    print "Upgrade to $DBversion done (Bug 11001 - Add column aqorders.branchcode)\n";
7177
    SetVersion($DBversion);
7178
}
7179
7180
7181
7165
=head1 FUNCTIONS
7182
=head1 FUNCTIONS
7166
7183
7167
=head2 TableExists($table)
7184
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt (-1 / +21 lines)
Lines 1-4 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE Branches %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Acquisitions &rsaquo; Basket [% basketno %] &rsaquo; [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber %])[% ELSE %]New order[% END %]</title>
4
<title>Koha &rsaquo; Acquisitions &rsaquo; Basket [% basketno %] &rsaquo; [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber %])[% ELSE %]New order[% END %]</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
Lines 430-435 $(document).ready(function() Link Here
430
                <input type="checkbox" id="showallbudgets" />
431
                <input type="checkbox" id="showallbudgets" />
431
                [% END %]
432
                [% END %]
432
            </li>
433
            </li>
434
435
            <li>
436
              [% IF close %]
437
                <span class="label required">Library: </span>
438
                <input type="hidden" name="branchcode" id="branchcode" value="[% branchcode %]" />[% Branches.GetName( branchcode ) %]
439
              [% ELSE %]
440
                <label for="branchcode">Library: </label>
441
                <select id="branchcode" size="1" name="branchcode">
442
                  <option value="">Select a library</option>
443
                  [% FOREACH branch IN branchloop %]
444
                    [% IF branch.selected %]
445
                      <option value="[% branch.value %]" selected="selected">[% branch.branchname %]</option>
446
                    [% ELSE %]
447
                      <option value="[% branch.value %]">[% branch.branchname %]</option>
448
                    [% END %]
449
                  [% END %]
450
                </select>
451
              [% END %]
452
            </li>
453
433
		<li>
454
		<li>
434
                [% IF ( close ) %]
455
                [% IF ( close ) %]
435
			<span class="label">Currency: </span>
456
			<span class="label">Currency: </span>
436
- 

Return to bug 11001