20060318. // //This program is free software; you can redistribute it and/or //modify it under the terms of the GNU General Public License //as published by the Free Software Foundation; either version 2 //of the License, or (at your option) any later version. // //This program is distributed in the hope that it will be useful, //but WITHOUT ANY WARRANTY; without even the implied warranty of //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //GNU General Public License for more details. $action = isset($_REQUEST['action'])?$_REQUEST['action']:''; $id = isset($_REQUEST['id'])?$_REQUEST['id']:''; $notes = isset($_REQUEST['notes'])?$_REQUEST['notes']:''; $rname = isset($_REQUEST['rname'])?$_REQUEST['rname']:''; $usersnum = isset($_REQUEST['usersnum'])?$_REQUEST['usersnum']:''; if (empty($usersnum)) { $dest = "unnumbered-"; } else { $dest = "{$usersnum}-"; } // get feature codes for diplay purposes $fcc = new featurecode('recordings', 'record_save'); $fc_save = $fcc->getCodeActive(); unset($fcc); $fcc = new featurecode('recordings', 'record_check'); $fc_check = $fcc->getCodeActive(); unset($fcc); $fc_save = ($fc_save != '' ? $fc_save : _('** MISSING FEATURE CODE **')); $fc_check = ($fc_check != '' ? $fc_check : _('** MISSING FEATURE CODE **')); echo "\n"; switch ($action) { case "recorded": // Clean up the filename, take out any nasty characters $filename = escapeshellcmd(strtr($rname, '/ ', '__')); if (!file_exists($recordings_astsnd_path."custom")) { if (!mkdir($recordings_astsnd_path."custom", 0775)) { echo '
'._("Failed to create").' '.$recordings_astsnd_path.'custom'.'
'; } } else { // can't rename a file from one partition to another, must use mv or cp // rename($recordings_save_path."{$dest}ivrrecording.wav",$recordings_astsnd_path."custom/{$filename}.wav"); exec("sudo mv " . $recordings_save_path . "{$dest}ivrrecording.wav " . $recordings_astsnd_path."custom/{$filename}.wav"); $isok = recordings_add($rname, "custom/{$filename}.wav"); recording_sidebar(null, $usersnum); recording_addpage($usersnum); if ($isok) echo '
'._("System Recording").' "'.$rname.'" '._("Saved").'!
'; } break; case "edit": $filename = $_REQUEST['filename']; copy($recordings_astsnd_path."{$filename}.wav", $recordings_save_path."{$dest}ivrrecording.wav"); recording_sidebar($id, $usersnum); recording_editpage($id, $usersnum); break; case "edited": $filename = $_REQUEST['filenam']; // can't rename a file from one partition to another, must use mv or cp // this line also appeared to be missinthe 'custom' prefix // rename($recordings_save_path."{$dest}ivrrecording.wav",$recordings_astsnd_path."custom/{$filename}.wav"); exec("mv " . $recordings_save_path . "{$dest}ivrrecording.wav " . $recordings_astsnd_path."custom/{$filename}.wav"); recordings_update($id, $rname, $notes); recording_sidebar($id, $usersnum); recording_editpage($id, $usersnum); echo '
'._("System Recording").' "'.$rname.'" '._("Updated").'!
'; break; case "delete"; recordings_del($id); default: recording_sidebar($id, $usersnum); recording_addpage($usersnum); break; } function recording_addpage($usersnum) { global $fc_save; global $fc_check; global $recordings_save_path; ?>

"._("dial")." ".$fc_save." "; echo _("Start speaking at the tone. Hangup when finished.").""; echo _("and speak the message you wish to record.")."\n"; } else { ?>

">

:
" onclick="document.upload.submit(upload);alert('');"/>
"._("Successfully uploaded")." ".$_FILES['ivrfile']['name'].""; } ?>

"._("dial")." ".$fc_check." "._("to listen to your recording.")?>

"._("Step 2: Name").""; } ?>
:
">

Error reading Recording ID $id - Aborting

"; return; }?> Remove Recording (Note, does not delete file from computer)"; ?>

Change NameThis changes the short name, visible on the right, of this recording
Descriptive NameThis is displayed, as a hint, when selecting this recording in Queues, Digital Receptionist, etc  
">
\n"; } function recordings_form_jscript() { ?>