ACL for hardware class config, RT#85057
[freeside.git] / FS / FS / phone_type.pm
index d2ef465..de56527 100644 (file)
@@ -1,7 +1,7 @@
 package FS::phone_type;
+use base qw( FS::Record );
 
 use strict;
-use base qw( FS::Record );
 use FS::Record qw( qsearch ); # qsearchs );
 
 =head1 NAME
@@ -91,6 +91,18 @@ sub check {
   $self->SUPER::check;
 }
 
+=item get_phone_types
+
+returns a list of phone_types.
+
+=cut
+
+sub get_phone_types {
+  ## not using Home and Fax right now. false laziness with  /elements/contact.html
+  my @phone_types = qsearch({table=>'phone_type', order_by=>'ORDER BY weight DESC', extra_sql => " WHERE typename NOT IN ('Home','Fax')"});
+  return @phone_types;
+}
+
 # Used by FS::Setup to initialize a new database.
 sub _populate_initial_data {
   my ($class, %opts) = @_;