[set table_perm]__ProductFiles_0__=v[/set]
[set help_name]item.editor[/set]
[set icon_name]icon_item.gif[/set]
@_UI_STD_HEAD_@
[if !cgi mv_data_table]
[or cgi ui_scrub_table]
[calc]
$CGI->{mv_data_table} = $Values->{mv_data_table} = $Config->{ProductFiles}[0];
return;
[/calc]
[/if]
[comment]
[/comment]
[if cgi deleterecords]
[if-mm function="!tables" table="[cgi mv_data_table]"]
[set ui_error]Not allowed to delete from [cgi mv_data_table].[/set]
[bounce page="__UI_BASE__/error"]
[else]
[tmp extra_tables][loop list=`
my @tab = grep /\S/, split /[\s,\0]+/, q{__UI_ITEM_TABLES__};
my %seen;
for (@tab) {
s/:.*//;
next if $seen{$_}++;
}
return join " ", @tab;
`][if-mm tables [loop-code]=d][loop-code] [flag type=write table="[loop-code]"][/if-mm][/loop][/tmp]
[/else]
[/if-mm]
[/if]
[perl tables="[cgi mv_data_table] [scratch extra_tables] __UI_META_TABLE__"]
delete $Scratch->{ui_location};
if($CGI->{ui_sequence_edit}) {
my $doit;
if($CGI->{item_id_left} =~ s/^(.*?),//) {
$CGI->{item_id} = $1;
$doit = 1;
}
elsif ($CGI->{item_id_left}) {
$CGI->{item_id} = delete $CGI->{item_id_left};
delete $CGI->{ui_sequence_edit};
$doit = 1;
}
else {
delete $CGI->{item_id};
delete $CGI->{ui_sequence_edit};
}
return unless $doit;
$Scratch->{ui_location}
= $Tag->area( {
href => '__UI_BASE__/item_edit',
form => qq{
item_id=$CGI->{item_id}
item_id_left=$CGI->{item_id_left}
ui_sequence_edit=$CGI->{ui_sequence_edit}
},
});
return;
}
# return unless $CGI->{item_id};
# return unless delete $CGI->{deleterecords};
# return unless $Tag->if_mm('tables', '=d');
#
# delete $Scratch->{ui_location};
# $Config->{NoSearch} = '';
#
# my $out = '';
# for(@{$CGI_array->{item_id}}) {
# my $key = $_;
# my $db;
# for( $CGI->{mv_data_table}, qw/__UI_ITEM_TABLES__/) {
# my ($t, $col) = split /:/, $_;
# if ( $Tag->if_mm('!tables', "$t=d") ) {
# push @errors, "Not authorized to delete from table $t";
# next;
# }
# unless ($db = $Db{$t}) {
# push @errors, "Table $t not available.";
# next;
# }
# if($col) {
# next unless length ($key);
# $key = $db->quote($key, $col);
# $out .= "deleted ";
# $out .= $db->query("delete from $t where $col = $key");
# $out .= " records from $t where $col = $key";
# }
# else {
# next unless $db->record_exists($key);
# $db->delete_record($key)
# or do {
# push @errors, $@;
# next;
# };
# $out .= "deleted $key from $t
";
# }
# }
# }
#
# if(@errors) {
# my $plural = @errors > 1 ? 's' : '';
# $out .= "Error$plural:
";
# }
# $Scratch->{ui_message} = $out;
# return;
[/perl]
[if scratch ui_location]
[bounce href=`delete $Scratch->{ui_location}`]
[/if]
[set ui_class]Items[/set]
[tmp page_title]Item editor[/tmp]
[if-mm super]
[tmp page_banner][page href="__UI_BASE__/flex_editor"
form='
mv_data_table=__UI_META_TABLE__
ui_meta_view=dbconfig
ui_data_fields=code name height field outboard options help help_url display_filter
ui_break_before=height display_filter
page_title=Change display information: [cgi mv_data_table]
ui_return_to=__UI_BASE__/item
ui_return_to=ui_scrub_table=1
item_id=[cgi mv_data_table]
']Item editor
[/tmp]
[/if-mm]
Message:
[scratchd ui_message]
|
[/if]