X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fmsg_template.html;h=7f3824127d72d992567501944abf46647f6e6311;hb=7b777a5bf7fcdb0f966e3789e00f646febedc60c;hp=115032a07a848b50a4e6022efed5a3d6ab378b8c;hpb=a6fe07e49e3fc12169e801b1ed6874c3a5bd8500;p=freeside.git diff --git a/httemplate/edit/msg_template.html b/httemplate/edit/msg_template.html index 115032a07..7f3824127 100644 --- a/httemplate/edit/msg_template.html +++ b/httemplate/edit/msg_template.html @@ -15,13 +15,14 @@ 'msgname' => 'Template name', 'from_addr' => 'From: ', 'bcc_addr' => 'Bcc: ', - 'locale' => 'Language', + 'locale' => 'Locale', 'subject' => 'Subject: ', 'body' => 'Message body', }, 'edit_callback' => \&edit_callback, 'error_callback' => \&edit_callback, 'html_bottom' => '', + 'html_table_bottom'=> \&html_table_bottom, 'html_foot' => ( $no_submit ? '' : "$sidebar" ), 'no_submit' => $no_submit, &> @@ -66,7 +67,8 @@ if ( $curuser->access_right('Edit global templates') { field => 'subject', size=>60, }, { field => 'body', type => 'htmlarea', - width => 763 + width => 763, + config=> { extraPlugins => 'blockprotect' }, }, ; } else { #readonly @@ -120,11 +122,12 @@ sub edit_callback { # make a list of available locales my $content_locales = $object->content_locales; - my @locales = grep { !exists($content_locales->{$_}) } FS::Locales->locales; + my @locales = grep { !exists($content_locales->{$_}) } + FS::Conf->new->config('available-locales'); my %labels; foreach (@locales) { my %info = FS::Locales->locale_info($_); - $labels{$_} = $info{'name'}; # ignoring country for now + $labels{$_} = $info{'label'}; } unshift @locales, 'new'; $labels{'new'} = 'Select language'; @@ -145,7 +148,7 @@ sub edit_callback { curr_value => 'new', onchange => $onchange_locale, ); - } # else it's already set up correctly + } } sub menubar_opt_callback { @@ -159,10 +162,10 @@ sub menubar_opt_callback { foreach my $l (FS::Locales->locales) { if ( exists $object->content_locales->{$l} ) { my %info = FS::Locales->locale_info($l); - push @tabs, - $info{'name'}, + push @tabs, + $info{'label'}, ';locale='.$l; - $selected = $info{'name'} if $object->locale eq $l; + $selected = $info{'label'} if $object->locale eq $l; } else { $display_new = 1; # there is at least one unused locale left @@ -200,12 +203,13 @@ my %substitutions = ( '$balance' => 'Current balance', '$credit_limit' => 'Credit limit', '$invoicing_list_emailonly' => 'Billing email address', - '$cust_status' => 'Status', - '$ucfirst_cust_status' => 'Status, capitalized', - '$cust_statuscolor' => 'Status color code', + #'$cust_status' => 'Status (raw internal label)', + '$cust_status_label' => 'Status (display label)', + '$cust_statuscolor' => 'Status color code', '$company_name' => 'Our company name', '$company_address'=> 'Our company address', '$company_phonenum' => 'Our phone number', + '$selfservice_server_base_url' => 'Base URL of customer self-service', ], 'contact' => [ # duplicate this for shipping '$name' => 'Company and contact name', @@ -238,6 +242,9 @@ my %substitutions = ( ], 'cust_bill' => [ '$invnum' => 'Invoice#', + '$_date_pretty' => 'Invoice date', + '$due_date' => 'Invoice due date (timestamp)', + '$due_date2str' => 'Invoice due date (human readable)', ], 'cust_pkg' => [ '$pkgnum' => 'Package#', @@ -326,9 +333,14 @@ my $widget = new HTML::Widgets::SelectLayers( my $sidebar = '
Substitutions: ' @@ -340,4 +352,22 @@ Substitutions: ' '; +sub html_table_bottom { + my $object = shift; + $cgi->param('locale') =~ /^(\w+)$/; + my $locale = $1; + my $html; + if ( $locale and $locale ne 'new' ) { + # set up a delete link + my $msgnum = $object->msgnum; + my $url = $p."misc/delete-template_content.html?msgnum=$msgnum;locale=$1"; + my $link = qq!! . + 'Delete this template' . + ''; + $html = qq! + $link!; + } + $html; +} +