| 1 | package DBIx::Class::HTMLWidget; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | #use Data::Dump qw(dump); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | our $VERSION = '0.16'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | # pod after __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 0 | ▶ | sub fill_widget { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fill_widget: not called CC=14 SCAR=53.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 0 | my ($dbic,$widget)=@_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 0 | ▶ | croak('fill_widget needs a HTML::Widget object as argument') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $widget and $widget->isa("HTML::Widget")
MC/DC0%0/2
ref $widget and $widget->isa("HTML::Widget")
ref $widget
$widget->isa("HTML::Widget")
Truth table0%0/3
A and B
A= ref $widgetB= $widget->isa("HTML::Widget")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | unless ref $widget && $widget->isa('HTML::Widget'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | my @real_elements = $widget->find_elements; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | foreach my $element ( @real_elements ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | my $name=$element->name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | ▶ | next unless $name && $dbic->can($name) && $element->can('value'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$name and $dbic->can($name) and $element->can("value")
$name and $dbic->can($name)
MC/DC0%0/3
$name and $dbic->can($name) and $element->can("value")
$name
$dbic->can($name)
$element->can("value")
Truth table0%0/4
A and B and C
A= $nameB= $dbic->can($name)C= $element->can("value")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | ▶ | next if ($element->value()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | if($element->isa('HTML::Widget::Element::Checkbox')) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | $element->checked($dbic->$name?1:0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | if (ref $dbic->$name and $dbic->$name->can('id') and $dbic->$name->id) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
ref $dbic->$name and $dbic->$name->can("id") and $dbic->$name->id
ref $dbic->$name and $dbic->$name->can("id")
MC/DC0%0/3
ref $dbic->$name and $dbic->$name->can("id") and $dbic->$name->id
ref $dbic->$name
$dbic->$name->can("id")
$dbic->$name->id
Truth table0%0/4
A and B and C
A= ref $dbic->$nameB= $dbic->$name->can("id")C= $dbic->$name->id
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | $element->value($dbic->$name->id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | $element->value($dbic->$name) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | unless $element->isa('HTML::Widget::Element::Password'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | ▶ | sub populate_from_widget { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
populate_from_widget: not called CC=20 SCAR=60.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | my ($dbic,$result)=@_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | croak('populate_from_widget needs a HTML::Widget::Result object as argument') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $result and $result->isa("HTML::Widget::Result")
MC/DC0%0/2
ref $result and $result->isa("HTML::Widget::Result")
ref $result
$result->isa("HTML::Widget::Result")
Truth table0%0/3
A and B
A= ref $resultB= $result->isa("HTML::Widget::Result")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | unless ref $result && $result->isa('HTML::Widget::Result'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | # find all checkboxes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | my %cb = map {$_->name => undef } grep { $_->isa('HTML::Widget::Element::Checkbox') } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | $result->find_elements; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | foreach my $col ( $dbic->result_source->columns ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | my $col_info = $dbic->column_info($col); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | my $value = scalar($result->param($col)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | if ($col_info->{data_type} and $col_info->{data_type} =~ m/^timestamp|date|integer|numeric/i | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
$col_info->{"data_type"} and $col_info->{"data_type"} =~ /^timestamp|date|integer|numeric/i and defined $value and $value eq ""
$col_info->{"data_type"} and $col_info->{"data_type"} =~ /^timestamp|date|integer|numeric/i and defined $value
$col_info->{"data_type"} and $col_info->{"data_type"} =~ /^timestamp|date|integer|numeric/i
MC/DC0%0/4
$col_info->{"data_type"} and $col_info->{"data_type"} =~ /^timestamp|date|integer|numeric/i and defined $value and $value eq ""
$col_info->{"data_type"}
$col_info->{"data_type"} =~ /^timestamp|date|integer|numeric/i
defined $value
$value eq ""
Truth table0%0/5
A and B and C and D
A= $col_info->{"data_type"}B= $col_info->{"data_type"} =~ /^timestamp|date|integer|numeric/iC= defined $valueD= $value eq ""
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | and defined $value and $value eq '') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | $value = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | $dbic->$col(undef); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | ▶ | if (defined($value) and !ref($value) and $value eq 'undef') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
defined $value and not ref $value and $value eq "undef"
defined $value and not ref $value
MC/DC0%0/3
defined $value and not ref $value and $value eq "undef"
defined $value
not ref $value
$value eq "undef"
Truth table0%0/4
A and not(B) and C
A= defined $valueB= not ref $valueC= $value eq "undef"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | $dbic->$col(undef); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 0 | $value = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | if ($col_info->{data_type} and $col_info->{data_type} =~ m/boolean/i | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/18
$col_info->{"data_type"} and ($col_info->{"data_type"} =~ /boolean/i and exists $col_info->{"is_nullable"} and not $col_info->{"is_nullable"} and exists $cb{$col} and not defined $value and $dbic->result_source->schema->storage->sqlt_type eq "PostgreSQL")
$col_info->{"data_type"} =~ /boolean/i and exists $col_info->{"is_nullable"} and not $col_info->{"is_nullable"} and exists $cb{$col} and not defined $value and $dbic->result_source->schema->storage->sqlt_type eq "PostgreSQL"
$col_info->{"data_type"} =~ /boolean/i and exists $col_info->{"is_nullable"} and not $col_info->{"is_nullable"} and exists $cb{$col} and not defined $value
$col_info->{"data_type"} =~ /boolean/i and exists $col_info->{"is_nullable"} and not $col_info->{"is_nullable"} and exists $cb{$col}
$col_info->{"data_type"} =~ /boolean/i and exists $col_info->{"is_nullable"} and not $col_info->{"is_nullable"}
$col_info->{"data_type"} =~ /boolean/i and exists $col_info->{"is_nullable"}
MC/DC0%0/7
$col_info->{"data_type"} and ($col_info->{"data_type"} =~ /boolean/i and exists $col_info->{"is_nullable"} and not $col_info->{"is_nullable"} and exists $cb{$col} and not defined $value and $dbic->result_source->schema->storage->sqlt_type eq "PostgreSQL")
$col_info->{"data_type"}
$col_info->{"data_type"} =~ /boolean/i
exists $col_info->{"is_nullable"}
not $col_info->{"is_nullable"}
exists $cb{$col}
not defined $value
$dbic->result_source->schema->storage->sqlt_type eq "PostgreSQL"
Truth table0%0/8
A and B and C and not(D) and E and not(F) and G
A= $col_info->{"data_type"}B= $col_info->{"data_type"} =~ /boolean/iC= exists $col_info->{"is_nullable"}D= not $col_info->{"is_nullable"}E= exists $cb{$col}F= not defined $valueG= $dbic->result_source->schema->storage->sqlt_type eq "PostgreSQL"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | && exists $col_info->{is_nullable} && !$col_info->{is_nullable} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | && exists $cb{$col} && !defined($value) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | && $dbic->result_source->schema->storage->sqlt_type eq 'PostgreSQL') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | # We need to set the value to 0 if it is postgres | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | $value = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | $dbic->$col($value) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 0 | ▶ | if defined $value || exists $cb{$col}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $value or exists $cb{$col}
MC/DC0%0/2
defined $value or exists $cb{$col}
defined $value
exists $cb{$col}
Truth table0%0/3
A or B
A= defined $valueB= exists $cb{$col}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | $dbic->insert_or_update; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | return $dbic; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | ▶ | sub experimental_populate_from_widget { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
experimental_populate_from_widget: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | my ($dbic,$result)=@_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | foreach (@{$result->{_elements}} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | # Its called a fair few times so save name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | my $name = $_->name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | #prevent passwords being overwritten. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | ▶ | next if $_->isa('HTML::Widget::Element::Password') && $result->param($name) eq ""; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_->isa("HTML::Widget::Element::Password") and $result->param($name) eq ""
MC/DC0%0/2
$_->isa("HTML::Widget::Element::Password") and $result->param($name) eq ""
$_->isa("HTML::Widget::Element::Password")
$result->param($name) eq ""
Truth table0%0/3
A and B
A= $_->isa("HTML::Widget::Element::Password")B= $result->param($name) eq ""
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | $dbic->set_column($name, scalar $result->param($name)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | if (defined $result->param($name) || $_->isa('HTML::Widget::Element::Checkbox')) && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | # Ignore this element if its readonly or not in the DBIC | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | ▶ | !$_->{attributes}{readonly} && $dbic->has_column($name); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
defined $result->param($name) || $_->isa("HTML::Widget::Element::Checkbox") and not $_->{"attributes"}{"readonly"} and $dbic->has_column($name)
defined $result->param($name) || $_->isa("HTML::Widget::Element::Checkbox") and not $_->{"attributes"}{"readonly"}
defined $result->param($name) or $_->isa("HTML::Widget::Element::Checkbox")
MC/DC0%0/4
defined $result->param($name) || $_->isa("HTML::Widget::Element::Checkbox") and not $_->{"attributes"}{"readonly"} and $dbic->has_column($name)
defined $result->param($name)
$_->isa("HTML::Widget::Element::Checkbox")
not $_->{"attributes"}{"readonly"}
$dbic->has_column($name)
Truth table0%0/7
A or B and not(C) and D
A= defined $result->param($name)B= $_->isa("HTML::Widget::Element::Checkbox")C= not $_->{"attributes"}{"readonly"}D= $dbic->has_column($name)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | $dbic->insert_or_update; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | return $dbic; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||