@_UI_STD_INIT_@ [calc] return unless $CGI->{mv_more_ip}; $CGI->{mv_data_table} = $Values->{mv_data_table}; return; [/calc] [seti page_title] [either] [cgi page_title] [or] [L]Spreadsheet Edit:[/L] [cgi mv_data_table] [/either] [/seti] [seti page_banner] [either] [cgi page_banner] [or] [L]Spreadsheet Edit:[/L] [page href=__UI_BASE__/db_metaconfig form=" ui_table=[cgi mv_data_table] ui_view=[cgi ui_meta_view] start_at=extended.spread_height "][cgi mv_data_table] [/either] [/seti] [set ui_class]Admin[/set] [seti help_name][either][cgi help_name][or]gensql.main[/either][/seti] [seti icon_name][either][cgi icon_name][or]icon_config.gif[/either][/seti] @_UI_STD_HEAD_@ [tmp extra_title] [loop list="[cgi mv_data_table]"] [if-loop-data __UI_META_TABLE__ name] [loop-data __UI_META_TABLE__ name] [/if-loop-data] [if-loop-data __UI_META_TABLE__ help_url]    help [/if-loop-data] [if-loop-data __UI_META_TABLE__ help] [loop-data __UI_META_TABLE__ name] [/if-loop-data] [/loop] [/tmp] [calc] $Scratch->{page_banner} .= $Scratch->{extra_title}; $Scratch->{page_title} .= $Scratch->{extra_title}; return; [/calc] [output name=search_box]
[L]Limit with search[/L]:
[output name=""] [perl tables="[cgi mv_data_table] __UI_META_TABLE__"] my $table = $CGI->{mv_data_table}; my $db = $Db{$table}; my $mrec = $Tag->meta_record($table, $CGI->{ui_meta_view}) || {}; my $sp = q{@@MV_PAGE@@}; $mrec ||= {}; $mrec->{spread_fields} ||= join(" ", $db->columns()); $mrec->{spread_height} ||= 10; my $key = $CGI->{ui_data_key_name} = $db->config('KEY'); $mrec->{spread_sort} ||= $key; $CGI->{ui_description_field} = $mrec->{label}; my $qualbase = qq{ sp=$sp st=db ml=$mrec->{spread_height} ms=0 }; my $qualsimple = qq{ fi=$table rf=$CGI->{ui_data_key_name} tf=$mrec->{spread_sort} }; my $qual; my $sstring; if(! $CGI->{ui_text_qualification}) { $qual = "ra=yes"; } elsif ($CGI->{ui_text_qualification} =~ /^\s*select/ ) { $qual = "sq=$CGI->{ui_text_qualification}"; $sstring = join "\n", $qualbase, $qual; } elsif ($CGI->{ui_text_qualification} =~ /=/ ) { my ($f, $s) = split /\s*=\s*/, $CGI->{ui_text_qualification} , 2; $qual = "co=1\nop=eq\nse=$s\nsf=$f"; } elsif ($CGI->{ui_text_qualification}) { $qual = "se=$CGI->{ui_text_qualification}\nsu=1"; } else { $qual = "ra=yes"; } $sstring ||= join "\n", $qualbase, $qualsimple, $qual; my @fields = split /[\0\s,]+/, $mrec->{spread_fields}; @fields = grep length($_) && $_ ne $key, @fields; $CGI->{mv_data_fields} = join " ", @fields; $CGI->{mrec_textarea_rows} ||= 4; $CGI->{mrec_spread_width} ||= $mrec->{spread_width} || 12; $Scratch->{mrec_options} = $sstring; $Scratch->{ui_num_col} = scalar(@fields) + 2; $Scratch->{ui_most_col} = $Scratch->{ui_num_col} - 1; $Config->{NoSearch} = ''; return; [/perl] [output name="top_of_form"]
[output name=""] [calc] [/calc] [search-region more=1 arg="[scratch mrec_options]"] [more-list] [prev-anchor]  <  [/prev-anchor] [next-anchor]  >  [/next-anchor] [first-anchor] <<[/first-anchor] [last-anchor] >>[/last-anchor] [page-anchor] $PAGE$[/page-anchor] [/more-list] [row-edit columns="[cgi mv_data_fields]" ] [search-list] [item-sub addnum] my $inc = shift; my $out = ''; if($ss_row_num) { $out = $ss_row_num . '_'; } $ss_row_num++ if $inc; return $out; [/item-sub] [if-mm keys [item-code]] [row-edit key="[item-code]" extra="valign=top" pointer="[item-exec addnum]1[/item-exec]" columns="[cgi mv_data_fields]" ui_meta_specific="[cgi ui_meta_specific]" ] [/if-mm] [set row_number][item-increment][/set] [/search-list] [row-edit columns="[cgi mv_data_fields]"] [row-edit blank=1 pointer=999999 extra="valign=top" columns="[cgi mv_data_fields]" extra="valign=top" ] [more-list] [prev-anchor]  <  [/prev-anchor] [next-anchor]  >  [/next-anchor] [first-anchor] <<[/first-anchor] [last-anchor] >>[/last-anchor] [page-anchor] $PAGE$[/page-anchor] [/more-list]
  [msg arg.0=`q{[more]}`]More pages: %s[/msg]
  [cgi ui_data_key_name]
