blib/lib/Embperl/Form/Control/grid.pm untested

filter: Statementstmt 0.0% 0 / 309 Branchbran 0.0% 0 / 134 Conditioncond 0.0% 0 / 23 MC/DCmcdc 0.0% 0 / 13 Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 9 totaltotal 0.0% 0 / 502 CC 59 SCAR 55.1
CC
59
Cov
0%
prepare_fdat
420.0
init_data
380.0
get_display_text
156.0
CRAP 248.3
1  
2 ###################################################################################
3 #
4 # Embperl - Copyright (c) 1997-2008 Gerald Richter / ecos gmbh www.ecos.de
5 # Embperl - Copyright (c) 2008-2015 Gerald Richter
6 # Embperl - Copyright (c) 2015-2023 actevy.io
7 #
8 # You may distribute under the terms of either the GNU General Public
9 # License or the Artistic License, as specified in the Perl README file.
10 #
11 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
12 # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
13 # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14 #
15 # $Id$
16 #
17 ###################################################################################
18  
19 package Embperl::Form::Control::grid ;
20  
21 use strict ;
22 use base 'Embperl::Form::ControlMultValue' ;
23  
24 use vars qw{%fdat $epreq} ;
25  
26 use Embperl::Inline ;
27 use Data::Clone ;
28  
29 # ---------------------------------------------------------------------------
30 #
31 # new - create a new control
32 #
33  
34  
35 sub new
36  
37 {
38 my ($class, $args) = @_ ;
39  
40 my $self = Embperl::Form::ControlMultValue -> new($args) ;
41 bless $self, $class ;
42
43 $self -> init ;
44
45 return $self ;
46 }
47  
48 # ---------------------------------------------------------------------------
49 #
50 # init - init the new control
51 #
52  
53 sub init
54  
55 {
56 my ($self) = @_ ;
57  
58 $self -> {header_bottom} = 10 if (!exists ($self -> {header_bottom})) ;
59 $self -> {width} = 1 if (!$self -> {width}) ;
60
61 my $flat = $self -> {flatopt} ;
62 my @flat = split /\s*;\s*/, $flat ;
63 # make sure we do not change another instance of this grid
64 my $fields = $self -> {fields} = clone ($self -> {fields}) ;
65 if (@flat)
66 {
67 foreach (@$fields)
68 {
69 my $name = $_ -> {name} ;
70 for (my $i = 0 ; $i < @flat; $i+=3)
71 {
72 $_ -> {$flat[$i+1]} = $flat[$i+2] if ($name eq $flat[$i]);
73 }
74 }
75 }
76 my $form = $self -> form ;
77 my $options = $form -> {options} ;
78 $form -> new_controls ($fields, $options, undef, undef, $options -> {masks}, $options -> {defaults}, 1) ;
79 if ($self -> {line2})
80 {
81 my $ctl = [$self -> {line2}] ;
82 $form -> new_controls ($ctl, $options, undef, undef, $options -> {masks}, $options -> {defaults}, 1) ;
83 $self -> {line2} = $ctl -> [0] ;
84 }
85
86 return $self ;
87 }
88  
89  
90  
91 # ------------------------------------------------------------------------------------------
92 #
93 # init_data_hash
94 #
95  
96 sub init_data_hash
97 {
98 my ($rowno, $hashdata, $fields) = @_ ;
99
100 my $data ;
101 map
102 {
103 $data = $hashdata -> {$_} ;
104 my @data ;
105 if (ref $data eq 'HASH')
106 {
107 $data -> {'_key'} = $_ ;
108 foreach (@$fields)
109 {
110 push @data, $data -> {$_ -> {name}} ;
111 }
112 }
113 elsif (ref $data eq 'ARRAY')
114 {
115 push @data, $_, @$data ;
116 }
117 else
118 {
119 push @data, $_, $data ;
120 }
121
122 [$rowno++, @data ]
123 } sort keys %$hashdata ;
124
125 }
126  
127 # ------------------------------------------------------------------------------------------
128 #
129 # init_data - daten aufteilen
130 #
131  
132 sub init_data
133 {
134 my ($self, $req) = @_ ;
135
136 my $fdat = $req -> {docdata} || \%fdat ;
137 my $ldap = $req->{ldap};
138 my $name = $self->{name} ;
139 my $rowno = 1 ;
140 my $fields = $self -> {fields} ;
141 my @entries = ref $fdat->{$name} eq 'ARRAY'?@{$fdat->{$name}}:
142 ref $fdat->{$name} eq 'HASH' ?init_data_hash ($rowno, $fdat->{$name}, $fields):
143 split("\t",$fdat->{$name});
144 my $line2 = $self -> {line2} ;
145 my $order = $self -> {order} ;
146 my $order_desc = $self -> {order_desc} ;
147
148 if ($order)
149 {
150 if ($order !~ /^\d+$/)
151 {
152 my $i = 1 ;
153 foreach (@$fields)
154 {
155 $order = $i if ($_ -> {name} eq $order) ;
156 $i++ ;
157 }
158 }
159  
160 if ($order_desc)
161 {
162 @entries = sort { $b -> [$order] cmp $a -> [$order] } @entries ;
163 }
164 else
165 {
166 @entries = sort { $a -> [$order] cmp $b -> [$order] } @entries ;
167 }
168 }
169  
170 my $gridro = $self -> is_readonly ($req) ;
171 my $coloffset = defined ($self -> {coloffset})?$self -> {coloffset}:1 ;
172 my $data;
173 my $i = 0 ;
174 my $j ;
175 my $col ;
176 my $colval ;
177 my @rowclass ;
178 foreach my $entry (@entries)
179 {
180 $data = ref $entry?$entry:[$ldap?ecos::LdapBase -> splitAttrValue($entry):$entry];
181 if (ref $self -> {rowclass} eq 'CODE')
182 {
183 $rowclass[$i] = &{$self -> {rowclass}}($data, $self) ;
184 }
185 #my $co = $coloffset ;
186 #shift @$data while ($co-- > 0) ;
187 $j = 0 ;
188 foreach my $field ((@$fields, ($line2?($line2):())))
189 {
190 if (ref $data eq 'HASH')
191 {
192 $fdat->{"__${name}_${j}_$i"} = $data->{$field->{name}} ;
193 }
194 else
195 {
196 $col = exists $field -> {col}?$field -> {col}:$j ;
197 if ($colval = $field -> {colval})
198 {
199 $fdat->{"__${name}_${j}_$i"} = ($data->[$col+$coloffset] =~ /\Q$colval\E/)?1:0 ;
200 }
201 else
202 {
203 $fdat->{"__${name}_${j}_$i"} = $data->[$col+$coloffset] ;
204 }
205 }
206
207 if ($field -> can ('init_data'))
208 {
209 local $field->{name} = "__${name}_${j}_$i" ;
210 local $field -> {fullid} = "$self->{fullid}_${j}_$i" ;
211 local $field->{dataprefix} ;
212 $field -> init_data ($req, $self) if (!$gridro && $field -> should_init_data($req)) ;
213 }
214 $j++ ;
215 }
216 $i++ ;
217 }
218 $fdat->{"__${name}_max"} = $i?$i:1;
219 $self -> {rowclasses} ||= \@rowclass ;
220 }
221  
222 # ------------------------------------------------------------------------------------------
223 #
224 # init_markup
225 #
226  
227 sub init_markup
228 {
229 my ($self, $req, $grid, $method) = @_ ;
230
231 $self -> init_data ($req) if ($self -> is_readonly()) ;
232
233 my $fdat = $req -> {docdata} || \%fdat ;
234 my $name = $self->{name} ;
235 my $i ;
236 my $j ;
237 my $max = $fdat->{"__${name}_max"} ;
238 my $fields = $self -> {fields} ;
239 my $line2 = $self -> {line2} ;
240  
241 foreach $i (0..$max, '%row%')
242 {
243 $j = 0 ;
244 foreach my $field ((@$fields, ($line2?($line2):())))
245 {
246 if ($field -> can ('init_markup'))
247 {
248 local $field->{name} = "__${name}_${j}_$i" ;
249 local $field -> {fullid} = "$self->{fullid}_${j}_$i" ;
250 local $field->{dataprefix} ;
251 $field -> init_markup ($req, $self, 'show_control') ;
252 }
253 $j++ ;
254 }
255 }
256 }
257  
258 # ---------------------------------------------------------------------------
259 #
260 # should_init_data - returns true if init_data should be called for this control
261 #
262  
263 sub should_init_data
264  
265 {
266 my ($self, $req) = @_ ;
267  
268 return !$self -> is_disabled ($req) ;
269 }
270  
271 # ------------------------------------------------------------------------------------------
272 #
273 # prepare_fdat_sub - wird aufgerufen nachdem die einzelen Controls abgearbeitet sind abd
274 # bevor die daten zusammenfuehrt werden
275 #
276  
277 sub prepare_fdat_sub
278 {
279 my ($self, $req) = @_ ;
280
281 }
282
283 # ------------------------------------------------------------------------------------------
284 #
285 # prepare_fdat - daten zusammenfuehren
286 #
287  
288 sub prepare_fdat
289 {
290 my ($self, $req) = @_ ;
291
292 return if ($self -> is_readonly ($req)) ;
293
294 my $fdat = $req -> {form} || \%fdat ;
295 my $ldap = $req->{ldap};
296 my $name = $self->{name} ;
297 return if (!exists $fdat->{"__${name}_max"}) ;
298  
299 my $fields = $self -> {fields} ;
300 my $line2 = $self -> {line2} ;
301 my $max = $fdat->{"__${name}_max"} ;
302  
303 my @rows;
304 my $j ;
305 my $i ;
306 my $val ;
307 my $col ;
308 my $colval ;
309 my %orders ;
310 my $order ;
311 for (my $i = 0; $i < $max; $i++)
312 {
313 my $ok = 0 ;
314 my $j = 0 ;
315 foreach my $field (@$fields, $line2?($line2):())
316 {
317 if ((ref ($field) =~ /::/) && $field -> can ('prepare_fdat'))
318 {
319 local $field->{name} = "__${name}_${j}_$i" ;
320 local $field -> {fullid} = "$self->{fullid}_${j}_$i" ;
321 local $field->{dataprefix} ;
322 $field -> prepare_fdat ($req) ;
323 }
324 $ok++ ;
325 $j++ ;
326 }
327
328 next if (!$ok) ;
329  
330 $order = $fdat->{"__${name}_#row#_$i"} ;
331 next if (!defined($order)) ;
332 $order = $i + 10000 if (!defined($order)) ;
333 $orders{$order} = $i ;
334 }
335  
336 $self -> prepare_fdat_sub ($req) if ((ref ($self) =~ /::/));
337  
338 my $coloffset = defined ($self -> {coloffset})?$self -> {coloffset}:1 ;
339 foreach my $order (sort { $a <=> $b } keys %orders)
340 {
341 $i = $orders{$order} ;
342 $j = 0 ;
343 my $empty = 1 ;
344 my @data = $coloffset?($i+1):() ;
345 foreach my $field (@$fields)
346 {
347 $col = exists $field -> {col}?$field -> {col}:$j ;
348 if ($colval = $field -> {colval})
349 {
350 $data[$col+$coloffset] .= $colval if ($fdat->{"__${name}_${j}_$i"}) ;
351 }
352 else
353 {
354 $data[$col+$coloffset] = $fdat->{"__${name}_${j}_$i"} ;
355 }
356 $empty = 0 if ($data[$col+$coloffset] ne '') ;
357 $j++ ;
358 }
359 $val = $ldap?ecos::LdapBase -> joinAttrValue(\@data):\@data ;
360 push @rows, $val if (!$empty) ;
361 }
362 if ($self -> {datatype} eq 'hash')
363 {
364 if (exists $self -> {hasharray})
365 {
366 $fdat->{$name} = { map { ( shift @$_ => \@$_ ) } @rows } ;
367 }
368 else
369 {
370 $fdat->{$name} = { map { ($_->[1] => $_->[2]) } @rows } ;
371 }
372 }
373 else
374 {
375 $fdat->{$name} = \@rows ;
376 }
377
378 foreach my $key (keys %$fdat)
379 {
380 delete $fdat->{$key} if ($key =~ /^__\Q$name\E_/) ;
381 }
382  
383 }
384  
385 # ------------------------------------------------------------------------------------------
386 #
387 # get_display_text - returns the text that should be displayed
388 #
389  
390 sub get_display_text
391 {
392 my ($self, $req, $value) = @_ ;
393
394 return '' if (!ref $value) ;
395
396 my $name = $self -> {name} ;
397 my $fields = $self -> {'fields'};
398 my $showfields = $req -> {'grid_gtf_' . $name} ;
399 my $allfields = $req -> {'grid_gta_' . $name} ;
400 if (!$showfields)
401 {
402 my $fdat = $req -> {docdata} || \%Embperl::fdat ;
403 my $max = $fdat -> {"__${name}_max"} ||= 0 ;
404 my $flat = $self -> {flat} ;
405 my @flat = split /\s*;\s*/, $flat ;
406 my $i = 0 ;
407 my @fields ;
408 my %fields ;
409 foreach my $field (@$fields)
410 {
411 $fields{$field -> {name}} = $i ;
412 push @fields, $field -> {name} ;
413 $i++ ;
414 }
415 @fields = @flat if (@flat) ;
416 $req -> {'grid_gtf_' . $name} = $showfields = \@fields ;
417 $req -> {'grid_gta_' . $name} = $allfields = \%fields ;
418 }
419
420 my @data ;
421 my $fieldname ;
422 my $j ;
423 my @rows ;
424 my $field ;
425 my $text ;
426 my @value ;
427 my $coloffset = defined ($self -> {coloffset})?$self -> {coloffset}:1 ;
428 my $col ;
429 my $colval ;
430 my $val ;
431 @value = (ref ($value) eq 'HASH')?init_data_hash (1, $value, $fields):@$value ;
432 foreach my $rowval (@value)
433 {
434 my @row ;
435 foreach $fieldname (@$showfields)
436 {
437 $j = $allfields -> {$fieldname} ;
438 $field = $fields -> [$j] ;
439 next if $field -> is_hidden ;
440 $col = exists $field -> {col}?$field -> {col}:$j ;
441 if ($colval = $field -> {colval})
442 {
443 $val = $rowval->[$col+$coloffset] =~ /\Q$colval\E/?1:0 ;
444 }
445 else
446 {
447 $val = $rowval->[$col+$coloffset] ;
448 }
449  
450 $text = $field -> get_display_text ($req, $val, 1) ;
451 push @row, $text if ($text ne '') ;
452 }
453 push @rows, join (', ', @row) if (@row) ;
454 }
455 return join (' / ', @rows) ;
456 }
457 1 ;
458  
459 __EMBPERL__
460  
461 [# ---------------------------------------------------------------------------
462 #
463 # show_control_readonly - output readonly grid
464 #]
465  
466 [$ sub xshow_control_readonly ($self, $req)
467  
468 my $name = $self -> {name} ;
469 my $max = $fdat{"__${name}_max"} ||= 0 ;
470  
471 my $flat = $self -> {flat} ;
472 my @flat = split /\s*;\s*/, $flat ;
473 my $fields = $self -> {'fields'};
474 my $i = 0 ;
475 my @fields ;
476 my %fields ;
477 foreach my $field (@$fields)
478 {
479 $fields{$field -> {name}} = $i ;
480 push @fields, $field -> {name} ;
481 $i++ ;
482 }
483 @fields = @flat if (@flat) ;
484  
485 my @data ;
486 for ($i = 0; $i < $max ; $i++)
487 {
488 my $j ;
489 my @row ;
490 foreach $fieldname (@fields)
491 {
492 my $field = $fields -> [$fields{$fieldname}] ;
493 next if $field -> is_hidden ;
494 $j = $fields{$fieldname} ;
495 if ($field -> {datasrcobj})
496 {
497 push @row, $field -> get_option_from_value ($fdat{"__${name}_${j}_$i"}, $req) ;
498 }
499 else
500 {
501 push @row, $fdat{"__${name}_${j}_$i"} ;
502 }
503 }
504 push @data, join (' ', @row) if (grep /\S/, @row) ;
505 }
506 my $value = join (' / ', @data) ;
507 $]
508 <div [+ do { local $escmode = 0 ; $self -> get_std_control_attr($req, '', 'readonly') } +]>[+ $value +]</div>
509 [$endsub$]
510
511  
512 [# ---------------------------------------------------------------------------
513 #
514 # show - output the control
515 #]
516  
517 [$ sub show ($self, $req)
518  
519 my $name = $self -> {name} ;
520 my $span = ($self->{width_percent}) ;
521 my $nsprefix = $self -> form -> {jsnamespace} ;
522 my $max = $fdat{"__${name}_max"} ||= 1 ;
523 $self -> {fullid} = $req -> {uuid} . '_' . $self -> {id} ;
524  
525 $]<table class="ef-element ef-element-width-[+ $self -> {width_percent} +][+ ' ' +][+ $self -> {state} +] ef-attach-always" _ef_attach="ef_grid">
526 <tr>
527 <td class="ui-label-box" colspan="[+ $span +]">
528 [-
529 $fdat{$name} = $self -> {default} if ($fdat{$name} eq '' && exists ($self -> {default})) ;
530 my $span = 0 ;
531 $self -> show_grid_title ($req);
532 -]
533 <input type="hidden" name="__[+ $self -> {name} +]_max" class="ef-control-grid-max">
534 <table class="cGridTable cBase ef-control-grid-table [+ $self -> {state} +]" >
535 [- $self -> show_grid_header ($req); -]
536 [- $self -> show_grid_table ($req) ; -]
537 </table>
538 [- $self -> show_grid_title ($req)
539 if ($max > $self -> {header_bottom} && !$self -> {disable_controls}) -]
540 [$ if (!$self -> {no_addrow}) $]
541 <table class="ef-control-grid-newrow" style="display: none">
542 [-
543 local $req -> {epf_no_script} = 1 ;
544 $self -> show_grid_table_row ($req, '%row%') ;
545 -]
546 </table>
547 [$endif$]
548 </td>
549 </tr>
550 </table>
551 [$endsub$]
552
553  
554 [# -----------------------------------------------------------------------------
555 #
556 # show_grid_title - Zeigt den Titel der Tabelle an
557 #]
558  
559 [$ sub show_grid_title ($self, $req)
560 $]
561 <table class="cBase cGridTitle [+ $self -> {state} +]">
562 <tr class="cTableRow">
563 <td class="cBase cGridLabelBox" _ef_attr="[+ $self -> {name} +]">[+ $self -> form -> convert_label ($self, undef, undef, $req) +]</td>
564 [$if !($self -> is_readonly ($req)) && !$self -> {disable_controls} $]
565 <td class="cBase cGridControlBox">
566 <div>
567 <span class="ui-icon ui-icon-circle-triangle-n ef-icon ef-control-grid-up" title="[= ctl:grid_up =]"></span>
568 <span class="ui-icon ui-icon-circle-triangle-s ef-icon ef-control-grid-down" title="[= ctl:grid_down =]"></span>
569 <span class="ui-icon ui-icon-circle-plus ef-icon ef-control-grid-add" title="[= ctl:grid_add =]"></span>
570 <span class="ui-icon ui-icon-circle-arrow-e ef-icon ef-control-grid-insert" title="[= ctl:grid_insert =]"></span>
571 <span class="ui-icon ui-icon-circle-arrow-s ef-icon ef-control-grid-copy" title="[= ctl:grid_copy =]"></span>
572 <span class="ui-icon ui-icon-circle-minus ef-icon ef-control-grid-del" title="[= ctl:grid_del =]"></span>
573 </div>
574 </td>
575 [$endif$]
576 </tr>
577 </table>
578 [$ endsub $]
579
580 [# ---------------------------------------------------------------------------
581 #
582 # show_grid_header Erzeugt den Tabellenkopf
583 #]
584  
585 [$ sub show_grid_header ($self, $req)
586  
587 my $fields = $self->{'fields'};
588 $]
589 <thead>
590 <tr class="cGridHeader">
591 [$ foreach my $field (@$fields) $]
592 [* next if ($field -> is_hidden ) ; *]
593 <td class="cGridHeader" style="[$if($width = $field->{width})$]width: [+$width+];[$endif$] [$if($width = $field->{min_width})$]min-width: [+$width+];[$endif$]" _colattr="[+ $field->{name} +]">[+ $self -> form -> convert_label ($self, $field->{nameprefix}?$field->{nameprefix} . $field->{name}:$field->{name}, $field->{text}, $req) +]</td>
594 [$ endforeach $]
595 </tr>
596 </thead>
597 [$ endsub $]
598  
599 [# ---------------------------------------------------------------------------
600 #
601 # show_grid_footer Erzeugt den Tabellenfu� (Summenzeile)
602 #]
603  
604 [$ sub show_grid_footer ($self, $req)
605  
606 my $fields = $self->{'fields'};
607 my $name = $self -> {name} ;
608 my $i = $fdat{"__${name}_footer"} ;
609 my $j = 0 ;
610 $]
611  
612 <tfoot>
613 <tr class="cGridFooter">
614 [$ foreach my $field (@$fields) $]
615 [* next if ($field -> is_hidden ) ; *]
616 <td class="cGridFooter cGridCellReadonly">[-
617 local $field -> {name} = "__${name}_${j}_$i" ;
618 local $field -> {state} = $field -> {state} . ' ' . $self -> {state} ;
619 local $field -> {fullid} = "$self->{fullid}_${j}_$i" ;
620 local $field->{dataprefix} ;
621 $field -> show_control_readonly_array ($req) if (!$field -> {nofooter}) ;
622 $j++ ;
623 -]</td>
624 [$ endforeach $]
625 </tr>
626 </tfoot>
627 [$ endsub $]
628  
629 [# ---------------------------------------------------------------------------
630 #
631 # show_grid_table_row Erzeugt eine Grid-Tabelle-Zeile
632 #]
633  
634 [$ sub show_grid_table_row ($self, $req, $i)
635  
636 my $fields = $self -> {fields} ;
637 my $line2 = $self -> {line2} ;
638 my $id = $self -> {fullid};
639 my $name = $self -> {name} ;
640 my $n = 0 ;
641 my $gridro = $self -> is_readonly ($req) ;
642 my $ro ;
643 my $j = 0 ;
644 my $rowclass = $self -> {rowclasses}[$i];
645 if ($req -> {only_one_css_class})
646 {
647 $rowclass ||= 'cGridRow' ;
648 }
649 else
650 {
651 $rowclass = 'cGridRow ' . $rowclass ;
652 }
653 $]
654
655 <tr class="[+ $rowclass +]" id="[+ "$id-row-$i" +]">
656 [$foreach $field (@$fields)$]
657 [$if $field -> is_hidden $][-
658 local $field -> {name} = "__${name}_${j}_$i" ;
659 local $field -> {state} = $self -> {state} ;
660 local $field -> {fullid} = "${id}_${j}_$i" ;
661 local $field->{dataprefix} ;
662 $field -> show_control ($req) ;
663 $j++ ;
664 -][$else$]
665 [- $ro = $gridro || $field -> is_readonly () ; -]
666 <td class="[+ $ro?'cGridCellReadonly':'cGridCell' +]" style="[$if($width = $field->{width})$]width: [+$width+];[$endif$]">[$if $n++ == 0$]<input type="hidden" name="[+ "__${name}_#row#_$i" +]" value="[+ $i +]">[$endif$][-
667 local $field -> {name} = "__${name}_${j}_$i" ;
668 local $field -> {state} = $self -> {state} ;
669 local $field -> {fullid} = "${id}_${j}_$i" ;
670 local $field->{dataprefix} ;
671 if ($ro)
672 {
673 $field -> show_control_readonly_array ($req)
674 }
675 else
676 {
677 $field -> show_control ($req)
678 }
679 $j++ ;
680 -]</td>
681 [$endif$]
682 [$endforeach$]
683 </tr>
684 [$if $line2 $]
685 [- $ro = $gridro || $line2 -> is_readonly ; -]
686 [$if (!$ro || $fdat{"__${name}_${j}_$i"} !~ /^\s*$/) $]
687 <tr class="cGridRow2" id="[+ "$id-row2-$i" +]">
688
689 <td colspan="[+ scalar(@$fields) +]" class="[+ $ro?'cGridCellReadonly':'cGridCell' +]">[$if $n++ == 0$]<input type="hidden" name="[+ "__${name}_#row#_$i" +]" value="[+ $i +]">[$endif$][-
690 local $line2 -> {name} = "__${name}_${j}_$i" ;
691 local $line2 -> {state} = $self -> {state} ;
692 local $field -> {fullid} = "${id}_${j}_$i" ;
693 local $field->{dataprefix} ;
694 if ($ro)
695 {
696 $line2 -> show_control_readonly_array ($req)
697 }
698 else
699 {
700 $line2 -> show_control ($req)
701 }
702 $j++ ;
703 -]</td>
704 </tr>
705 [$endif$]
706 [$endif$]
707 [$ endsub $]
708
709 [# ---------------------------------------------------------------------------
710 #
711 # show_grid_table Erzeugt eine Grid-Tabelle
712 #]
713  
714 [$ sub show_grid_table ($self, $req)
715 my $name = $self->{name} ;
716 my $fields = $self -> {fields} ;
717 my $id = $self -> {fullid};
718 my $i = 0 ;
719 my $max = $fdat{"__${name}_max"} || 1 ;
720 my $order = $self -> {order_indices} ;
721 $]
722  
723 <tbody>
724 [* for ($i = 0; $i < $max ; $i++ ) { *]
725 [- $self -> show_grid_table_row ($req, $order?$order -> [$i]:$i) ; -]
726 [* } *]
727 </tbody>
728
729 [$endsub$]
730  
731  
732  
733 __END__