summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/cgp_rule-redirect_all.html57
-rw-r--r--httemplate/edit/cgp_rule-vacation.html47
-rw-r--r--httemplate/edit/cgp_rule.html4
-rwxr-xr-xhttemplate/edit/cust_main.cgi8
-rw-r--r--httemplate/edit/cust_main/birthdate.html13
-rw-r--r--httemplate/edit/cust_main/top_misc.html8
-rw-r--r--httemplate/edit/elements/edit.html7
-rw-r--r--httemplate/edit/elements/rate_detail.html239
-rw-r--r--httemplate/edit/msg_template.html158
-rwxr-xr-xhttemplate/edit/part_pkg.cgi4
-rw-r--r--httemplate/edit/part_tag.html29
-rw-r--r--httemplate/edit/process/access_group.html9
-rw-r--r--httemplate/edit/process/access_user.html5
-rwxr-xr-xhttemplate/edit/process/agent.cgi5
-rw-r--r--httemplate/edit/process/cgp_rule.html8
-rwxr-xr-xhttemplate/edit/process/cust_main.cgi2
-rw-r--r--httemplate/edit/process/elements/process.html12
-rw-r--r--httemplate/edit/process/elements/svc_Common.html15
-rw-r--r--httemplate/edit/process/msg_template.html13
-rw-r--r--httemplate/edit/process/part_tag.html11
-rwxr-xr-xhttemplate/edit/process/rate_region.cgi21
-rw-r--r--httemplate/edit/process/rate_time.cgi94
-rwxr-xr-xhttemplate/edit/process/svc_acct.cgi1
-rw-r--r--httemplate/edit/prospect_main.html3
-rw-r--r--httemplate/edit/rate.cgi8
-rw-r--r--httemplate/edit/rate_detail.html9
-rw-r--r--httemplate/edit/rate_region.cgi114
-rw-r--r--httemplate/edit/rate_time.cgi69
-rwxr-xr-xhttemplate/edit/svc_acct.cgi78
-rwxr-xr-xhttemplate/edit/svc_domain.cgi72
30 files changed, 280 insertions, 843 deletions
diff --git a/httemplate/edit/cgp_rule-redirect_all.html b/httemplate/edit/cgp_rule-redirect_all.html
deleted file mode 100644
index 898eef8fc..000000000
--- a/httemplate/edit/cgp_rule-redirect_all.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<% include('/elements/header-popup.html', 'Redirect all mail') %>
-
-<FORM NAME="RedirectAllForm" ACTION="process/cgp_rule-redirect_all.html" METHOD=POST>
-
-%# XXX upstream Redirect 1
-
-<% ntable("#cccccc", 2) %>
-
-<TR>
- <TD ALIGN="right">Redirect all mail to</TD>
- <TD><textarea name="RedirectText" rows="5" cols="50"></textarea></TD>
-</TR>
-
-<% include('/elements/tr-checkbox.html',
- 'name' => 'RedirKeep',
- 'label' => 'Keep a copy',
- 'value' => 1,
- 'curr_value' => '', #XXX
- )
-%>
-
-<% include('/elements/tr-checkbox.html',
- 'name' => 'RedirHuman',
- 'label' => 'Do not redirect automatic messages',
- 'value' => 1,
- 'curr_value' => '', #XXX
- )
-%>
-
-<% include('/elements/tr-checkbox.html',
- 'name' => 'KeepToAndCc',
- 'label' => 'Preserve To/Cc fields',
- 'value' => 1,
- 'curr_value' => '', #XXX
- )
-%>
-
-</TABLE>
-
-<BR>
-<INPUT TYPE="submit" VALUE="Redirect all mail">
-%#XXX Add/Edit
-
-</FORM>
-
-</BODY>
-</HTML>
-<%init>
-
-my %opt = @_;
-
-my $svc_acct = qsearchs('svc_acct', { 'svcnum' => $opt{'svcnum'} } )
- or die "unknown svcnum";
-
-#XXX look for existing redirect all rule
-
-</%init>
diff --git a/httemplate/edit/cgp_rule-vacation.html b/httemplate/edit/cgp_rule-vacation.html
deleted file mode 100644
index efdc5417e..000000000
--- a/httemplate/edit/cgp_rule-vacation.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<% include('/elements/header-popup.html', 'Vacation rule') %>
-
-<FORM NAME="VacationForm" ACTION="process/cgp_rule-vacation.html" METHOD=POST>
-
-%# XXX upstream Vacation 1
-
-<% ntable("#cccccc", 2) %>
-
-<TR>
- <TD ALIGN="right">Vacation message</TD>
- <TD><textarea name="VacationText" rows="5" cols="50"></textarea></TD>
-</TR>
-
-<% include('/elements/tr-input-date-field.html', {
- 'label' => 'Ends',
- 'name' => 'vacationTill',
- 'value' => '', #XXX
- })
-%>
-%# XXX upstream:
-%# VacationTill 1
-%# vacationDay
-%# vacationMonth
-%# vacationYear
-
-%#XXX Clear 'Replied Addresses' List
-
-</TABLE>
-
-<BR>
-<INPUT TYPE="submit" VALUE="Add vacation message">
-%#XXX Add/Edit
-
-</FORM>
-
-</BODY>
-</HTML>
-<%init>
-
-my %opt = @_;
-
-my $svc_acct = qsearchs('svc_acct', { 'svcnum' => $opt{'svcnum'} } )
- or die "unknown svcnum";
-
-#XXX look for existing vacation rule
-
-</%init>
diff --git a/httemplate/edit/cgp_rule.html b/httemplate/edit/cgp_rule.html
index 41275aba7..d9c19a150 100644
--- a/httemplate/edit/cgp_rule.html
+++ b/httemplate/edit/cgp_rule.html
@@ -51,7 +51,7 @@ my %opt = @_;
my $m2_error_callback_cond = sub {
my($cgi, $object) = @_;
- my @fields = qw( conditionname op params );
+ my @fields = qw( condition op params );
my @gfields = ( '', map "_$_", @fields );
map {
@@ -83,7 +83,7 @@ my $m2_error_callback_action = sub {
if ( /^ruleactionnum(\d+)$/ ) {
my $num = $1;
if ( grep $cgi->param("ruleactionnum$num$_"), @gfields ) {
- my $x = new FS::cgp_rule_action {
+ my $x = new FS::cgp_rule_condition {
'ruleactionnum' => $cgi->param("ruleactionnum$num"),
map { $_ => scalar($cgi->param("ruleactionnum${num}_$_")) } @fields,
};
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index 57dc3597a..fac7ef27c 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -1,5 +1,5 @@
<% include('/elements/header.html',
- $title,
+ "Customer $action",
'',
' onUnload="myclose()"' #hmm, in billing.html
) %>
@@ -190,7 +190,7 @@ function samechanged(what) {
% }
-<INPUT TYPE="hidden" NAME="usernum" VALUE="<% $cust_main->usernum %>">
+<INPUT TYPE="hidden" NAME="otaker" VALUE="<% $cust_main->otaker %>">
%# cust_main/bottomfixup.js
% foreach my $hidden (
@@ -313,8 +313,8 @@ my $error = $cgi->param('error');
$cgi->delete_all();
$cgi->param('error', $error);
-my $title = $custnum ? 'Edit Customer' : 'Add Customer';
-$title .= ": ". $cust_main->name if $custnum;
+my $action = $custnum ? 'Edit' : 'Add';
+$action .= ": ". $cust_main->name if $custnum;
my $r = qq!<font color="#ff0000">*</font>&nbsp;!;
diff --git a/httemplate/edit/cust_main/birthdate.html b/httemplate/edit/cust_main/birthdate.html
index b4e78e3b9..415aba3c4 100644
--- a/httemplate/edit/cust_main/birthdate.html
+++ b/httemplate/edit/cust_main/birthdate.html
@@ -1,11 +1,10 @@
<% ntable("#cccccc", 2) %>
- <% include( '/elements/tr-input-date-field.html',
- 'birthdate',
- $cust_main->birthdate,
- 'Date of Birth',
- ( $conf->config('date_format') || "%m/%d/%Y" ),
- 1
- )
+ <% include ('/elements/tr-input-date-field.html',
+ 'birthdate',
+ $cust_main->birthdate,
+ 'Date of Birth',
+ $conf->config('date_format') || "%m/%d/%Y",
+ 1)
%>
</TABLE>
<%init>
diff --git a/httemplate/edit/cust_main/top_misc.html b/httemplate/edit/cust_main/top_misc.html
index 441a36334..36add3721 100644
--- a/httemplate/edit/cust_main/top_misc.html
+++ b/httemplate/edit/cust_main/top_misc.html
@@ -1,19 +1,11 @@
<% &ntable("#cccccc") %>
-%# tags
-<% include('/elements/tr-select-cust_tag.html',
- 'custnum' => $custnum,
- 'cgi' => $cgi,
- )
-%>
-
%# agent
<% include('/elements/tr-select-agent.html',
'curr_value' => $cust_main->agentnum,
'label' => "<B>${r}Agent</B>",
'empty_label' => 'Select agent',
'disable_empty' => ( $cust_main->agentnum ? 1 : 0 ),
- 'viewall_right' => 'None', #override default 'View customers of all agents'
)
%>
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index b19b3618c..0417dc536 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -307,11 +307,6 @@ Example:
% foreach grep exists($f->{$_}),
% qw( hashref agent_virt agent_null agent_null_right );
%
-% #htmlarea
-% $include_common{$_} = $f->{$_}
-% foreach grep exists($f->{$_}), qw( width height );
-%
-%
% if ( $type eq 'tablebreak-tr-title' ) {
% $include_common{'table_id'} = 'TableNumber'. $tablenum++;
% }
@@ -541,7 +536,7 @@ Example:
var field_regex = /(\d+)(_[a-z]+)?$/;
var match = field_regex.exec(what.name);
if ( !match ) {
- alert(what.name + " didn't match for " + what);
+ alert(what.name + " didn't match?!");
return;
}
if ( match[1] != <%$field%>_fieldnum ) {
diff --git a/httemplate/edit/elements/rate_detail.html b/httemplate/edit/elements/rate_detail.html
deleted file mode 100644
index faf11f844..000000000
--- a/httemplate/edit/elements/rate_detail.html
+++ /dev/null
@@ -1,239 +0,0 @@
-<%doc>
-<% include('/edit/elements/rate_detail.html',
- # required
- 'ratenum' => '1',
-
- # optional
- 'regionnum' => '25',
- # or
- 'countrycode' => '237',
-) %>
-
-If regionnum is specified, this produces column headers plus
-one row of rate details for that region (in all time periods).
-Otherwise, there's one row for each region in the specified
-countrycode (or each region anywhere, if there is no countrycode),
-with row headers showing the region name and prefixes.
-
-</%doc>
-<% include('/elements/table-grid.html') %>
-<TR>
-% my $col = 0;
-% foreach (@header) {
-% my $hlink = $hlinks[$col];
- <TH CLASS = "grid",
- BGCOLOR = "#cccccc">
- <% $hlink ? qq!<A HREF="$hlink">$_</A>! : $_ %>
- </TH>
-% $col++;
-% } #foreach @header
-</TR><TR>
-% my $row = 0;
-% foreach my $r (@rows) {
-% $col = 0;
-% if ( !$opt{'regionnum'} ) {
-% $region = $r;
-% foreach ($r->regionname, $r->prefixes_short) {
- <TD>
- <A HREF="<% $p.'edit/rate_region.cgi?'.$r->regionnum %>"><% $_ %></A>
- </TD>
-% }
-% }
-% elsif ( !$opt{'ratenum'} ) {
-% $rate = $r;
- <TD>
- <A HREF="<% $p.'edit/rate.cgi?'.$r->ratenum %>"><% $r->ratename %></A>
- </TD>
-% }
-% foreach my $rate_time (@rate_time, '') {
- <TD>
-% my $detail = $details[$row][$col];
-% if($detail) {
- <TABLE CLASS="inv" STYLE="border:none">
- <TR><TD><% edit_link($detail) %><% $money_char.$detail->min_charge %>
- <% $detail->sec_granularity ? ' / minute':' / call' %>
- <% $edit_hint %></A>
- </TD></TR>
- <% granularity_detail($detail) %>
- <% min_included_detail($detail) %>
- <% conn_charge_detail($detail) %>
- <TR><TD><% $rate_time ? delete_link($detail) : '' %></TD></TR>
- </TABLE>
-% }
-% else { #!$detail
- <% add_link($rate, $region, $rate_time) %>
-% }
-% $col++;
- </TD>
-% } # foreach @rate_time
-</TR>
-% $row++;
-% }# foreach @rate_region
-</TABLE>
-
-<%once>
-
-tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
-tie my %conn_secs, 'Tie::IxHash', FS::rate_detail::conn_secs();
-
-my $conf = new FS::Conf;
-my $money_char = $conf->config('money_char') || '$';
-
-sub small {
- '<FONT SIZE="-1">'.shift.'</FONT>'
-}
-my $edit_hint = small('(edit)');
-
-sub edit_link {
- my $rate_detail = shift;
- my $ratedetailnum = $rate_detail->ratedetailnum;
- '<A HREF="javascript:void(0);" onclick="'.
- include( '/elements/popup_link_onclick.html',
- 'action' => "${p}edit/rate_detail.html?$ratedetailnum",
- 'actionlabel' => 'Edit rate',
- 'height' => 420,
- #default# 'width' => 540,
- #default# 'color' => '#333399',
- ) . '">'
-}
-
-sub add_link {
- my ($rate, $region, $rate_time) = @_;
- '<A HREF="javascript:void(0);" onclick="'.
- include( '/elements/popup_link_onclick.html',
- 'action' => "${p}edit/rate_detail.html?ratenum=".
- $rate->ratenum.
- ';dest_regionnum='.
- $region->regionnum.
- ($rate_time ?
- ';ratetimenum='.$rate_time->ratetimenum :
- ''),
- 'actionlabel' => 'Add rate',
- 'height' => 420,
- ).'">'.small('(add)').'</A>'
-}
-
-sub delete_link {
- my $rate_detail = shift;
- my $ratedetailnum = $rate_detail->ratedetailnum;
- my $onclick = include( '/elements/popup_link_onclick.html',
- 'action' => "${p}misc/delete-rate_detail.html?$ratedetailnum",
- 'actionlabel' => 'Delete rate',
- 'width' => 510,
- 'height' => 315,
- 'frame' => 'top',
- );
- $onclick = "if(confirm('Delete this rate?')) { $onclick }";
- qq!<A HREF="javascript:void(0);" onclick="$onclick">!.small('(delete)').'</A>'
-}
-
-sub granularity_detail {
- my $rate_detail = shift;
- if($rate_detail->sec_granularity != 60 && $rate_detail->sec_granularity > 0) {
- '<TR><TD>'.
- small('in '.$granularity{$rate_detail->sec_granularity}.' increments').
- '</TD></TR>';
- }
- else { '' }
-}
-
-sub min_included_detail {
- my $rate_detail = shift;
- if($rate_detail->min_included) {
- '<TR><TD>'.
- small( $rate_detail->min_included .
- ($rate_detail->sec_granularity ?
- ' minutes included' :
- ' calls included') ).
- '</TD></TR>'
- }
- else { '' }
-}
-
-sub conn_charge_detail {
- my $rate_detail = shift;
- if($rate_detail->conn_charge > 0) {
- #return '' unless $rate_detail->conn_charge > 0 || $rate_detail->conn_sec;
- '<TR><TD>'.
- small( $money_char. $rate_detail->conn_charge.
- ' for '.$conn_secs{$rate_detail->conn_sec}
- ).
- '</TD></TR>'
- }
- else { '' }
-}
-
-</%once>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-
-my %opt = @_;
-my $ratenum = $opt{'ratenum'} || '';
-my $regionnum = $opt{'regionnum'} || '';
-
-# either of these, if the $opt isn't passed, will be set to the
-# correct object when generating each row.
-my $rate = qsearchs('rate', { 'ratenum' => $ratenum } ) if $ratenum;
-my $region = qsearchs('rate_region', { 'regionnum' => $regionnum }) if $regionnum;
-
-my @rate_time = qsearch('rate_time', {});
-my @header = (
- map( { $_->ratetimename } @rate_time ),
- 'Default rate');
-my @hlinks = map( {$p.'edit/rate_time.cgi?'.$_->ratetimenum} @rate_time ), '';
-my @rtns = ( map( { $_->ratetimenum } @rate_time ), '' );
-
-my @details;
-my @rows;
-if ( $ratenum ) {
- if ( $regionnum ) {
- @rows = qsearch('rate_region',
- { ratenum => $ratenum, regionnum => $regionnum });
- }
- else {
- my $where = '';
- if ( $opt{'countrycode'} ) {
- $where = "WHERE 0 < (
- SELECT COUNT(*) FROM rate_prefix
- WHERE rate_prefix.regionnum = rate_region.regionnum
- AND countrycode = '$opt{countrycode}'
- )";
- }
- @rows = qsearch({ table => 'rate_region',
- hashref => { },
- extra_sql => $where,
- });
- die "no region found" if !@rows;
-
- unshift @header, 'Region', 'Prefix(es)';
- unshift @hlinks, '', '';
- }
- foreach my $region (@rows) {
- push @details, [ map { qsearchs('rate_detail',
- { 'ratenum' => $ratenum,
- 'dest_regionnum' => $region->regionnum,
- 'ratetimenum' => $_ } ) or ''
- } @rtns
- ];
- }
-}
-elsif ( $regionnum ) {
- @rows = qsearch('rate', {}) or die "no rate plans found";
- unshift @header, 'Rate plan';
- unshift @hlinks, '';
- foreach my $rate (@rows) {
- push @details, [ map { qsearchs('rate_detail',
- { 'ratenum' => $rate->ratenum,
- 'dest_regionnum' => $regionnum,
- 'ratetimenum' => $_ } ) or ''
- } @rtns
- ];
- }
-}
-else {
- die "no ratenum or regionnum specified";
-}
-
-</%init>
diff --git a/httemplate/edit/msg_template.html b/httemplate/edit/msg_template.html
deleted file mode 100644
index 67eae185d..000000000
--- a/httemplate/edit/msg_template.html
+++ /dev/null
@@ -1,158 +0,0 @@
-<% include( 'elements/edit.html',
- 'html_init' => '<TABLE id="outerTable"><TR><TD>',
- 'name_singular' => 'template',
- 'table' => 'msg_template',
- 'viewall_dir' => 'browse',
- 'agent_virt' => 1,
- 'agent_null' => 1,
- 'agent_null_right' => 'Edit global templates',
-
- 'fields' => [ 'msgname',
- 'subject',
- 'from_addr',
- { field=>'body', type=>'htmlarea', width=>763 },
- ],
- 'labels' => { 'msgnum' => 'Template',
- 'msgname' => 'Template name',
- 'from_addr' => 'Return address',
- 'subject' => 'Message subject',
- 'body' => 'Message template',
- },
- 'html_foot' => "</TD>$sidebar</TR></TABLE>",
- )
-%>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Edit templates')
- || $FS::CurrentUser::CurrentUser->access_right('Edit global templates')
- || $FS::CurrentUser::CurrentUser->access_right('Configuration');
-
-# Create hints pane
-
-my %substitutions = (
- 'cust_main' => [
- '$display_custnum'=> 'Customer#',
- '$agentnum' => 'Agent#',
- '$agent_name' => 'Agent name',
- '$payby' => 'Payment method',
- '$paymask' => 'Card/account# (masked)',
- '$payname' => 'Name on card/bank name',
- '$paytype' => 'Account type',
- '$payip' => 'IP address used to submit payment info',
- '$num_ncancelled_pkgs' => '# of active packages',
- '$num_cancelled_pkgs' => '# of cancelled packages',
- '$num_pkgs' => '# of packages',
- '$classname' => 'Customer class',
- '$categoryname' => 'Customer category',
- '$balance' => 'Current balance',
- '$invoicing_list_emailonly' => 'Billing email address',
- '$cust_status' => 'Status',
- '$ucfirst_cust_status' => 'Status, capitalized',
- '$cust_statuscolor' => 'Status color code',
- '$company_name' => 'Our company name',
- ],
- 'contact' => [ # duplicate this for shipping
- '$name' => 'Company and contact name',
- '$name_short' => 'Company or contact name',
- '$company' => 'Company name',
- '$contact' => 'Contact name (last, first)',
- '$contact_firstlast'=> 'Contact name (first last)',
- '$first' => 'First name',
- '$last' => 'Last name',
- '$address1' => 'Address line 1',
- '$address2' => 'Address line 2',
- '$city' => 'City',
- '$county' => 'County',
- '$state' => 'State',
- '$zip' => 'Zip',
- '$country' => 'Country',
- '$daytime' => 'Day phone',
- '$night' => 'Night phone',
- '$fax' => 'Fax',
- ],
- 'cust_bill' => [
- '$invnum' => 'Invoice#',
- ],
- 'cust_pkg' => [
- '$pkgnum' => 'Package#',
- '$pkg_label' => 'Package label (short)',
- '$pkg_label_long' => 'Package label (long)',
- '$status' => 'Status',
- '$statuscolor' => 'Status color code',
- '$start_ymd' => 'Start date',
- '$setup_ymd' => 'Setup date',
- '$last_bill_ymd' => 'Last bill date',
- '$next_bill_ymd' => 'Next bill date',
- '$susp_ymd' => 'Suspended on date',
- '$cancel_ymd' => 'Canceled on date',
- '$adjourn_ymd' => 'Adjournment date',
- '$expire_ymd' => 'Expiration date',
- '$labels_short' => 'Service labels',
- '$location_label' => 'Service location',
- ],
- 'svc_acct' => [
- '$username' => 'Login name',
- '$password' => 'Password',
- ],
- 'cust_pay' => [
- '$paynum' => 'Payment#',
- '$paid' => 'Amount',
- '$payby' => 'Payment method',
- '$date' => 'Payment date',
- '$payinfo' => 'Card/account# (masked)',
- ],
-);
-my @c = @{ $substitutions{'contact'} };
-for (my $i=0; $i<scalar(@c); $i += 2) {
- $c[$i] =~ s/\$(.*)/\$ship_$1/;
-}
-$substitutions{'shipping'} = \@c;
-
-tie my %sections, 'Tie::IxHash', (
-'contact' => 'Name and contact info (billing)',
-'shipping' => 'Name and contact info (shipping)',
-'cust_main' => 'Customer status and payment info',
-'cust_pkg' => 'Package fields',
-'cust_bill' => 'Invoice fields',
-'cust_pay' => 'Payment fields',
-'svc_acct' => 'Login service fields',
-);
-
-my $widget = new HTML::Widgets::SelectLayers(
- 'options' => \%sections,
- 'form_name' => 'dummy',
- 'html_between'=>'</FORM><FONT SIZE=-1>',
- 'selected_layer'=>(keys(%sections))[0],
- 'layer_callback' => sub {
- my $section = shift;
- my $html = include('/elements/table-grid.html');
- my @hints = @{ $substitutions{$section} };
- while(@hints) {
- my $key = shift @hints;
- $html .= qq!\n<TR><TD><A href="javascript:insertHtml('{$key}')">$key</A></TD>!;
- $html .= "\n<TD>".shift(@hints).'</TD></TR>';
- }
- $html .= "\n</TABLE>";
- return $html;
- },
-);
-
-my $sidebar = '
-<SCRIPT TYPE="text/javascript">
-function insertHtml(what) {
- var oEditor = FCKeditorAPI.GetInstance("body");
- oEditor.InsertHtml(what);
-};
-</SCRIPT>
-<TD valign="top"><FORM name="dummy">
-Substitutions: '
-. $widget->html .
-'<BR>Click links to insert.
-<BR>Enclose substitutions and other Perl expressions in braces:
-<BR>{ $name } = ExampleCo (Smith, John)
-<BR>{ time2str("%D", time) } = '.time2str("%D", time).'
-</FONT></TD>
-';
-
-</%init>
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index deefa9cc1..c8b7ecb58 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -563,10 +563,6 @@ my $html_bottom = sub {
$html .= ' MULTIPLE'
if $href->{$field}{'type'} eq 'select_multiple';
$html .= qq! NAME="${layer}__$field">!;
-
- $html .= '<OPTION VALUE="">'. $href->{$field}{'empty_label'}
- if exists($href->{$field}{'disable_empty'})
- && ! $href->{$field}{'disable_empty'};
if ( $href->{$field}{'select_table'} ) {
foreach my $record (
diff --git a/httemplate/edit/part_tag.html b/httemplate/edit/part_tag.html
deleted file mode 100644
index 87c77fa98..000000000
--- a/httemplate/edit/part_tag.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<% include( 'elements/edit.html',
- 'table' => 'part_tag',
- 'name_singular' => 'tag',
- 'fields' => [
- { field=>'tagname', type=>'text', size=>10 },
- { field=>'disabled', type=>'checkbox', value=>'Y' },
- { field=>'tagdesc', type=>'text', size=>60 },
- $tagcolor,
- ],
- 'labels' => { 'tagnum' => 'Tag #',
- 'tagname' => 'Tag',
- 'tagdesc' => 'Message',
- 'tagcolor' => 'Highlight Color',
- 'disabled' => 'Disabled',
- },
- 'viewall_dir' => 'browse',
- )
-%>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-
-my $tagcolor = {
- field => 'tagcolor',
- type => 'pickcolor',
-};
-
-</%init>
diff --git a/httemplate/edit/process/access_group.html b/httemplate/edit/process/access_group.html
index 2d125c387..ab25cb3a2 100644
--- a/httemplate/edit/process/access_group.html
+++ b/httemplate/edit/process/access_group.html
@@ -1,3 +1,6 @@
+% if ( $conf->exists('disable_acl_changes') ) {
+ ACL changes disabled in public demo.
+% } else {
<% include( 'elements/process.html',
'table' => 'access_group',
'viewall_dir' => 'browse',
@@ -14,14 +17,12 @@
},
)
%>
+% }
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-if ( FS::Conf->new->exists('disable_acl_changes') ) {
- errorpage('ACL changes disabled in public demo.');
- die "shouldn't be reached";
-}
+my $conf = new FS::Conf;
</%init>
diff --git a/httemplate/edit/process/access_user.html b/httemplate/edit/process/access_user.html
index e6258a9b1..ca6bb603f 100644
--- a/httemplate/edit/process/access_user.html
+++ b/httemplate/edit/process/access_user.html
@@ -18,9 +18,4 @@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-if ( FS::Conf->new->exists('disable_acl_changes') ) {
- errorpage('ACL changes disabled in public demo.');
- die "shouldn't be reached";
-}
-
</%init>
diff --git a/httemplate/edit/process/agent.cgi b/httemplate/edit/process/agent.cgi
index e776d281c..3cdf40c9b 100755
--- a/httemplate/edit/process/agent.cgi
+++ b/httemplate/edit/process/agent.cgi
@@ -13,9 +13,4 @@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-if ( FS::Conf->new->exists('disable_acl_changes') ) {
- errorpage('ACL changes disabled in public demo.');
- die "shouldn't be reached";
-}
-
</%init>
diff --git a/httemplate/edit/process/cgp_rule.html b/httemplate/edit/process/cgp_rule.html
index 5326587cb..f427b6ccf 100644
--- a/httemplate/edit/process/cgp_rule.html
+++ b/httemplate/edit/process/cgp_rule.html
@@ -4,19 +4,13 @@
'process_o2m' => [
{
'table' => 'cgp_rule_condition',
- 'fields' => [qw( conditionname op params )],
+ 'fields' => [qw( condition op params )],
},
{
'table' => 'cgp_rule_action',
'fields' => [qw( action params )],
},
],
- 'noerror_callback' => sub {
- my( $cgi, $object ) = @_;
- my $error = $object->svc_export;
- #shit, not a good place for error handling :/
- die $error if $error;
- },
)
%>
<%init>
diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi
index 3158d7bbf..1311ba4f3 100755
--- a/httemplate/edit/process/cust_main.cgi
+++ b/httemplate/edit/process/cust_main.cgi
@@ -73,8 +73,6 @@ if ( defined($cgi->param('same')) && $cgi->param('same') eq "Y" ) {
);
}
-$new->tagnum( [ $cgi->param('tagnum') ] );
-
my %usedatetime = ( 'birthdate' => 1 );
foreach my $dfield (qw( birthdate signupdate )) {
diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html
index 53419cde0..87cadb774 100644
--- a/httemplate/edit/process/elements/process.html
+++ b/httemplate/edit/process/elements/process.html
@@ -65,9 +65,6 @@ Example:
#return an error string or empty for no error
'precheck_callback' => sub { my( $cgi ) = @_; },
- #after everything's inserted
- 'noerror_callback' => sub { my( $cgi, $object ) = @_; },
-
#supplies arguments to insert() and replace()
# for use with tables that are FS::option_Common (among other things)
'args_callback' => sub { my( $cgi, $object ) = @_; },
@@ -207,7 +204,6 @@ if ( $opt{'agent_virt'} ) {
die "illegal agentnum"
unless $curuser->agentnums_href->{$new->agentnum}
- or $curuser->access_right('View customers of all agents')
or $opt{'agent_null_right'}
&& ! $new->agentnum
&& $curuser->access_right($opt{'agent_null_right'});
@@ -302,20 +298,12 @@ if ( !$error && $opt{'process_o2m'} ) {
if ( $error ) {
-
$cgi->param('error', $error);
if ( $opt{'clear_on_error'} && scalar(@{$opt{'clear_on_error'}}) ) {
foreach my $field (@{$opt{'clear_on_error'}}) {
$cgi->param($field, '')
}
}
-
-} else {
-
- if ( $opt{'noerror_callback'} ) {
- &{ $opt{'noerror_callback'} }( $cgi, $new );
- }
-
}
</%init>
diff --git a/httemplate/edit/process/elements/svc_Common.html b/httemplate/edit/process/elements/svc_Common.html
index 5a8afbd6c..8e8c99a42 100644
--- a/httemplate/edit/process/elements/svc_Common.html
+++ b/httemplate/edit/process/elements/svc_Common.html
@@ -1,14 +1,15 @@
+%
+%
+% my %opt = @_;
+% my $table = $opt{'table'};
+% $opt{'fields'} ||= [ fields($table) ];
+% push @{ $opt{'fields'} }, qw( pkgnum svcpart );
+%
+%
<% include( 'process.html',
'edit_ext' => 'cgi',
'redirect' => popurl(3)."view/$table.cgi?",
%opt,
)
%>
-<%init>
-my %opt = @_;
-my $table = $opt{'table'};
-$opt{'fields'} ||= [ fields($table) ];
-push @{ $opt{'fields'} }, qw( pkgnum svcpart );
-
-</%init>
diff --git a/httemplate/edit/process/msg_template.html b/httemplate/edit/process/msg_template.html
deleted file mode 100644
index 70d451b72..000000000
--- a/httemplate/edit/process/msg_template.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<% include( 'elements/process.html',
- 'table' => 'msg_template',
- 'viewall_dir' => 'browse',
- )
-%>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Edit templates')
- || $FS::CurrentUser::CurrentUser->access_right('Edit global templates')
- || $FS::CurrentUser::CurrentUser->access_right('Configuration');
-
-</%init>
diff --git a/httemplate/edit/process/part_tag.html b/httemplate/edit/process/part_tag.html
deleted file mode 100644
index 077dc4cd9..000000000
--- a/httemplate/edit/process/part_tag.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<% include( 'elements/process.html',
- 'table' => 'part_tag',
- 'viewall_dir' => 'browse',
- )
-%>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-
-</%init>
diff --git a/httemplate/edit/process/rate_region.cgi b/httemplate/edit/process/rate_region.cgi
index d342e605a..8036f7388 100755
--- a/httemplate/edit/process/rate_region.cgi
+++ b/httemplate/edit/process/rate_region.cgi
@@ -1,8 +1,6 @@
%if ( $error ) {
% $cgi->param('error', $error);
<% $cgi->redirect(popurl(2). "rate_region.cgi?". $cgi->query_string ) %>
-%} elsif ( $action eq 'Add' ) {
-<% $cgi->redirect(popurl(2). "rate_region.cgi?$regionnum") %>
%} else {
<% $cgi->redirect(popurl(3). "browse/rate_region.html") %>
%}
@@ -13,7 +11,6 @@ die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
my $regionnum = $cgi->param('regionnum');
-my $action = $regionnum ? 'Edit' : 'Add';
my $old = qsearchs('rate_region', { 'regionnum' => $regionnum } ) if $regionnum;
@@ -36,12 +33,24 @@ my @rate_prefix = map {
'npa' => $_,
}
} @npa;
-# we no longer process dest_detail records here
+
+my @dest_detail = map {
+ my $ratenum = $_->ratenum;
+ new FS::rate_detail {
+ 'ratenum' => $ratenum,
+ map { $_ => $cgi->param("$_$ratenum") }
+ qw( min_included conn_charge conn_sec min_charge sec_granularity classnum )
+ };
+} qsearch('rate', {} );
+
+
my $error;
if ( $regionnum ) {
- $error = $new->replace($old, 'rate_prefix' => \@rate_prefix );
+ $error = $new->replace($old, 'rate_prefix' => \@rate_prefix,
+ 'dest_detail' => \@dest_detail, );
} else {
- $error = $new->insert( 'rate_prefix' => \@rate_prefix );
+ $error = $new->insert( 'rate_prefix' => \@rate_prefix,
+ 'dest_detail' => \@dest_detail, );
$regionnum = $new->getfield('regionnum');
}
diff --git a/httemplate/edit/process/rate_time.cgi b/httemplate/edit/process/rate_time.cgi
deleted file mode 100644
index 4fa78ce6d..000000000
--- a/httemplate/edit/process/rate_time.cgi
+++ /dev/null
@@ -1,94 +0,0 @@
-% if ( $error ) {
-% $cgi->param('error', $error);
-<% $cgi->redirect(popurl(2). "rate_time.cgi?". $cgi->query_string ) %>
-% } else {
-<% $cgi->redirect(popurl(3). "browse/rate_time.html" ) %>
-% }
-%# dumper_html(\%vars, \%old_ints, {$rate_time->intervals}) %>
-<%init>
-my $error = '';
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-my $ratetimenum = $cgi->param('ratetimenum');
-my $ratetimename = $cgi->param('ratetimename');
-my $delete = $cgi->param('delete');
-
-my %vars = $cgi->Vars;
-#warn Dumper(\%vars)."\n";
-
-my $rate_time;
-
-my %old_ints;
-if( $ratetimenum ) {
- # editing
- $rate_time = FS::rate_time->by_key($ratetimenum);
-
- # make a list of existing intervals that will be deleted
- foreach ($rate_time->intervals) {
- $old_ints{$_->intervalnum} = $_;
- }
-
- if ( $delete ) {
- $error = $rate_time->delete;
- # intervals will be deleted later
- }
- elsif( $ratetimename ne $rate_time->ratetimename ) {
- # the only case where the rate_time itself must be replaced
- $rate_time->ratetimename($ratetimename);
- $error = $rate_time->replace;
- }
-}
-else { #!$ratetimenum, adding new
- $rate_time = FS::rate_time->new({ ratetimename => $ratetimename });
- $error = $rate_time->insert;
- $ratetimenum = $rate_time->ratetimenum;
-}
-
-my @new_ints;
-if(!$delete and !$error) {
- foreach my $i (map { /^sd(\d+)$/ } keys(%vars)) {
- my $stime = l2wtime(@vars{"sd$i", "sh$i", "sm$i", "sa$i"});
- my $etime = l2wtime(@vars{"ed$i", "eh$i", "em$i", "ea$i"});
- #warn "$i: $stime - $etime";
- next if !defined($stime) or !defined($etime) or $etime == $stime;
- # try to avoid needlessly wiping and replacing intervals every
- # time this is edited.
- if( %old_ints ) {
- my $this_int = qsearchs('rate_time_interval',
- { ratetimenum => $ratetimenum,
- stime => $stime,
- etime => $etime, } );
- if($this_int) {
- delete $old_ints{$this_int->intervalnum};
- #warn "not deleting $stime-$etime\n";
- next; #$i
- }
- }
- push @new_ints, FS::rate_time_interval->new({ ratetimenum => $ratetimenum,
- stime => $stime,
- etime => $etime, } );
- }
-}
-if(!$error) {
- foreach (values(%old_ints)) {
- $error = $_->delete;
- #warn "deleting ".$_->stime.' '.$_->etime."\n";
- last if $error;
- }
-}
-if(!$error) {
- # do this last to avoid overlap errors with deleted intervals
- foreach (@new_ints) {
- $error = $_->insert;
- #warn "inserting $stime-$etime\n";
- last if $error;
- }
-}
-
-sub l2wtime {
- my ($d, $h, $m, $a) = @_;
- $h += 24*$d + 12*$a;
- $m += 60*$h;
- return 60*$m
-}
-</%init>
diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi
index 0b272b5b1..0d2c007f1 100755
--- a/httemplate/edit/process/svc_acct.cgi
+++ b/httemplate/edit/process/svc_acct.cgi
@@ -70,7 +70,6 @@ if ( $svcnum ) {
grep { $new->$_ }
qw( seconds upbytes downbytes totalbytes );
- $error ||= "invalid $_" foreach grep { $hash{$_} !~ /^\d+$/ } keys %hash;
$error ||= $new->set_usage(\%hash); #unoverlimit and trigger radius changes
last; #once is enough
}
diff --git a/httemplate/edit/prospect_main.html b/httemplate/edit/prospect_main.html
index e867907ed..8ae76a9a1 100644
--- a/httemplate/edit/prospect_main.html
+++ b/httemplate/edit/prospect_main.html
@@ -98,6 +98,7 @@ my $m2_error_callback = sub {
'contactnum' => $cgi->param("contactnum$num"),
map { $_ => scalar($cgi->param("contactnum${num}_$_")) } @fields,
};
+ use Data::Dumper; warn Dumper $x;
$x;
} else {
();
@@ -109,6 +110,6 @@ my $m2_error_callback = sub {
$cgi->param;
};
-#my @agentnums = $FS::CurrentUser::CurrentUser->agentnums;
+my @agentnums = $FS::CurrentUser::CurrentUser->agentnums;
</%init>
diff --git a/httemplate/edit/rate.cgi b/httemplate/edit/rate.cgi
index 13717dc1a..75c714322 100644
--- a/httemplate/edit/rate.cgi
+++ b/httemplate/edit/rate.cgi
@@ -22,14 +22,8 @@ Rate plan
<INPUT NAME="submit" TYPE="button" VALUE="<%
$rate->ratenum ? "Apply changes" : "Add rate plan"
%>" onClick="document.OneTrueForm.submit.disabled=true; process();">
-</FORM>
-% if($rate->ratenum) {
-<BR><BR><FONT SIZE="+2">Rates in this plan</FONT>
-<% include('/edit/elements/rate_detail.html',
- 'ratenum' => $rate->ratenum
-) %>
-% }
+</FORM>
<% include('/elements/footer.html') %>
diff --git a/httemplate/edit/rate_detail.html b/httemplate/edit/rate_detail.html
index ec04e4cbb..869ace8d4 100644
--- a/httemplate/edit/rate_detail.html
+++ b/httemplate/edit/rate_detail.html
@@ -5,7 +5,6 @@
'labels' => { 'ratedetailnum' => 'Rate', #should hide...
'dest_regionname' => 'Region',
'dest_prefixes_short' => 'Prefix(es)',
- 'rate_time_name' => 'Time period',
'min_included' => 'Included minutes/calls',
'conn_charge' => 'Connection charge',
'conn_sec' => 'For',
@@ -17,10 +16,8 @@
{ field=>'ratenum', type=>'hidden', },
{ field=>'orig_regionnum', type=>'hidden', },
{ field=>'dest_regionnum', type=>'hidden', },
- { field=>'ratetimenum', type=>'hidden', },
{ field=>'dest_regionname', type=>'fixed', },
{ field=>'dest_prefixes_short', type=>'fixed', },
- { field=>'rate_time_name', type=>'fixed', },
{ field=>'min_included', type=>'text', size=>5 },
{ field=>'conn_charge', type=>'money', size=>4 },
{ field =>'conn_sec',
@@ -45,12 +42,6 @@
},
],
- 'new_hashref_callback' => sub {
- { ratenum => $cgi->param('ratenum'),
- dest_regionnum => $cgi->param('dest_regionnum'),
- ratetimenum => $cgi->param('ratetimenum'),
- }
- },
)
%>
<%once>
diff --git a/httemplate/edit/rate_region.cgi b/httemplate/edit/rate_region.cgi
index cae30030a..f77c0dbe7 100644
--- a/httemplate/edit/rate_region.cgi
+++ b/httemplate/edit/rate_region.cgi
@@ -35,20 +35,114 @@
</TABLE>
-<BR><BR>
-<INPUT TYPE="submit" VALUE="<% $rate_region->regionnum ? "Apply changes" : "Add region" %>">
-</FORM>
-%# rate plan info, if the region has been created yet
+%# rate plan info
-% if($rate_region->regionnum) {
<BR>
-<BR>
-<FONT SIZE="+2">Rates in this region</FONT>
-<% include('/edit/elements/rate_detail.html',
- 'regionnum' => $rate_region->regionnum,
-) %>
+
+<% include('/elements/table-grid.html') %>
+% my $bgcolor1 = '#eeeeee';
+% my $bgcolor2 = '#ffffff';
+% my $bgcolor = '';
+
+ <TR>
+ <TH CLASS="grid" BGCOLOR="#cccccc">
+ Rate plan
+ </TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">
+ <FONT SIZE=-1>Included<BR>minutes/calls</FONT>
+ </TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">
+ <FONT SIZE=-1>Connection<BR>charge</FONT>
+ </TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">
+ <FONT SIZE=-1>Connection<BR>charge for</FONT>
+ </TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">
+ <FONT SIZE=-1>Charge per<BR>minute/call</FONT>
+ </TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">
+ <FONT SIZE=-1>Granularity</FONT>
+ </TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">
+ <FONT SIZE=-1>Usage class</FONT>
+ </TH>
+ </TR>
+
+% foreach my $rate ( qsearch('rate', {}) ) {
+%
+% my $n = $rate->ratenum;
+% my $rate_detail = $rate->dest_detail($rate_region)
+% || new FS::rate_region { 'min_included' => 0,
+% 'min_charge' => 0,
+% 'sec_granularity' => '60'
+% };
+%
+% if ( $bgcolor eq $bgcolor1 ) {
+% $bgcolor = $bgcolor2;
+% } else {
+% $bgcolor = $bgcolor1;
% }
+ <TR>
+
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <A HREF="<%$p%>edit/rate.cgi?<% $rate->ratenum %>"><% $rate->ratename %></A>
+ </TD>
+
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <INPUT TYPE="text" SIZE=9 NAME="min_included<%$n%>" VALUE="<% $cgi->param("min_included$n") || $rate_detail->min_included |h %>">
+ </TD>
+
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <%$money_char%><INPUT TYPE="text" SIZE=9 NAME="conn_charge<%$n%>" VALUE="<% $cgi->param("conn_charge$n") || $rate_detail->conn_charge |h %>">
+ </TD>
+
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <SELECT NAME="conn_sec<%$n%>">
+% foreach my $conn_sec ( keys %conn_secs ) {
+% my $curr_value = $cgi->param("conn_sec$n") || $rate_detail->conn_sec;
+% my $selected = ($conn_sec==$curr_value) ? ' SELECTED' : '';
+ <OPTION VALUE="<% $conn_sec %>" <%$selected%>><% $conn_secs{$conn_sec} %></OPTION>
+% }
+ </TD>
+
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <%$money_char%><INPUT TYPE="text" SIZE=6 NAME="min_charge<%$n%>" VALUE="<% $cgi->param("min_charge$n") || $rate_detail->min_charge |h %>">
+ </TD>
+
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <SELECT NAME="sec_granularity<%$n%>">
+% foreach my $granularity ( keys %granularity ) {
+ <OPTION VALUE="<%$granularity%>"<% $granularity == ( $cgi->param("sec_granularity$n") || $rate_detail->sec_granularity ) ? ' SELECTED' : '' %>><%$granularity{$granularity}%>
+% }
+ </SELECT>
+ </TD>
+
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <% include( '/elements/select-table.html',
+ 'element_name' => "classnum$n",
+ 'table' => 'usage_class',
+ 'name_col' => 'classname',
+ 'empty_label' => '(default)',
+ 'hashref' => { disabled => '' },
+ 'curr_value' => ( $cgi->param("classnum$n") ||
+ $rate_detail->classnum ),
+ )
+ %>
+ </TD>
+
+ </TR>
+
+% }
+
+</TABLE>
+
+
+<BR><BR>
+<INPUT TYPE="submit" VALUE="<% $rate_region->regionnum ? "Apply changes" : "Add region" %>">
+
+</FORM>
+
<% include('/elements/footer.html') %>
<%once>
diff --git a/httemplate/edit/rate_time.cgi b/httemplate/edit/rate_time.cgi
deleted file mode 100644
index eca8fbb61..000000000
--- a/httemplate/edit/rate_time.cgi
+++ /dev/null
@@ -1,69 +0,0 @@
-<% include("/elements/header.html", { title => "$action Time Period" }) %>
-<% include("/elements/menubar.html",
- 'Rate plans' => "${p}browse/rate.cgi",
- ) %>
-<BR>
-<% include('/elements/error.html') %>
-<BR>
-
-<FORM METHOD="POST" ACTION="<% "${p}edit/process/rate_time.cgi" %>">
-<INPUT TYPE="hidden" NAME="ratetimenum" VALUE="<% $ratetimenum %>">
-<% ntable('#cccccc',2) %>
-<TABLE>
- <TR>
- <TH ALIGN="right">Period name</TH>
- <TD><INPUT TYPE="text" NAME="ratetimename" VALUE="<% $rate_time ? $rate_time->ratetimename : '' %>"></TD>
- </TR>
-</TABLE>
-<% include('/elements/auto-table.html',
- 'header' => [ '', 'Start','','', '','End','','' ],
- 'fields' => [ qw(sd sh sm sa ed eh em ea) ],
- 'select' => [ ($day, $hour, $min, $ampm) x 2 ],
- 'data' => \@data,
- ) %>
-<INPUT TYPE="submit" VALUE="<% $rate_time ? 'Apply changes' : 'Add period'%>">
-</FORM>
-<BR>
-<A HREF="<% "${p}edit/process/rate_time.cgi?ratetimenum=$ratetimenum;delete=1" %>">Delete this period</A>
-<% include('/elements/footer.html') %>
-
-<%init>
-my $ratetimenum = ($cgi->keywords)[0] || $cgi->param('ratetimenum') || '';
-my $action = 'Add';
-my $rate_time;
-my @data = ();
-my $day = [ 0 => 'Sun',
- 1 => 'Mon',
- 2 => 'Tue',
- 3 => 'Wed',
- 4 => 'Thu',
- 5 => 'Fri',
- 6 => 'Sat', ];
-my $hour = [ map( {$_, sprintf('%02d',$_) } 0..11 )];
-my $min = [ map( {$_, sprintf('%02d',$_) } 0,30 )];
-my $ampm = [ 0 => 'AM', 1 => 'PM' ];
-
-if($ratetimenum) {
- $action = 'Edit';
- $rate_time = qsearchs('rate_time', {ratetimenum => $ratetimenum})
- or die "ratetimenum $ratetimenum not found";
- if($cgi->param('error')) {
- my %vars = $cgi->Vars;
- foreach my $i (sort {$a <=> $b } map { /^sd(\d+)$/ } keys(%vars)) {
- push @data, [ @vars{"sd$i", "sh$i", "sm$i", "sa$i",
- "ed$i", "eh$i", "em$i", "ea$i"} ];
- }
- }
- else {
- foreach my $interval ($rate_time->intervals) {
- push @data, [ map { int($_/86400) % 7,
- int($_/3600) % 12,
- int($_/60) % 60,
- int($_/43200) % 2, }
- ( $interval->stime, $interval->etime )
- ];
- }
- }
-}
-
-</%init>
diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi
index 59b5d10f3..5c2d5f495 100755
--- a/httemplate/edit/svc_acct.cgi
+++ b/httemplate/edit/svc_acct.cgi
@@ -392,16 +392,10 @@ Service # <% $svcnum ? "<B>$svcnum</B>" : " (NEW)" %><BR>
</TD>
</TR>
- <% include('/elements/tr-select.html',
- 'label' => 'On logout remove trash',
- 'field' => 'cgp_emptytrash',
- 'options' => $svc_acct->cgp_emptytrash_values,
- 'labels' => {
- '' => 'default (92 days)', #right?
- },
- 'curr_value' => $svc_acct->cgp_emptytrash,
- )
- %>
+ <TR>
+ <TD ALIGN="right">On logout remove trash</TD>
+ <TD><INPUT TYPE="text" NAME="cgp_emptytrash" VALUE="<% $svc_acct->cgp_emptytrash %>"></TD>
+ </TR>
<% include('/elements/tr-select.html',
'label' => 'Language',
@@ -417,7 +411,69 @@ Service # <% $svcnum ? "<B>$svcnum</B>" : " (NEW)" %><BR>
<% include('/elements/tr-select.html',
'label' => 'Time zone',
'field' => 'cgp_timezone',
- 'options' => $svc_acct->cgp_timezone_values,
+ 'options' => [
+ 'HostOS',
+ '(+0100) Algeria/Congo',
+ '(+0200) Egypt/South Africa',
+ '(+0300) Saudi Arabia',
+ '(+0400) Oman',
+ '(+0500) Pakistan',
+ '(+0600) Bangladesh',
+ '(+0700) Thailand/Vietnam',
+ '(+0800) China/Malaysia',
+ '(+0900) Japan/Korea',
+ '(+1000) Queensland',
+ '(+1100) Micronesia',
+ '(+1200) Fiji',
+ '(+1300) Tonga/Kiribati',
+ '(+1400) Christmas Islands',
+ '(-0100) Azores/Cape Verde',
+ '(-0200) Fernando de Noronha',
+ '(-0300) Argentina/Uruguay',
+ '(-0400) Venezuela/Guyana',
+ '(-0500) Haiti/Peru',
+ '(-0600) Central America',
+ '(-0700) Arisona',
+ '(-0800) Adamstown',
+ '(-0900) Marquesas Islands',
+ '(-1000) Hawaii/Tahiti',
+ '(-1100) Samoa',
+ 'Asia/Afghanistan',
+ 'Asia/India',
+ 'Asia/Iran',
+ 'Asia/Iraq',
+ 'Asia/Israel',
+ 'Asia/Jordan',
+ 'Asia/Lebanon',
+ 'Asia/Syria',
+ 'Australia/Adelaide',
+ 'Australia/East',
+ 'Australia/NorthernTerritory',
+ 'Europe/Central',
+ 'Europe/Eastern',
+ 'Europe/Moscow',
+ 'Europe/Western',
+ 'GMT (+0000)',
+ 'Newfoundland',
+ 'NewZealand/Auckland',
+ 'NorthAmerica/Alaska',
+ 'NorthAmerica/Atlantic',
+ 'NorthAmerica/Central',
+ 'NorthAmerica/Eastern',
+ 'NorthAmerica/Mountain',
+ 'NorthAmerica/Pacific',
+ 'Russia/Ekaterinburg',
+ 'Russia/Irkutsk',
+ 'Russia/Kamchatka',
+ 'Russia/Krasnoyarsk',
+ 'Russia/Magadan',
+ 'Russia/Novosibirsk',
+ 'Russia/Vladivostok',
+ 'Russia/Yakutsk',
+ 'SouthAmerica/Brasil',
+ 'SouthAmerica/Chile',
+ 'SouthAmerica/Paraguay',
+ ],
'labels' => {
'' => 'default (HostOS)',
},
diff --git a/httemplate/edit/svc_domain.cgi b/httemplate/edit/svc_domain.cgi
index 5abe9d6b5..b19e9ee15 100755
--- a/httemplate/edit/svc_domain.cgi
+++ b/httemplate/edit/svc_domain.cgi
@@ -220,17 +220,11 @@ Account defaults
</TD>
</TR>
- <% include('/elements/tr-select.html',
+ <% include('/elements/tr-input-text.html',
'label' => 'On logout remove trash',
- 'field' => 'acct_def_cgp_emptytrash',
- 'options' => $svc_domain->cgp_emptytrash_values,
- 'labels' => {
- '' => 'default (92 days)', #right?
- },
'curr_value' => $svc_domain->acct_def_cgp_emptytrash,
)
%>
-
<% include('/elements/tr-select.html',
'label' => 'Language',
'field' => 'acct_def_cgp_language',
@@ -245,7 +239,69 @@ Account defaults
<% include('/elements/tr-select.html',
'label' => 'Time zone',
'field' => 'acct_def_cgp_timezone',
- 'options' => $svc_domain->cgp_timezone_values,
+ 'options' => [
+ 'HostOS',
+ '(+0100) Algeria/Congo',
+ '(+0200) Egypt/South Africa',
+ '(+0300) Saudi Arabia',
+ '(+0400) Oman',
+ '(+0500) Pakistan',
+ '(+0600) Bangladesh',
+ '(+0700) Thailand/Vietnam',
+ '(+0800) China/Malaysia',
+ '(+0900) Japan/Korea',
+ '(+1000) Queensland',
+ '(+1100) Micronesia',
+ '(+1200) Fiji',
+ '(+1300) Tonga/Kiribati',
+ '(+1400) Christmas Islands',
+ '(-0100) Azores/Cape Verde',
+ '(-0200) Fernando de Noronha',
+ '(-0300) Argentina/Uruguay',
+ '(-0400) Venezuela/Guyana',
+ '(-0500) Haiti/Peru',
+ '(-0600) Central America',
+ '(-0700) Arisona',
+ '(-0800) Adamstown',
+ '(-0900) Marquesas Islands',
+ '(-1000) Hawaii/Tahiti',
+ '(-1100) Samoa',
+ 'Asia/Afghanistan',
+ 'Asia/India',
+ 'Asia/Iran',
+ 'Asia/Iraq',
+ 'Asia/Israel',
+ 'Asia/Jordan',
+ 'Asia/Lebanon',
+ 'Asia/Syria',
+ 'Australia/Adelaide',
+ 'Australia/East',
+ 'Australia/NorthernTerritory',
+ 'Europe/Central',
+ 'Europe/Eastern',
+ 'Europe/Moscow',
+ 'Europe/Western',
+ 'GMT (+0000)',
+ 'Newfoundland',
+ 'NewZealand/Auckland',
+ 'NorthAmerica/Alaska',
+ 'NorthAmerica/Atlantic',
+ 'NorthAmerica/Central',
+ 'NorthAmerica/Eastern',
+ 'NorthAmerica/Mountain',
+ 'NorthAmerica/Pacific',
+ 'Russia/Ekaterinburg',
+ 'Russia/Irkutsk',
+ 'Russia/Kamchatka',
+ 'Russia/Krasnoyarsk',
+ 'Russia/Magadan',
+ 'Russia/Novosibirsk',
+ 'Russia/Vladivostok',
+ 'Russia/Yakutsk',
+ 'SouthAmerica/Brasil',
+ 'SouthAmerica/Chile',
+ 'SouthAmerica/Paraguay',
+ ],
'labels' => {
'' => 'default (HostOS)',
},