diff options
| author | ivan <ivan> | 2008-08-03 02:15:08 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2008-08-03 02:15:08 +0000 | 
| commit | 5a218e8d28a8fd7c486ca84413b13bae5a987f76 (patch) | |
| tree | 0fc77d9c25e0fe39478665f570a72037d345b1fd | |
| parent | a8acb88758229305e88fa8cf13bc31dc902719ff (diff) | |
add a name field to svc_phone
| -rw-r--r-- | FS/FS/Schema.pm | 1 | ||||
| -rw-r--r-- | FS/FS/svc_phone.pm | 9 | ||||
| -rw-r--r-- | httemplate/edit/svc_phone.cgi | 2 | ||||
| -rw-r--r-- | httemplate/view/svc_phone.cgi | 9 | 
4 files changed, 19 insertions, 2 deletions
| diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 9a1ce9fc0..6c899c5a1 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -2036,6 +2036,7 @@ sub tables_hashref {          'phonenum',     'varchar',     '',      15, '', '',  #12 ?          'pin',          'varchar', 'NULL', $char_d, '', '',          'sip_password', 'varchar', 'NULL', $char_d, '', '', +        'phone_name',   'varchar', 'NULL', $char_d, '', '',        ],        'primary_key' => 'svcnum',        'unique' => [], diff --git a/FS/FS/svc_phone.pm b/FS/FS/svc_phone.pm index f7a44892f..b91ba6551 100644 --- a/FS/FS/svc_phone.pm +++ b/FS/FS/svc_phone.pm @@ -56,6 +56,8 @@ primary key  Voicemail PIN +=item phone_name +  =back  =head1 METHODS @@ -92,6 +94,7 @@ sub table_info {                              disable_select => 1,                            },          'sip_password' => 'SIP password', +        'name'         => 'Name',      },    };  } @@ -117,7 +120,10 @@ Returns the phone number.  sub label {    my $self = shift; -  $self->phonenum; #XXX format it better +  my $phonenum = $self->phonenum; #XXX format it better +  my $label = $phonenum; +  $label .= ' ('.$self->phone_name.')' if $self->phone_name; +  $label;  }  =item insert @@ -182,6 +188,7 @@ sub check {      || $self->ut_number('phonenum')      || $self->ut_anything('sip_password')      || $self->ut_numbern('pin') +    || $self->ut_textn('phone_name')    ;    return $error if $error; diff --git a/httemplate/edit/svc_phone.cgi b/httemplate/edit/svc_phone.cgi index bb9c08508..d7629ab6f 100644 --- a/httemplate/edit/svc_phone.cgi +++ b/httemplate/edit/svc_phone.cgi @@ -8,12 +8,14 @@                                 },                                 'sip_password',                                 'pin', +                               'phone_name',                               ],                 'labels'   => {                                 'countrycode'  => 'Country code',                                 'phonenum'     => 'Phone number',                                 'sip_password' => 'SIP password',                                 'pin'          => 'Voicemail PIN', +                               'phone_name'   => 'Name',                               },             )  %> diff --git a/httemplate/view/svc_phone.cgi b/httemplate/view/svc_phone.cgi index 3cc1b3f44..12b246297 100644 --- a/httemplate/view/svc_phone.cgi +++ b/httemplate/view/svc_phone.cgi @@ -1,11 +1,18 @@  <% include('elements/svc_Common.html',                'table'     => 'svc_phone', -              'fields'    => [qw( countrycode phonenum sip_password pin )], +              'fields'    => [qw( +                                  countrycode +                                  phonenum +                                  sip_password +                                  pin +                                  phone_name +                             )],                'labels'    => {                                 'countrycode'  => 'Country code',                                 'phonenum'     => 'Phone number',                                 'sip_password' => 'SIP password',                                 'pin'          => 'PIN', +                               'phone_name'   => 'Name',                               },                'html_foot' => $html_foot,            ) | 
