botched backport; sync with 2.1, RT#9883
[freeside.git] / FS / FS / svc_domain.pm
index 4d85060..7fd0779 100644 (file)
@@ -207,6 +207,27 @@ sub table_info {
         label => 'Acct. default Add trailer to sent mail',
         type  => 'checkbox',
       },
+      'acct_def_cgp_archiveafter'   => {
+        label       => 'Archive messages after',
+        type        => 'select',
+        select_hash => [ 
+                         -2 => 'default(730 days)',
+                         0 => 'Never',
+                         86400 => '24 hours',
+                         172800 => '2 days',
+                         259200 => '3 days',
+                         432000 => '5 days',
+                         604800 => '7 days',
+                         1209600 => '2 weeks',
+                         2592000 => '30 days',
+                         7776000 => '90 days',
+                         15552000 => '180 days',
+                         31536000 => '365 days',
+                         63072000 => '730 days',
+                       ],
+        disable_inventory => 1,
+        disable_select    => 1,
+      },
       'trailer' => {
         label => 'Mail trailer',
         type  => 'textarea',
@@ -282,9 +303,6 @@ defined.  An FS::cust_svc record will be created and inserted.
 The additional field I<action> should be set to I<N> for new domains, I<M>
 for transfers, or I<I> for no action (registered elsewhere).
 
-A registration or transfer email will be submitted unless
-$FS::svc_domain::whois_hack is true.
-
 The additional field I<email> can be used to manually set the admin contact
 email address on this email.  Otherwise, the svc_acct records for this package 
 (see L<FS::cust_pkg>) are searched.  If there is exactly one svc_acct record
@@ -490,7 +508,7 @@ sub check {
               || $self->ut_enum('acct_def_cgp_rpopallowed', [ '', 'Y' ])
               || $self->ut_enum('acct_def_cgp_mailtoall', [ '', 'Y' ])
               || $self->ut_enum('acct_def_cgp_addmailtrailer', [ '', 'Y' ])
-              #XXX archive messages
+              || $self->ut_snumbern('acct_def_cgp_archiveafter')
               #preferences
               || $self->ut_alphasn('acct_def_cgp_deletemode')
               || $self->ut_enum('acct_def_cgp_emptytrash',
@@ -501,7 +519,6 @@ sub check {
               || $self->ut_textn('acct_def_cgp_prontoskinname')
               || $self->ut_alphan('acct_def_cgp_sendmdnmode')
               #mail
-              #XXX rules, archive rule, spam foldering rule(s)
   ;
   return $error if $error;
 
@@ -521,7 +538,7 @@ sub check {
     $recref->{domain} = "$1.$2";
     $recref->{suffix} ||= $2;
   # hmmmmmmmm.
-  } elsif ( $whois_hack && $recref->{domain} =~ /^([\w\-\.]+)\.(\w+)$/ ) {
+  } elsif ( $whois_hack && $recref->{domain} =~ /^([\w\-\.\/]+)\.(\w+)$/ ) {
     $recref->{domain} = "$1.$2";
     # need to match a list of suffixes - no guarantee they're top-level..
     # http://wiki.mozilla.org/TLD_List
@@ -579,6 +596,7 @@ sub domain_record {
     'A'     => 5,
     'TXT'   => 6,
     'PTR'   => 7,
+    'SRV'   => 8,
   );
 
   my %sort = (