[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] Spreadsheet Edit: [page href=__UI_BASE__/db_metaconfig_spread form=" ui_table=[cgi mv_data_table] ui_view=[cgi ui_meta_view] "][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_@
[if !scratch tmp_large]
[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]
[/if]
[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}) || {}; $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 $qual; if ($CGI->{ui_text_qualification} and $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}"; } else { $qual = "ra=yes"; } 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; my $sp = q{@@MV_PAGE@@}; $Scratch->{mrec_options} = qq{ $qual fi=$table st=db sp=$sp ml=$mrec->{spread_height} rf=$CGI->{ui_data_key_name} tf=$mrec->{spread_sort} }; $Scratch->{ui_num_col} = scalar(@fields) + 2; $Scratch->{ui_most_col} = $Scratch->{ui_num_col} - 1; $Config->{NoSearch} = ''; return; [/perl]
[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]" ] [/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]
     [button text="[L]Ok[/L]" extra=|style="font-weight: bold"|] mv_todo=set [return-to click] [/button]      
  [msg arg.0=`q{[more]}`]More pages: %s[/msg]
  [cgi ui_data_key_name]
[page href="__UI_BASE__/flex_editor" form=| page_title=Edit [value mv_data_table]: [item-code] mv_data_table=[value mv_data_table] item_id=[item-code] |]edit [item-code]
New record
  [cgi ui_data_key_name]
  [msg arg.0=`q{[more]}`]More pages: %s[/msg]
     [button text="[L]Ok[/L]" extra=|style="font-weight: bold"|] mv_todo=set [return-to click] [/button]       [button text="[L]Delete checked rows[/L]" confirm="[L]Are you sure you want to delete the checked rows?[/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 .= "Deleted $item from table $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]    [if-mm super]
[L]Auto-export[/L] [/if-mm]
[/search-region]
@_UI_STD_FOOTER_@