Get success message working after save
This commit is contained in:
@@ -77,7 +77,7 @@ sub main {
|
||||
# which DB - this only really works if the initial panel is a PARAMS type panel and not a TABLE
|
||||
my $db = $$${controldb | db | 'cdb'}; #pickup local or global db or Default to config
|
||||
<tal:block tal:repeat="dbfield dbfields">
|
||||
$$${prefix}_data{${dbfield}} = $db->prop('${dbfield}') || ${dbdefault | ""} || "";
|
||||
$$${prefix}_data{'${dbfield}'} = $db->prop('${dbfield}') || ${dbdefault | ""} || "";
|
||||
</tal:block>
|
||||
|
||||
#pickup any other contents needed and load them into hash shared with panel
|
||||
@@ -160,7 +160,7 @@ sub do_update {
|
||||
</tal:block>
|
||||
|
||||
if ($ret ne "ok") {
|
||||
${prefix}_data{trt} = $thispanel;
|
||||
${prefix}_data{'trt'} = $thispanel;
|
||||
$c->stash(error => $c->l($ret));
|
||||
$c->stash(
|
||||
title => $title,
|
||||
@@ -177,26 +177,31 @@ sub do_update {
|
||||
if ($ret ne "ok") {
|
||||
# return to the panel with error message
|
||||
$c->stash(error => $c->l($ret));
|
||||
$c->render("${lcPackageName}");
|
||||
$c->stash(
|
||||
title => $title,
|
||||
modul => $modul,
|
||||
${prefix}_data => \%${prefix}_data
|
||||
);
|
||||
$c->render(template => "${lcPackageName}");
|
||||
} else {
|
||||
$c->stash( success => $c->l('${panel} panel action was successful')); #A bit bland - edit it in the lex file
|
||||
}
|
||||
}
|
||||
</tal:block>
|
||||
# and call any signal-events needed
|
||||
|
||||
|
||||
#TBD
|
||||
# Setup shared data and call panel
|
||||
$c->stash(
|
||||
title => $title,
|
||||
${prefix}_data => \%${prefix}_data
|
||||
);
|
||||
if ('${nextpanel | "none"}' eq 'none') {
|
||||
$$${prefix}_data{'trt'} = '${firstPanel}';
|
||||
} else {
|
||||
$$${prefix}_data{'trt'} = '${NextPanel | "none"}';
|
||||
}
|
||||
$c->do_display()
|
||||
$c->stash(
|
||||
title => $title,
|
||||
modul => $modul,
|
||||
${prefix}_data => \%${prefix}_data
|
||||
);
|
||||
$c->render( template => "${lcPackageName}" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,6 +280,6 @@ sub do_display {
|
||||
title => $title,
|
||||
${prefix}_data => \%${prefix}_data
|
||||
);
|
||||
$c->render("${lcPackageName}");
|
||||
$c->render(template => "${lcPackageName}");
|
||||
}
|
||||
1;
|
Reference in New Issue
Block a user