Gossamer Forum
Home : Products : DBMan SQL : Discussion :

creating a new request during a request

Quote Reply
creating a new request during a request
Hi,

Kind of a weird question. When certain data is modified, I want to send an email containing the results of the search results page from the DBMan SQL system to the user. Hard to explain what I mean....Crazy

I guess it comes to the following: in a PRE modify_record plugin, I want to get a string with the results of a search_results query. Does someone know if this is possible?

Thanks, Jasper

http://www.bookings.org
Quote Reply
Re: [jaspercram] creating a new request during a request In reply to
Hi,

You can get the modified information with modify_success instead of modify_record hook

TheStone.

B.
Quote Reply
Re: [TheStone] creating a new request during a request In reply to
Great. Will save me a lot of time. Cool

Do you (or someone else) also have idea how to create a completely new page in this plugin?

Jasper

http://www.bookings.org
Quote Reply
Re: [jaspercram] creating a new request during a request In reply to
You should create PRE modify_success plugin. Have a look at the code below:

sub modify_success {
#----------------------------------------------------------------------
my ($home, $id) = @_;

my $hsh;
if ( $home->{db}->ai ) {
$hsh = $home->{db}->get ($id, 'HASH');
}
else {
my $lookup = {};
my $pk = $home->{db}->pk;
foreach (@$pk) { $lookup->{$_} = $home->{cgi}->{$_}; }
$hsh = $home->{db}->get ($lookup, 'HASH');
}

# Add your code right here

return ('modify_success.html', {
header => $home->_language('HEA_MODED'),
msg => $home->_language('MOD_SUCCESSFULLY'),
values => $hsh,
($hsh) ? %$hsh : hsh => 1
});
}


Hope that helps.

TheStone.

B.