BugFix-remove-legacy-warning (#1638)
changed switch_music_on_hold->select to be more inline of usage changed extension_edit to use new format changed call_center_queue_edit to use new format while https://github.com/fusionpbx/fusionpbx/pull/1637 is in testing
This commit is contained in:
parent
7e024a5521
commit
27dc84b3b8
|
|
@ -724,10 +724,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
}
|
}
|
||||||
require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php";
|
require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php";
|
||||||
$moh= new switch_music_on_hold;
|
$moh= new switch_music_on_hold;
|
||||||
$moh->select_name = "queue_moh_sound";
|
echo $moh->select("queue_moh_sound", $queue_moh_sound, $select_options);
|
||||||
$moh->select_value = $queue_moh_sound;
|
|
||||||
$moh->select_options = $select_options;
|
|
||||||
echo $moh->select();
|
|
||||||
|
|
||||||
echo "<br />\n";
|
echo "<br />\n";
|
||||||
echo $text['description-music_on_hold']."\n";
|
echo $text['description-music_on_hold']."\n";
|
||||||
|
|
|
||||||
|
|
@ -1787,9 +1787,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
echo "<td width=\"70%\" class='vtable' align='left'>\n";
|
echo "<td width=\"70%\" class='vtable' align='left'>\n";
|
||||||
require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php";
|
require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php";
|
||||||
$moh = new switch_music_on_hold;
|
$moh = new switch_music_on_hold;
|
||||||
$moh->select_name = "hold_music";
|
echo $moh->select('hold_music', $hold_music);
|
||||||
$moh->select_value = $hold_music;
|
|
||||||
echo $moh->select();
|
|
||||||
echo " <br />\n";
|
echo " <br />\n";
|
||||||
echo $text['description-hold_music']."\n";
|
echo $text['description-hold_music']."\n";
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,6 @@ include "root.php";
|
||||||
class switch_music_on_hold {
|
class switch_music_on_hold {
|
||||||
|
|
||||||
public $domain_uuid;
|
public $domain_uuid;
|
||||||
public $select_name;
|
|
||||||
public $select_value;
|
|
||||||
public $select_options;
|
|
||||||
private $xml;
|
private $xml;
|
||||||
private $db;
|
private $db;
|
||||||
|
|
||||||
|
|
@ -53,29 +50,22 @@ include "root.php";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//it is NOT recommended to use this function anymore you should be using the ringback class
|
//it is NOT recommended to use this function if you want to include ringback you should be using the ringback class
|
||||||
//see app/ring_groups/ring_group_edit.php for example
|
//see app/ring_groups/ring_group_edit.php for example
|
||||||
public function select() {
|
public function select($name, $selected, $options) {
|
||||||
$trace = debug_backtrace();
|
|
||||||
$caller = $trace[1];
|
|
||||||
$what = $caller['function'];
|
|
||||||
if (isset($caller['class'])) {
|
|
||||||
$what .= " in {$caller['class']}";
|
|
||||||
}
|
|
||||||
trigger_error("Legacy call to select in switch_music_on_hold class by $what", E_USER_WARNING);
|
|
||||||
//add multi-lingual support
|
//add multi-lingual support
|
||||||
$language = new text;
|
$language = new text;
|
||||||
$text = $language->get();
|
$text = $language->get();
|
||||||
|
|
||||||
//start the select
|
//start the select
|
||||||
$select = " <select class='formfld' name='".$this->select_name."' id='".$this->select_name."' style='width: auto;'>\n";
|
$select = "<select class='formfld' name='".$name."' id='".$name."' style='width: auto;'>\n";
|
||||||
|
|
||||||
//moh
|
//moh
|
||||||
$options = $this->list_moh();
|
$options = $this->list_moh();
|
||||||
if (sizeof($options) > 0) {
|
if (sizeof($options) > 0) {
|
||||||
$select .= " <optgroup label='".$text['label-music_on_hold']."'>";
|
$select .= " <optgroup label='".$text['label-music_on_hold']."'>";
|
||||||
foreach($options as $moh_value => $moh_name) {
|
foreach($options as $moh_value => $moh_name) {
|
||||||
$select .= "<option value='".$moh_value."' ".(($this->select_value == $moh_value) ? 'selected="selected"' : null).">".$moh_name."</option>\n";
|
$select .= " <option value='".$moh_value."' ".(($selected == $moh_value) ? 'selected="selected"' : null).">".$moh_name."</option>\n";
|
||||||
}
|
}
|
||||||
$select .= " </optgroup>\n";
|
$select .= " </optgroup>\n";
|
||||||
}
|
}
|
||||||
|
|
@ -87,15 +77,15 @@ include "root.php";
|
||||||
if (sizeof($recordings) > 0) {
|
if (sizeof($recordings) > 0) {
|
||||||
$select .= " <optgroup label='".$text['label-recordings']."'>";
|
$select .= " <optgroup label='".$text['label-recordings']."'>";
|
||||||
foreach($recordings as $recording_value => $recording_name){
|
foreach($recordings as $recording_value => $recording_name){
|
||||||
$select .= "<option value='".$recording_value."' ".(($this->select_value == $recording_value) ? 'selected="selected"' : null).">".$recording_name."</option>\n";
|
$select .= " <option value='".$recording_value."' ".(($selected == $recording_value) ? 'selected="selected"' : null).">".$recording_name."</option>\n";
|
||||||
}
|
}
|
||||||
$select .= " </optgroup>\n";
|
$select .= " </optgroup>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//add additional options
|
//add additional options
|
||||||
if (sizeof($this->select_options) > 0) {
|
if (sizeof($options) > 0) {
|
||||||
$select .= " <optgroup label='".$text['label-others']."'>";
|
$select .= " <optgroup label='".$text['label-others']."'>";
|
||||||
$select .= $this->select_options;
|
$select .= $options;
|
||||||
$select .= " </optgroup>\n";
|
$select .= " </optgroup>\n";
|
||||||
}
|
}
|
||||||
//end the select and return it
|
//end the select and return it
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue