[freeside-commits] freeside/FS/FS svc_acct.pm, 1.216, 1.217 svc_phone.pm, 1.2, 1.3

Ivan,,, ivan at wavetail.420.am
Fri Feb 9 22:13:17 PST 2007


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv10960/FS/FS

Modified Files:
	svc_acct.pm svc_phone.pm 
Log Message:
reincorporate the changes from http://www.sisd.com/cgi-bin/viewcvs.cgi/freeside/httemplate/edit/part_svc.cgi?r1=1.52&r2=1.53 that were lost due to the concurrent service-refactor merge

Index: svc_phone.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_phone.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- svc_phone.pm	29 Dec 2006 08:51:32 -0000	1.2
+++ svc_phone.pm	10 Feb 2007 06:13:15 -0000	1.3
@@ -74,11 +74,13 @@
         'countrycode' => { label => 'Country code',
                            type  => 'text',
                            disable_inventory => 1,
+                           disable_select => 1,
                          },
         'phonenum'    => 'Phone number',
         'pin'         => { label => 'Personal Identification Number',
                            type  => 'text',
                            disable_inventory => 1,
+                           disable_select => 1,
                          },
     },
   };

Index: svc_acct.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_acct.pm,v
retrieving revision 1.216
retrieving revision 1.217
diff -u -d -r1.216 -r1.217
--- svc_acct.pm	8 Feb 2007 17:00:37 -0000	1.216
+++ svc_acct.pm	10 Feb 2007 06:13:15 -0000	1.217
@@ -8,7 +8,8 @@
              $username_noperiod $username_nounderscore $username_nodash
              $username_uppercase $username_percent
              $password_noampersand $password_noexclamation
-             $welcome_template $welcome_from $welcome_subject $welcome_mimetype
+             $welcome_template $welcome_from
+             $welcome_subject $welcome_subject_template $welcome_mimetype
              $warning_template $warning_from $warning_subject $warning_mimetype
              $warning_cc
              $smtpmachine
@@ -71,6 +72,10 @@
     ) or warn "can't create welcome email template: $Text::Template::ERROR";
     $welcome_from = $conf->config('welcome_email-from'); # || 'your-isp-is-dum'
     $welcome_subject = $conf->config('welcome_email-subject') || 'Welcome';
+    $welcome_subject_template = new Text::Template (
+      TYPE   => 'STRING',
+      SOURCE => $welcome_subject,
+    ) or warn "can't create welcome email subject template: $Text::Template::ERROR";
     $welcome_mimetype = $conf->config('welcome_email-mimetype') || 'text/plain';
   } else {
     $welcome_template = '';
@@ -232,17 +237,20 @@
                          select_table => 'svc_acct_pop',
                          select_key   => 'popnum',
                          select_label => 'city',
+                         disable_select => 1,
                        },
         'username'  => {
                          label => 'Username',
                          type => 'text',
                          disable_default => 1,
                          disable_fixed => 1,
+                         disable_select => 1,
                        },
         'quota'     => { 
                          label => 'Quota',
                          type => 'text',
                          disable_inventory => 1,
+                         disable_select => 1,
                        },
         '_password' => 'Password',
         'gid'       => {
@@ -257,16 +265,18 @@
                          type     =>'select',
                          select_list => [ $conf->config('shells') ],
                          disable_inventory => 1,
+                         disable_select => 1,
                        },
         'finger'    => 'Real name (GECOS)',
         'domsvc'    => {
                          label     => 'Domain',
-                         def_label => 'svcnum from svc_domain',
+                         #def_label => 'svcnum from svc_domain',
                          type      => 'select',
                          select_table => 'svc_domain',
                          select_key   => 'svcnum',
                          select_label => 'domain',
                          disable_inventory => 1,
+
                        },
         'usergroup' => {
                          label => 'RADIUS groups',
@@ -277,6 +287,7 @@
         'seconds'   => { label => 'Seconds',
                          type  => 'text',
                          disable_inventory => 1,
+                         disable_select => 1,
                        },
     },
   };
@@ -468,6 +479,15 @@
     if ( $welcome_template && $cust_pkg ) {
       my $to = join(', ', grep { $_ !~ /^(POST|FAX)$/ } $cust_main->invoicing_list );
       if ( $to ) {
+
+        my %hash = (
+                     'custnum'  => $self->custnum,
+                     'username' => $self->username,
+                     'password' => $self->_password,
+                     'first'    => $cust_main->first,
+                     'last'     => $cust_main->getfield('last'),
+                     'pkg'      => $cust_pkg->part_pkg->pkg,
+                   );
         my $wqueue = new FS::queue {
           'svcnum' => $self->svcnum,
           'job'    => 'FS::svc_acct::send_email'
@@ -475,16 +495,9 @@
         my $error = $wqueue->insert(
           'to'       => $to,
           'from'     => $welcome_from,
-          'subject'  => $welcome_subject,
+          'subject'  => $welcome_subject_template->fill_in( HASH => \%hash, ),
           'mimetype' => $welcome_mimetype,
-          'body'     => $welcome_template->fill_in( HASH => {
-                          'custnum'  => $self->custnum,
-                          'username' => $self->username,
-                          'password' => $self->_password,
-                          'first'    => $cust_main->first,
-                          'last'     => $cust_main->getfield('last'),
-                          'pkg'      => $cust_pkg->part_pkg->pkg,
-                        } ),
+          'body'     => $welcome_template->fill_in( HASH => \%hash, ),
         );
         if ( $error ) {
           $dbh->rollback if $oldAutoCommit;



More information about the freeside-commits mailing list