summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/edit/part_virtual_field.html4
-rw-r--r--httemplate/edit/process/elements/process.html18
-rw-r--r--httemplate/edit/process/part_virtual_field.html3
-rw-r--r--httemplate/elements/header-full.html2
4 files changed, 22 insertions, 5 deletions
diff --git a/httemplate/edit/part_virtual_field.html b/httemplate/edit/part_virtual_field.html
index f3fb53065..8b8b33d0b 100644
--- a/httemplate/edit/part_virtual_field.html
+++ b/httemplate/edit/part_virtual_field.html
@@ -21,8 +21,8 @@
],
'edit_callback' => $callback,
'error_callback' => $callback,
- 'html_init' => 'Please be patient after clicking the button as
- this process may take more than 10 seconds.
+ 'html_init' => 'Please be patient after clicking the button as this process may take more than 10 seconds.<br>
+ You will also need to restart Apache after adding the custom field.
<br><br>',
)
%>
diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html
index 6e27ad4e2..c474b1904 100644
--- a/httemplate/edit/process/elements/process.html
+++ b/httemplate/edit/process/elements/process.html
@@ -34,6 +34,11 @@ Example:
'clear_on_error' => [ 'form_field1', 'form_field2', ... ],
+ ## message will be returned to redirect page as cookie and read by header.html
+ ## append =status, =warning, =error to change color of message box. Default is status
+ ## status is green, warning is yellow, and error is red
+ 'message' => [ 'My message=status', 'Please restart=warning' ],
+
#pass an arrayref of hashrefs for multiple m2ms or m2names
#be certain you incorporate m2m_Common if you see error: param
@@ -204,7 +209,16 @@ process();
</HTML>
%} else {
-<% $cgi->redirect($redirect) %>
+% my $cookie;
+% $cookie = CGI::Cookie->new(
+% -name => 'freeside_status',
+% -value => $messages,
+% -expires => '+5m',
+% ) if $messages;
+ <% $cgi->redirect( -uri => $redirect,
+ -cookie => $cookie,
+ )
+ %>
%}
<%init>
@@ -506,6 +520,8 @@ if ( !$error ) {
}
}
+my $messages = $opt{'message'} ? $opt{'message'} : '';
+
my $edit_ext = $opt{'edit_ext'} || 'html';
my $error_redirect = $opt{'error_redirect'}
|| popurl(2)."$table.$edit_ext";
diff --git a/httemplate/edit/process/part_virtual_field.html b/httemplate/edit/process/part_virtual_field.html
index 97be7e65e..dc03ea4c8 100644
--- a/httemplate/edit/process/part_virtual_field.html
+++ b/httemplate/edit/process/part_virtual_field.html
@@ -1,6 +1,7 @@
<% include( 'elements/process.html',
'table' => 'part_virtual_field',
'viewall_dir' => 'browse',
+ 'message' => [ 'Your custom field has been created, but will not be available untill Apache has been restarted.=warning', ],
'precheck_callback' => sub {
my ($cgi) = @_;
$act = 'edit' if $cgi->param('vfieldpart');
@@ -25,7 +26,7 @@
$dbh->commit or die $dbh->errstr;
# reload schema
- my $dbdef_file = "/usr/local/etc/freeside/dbdef.".datasrc # XXX: fix this
+ my $dbdef_file = "/usr/local/etc/freeside/dbdef.".datasrc;
my $dbdef = new_native DBIx::DBSchema $dbh;
$dbdef->save($dbdef_file);
delete $FS::Schema::dbdef_cache{$dbdef_file}; #force an actual reload
diff --git a/httemplate/elements/header-full.html b/httemplate/elements/header-full.html
index 3898b536c..cdcb0afa4 100644
--- a/httemplate/elements/header-full.html
+++ b/httemplate/elements/header-full.html
@@ -246,4 +246,4 @@ if ( scalar(@agentnums) == 1 ) {
$company_url = $conf->config('company_url');
}
-</%init>
+</%init> \ No newline at end of file