summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/svc_CGP_Mixin.pm34
-rw-r--r--FS/FS/svc_acct.pm13
-rw-r--r--FS/FS/svc_domain.pm12
-rwxr-xr-xhttemplate/edit/svc_acct.cgi16
-rwxr-xr-xhttemplate/edit/svc_domain.cgi10
5 files changed, 66 insertions, 19 deletions
diff --git a/FS/FS/svc_CGP_Mixin.pm b/FS/FS/svc_CGP_Mixin.pm
index adde61f..489e979 100644
--- a/FS/FS/svc_CGP_Mixin.pm
+++ b/FS/FS/svc_CGP_Mixin.pm
@@ -30,7 +30,7 @@ Returns an arrayref of Communigate time zones.
#http://www.communigate.com/pub/client/TimeZones.data
#http://www.communigate.com/cgatepro/WebMail.html#Settings
-sub cgp_timezone {
+sub cgp_timezone_values {
#my $self = shift; #i'm used as a class and object method but just return data
[ '',
@@ -96,7 +96,39 @@ sub cgp_timezone {
'SouthAmerica/Chile',
'SouthAmerica/Paraguay',
];
+}
+
+=item cgp_emptytrash_values
+
+Returns an arrayref of possible EmptyTrash values.
+
+=cut
+#http://www.communigate.com/cgatepro/WebMail.html#Trash
+
+sub cgp_emptytrash_values {
+ #my $self = shift; #i'm used as a class and object method but just return data
+
+ [ '', #<option value="-1">default(92 days)
+ '0 seconds',
+ '60 minutes',
+ '2 hours',
+ '3 hours',
+ '6 hours',
+ '12 hours',
+ '24 hours',
+ '2 days',
+ '3 days',
+ '7 days',
+ '10 days',
+ '2 weeks',
+ '3 weeks',
+ '30 days',
+ '60 days',
+ '90 days',
+ '180 days',
+ '360 days',
+ ];
}
=back
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm
index 6aede58..0458bb9 100644
--- a/FS/FS/svc_acct.pm
+++ b/FS/FS/svc_acct.pm
@@ -451,8 +451,9 @@ sub table_info {
disable_select => 1,
},
'cgp_emptytrash' => {
- label => 'Communigate on logout remove trash',
- type => 'text',
+ label => 'Communigate on logout remove trash',
+ type => 'select',
+ select_list => __PACKAGE__->cgp_emptytrash_values,
disable_inventory => 1,
disable_select => 1,
},
@@ -464,9 +465,9 @@ sub table_info {
disable_select => 1,
},
'cgp_timezone' => {
- label => 'Communigate time zone',
- type => 'select',
- select_list => __PACKAGE__->cgp_timezone,
+ label => 'Communigate time zone',
+ type => 'select',
+ select_list => __PACKAGE__->cgp_timezone_values,
disable_inventory => 1,
disable_select => 1,
},
@@ -1184,7 +1185,7 @@ sub check {
|| $self->ut_enum('cgp_addmailtrailer', [ '', 'Y' ])
#preferences
|| $self->ut_alphasn('cgp_deletemode')
- || $self->ut_alphan('cgp_emptytrash')
+ || $self->ut_enum('cgp_emptytrash', $self->cgp_emptytrash_values)
|| $self->ut_alphan('cgp_language')
|| $self->ut_textn('cgp_timezone')
|| $self->ut_textn('cgp_skinname')
diff --git a/FS/FS/svc_domain.pm b/FS/FS/svc_domain.pm
index 8215380..4d85060 100644
--- a/FS/FS/svc_domain.pm
+++ b/FS/FS/svc_domain.pm
@@ -159,7 +159,8 @@ sub table_info {
},
'acct_def_cgp_emptytrash' => {
label => 'Acct. default Communigate on logout remove trash',
- type => 'text',
+ type => 'select',
+ select_list => __PACKAGE__->cgp_emptytrash_values,
disable_inventory => 1,
disable_select => 1,
},
@@ -220,9 +221,9 @@ sub table_info {
disable_select => 1,
},
'acct_def_cgp_timezone' => {
- label => 'Acct. default time zone',
- type => 'select',
- select_list => __PACKAGE__->cgp_timezone,
+ label => 'Acct. default time zone',
+ type => 'select',
+ select_list => __PACKAGE__->cgp_timezone_values,
disable_inventory => 1,
disable_select => 1,
},
@@ -492,7 +493,8 @@ sub check {
#XXX archive messages
#preferences
|| $self->ut_alphasn('acct_def_cgp_deletemode')
- || $self->ut_alphan('acct_def_cgp_emptytrash')
+ || $self->ut_enum('acct_def_cgp_emptytrash',
+ $self->cgp_emptytrash_values )
|| $self->ut_alphan('acct_def_cgp_language')
|| $self->ut_textn('acct_def_cgp_timezone')
|| $self->ut_textn('acct_def_cgp_skinname')
diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi
index 09a4cfd..59b5d10 100755
--- a/httemplate/edit/svc_acct.cgi
+++ b/httemplate/edit/svc_acct.cgi
@@ -392,10 +392,16 @@ Service # <% $svcnum ? "<B>$svcnum</B>" : " (NEW)" %><BR>
</TD>
</TR>
- <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' => 'On logout remove trash',
+ 'field' => 'cgp_emptytrash',
+ 'options' => $svc_acct->cgp_emptytrash_values,
+ 'labels' => {
+ '' => 'default (92 days)', #right?
+ },
+ 'curr_value' => $svc_acct->cgp_emptytrash,
+ )
+ %>
<% include('/elements/tr-select.html',
'label' => 'Language',
@@ -411,7 +417,7 @@ Service # <% $svcnum ? "<B>$svcnum</B>" : " (NEW)" %><BR>
<% include('/elements/tr-select.html',
'label' => 'Time zone',
'field' => 'cgp_timezone',
- 'options' => $svc_acct->cgp_timezone,
+ 'options' => $svc_acct->cgp_timezone_values,
'labels' => {
'' => 'default (HostOS)',
},
diff --git a/httemplate/edit/svc_domain.cgi b/httemplate/edit/svc_domain.cgi
index 5fe095d..5abe9d6 100755
--- a/httemplate/edit/svc_domain.cgi
+++ b/httemplate/edit/svc_domain.cgi
@@ -220,11 +220,17 @@ Account defaults
</TD>
</TR>
- <% include('/elements/tr-input-text.html',
+ <% include('/elements/tr-select.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',
@@ -239,7 +245,7 @@ Account defaults
<% include('/elements/tr-select.html',
'label' => 'Time zone',
'field' => 'acct_def_cgp_timezone',
- 'options' => $svc_domain->cgp_timezone,
+ 'options' => $svc_domain->cgp_timezone_values,
'labels' => {
'' => 'default (HostOS)',
},