[if-mm !tables] [set ui_error]Not authorized for table.[/set] [bounce page="__UI_BASE__/error"] [/if-mm] [if-mm !advanced report] [bounce page="__UI_BASE__/error"] [value name=saved_report set=""] [/if-mm] [seti page_title]Reports[/seti] [set ui_class]Reports[/set] [set help_name]report[/set] [set icon_name]icon_config.gif[/set] [seti name=tables][list-databases][/seti] @_UI_STD_HEAD_@ [seti table_list] [loop prefix=table list="[scratch tables]"] [table-code] [/loop] [/seti]

Run saved report | Retrieve saved definition | Delete report
| [loop list="[list-glob spec='pages/__UI_BASE__/reports/* pages/__UI_BASE__/user/[data session mm_username]/reports/*']"] [calc] $lab = q{[loop-code]}; $lab =~ s:\.html.*::; $opt = $lab; $opt =~ s:^pages/::; $lab =~ s:.*/::; $lab =~ s/%([0-9a-fA-F]{2})/chr(hex($1))/ge; my $out = $Tag->page($opt); $out .= $lab; $out .= ' ' [/calc] [/loop] | [loop list="[list-glob spec='pages/__UI_BASE__/report_def/* pages/__UI_BASE__/user/[data session mm_username]/report_def/*']"] [calc] $lab = q{[loop-code]}; $lab =~ s:\.html.*::; $opt = $lab; $opt =~ s:^pages/::; $lab =~ s:.*/::; $lab =~ s/%([0-9a-fA-F]{2})/chr(hex($1))/ge; my $out = $Tag->page($opt); $out .= $lab; $out .= ' ' [/calc] [/loop] | [calc] delete $Scratch->{report_spec}; $reldir = $Config->{PageDir}; $reldir =~ s:^$Config->{VendRoot}/:: or do { $Scratch->{report_spec} = "Cannot do reports with absolute page directory."; return; }; $Session->{username} =~ /^\S+$/ or return "Bad username, no spaces allowed."; my @files = $Tag->list_glob("$reldir/__UI_BASE__/$Session->{username}/report*/*.html"); if($Tag->if_mm('super')) { push @files, $Tag->list_glob("$reldir/__UI_BASE__/report*/*.html"); } @files = sort @files; $Scratch->{report_spec} = join "\n", @files; return; [/calc] [set del_report] [calc] return unless $CGI->{ui_report_delete}; $reldir = $Config->{PageDir}; $reldir =~ s:^$Config->{VendRoot}/:: or return "Cannot do reports with absolute page directory."; @files = grep /$CGI->{ui_report_delete}$/, split /\n+/, $Scratch->{report_spec}; $out = ''; for(@files) { my $lab = $_; $lab =~ s:.*/([^/]+/.+)\.html:$1:; $lab =~ s/%([0-9a-fA-F]{2})/chr(hex($1))/ge; $out .= "Delete $lab: "; $out .= $Tag->unlink_file($_, "$reldir/") ? 'success' : 'FAILED'; $out .= ' '; } $Scratch->{report_delete_message} = $out; return; [/calc] [/set] [scratchd report_delete_message] [form-session-id]

[form-session-id]

| [form-session-id]

@_UI_STD_FOOTER_@