[-
$r = shift ;
-]
[$ if $fdat{-update_item} $]
[= edit1 =] [+ $r->{category_set}{category} +]
[$ elsif $fdat{-delete_item} $]
[= del1 =]
[$ elsif $fdat{-add_item} $]
[= add1 =] [+ $r->{category_set}{category} +]
[$ else $]
[# [= show1 =] #][+ $r->{category_set}{category} +]
[$ endif $]
|
[$ if ($item_set = $r->{item_set}) $] [# && (ref ($item_set) ne 'ARRAY' || @$item_set > 0) $]#]
[$ if $fdat{-update_item} $]
[= edit2 =]
[$ elsif $fdat{-delete_item} $]
[= del2 =]
[$ elsif $fdat{-add_item} $]
[= add2 =]
[$ else $]
[= show2 =]
[$ endif $]
[$ if $fdat{-delete_item} && !$r->{error} $]
[= back_to_index =]
[$ endif $]
[-
$ct = $r->{category_texts};
$cy = $r->{category_types};
$cf = $r->{category_fields};
$cfnl = $r->{category_fields_nolang};
$rec = $item_set->[0] ;
$email = $rec -> {email} ;
$date = $item_set -> {modtime} ;
$date =~ /^(\d+)-(\d+)-(\d+)/ ;
$date = $r -> param -> language eq 'de'?"$3.$2.$1":"$1-$2-$3" ;
$status = eval { $r -> gettext ($item_set->{state} ? 'display' : 'hide') } ;
-]
[# [- use Data::Dumper -][+ Dumper ($cfnl, $rec) +]
#]
[$if $cfnl && @$cfnl $]
[$ foreach $type (@$cfnl) $]
[$ if $txt = $ct->{$type . '_text'} $]
[$ if $cy->{$type} =~ /showstatic/ $]
[- @txt = split (/\n/, $txt) -][$ foreach $t (@txt) $][+ $t +] [$ endforeach $]
[$ elsif $cy->{$type} !~ /static/ $]
[+ $txt +]: |
[$ if $cy->{$type} =~ /pulldown/ $]
[+ $r->app->get_title($r,$type,$rec->{$type}) +]
[$ elsif $cy->{$type} =~ /checkboxrow/ $]
[-
%selected = map { $_ => 1 } split ("\t", $rec->{$type});
#warn "selected checkboxes: ", Data::Dumper->Dumper (\%selected), "\n";
if ($type =~ /^(.*?)_id$/) {
$table = $1 ;
} else {
$table = $type;
}
$table =~ s/^.*__// ;
$poss = $r->app->get_titles($r,$table);
$i = 0;
$moreThanOne = 0;
-]
[$ while $t = ($poss->[$i++]) $]
[# - #warn "checkboxrow[$i] = ", Data::Dumper->Dumper ($t), "\n"; - #]
[+ $selected{$t->{id}} ? ($moreThanOne++ ? ", " : "") . $t->{title} : "" +]
[$ endwhile $]
[$ elsif $cy->{$type} =~ /checkbox/ $]
[+ $r -> param -> language eq 'de'?($rec->{$type}?'Ja':'Nein'):($rec->{$type}?'Yes':'No') +]
[$ else $]
[- @txt = split (/\n/, $rec -> {$type}) -][$ foreach $t (@txt) $][+ $t +] [$ endforeach $]
[$ endif $]
|
[$endif$]
[$endif$]
[$endforeach$]
|
[$endif$]
[$if $cf && @$cf $]
[- $rec = $item_set->[$row] -]
[+ $rec -> {name} +] |
[$ foreach $type (@$cf) $]
[$ if $cy->{$type} !~ /static/ $]
[$ if $txt = $ct->{$type . '_text'} $]
[+ $txt +]: |
[$ if $cy->{$type} =~ /pulldown/ $]
[+ $r->app->get_title($r,$type,$rec->{$type}) +]
[$ elsif $cy->{$type} =~ /checkboxrow/ $]
[-
%selected = map { $_ => 1 } split ("\t", $rec->{$type});
if ($type =~ /^(.*?)_id$/) {
$table = $1 ;
} else {
$table = $type;
}
$table =~ s/^.*__// ;
$poss = $r->app->get_titles($r,$table);
$i = 0;
$moreThanOne = 0;
-]
[$ while $t = ($poss->[$i++]) $]
[- warn "checkboxrow[$i] = ", Data::Dumper->Dumper ($t), "\n"; -]
[+ $selected{$t->{id}} ? ($moreThanOne++ ? ", " : "") . $t->{title} : "" +]
[$ endwhile $]
[$ elsif $cy->{$type} =~ /checkbox/ $]
[$ if $rec->{$type} $]
Ja
[$ else $]
Nein
[$ endif $]
[$ else $]
[- @txt = split (/\n/, $rec-> {$type}) -]
[$ foreach $t (@txt) $]
[+ $t +]
[$ endforeach $]
[$ endif $]
|
[$endif$]
[$endif$]
[$endforeach$]
|
[$endif$]
[$ if $udat{user_email} $]
[- $tt = $r->{category_set}{table_type} -]
[New]
[Edit]
[Overview]
[$ endif $]
Owner: [+ $email +]
Status: [+ $status +]
[+ $date +]
[$ endif $]
[#
[! use Data::Dumper; !]
[- $DBIx::Recordset::FetchsizeWarn = 0; -]
[+ Dumper $r->{error},\%fdat,[keys %$r],[@{$r->{category_fields}}],{%{$r->{category_texts}}},{%{$r->{category_set}}},$r->{item_set} +]
#]