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

(-)a/Koha/DiscreteCalendar.pm (-2 / +1 lines)
Lines 107-113 sub _init { Link Here
107
    );
107
    );
108
    #use default if no calendar is found
108
    #use default if no calendar is found
109
    if (!$rs){
109
    if (!$rs){
110
        $self->{branchcode} = '';
110
        $self->{branchcode} = undef;
111
        $self->{no_branch_selected} = 1;
111
        $self->{no_branch_selected} = 1;
112
    }
112
    }
113
113
Lines 169-175 C<$newBranch> is the branch to be created, and copy into Link Here
169
sub add_new_branch {
169
sub add_new_branch {
170
    my ( $classname, $copyBranch, $newBranch) = @_;
170
    my ( $classname, $copyBranch, $newBranch) = @_;
171
171
172
    $copyBranch = '' unless $copyBranch;
173
    my $schema = Koha::Database->new->schema;
172
    my $schema = Koha::Database->new->schema;
174
173
175
    my $branch_rs = $schema->resultset('DiscreteCalendar')->search({
174
    my $branch_rs = $schema->resultset('DiscreteCalendar')->search({
(-)a/installer/data/mysql/atomicupdate/bug_17015_part2_fill_discrete_calendar.perl (-4 lines)
Lines 36-45 time_zone => C4::Context->tz() Link Here
36
)->truncate( to => 'day' );
36
)->truncate( to => 'day' );
37
$endDate->add(days => $daysInFuture);
37
$endDate->add(days => $daysInFuture);
38
38
39
#Added a default (standard) branch.
40
my $add_default_branch = 'INSERT IGNORE INTO branches (branchname, branchcode) VALUES(?,?)';
41
my $add_Branch_Sth = $dbh->prepare($add_default_branch);
42
$add_Branch_Sth->execute('Default', '');
43
# finds branches;
39
# finds branches;
44
my $selectBranchesSt = 'SELECT branchname, branchcode FROM branches';
40
my $selectBranchesSt = 'SELECT branchname, branchcode FROM branches';
45
my $selectBranchesSth = $dbh->prepare($selectBranchesSt);
41
my $selectBranchesSth = $dbh->prepare($selectBranchesSt);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/discrete_calendar.tt (-3 / +4 lines)
Lines 51-57 Link Here
51
51
52
    [% IF  no_branch_selected %]
52
    [% IF  no_branch_selected %]
53
    <div class="alert alert-danger" style="float: left; margin-left:15px">
53
    <div class="alert alert-danger" style="float: left; margin-left:15px">
54
        <strong>No library set!</strong> You are using the default calendar.
54
        <strong>No library set!</strong>
55
    </div>
55
    </div>
56
    [% END %]
56
    [% END %]
57
57
Lines 608-614 Link Here
608
            //Main datepicker
608
            //Main datepicker
609
            $("#jcalendar-container").datepicker({
609
            $("#jcalendar-container").datepicker({
610
                onSelect: function(dateText, inst) {
610
                onSelect: function(dateText, inst) {
611
                    dateChanged(dateText, $(this).datepicker("getDate"));
611
                    [% IF datesInfos %]
612
                        dateChanged(dateText, $(this).datepicker("getDate"));
613
                    [% END %]
612
                },
614
                },
613
            });
615
            });
614
            $('#from_copyToDatePicker').datepicker();
616
            $('#from_copyToDatePicker').datepicker();
615
- 

Return to bug 17015