Lines 32-38
my $login = $ENV{KOHA_USER} || 'koha';
Link Here
|
32 |
my $itemtype = 'UT_DVD'; |
32 |
my $itemtype = 'UT_DVD'; |
33 |
my $frameworkcode = 'UTFW'; # frameworkcode is only 4 characters max! |
33 |
my $frameworkcode = 'UTFW'; # frameworkcode is only 4 characters max! |
34 |
my $branchcode = 'UT_BC'; |
34 |
my $branchcode = 'UT_BC'; |
35 |
my $categoryname = 'Test'; |
35 |
my $av_category = 'AV_CAT_TEST'; |
36 |
our ($cleanup_needed); |
36 |
our ($cleanup_needed); |
37 |
|
37 |
|
38 |
SKIP: { |
38 |
SKIP: { |
Lines 132-147
SKIP: {
Link Here
|
132 |
|
132 |
|
133 |
$s->click( { href => '/admin/authorised_values.pl', main => 'doc' } ); #Authorized values |
133 |
$s->click( { href => '/admin/authorised_values.pl', main => 'doc' } ); #Authorized values |
134 |
|
134 |
|
135 |
$s->click( { href => '/admin/authorised_values.pl?op=add_form&category=Adult', main => 'doc3' } ); # New category |
135 |
$s->click( { href => { 'ends-with' => '/admin/authorised_values.pl?op=add_form' }, main => 'doc3' } ); # New category |
136 |
$s->fill_form( { authorised_value => 'Hardover', lib => 'Hardcover book'} ); |
136 |
$s->fill_form( { category => $av_category } ); |
137 |
$s->submit_form; |
137 |
$s->submit_form; |
138 |
|
138 |
|
139 |
$s->click( |
139 |
$s->click( |
140 |
{ |
140 |
{ |
141 |
href => '/admin/authorised_values.pl?op=delete&searchfield=Adult&id=400', |
141 |
href => '/admin/authorised_values.pl?op=add_form&category=' . $av_category, |
|
|
142 |
main => 'doc3' |
143 |
} |
144 |
); # New authorised value for ... |
145 |
$s->fill_form( |
146 |
{ |
147 |
authorised_value => "$av_category" . "_xxx", |
148 |
lib => "This is a description for staff", |
149 |
lib_opac => "This is a description for OPAC" |
150 |
} |
151 |
); |
152 |
$s->submit_form; |
153 |
|
154 |
my $dbh = C4::Context->dbh; |
155 |
my ( $av_id ) = $dbh->selectrow_array(q| |
156 |
SELECT id FROM authorised_values WHERE category=?|, undef, $av_category ); |
157 |
$s->click( |
158 |
{ |
159 |
href => '/admin/authorised_values.pl?op=delete&searchfield=' . $av_category . '&id=' . $av_id, |
142 |
main => 'doc3' |
160 |
main => 'doc3' |
143 |
} |
161 |
} |
144 |
); |
162 |
); |
|
|
163 |
$s->driver->accept_alert; |
145 |
}; |
164 |
}; |
146 |
|
165 |
|
147 |
{ #Patron categories |
166 |
{ #Patron categories |
Lines 172-175
sub cleanup {
Link Here
|
172 |
$dbh->do(q|DELETE FROM itemtypes WHERE itemtype=?|, undef, $itemtype); |
191 |
$dbh->do(q|DELETE FROM itemtypes WHERE itemtype=?|, undef, $itemtype); |
173 |
$dbh->do(q|DELETE FROM biblio_framework WHERE frameworkcode=?|, undef, $frameworkcode); |
192 |
$dbh->do(q|DELETE FROM biblio_framework WHERE frameworkcode=?|, undef, $frameworkcode); |
174 |
$dbh->do(q|DELETE FROM branches WHERE branchcode=?|, undef, $branchcode); |
193 |
$dbh->do(q|DELETE FROM branches WHERE branchcode=?|, undef, $branchcode); |
|
|
194 |
$dbh->do(q|DELETE FROM authorised_value_categories WHERE category_name=?|, undef, $av_category); |
175 |
} |
195 |
} |