소스 검색

Update ringbacks.php

FusionPBX 7 년 전
부모
커밋
6c3fc52fe5
1개의 변경된 파일25개의 추가작업 그리고 3개의 파일을 삭제
  1. 25 3
      resources/classes/ringbacks.php

+ 25 - 3
resources/classes/ringbacks.php

@@ -17,7 +17,7 @@
 
 
 	The Initial Developer of the Original Code is
 	The Initial Developer of the Original Code is
 	Mark J Crane <[email protected]>
 	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2016
+	Portions created by the Initial Developer are Copyright (C) 2016-2018
 	the Initial Developer. All Rights Reserved.
 	the Initial Developer. All Rights Reserved.
 
 
 	Contributor(s):
 	Contributor(s):
@@ -30,6 +30,7 @@ if (!class_exists('ringbacks')) {
 
 
 		//define variables
 		//define variables
 		public $db;
 		public $db;
+		public $domain_uuid;
 		private $ringbacks;
 		private $ringbacks;
 		private $tones_list;
 		private $tones_list;
 		private $music_list;
 		private $music_list;
@@ -46,6 +47,9 @@ if (!class_exists('ringbacks')) {
 					$this->db = $database->db;
 					$this->db = $database->db;
 				}
 				}
 
 
+			//set the domain_uuid
+				$this->domain_uuid = $_SESSION['domain_uuid'];
+
 			//add multi-lingual support
 			//add multi-lingual support
 				$language = new text;
 				$language = new text;
 				$text = $language->get();
 				$text = $language->get();
@@ -68,7 +72,7 @@ if (!class_exists('ringbacks')) {
 				}
 				}
 				$this->ringbacks = $ringback_list;
 				$this->ringbacks = $ringback_list;
 				unset($ringback_list);
 				unset($ringback_list);
-			
+
 			//get the default_ringback label
 			//get the default_ringback label
 				/*
 				/*
 				$sql = "select * from v_vars where var_name = 'ringback' ";
 				$sql = "select * from v_vars where var_name = 'ringback' ";
@@ -91,7 +95,7 @@ if (!class_exists('ringbacks')) {
 					require_once "resources/classes/tones.php";
 					require_once "resources/classes/tones.php";
 					$tones = new tones;
 					$tones = new tones;
 					$this->tones_list = $tones->tones_list();
 					$this->tones_list = $tones->tones_list();
-				
+
 			//get music on hold	and recordings
 			//get music on hold	and recordings
 				if (is_dir($_SERVER["PROJECT_ROOT"].'/app/music_on_hold')) {
 				if (is_dir($_SERVER["PROJECT_ROOT"].'/app/music_on_hold')) {
 					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";
@@ -140,6 +144,24 @@ if (!class_exists('ringbacks')) {
 					$select .= "	</optgroup>\n";
 					$select .= "	</optgroup>\n";
 				}
 				}
 
 
+			//streams
+				if (is_dir($_SERVER["PROJECT_ROOT"].'/app/streams')) {
+					$sql = "select * from v_streams ";
+					$sql .= "where (domain_uuid = '".$this->domain_uuid."' or domain_uuid is null) ";
+					$sql .= "and stream_enabled = 'true' ";
+					$sql .= "order by stream_name asc ";
+					$prep_statement = $this->db->prepare(check_sql($sql));
+					$prep_statement->execute();
+					$streams = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+					if (sizeof($streams) > 0) {
+						$select .= "	<optgroup label='".$text['label-streams']."'>";
+						foreach($streams as $row){
+							$select .= "		<option value='".$row['stream_location']."' ".(($selected == $row['stream_location']) ? 'selected="selected"' : null).">".$row['stream_name']."</option>\n";
+						}
+						$select .= "	</optgroup>\n";
+					}
+				}
+
 			//ringbacks
 			//ringbacks
 				if (sizeof($this->ringbacks) > 0) {
 				if (sizeof($this->ringbacks) > 0) {
 					$selected_ringback = $selected;
 					$selected_ringback = $selected;