X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FTemplate%2FPlugin%2FL.pm;h=f7ffc11b2d046493c957b99a5f90ee0cc46c4e22;hb=d13408232bfd23d718fee1bc76535196ff409880;hp=bc380882075bb3d7123cfdcf0542a9dd8f33ba6a;hpb=b498a3939d86fd9fd7c83e5174103250d8662ca7;p=kivitendo-erp.git diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index bc3808820..f7ffc11b2 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -295,7 +295,7 @@ sub date_tag { onChange => $onchange, ) : ()), %params, - ) . ((!$params{no_cal}) ? + ) . ((!$params{no_cal} && !$params{readonly}) ? $self->html_tag('img', undef, src => 'image/calendar.png', alt => $::locale->text('Calendar'), @@ -421,12 +421,19 @@ sub areainput_tag { my ($self, $name, $value, @slurp) = @_; my %attributes = _hashify(@slurp); - my $rows = delete $attributes{rows} || 1; + my ($rows, $cols); my $min = delete $attributes{min_rows} || 1; + if (exists $attributes{cols}) { + $cols = delete $attributes{cols}; + $rows = $::form->numtextrows($value, $cols); + } else { + $rows = delete $attributes{rows} || 1; + } + return $rows > 1 - ? $self->textarea_tag($name, $value, %attributes, rows => max $rows, $min) - : $self->input_tag($name, $value, %attributes); + ? $self->textarea_tag($name, $value, %attributes, rows => max($rows, $min), ($cols ? (cols => $cols) : ())) + : $self->input_tag($name, $value, %attributes, ($cols ? (size => $cols) : ())); } sub multiselect2side { @@ -691,7 +698,8 @@ should be selected by default. =item C Creates a generic input tag or textarea tag, depending on content size. The -mount of desired rows must be given with C parameter, Accpeted parameters +amount of desired rows must be either given with the C parameter or can +be computed from the value and the C paramter, Accepted parameters include C for rendering a minimum of rows if a textarea is displayed. You can force input by setting rows to 1, and you can force textarea by setting