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

(-)a/admin/smart-rules.pl (-3 / +2 lines)
Lines 164-172 elsif ($op eq 'add') { Link Here
164
    $holds_per_day = undef if $holds_per_day !~ /^\d+/;
164
    $holds_per_day = undef if $holds_per_day !~ /^\d+/;
165
    my $onshelfholds     = $input->param('onshelfholds') || 0;
165
    my $onshelfholds     = $input->param('onshelfholds') || 0;
166
    $maxissueqty =~ s/\s//g;
166
    $maxissueqty =~ s/\s//g;
167
    $maxissueqty = undef if $maxissueqty !~ /^\d+/;
167
    $maxissueqty = '' if $maxissueqty !~ /^\d+/;
168
    $maxonsiteissueqty =~ s/\s//g;
168
    $maxonsiteissueqty =~ s/\s//g;
169
    $maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/;
169
    $maxonsiteissueqty = '' if $maxonsiteissueqty !~ /^\d+/;
170
    my $issuelength  = $input->param('issuelength');
170
    my $issuelength  = $input->param('issuelength');
171
    $issuelength = $issuelength eq q{} ? undef : $issuelength;
171
    $issuelength = $issuelength eq q{} ? undef : $issuelength;
172
    my $lengthunit  = $input->param('lengthunit');
172
    my $lengthunit  = $input->param('lengthunit');
Lines 221-227 elsif ($op eq 'add') { Link Here
221
    } else {
221
    } else {
222
        Koha::IssuingRule->new()->set($params)->store();
222
        Koha::IssuingRule->new()->set($params)->store();
223
    }
223
    }
224
225
    Koha::CirculationRules->set_rules(
224
    Koha::CirculationRules->set_rules(
226
        {
225
        {
227
            categorycode => $bor,
226
            categorycode => $bor,
(-)a/t/db_dependent/selenium/administration_tasks.t (-3 / +16 lines)
Lines 23-31 use Modern::Perl; Link Here
23
23
24
use C4::Context;
24
use C4::Context;
25
25
26
use Test::More tests => 1;
26
use Test::More tests => 3;
27
27
28
use t::lib::Selenium;
28
use t::lib::Selenium;
29
use t::lib::TestBuilder;
30
31
my $builder = t::lib::TestBuilder->new;
29
32
30
my $login = $ENV{KOHA_USER} || 'koha';
33
my $login = $ENV{KOHA_USER} || 'koha';
31
34
Lines 67-78 SKIP: { Link Here
67
    };
70
    };
68
71
69
    { # Circulation/fine rules
72
    { # Circulation/fine rules
73
        my $itype = $builder->build_object({ class => "Koha::ItemTypes" });
70
        $driver->get($mainpage);
74
        $driver->get($mainpage);
71
        $s->click( { href => '/admin/admin-home.pl', main => 'container-main' } )
75
        $s->click( { href => '/admin/admin-home.pl', main => 'container-main' } )
72
          ;    # Koha administration
76
          ;    # Koha administration
73
        $s->click( { href => '/admin/smart-rules.pl', main_class => 'main container-fluid' } )
77
        $s->click( { href => '/admin/smart-rules.pl', main_class => 'main container-fluid' } )
74
          ;    # Circulation and fines rules
78
          ;    # Circulation and fines rules
75
               # TODO Create smart navigation here
79
        my $elt = $driver->find_element('//tr[@id="edit_row"]/td/select[@id="matrixitemtype"]/option[@value="'.$itype->itemtype.'"]');
80
        is( $elt->get_text(),$itype->description,"Our new itemtype is in the list");
81
        $elt->click();
82
        $elt = $driver->find_element('//tr[@id="edit_row"]/td[@class="actions"]/button[@type="submit"]');
83
        $elt->click();
84
        $elt = $driver->find_elements('//table[@id="default-circulation-rules"]/tbody/tr/td[contains(text(),"'.$itype->description.'")]/following-sibling::td/span[text() = "Unlimited"]');
85
        is( @$elt,2,"We have unlimited checkouts");
86
        #Clean up
87
        Koha::IssuingRules->find({itemtype=>$itype->itemtype})->delete();
88
        $itype->delete;
89
               # TODO Create more smart rules navigation here
76
    };
90
    };
77
91
78
    { # Biblio frameworks
92
    { # Biblio frameworks
79
- 

Return to bug 22619