Changeset 1618

Show
Ignore:
Timestamp:
04/16/06 23:03:42 (7 years ago)
Author:
mheydon1973
Message:

Changed place where System Recordings being used back to use the real filename and not the ID from the database for

a number of reason...

* Modules shouldn't stop using System Recordings just 'cos the module is currently not enabled / installed
* Recording details would be erased from ringgroups, queues, etc. if the relevent page was Submited with the System

Recordings module disabled
* If the System Recordings module was uninstalled / reinstalled, the ID numbers would be different and so the wrong

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.1/queues/functions.inc.php

    r1433 r1618  
    3838          $ext->add('ext-queues', $exten, '', new ext_setcidname($q['prefix'].'${CALLERIDNAME}')); 
    3939          $ext->add('ext-queues', $exten, '', new ext_setvar('MONITOR_FILENAME','/var/spool/asterisk/monitor/q${EXTEN}-${TIMESTAMP}-${UNIQUEID}')); 
    40           if(function_exists('recordings_list') && isset($q['joinannounce']) && $q['joinannounce'] != "") { 
    41             $filename = recordings_get($q['joinannounce']); 
    42             $ext->add('ext-queues', $exten, '', new ext_playback($filename['filename'])); 
    43           } else { 
    44             $filename['filename'] = null; 
     40          $joinannounce = (isset($q['joinannounce'])?$q['joinannounce']:''); 
     41          if($joinannounce != "") { 
     42            $ext->add('ext-queues', $exten, '', new ext_playback($joinannounce)); 
    4543          } 
    46           if(function_exists('recordings_list')) 
    47             $filename = recordings_get($q['agentannounce']); 
    48           $ext->add('ext-queues', $exten, '', new ext_queue($exten,'t','',$filename['filename'],$q['maxwait'])); 
     44          $agentannounce = (isset($q['agentannounce'])?$q['agentannounce']:''); 
     45          $ext->add('ext-queues', $exten, '', new ext_queue($exten,'t','',$agentannounce,$q['maxwait'])); 
    4946   
    5047          // destination field in 'incoming' database is backwards from what ext_goto expects 
     
    129126    $context = ''; 
    130127  } else { 
    131     $arr = ivr_get_details($_REQUEST['announcemenu']); 
    132     if(function_exists('recordings_list')) { 
    133       $rec = recordings_get($arr['announcement'])
     128    $arr = (ivr_get_details($_REQUEST['announcemenu'])); 
     129    if( (isset($arr['announcement'])?$arr['announcement']:'') != '' ) { 
     130      $rec = $arr['announcement']
    134131      $qthanku = $rec['filename']; 
    135132    } else { 
  • modules/branches/2.1/queues/page.queues.php

    r1334 r1618  
    184184        if (isset($tresults[0])) { 
    185185          foreach ($tresults as $tresult) { 
    186             echo '<option value="'.$tresult[0].'"'.($tresult[0] == $default ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n"; 
     186            echo '<option value="'.$tresult[2].'"'.($tresult[2] == $default ? ' SELECTED' : '').'>'.$tresult[1]."</option>\n"; 
    187187          } 
    188188        } 
     
    191191    </td> 
    192192  </tr> 
    193 <?php } if(function_exists('music_list')) { //only include if music module is enabled?> 
     193 
     194<?php } else { ?> 
     195  <tr> 
     196    <td><a href="#" class="info"><?php echo _("Agent Announcement:")?><span><?php echo _("Announcement played to the Agent prior to bridging in the caller <br><br> Example: \"the Following call is from the Sales Queue\" or \"This call is from the Technical Support Queue\".<br><br>You must install and enable the \"Systems Recordings\" Module to edit this option")?></span></a></td> 
     197    <td> 
     198      <?php 
     199        $default = (isset($agentannounce) ? $agentannounce : ''); 
     200      ?> 
     201      <input type="hidden" name="agentannounce" value="<?php echo $default; ?>"><?php echo ($default != '' ? $default : 'None'); ?> 
     202    </td> 
     203  </tr> 
     204<?php } ?> 
     205 
     206<?php if(function_exists('music_list')) { //only include if music module is enabled?> 
    194207  <tr> 
    195208    <td><a href="#" class="info"><?php echo _("Hold Music Category:")?><span><?php echo _("Music (or Commercial) played to the caller while they wait in line for an available agent.<br><br>  This music is defined in the \"On Hold Music\" Menu to the left.")?></span></a></td> 
     
    426439        if (isset($tresults[0])) { 
    427440          foreach ($tresults as $tresult) { 
    428             echo '<option value="'.$tresult[0].'" '.($tresult[0] == $default ? 'SELECTED' : '').'>'.$tresult[1]."</option>\n";; 
     441            echo '<option value="'.$tresult[2].'" '.($tresult[2] == $default ? 'SELECTED' : '').'>'.$tresult[1]."</option>\n";; 
    429442          } 
    430443        } 
     
    433446    </td> 
    434447  </tr> 
     448<?php } else { ?> 
     449  <tr> 
     450    <td><a href="#" class="info"><?php echo _("Join Announcement:")?><span><?php echo _("Announcement played to callers once prior to joining the queue.<br><br>You must install and enable the \"Systems Recordings\" Module to edit this option")?></span></a></td> 
     451    <td> 
     452      <?php 
     453        $default = (isset($joinannounce) ? $joinannounce : ''); 
     454      ?> 
     455      <input type="hidden" name="joinannounce" value="<?php echo $default; ?>"><?php echo ($default != '' ? $default : 'None'); ?> 
     456    </td> 
     457  </tr> 
    435458<?php } ?> 
    436  
    437459  <tr><td colspan="2"><br><h5><?php echo _("Fail Over Destination")?><hr></h5></td></tr> 
    438460