diff options
| author | ivan <ivan> | 2010-07-23 10:02:40 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2010-07-23 10:02:40 +0000 | 
| commit | 22e59cf0fddecd4808a6ce91fe2b1712f3ab3c87 (patch) | |
| tree | c7a99c8945765677fbec24b4e59b6696a961caba | |
| parent | abdb0f8539d8604b3e1ba6218e36a8717e96f88d (diff) | |
add EmptyTrash values and finish consolidating the CGP timezone arrays, RT#7083
| -rw-r--r-- | FS/FS/svc_CGP_Mixin.pm | 34 | ||||
| -rw-r--r-- | FS/FS/svc_acct.pm | 13 | ||||
| -rw-r--r-- | FS/FS/svc_domain.pm | 12 | ||||
| -rwxr-xr-x | httemplate/edit/svc_acct.cgi | 16 | ||||
| -rwxr-xr-x | httemplate/edit/svc_domain.cgi | 10 | 
5 files changed, 66 insertions, 19 deletions
| diff --git a/FS/FS/svc_CGP_Mixin.pm b/FS/FS/svc_CGP_Mixin.pm index adde61fe2..489e9791f 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 6aede58e8..0458bb998 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 8215380bb..4d85060d3 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 09a4cfd64..59b5d10f3 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 5fe095d07..5abe9d6b5 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)',                                 }, | 