[page href="__UI_BASE__/flex_editor" form=| page_title=Edit [cgi mv_data_table]: [item-code] mv_data_table=[cgi mv_data_table] ui_meta_specific=[cgi ui_meta_specific] item_id=[item-code] |][item-code]
[L]New record[/L]
  [cgi ui_data_key_name]
  [msg arg.0=`q{[more]}`]More pages: %s[/msg]
[/search-region] [output name=top_buttons] [button text="[L]Ok[/L]" extra=|style="font-weight: bold"|] mv_todo=set [return-to click] [/button] [button text="[L]Delete checked records[/L]" confirm="[L]Are you sure you want to delete the checked records?[/L]"] [flag type=write table="[cgi mv_data_table]"] mv_nextpage=__UI_BASE__/flex_select mv_auto_export= mv_todo=return [if-mm tables =d] [perl tables="[cgi mv_data_table]"] my $tab = $CGI->{mv_data_table}; my $db = $Db{$tab}; unless ($db) { $Scratch->{ui_message} = "No table '$tab'"; return; } my @items = split /\0/, $CGI->{batch_id}; foreach my $item (@items) { if ($db->delete_record($item)) { $out .= errmsg("Deleted %s from table %s", $item, $tab) . '
'; } else { $out .= "Item $item not in $tab table (or delete failed)
"; } } $Scratch->{ui_message} = $out; return; [/perl] [else] [set ui_message][L]Not authorized to delete items.[/L][/set] [/else] [/if-mm] [return-to click] [/button] [output name=bottom_buttons] [if-mm super] [L]Auto-export[/L] [/if-mm] [button text="[L]Ok[/L]" extra=|style="font-weight: bold"|] mv_todo=set [return-to click] [/button] [button text="[L]Delete checked records[/L]" confirm="[L]Are you sure you want to delete the checked records?[/L]"] [flag type=write table="[cgi mv_data_table]"] mv_nextpage=__UI_BASE__/flex_select mv_auto_export= mv_todo=return [if-mm tables =d] [perl tables="[cgi mv_data_table]"] my $tab = $CGI->{mv_data_table}; my $db = $Db{$tab}; unless ($db) { $Scratch->{ui_message} = "No table '$tab'"; return; } my @items = split /\0/, $CGI->{batch_id}; foreach my $item (@items) { if ($db->delete_record($item)) { $out .= errmsg("Deleted %s from table %s", $item, $tab) . '
'; } else { $out .= "Item $item not in $tab table (or delete failed)
"; } } $Scratch->{ui_message} = $out; return; [/perl] [else] [set ui_message][L]Not authorized to delete items.[/L][/set] [/else] [/if-mm] [return-to click] [/button] [output name="bottom_of_form"]
@_UI_STD_FOOTER_@