The code of Jean's subroutine for "add_record hook" also works for "modify_record hook":
sub modify_record {
my ($home) = @_;
my $cfg = Dbsql::Plugins->get_plugin_user_cfg ('PluginName');
$home->{cgi}->{$cfg->{date_col_name}} = GT::Date::date_transform($home->{cgi}->{$cfg->{date_col_name}},$cfg->{orig_format},$cfg->{new_format});
return @_;
}
I've tested it: first, I had a problem because I've installed several plugins that haven't been
loaded in the right order. After some research in the forum, I found a solution about how to
load the plugins in a specific order. Everything was fine after that
Does anyone have a solution for the modify_form hook? And another thing: sometimes, you
might have several date fields in a database - what's the best way to "enrich" Jean's plugin
with this functionality?
Thanks for your help and have a good time
Oliver
Code:
sub modify_record {
my ($home) = @_;
my $cfg = Dbsql::Plugins->get_plugin_user_cfg ('PluginName');
$home->{cgi}->{$cfg->{date_col_name}} = GT::Date::date_transform($home->{cgi}->{$cfg->{date_col_name}},$cfg->{orig_format},$cfg->{new_format});
return @_;
}
I've tested it: first, I had a problem because I've installed several plugins that haven't been
loaded in the right order. After some research in the forum, I found a solution about how to
load the plugins in a specific order. Everything was fine after that
Does anyone have a solution for the modify_form hook? And another thing: sometimes, you
might have several date fields in a database - what's the best way to "enrich" Jean's plugin
with this functionality?
Thanks for your help and have a good time
Oliver