1 package FS::svc_conferencing;
2 use base qw( FS::svc_Common );
6 #use FS::Record qw( qsearch qsearchs );
10 FS::svc_conferencing - Object methods for svc_conferencing records
14 use FS::svc_conferencing;
16 $record = new FS::svc_conferencing \%hash;
17 $record = new FS::svc_conferencing { 'column' => 'value' };
19 $error = $record->insert;
21 $error = $new_record->replace($old_record);
23 $error = $record->delete;
25 $error = $record->check;
29 An FS::svc_conferencing object represents a conferencing service.
30 FS::svc_conferencing inherits from FS::Record. The following fields are
92 Creates a new record. To add the record to the database, see L<"insert">.
94 Note that this stores the hash reference, not a distinct copy of the hash it
95 points to. You can ask the object for a copy with the I<hash> method.
99 sub table { 'svc_conferencing'; }
103 my %opts = ( 'type' => 'text',
104 'disable_select' => 1,
105 'disable_inventory' => 1,
108 tie my %fields, 'Tie::IxHash',
109 'svcnum' => { label => 'Service' },
110 'conf_id' => { label => 'Conference ID', %opts, },
111 'conf_name' => { label => 'Conference Name',
116 'conf_password' => { label => 'Password',
121 'access_code' => { label => 'Access code' ,
126 'duration' => { label => 'Duration',
129 disable_inventory => 1,
130 value_callback => sub {
131 my $min = shift->duration;
133 sprintf("%02d",$min%60)."m";
136 'participants' => { label => 'Num. participants', size=>5, %opts },
137 'conftypenum' => { label => 'Conference type',
138 type => 'select-conferencing_type',
140 disable_inventory => 1,
141 value_callback => sub {
142 shift->conferencing_type->typename;
145 'confqualitynum' => { label => 'Quality',
146 type => 'select-conferencing_quality',
148 disable_inventory => 1,
149 value_callback => sub {
150 shift->conferencing_quality->qualityname;
153 'opt_recording' => { label => 'Recording',
157 disable_inventory => 1,
159 'opt_sip' => { label => 'SIP participation',
163 disable_inventory => 1,
165 'opt_phone' => { label => 'Phone participation',
169 disable_inventory => 1,
174 'name' => 'Conferencing', # service',
175 #'name_plural' => '', #optional,
176 #'longname_plural' => '', #optional
177 'fields' => \%fields,
178 'addl_process_fields' => [ 'duration_units' ],
179 'sorts' => [ 'conf_id', 'conf_name' ],
180 'display_weight' => 57,
181 'cancel_weight' => 70, #? no deps, so
188 $self->conf_id.': '. $self->conf_name;
193 Adds this record to the database. If there is an error, returns the error,
194 otherwise returns false.
198 Delete this record from the database.
200 =item replace OLD_RECORD
202 Replaces the OLD_RECORD with this one in the database. If there is an error,
203 returns the error, otherwise returns false.
207 Checks all fields to make sure this is a valid record. If there is
208 an error, returns the error, otherwise returns false. Called by the insert
216 if ( $self->duration_units && $self->duration_units > 1 ) {
217 $self->duration( int( ($self->duration * $self->duration_units) + .5) );
219 $self->duration_units(1);
223 $self->ut_numbern('svcnum')
224 || $self->ut_numbern('conf_id')
225 || $self->ut_text('conf_name')
226 || $self->ut_text('conf_password')
227 || $self->ut_text('access_code')
228 || $self->ut_number('duration')
229 || $self->ut_number('participants')
230 || $self->ut_number('conftypenum')
231 || $self->ut_number('confqualitynum')
232 || $self->ut_enum('opt_recording', [ '', 'Y' ])
233 || $self->ut_enum('opt_sip', [ '', 'Y' ])
234 || $self->ut_enum('opt_phone', [ '', 'Y' ])
236 return $error if $error;
238 return 'Meeting name must be at least 4 characters'
239 unless length($self->conf_name) >= 4;
240 return 'Password must be at least 4 characters'
241 unless length($self->conf_password) >= 4;
242 return 'Access code must be at least 4 digits'
243 unless length($self->access_code) >= 4;