Browse Source

Bulk Accounts - Device Lines (#52)

* Update app_languages.php

* Update bulk_account_settings_devices.php

* Update bulk_account_settings_devices_update.php

* Update bulk_account_settings_devices.php

Fix paging
konradSC 8 years ago
parent
commit
6f4a5f677f

+ 231 - 0
bulk_account_settings/app_languages.php

@@ -364,6 +364,28 @@ $text['header-voicemails']['uk'] = "Voicemails";
 $text['header-voicemails']['de-at'] = "Voicemails";
 $text['header-voicemails']['it-it'] = "Voicemails";
 
+$text['label-add']['en-us'] = "Add";
+$text['label-add']['es-cl'] = "Add";
+$text['label-add']['pt-pt'] = "Add";
+$text['label-add']['fr-fr'] = "Add";
+$text['label-add']['pt-br'] = "Add";
+$text['label-add']['pl'] = "Add";
+$text['label-add']['sv-se'] = "Add";
+$text['label-add']['uk'] = "Add";
+$text['label-add']['de-at'] = "Add";
+$text['label-add']['it-it'] = "Add";
+
+$text['label-remove']['en-us'] = "Remove";
+$text['label-remove']['es-cl'] = "Remove";
+$text['label-remove']['pt-pt'] = "Remove";
+$text['label-remove']['fr-fr'] = "Remove";
+$text['label-remove']['pt-br'] = "Remove";
+$text['label-remove']['pl'] = "Remove";
+$text['label-remove']['sv-se'] = "Remove";
+$text['label-remove']['uk'] = "Remove";
+$text['label-remove']['de-at'] = "Remove";
+$text['label-remove']['it-it'] = "Remove";
+
 $text['label-accountcode']['en-us'] = "Accountcode";
 $text['label-accountcode']['es-cl'] = "Accountcode";
 $text['label-accountcode']['pt-pt'] = "Accountcode";
@@ -397,6 +419,39 @@ $text['label-confirm_password']['uk'] = "Confirm Password";
 $text['label-confirm_password']['de-at'] = "Confirm Password";
 $text['label-confirm_password']['it-it'] = "Confirm Password";
 
+$text['label-destination']['en-us'] = "Destination";
+$text['label-destination']['es-cl'] = "Destination";
+$text['label-destination']['pt-pt'] = "Destination";
+$text['label-destination']['fr-fr'] = "Destination";
+$text['label-destination']['pt-br'] = "Destination";
+$text['label-destination']['pl'] = "Destination";
+$text['label-destination']['sv-se'] = "Destination";
+$text['label-destination']['uk'] = "Destination";
+$text['label-destination']['de-at'] = "Destination";
+$text['label-destination']['it-it'] = "Destination";
+
+$text['label-order']['en-us'] = "Order";
+$text['label-order']['es-cl'] = "Order";
+$text['label-order']['pt-pt'] = "Order";
+$text['label-order']['fr-fr'] = "Order";
+$text['label-order']['pt-br'] = "Order";
+$text['label-order']['pl'] = "Order";
+$text['label-order']['sv-se'] = "Order";
+$text['label-order']['uk'] = "Order";
+$text['label-order']['de-at'] = "Order";
+$text['label-order']['it-it'] = "Order";
+
+$text['label-description']['en-us'] = "Description";
+$text['label-description']['es-cl'] = "Description";
+$text['label-description']['pt-pt'] = "Description";
+$text['label-description']['fr-fr'] = "Description";
+$text['label-description']['pt-br'] = "Description";
+$text['label-description']['pl'] = "Description";
+$text['label-description']['sv-se'] = "Description";
+$text['label-description']['uk'] = "Description";
+$text['label-description']['de-at'] = "Description";
+$text['label-description']['it-it'] = "Description";
+
 $text['label-extension']['en-us'] = "Extension";
 $text['label-extension']['es-cl'] = "Extension";
 $text['label-extension']['pt-pt'] = "Extension";
@@ -430,6 +485,72 @@ $text['label-group']['uk'] = "Group";
 $text['label-group']['de-at'] = "Group";
 $text['label-group']['it-it'] = "Group";
 
+$text['label-line_1_server_address']['en-us'] = "Line 1 - Server Address";
+$text['label-line_1_server_address']['es-cl'] = "Line 1 - Server Address";
+$text['label-line_1_server_address']['pt-pt'] = "Line 1 - Server Address";
+$text['label-line_1_server_address']['fr-fr'] = "Line 1 - Server Address";
+$text['label-line_1_server_address']['pt-br'] = "Line 1 - Server Address";
+$text['label-line_1_server_address']['pl'] = "Line 1 - Server Address";
+$text['label-line_1_server_address']['sv-se'] = "Line 1 - Server Address";
+$text['label-line_1_server_address']['uk'] = "Line 1 - Server Address";
+$text['label-line_1_server_address']['de-at'] = "Line 1 - Server Address";
+$text['label-line_1_server_address']['it-it'] = "Line 1 - Server Address";
+
+$text['label-line_1_outbound_proxy_primary']['en-us'] = "Line 1 - Outbound Proxy Primary";
+$text['label-line_1_outbound_proxy_primary']['es-cl'] = "Line 1 - Outbound Proxy Primary";
+$text['label-line_1_outbound_proxy_primary']['pt-pt'] = "Line 1 - Outbound Proxy Primary";
+$text['label-line_1_outbound_proxy_primary']['fr-fr'] = "Line 1 - Outbound Proxy Primary";
+$text['label-line_1_outbound_proxy_primary']['pt-br'] = "Line 1 - Outbound Proxy Primary";
+$text['label-line_1_outbound_proxy_primary']['pl'] = "Line 1 - Outbound Proxy Primary";
+$text['label-line_1_outbound_proxy_primary']['sv-se'] = "Line 1 - Outbound Proxy Primary";
+$text['label-line_1_outbound_proxy_primary']['uk'] = "Line 1 - Outbound Proxy Primary";
+$text['label-line_1_outbound_proxy_primary']['de-at'] = "Line 1 - Outbound Proxy Primary";
+$text['label-line_1_outbound_proxy_primary']['it-it'] = "Line 1 - Outbound Proxy Primary";
+
+$text['label-line_1_sip_port']['en-us'] = "Line 1 - SIP Port";
+$text['label-line_1_sip_port']['es-cl'] = "Line 1 - SIP Port";
+$text['label-line_1_sip_port']['pt-pt'] = "Line 1 - SIP Port";
+$text['label-line_1_sip_port']['fr-fr'] = "Line 1 - SIP Port";
+$text['label-line_1_sip_port']['pt-br'] = "Line 1 - SIP Port";
+$text['label-line_1_sip_port']['pl'] = "Line 1 - SIP Port";
+$text['label-line_1_sip_port']['sv-se'] = "Line 1 - SIP Port";
+$text['label-line_1_sip_port']['uk'] = "Line 1 - SIP Port";
+$text['label-line_1_sip_port']['de-at'] = "Line 1 - SIP Port";
+$text['label-line_1_sip_port']['it-it'] = "Line 1 - SIP Port";
+
+$text['label-line_1_sip_transport']['en-us'] = "Line 1 - SIP Transport";
+$text['label-line_1_sip_transport']['es-cl'] = "Line 1 - SIP Transport";
+$text['label-line_1_sip_transport']['pt-pt'] = "Line 1 - SIP Transport";
+$text['label-line_1_sip_transport']['fr-fr'] = "Line 1 - SIP Transport";
+$text['label-line_1_sip_transport']['pt-br'] = "Line 1 - SIP Transport";
+$text['label-line_1_sip_transport']['pl'] = "Line 1 - SIP Transport";
+$text['label-line_1_sip_transport']['sv-se'] = "Line 1 - SIP Transport";
+$text['label-line_1_sip_transport']['uk'] = "Line 1 - SIP Transport";
+$text['label-line_1_sip_transport']['de-at'] = "Line 1 - SIP Transport";
+$text['label-line_1_sip_transport']['it-it'] = "Line 1 - SIP Transport";
+
+$text['label-line_1_register_expires']['en-us'] = "Line 1 - Register Expires";
+$text['label-line_1_register_expires']['es-cl'] = "Line 1 - Register Expires";
+$text['label-line_1_register_expires']['pt-pt'] = "Line 1 - Register Expires";
+$text['label-line_1_register_expires']['fr-fr'] = "Line 1 - Register Expires";
+$text['label-line_1_register_expires']['pt-br'] = "Line 1 - Register Expires";
+$text['label-line_1_register_expires']['pl'] = "Line 1 - Register Expires";
+$text['label-line_1_register_expires']['sv-se'] = "Line 1 - Register Expires";
+$text['label-line_1_register_expires']['uk'] = "Line 1 - Register Expires";
+$text['label-line_1_register_expires']['de-at'] = "Line 1 - Register Expires";
+$text['label-line_1_register_expires']['it-it'] = "Line 1 - Register Expires";
+
+$text['label-line_1_outbound_proxy_secondary']['en-us'] = "Line 1 - Outbound Proxy Secondary";
+$text['label-line_1_outbound_proxy_secondary']['es-cl'] = "Line 1 - Outbound Proxy Secondary";
+$text['label-line_1_outbound_proxy_secondary']['pt-pt'] = "Line 1 - Outbound Proxy Secondary";
+$text['label-line_1_outbound_proxy_secondary']['fr-fr'] = "Line 1 - Outbound Proxy Secondary";
+$text['label-line_1_outbound_proxy_secondary']['pt-br'] = "Line 1 - Outbound Proxy Secondary";
+$text['label-line_1_outbound_proxy_secondary']['pl'] = "Line 1 - Outbound Proxy Secondary";
+$text['label-line_1_outbound_proxy_secondary']['sv-se'] = "Line 1 - Outbound Proxy Secondary";
+$text['label-line_1_outbound_proxy_secondary']['uk'] = "Line 1 - Outbound Proxy Secondary";
+$text['label-line_1_outbound_proxy_secondary']['de-at'] = "Line 1 - Outbound Proxy Secondary";
+$text['label-line_1_outbound_proxy_secondary']['it-it'] = "Line 1 - Outbound Proxy Secondary";
+
 $text['label-hold_music']['en-us'] = "Hold Music";
 $text['label-hold_music']['es-cl'] = "Hold Music";
 $text['label-hold_music']['pt-pt'] = "Hold Music";
@@ -672,6 +793,116 @@ $text['label-voicemail_null']['uk'] = " ";
 $text['label-voicemail_null']['de-at'] = " ";
 $text['label-voicemail_null']['it-it'] = " ";
 
+$text['label-voicemail_option_0']['en-us'] = "Option 0";
+$text['label-voicemail_option_0']['es-cl'] = "Option 0";
+$text['label-voicemail_option_0']['pt-pt'] = "Option 0";
+$text['label-voicemail_option_0']['fr-fr'] = "Option 0";
+$text['label-voicemail_option_0']['pt-br'] = "Option 0";
+$text['label-voicemail_option_0']['pl'] = "Option 0";
+$text['label-voicemail_option_0']['sv-se'] = "Option 0";
+$text['label-voicemail_option_0']['uk'] = "Option 0";
+$text['label-voicemail_option_0']['de-at'] = "Option 0";
+$text['label-voicemail_option_0']['it-it'] = "Option 0";
+
+$text['label-voicemail_option_1']['en-us'] = "Option 1";
+$text['label-voicemail_option_1']['es-cl'] = "Option 1";
+$text['label-voicemail_option_1']['pt-pt'] = "Option 1";
+$text['label-voicemail_option_1']['fr-fr'] = "Option 1";
+$text['label-voicemail_option_1']['pt-br'] = "Option 1";
+$text['label-voicemail_option_1']['pl'] = "Option 1";
+$text['label-voicemail_option_1']['sv-se'] = "Option 1";
+$text['label-voicemail_option_1']['uk'] = "Option 1";
+$text['label-voicemail_option_1']['de-at'] = "Option 1";
+$text['label-voicemail_option_1']['it-it'] = "Option 1";
+
+$text['label-voicemail_option_2']['en-us'] = "Option 2";
+$text['label-voicemail_option_2']['es-cl'] = "Option 2";
+$text['label-voicemail_option_2']['pt-pt'] = "Option 2";
+$text['label-voicemail_option_2']['fr-fr'] = "Option 2";
+$text['label-voicemail_option_2']['pt-br'] = "Option 2";
+$text['label-voicemail_option_2']['pl'] = "Option 2";
+$text['label-voicemail_option_2']['sv-se'] = "Option 2";
+$text['label-voicemail_option_2']['uk'] = "Option 2";
+$text['label-voicemail_option_2']['de-at'] = "Option 2";
+$text['label-voicemail_option_2']['it-it'] = "Option 2";
+
+$text['label-voicemail_option_3']['en-us'] = "Option 3";
+$text['label-voicemail_option_3']['es-cl'] = "Option 3";
+$text['label-voicemail_option_3']['pt-pt'] = "Option 3";
+$text['label-voicemail_option_3']['fr-fr'] = "Option 3";
+$text['label-voicemail_option_3']['pt-br'] = "Option 3";
+$text['label-voicemail_option_3']['pl'] = "Option 3";
+$text['label-voicemail_option_3']['sv-se'] = "Option 3";
+$text['label-voicemail_option_3']['uk'] = "Option 3";
+$text['label-voicemail_option_3']['de-at'] = "Option 3";
+$text['label-voicemail_option_3']['it-it'] = "Option 3";
+
+$text['label-voicemail_option_4']['en-us'] = "Option 4";
+$text['label-voicemail_option_4']['es-cl'] = "Option 4";
+$text['label-voicemail_option_4']['pt-pt'] = "Option 4";
+$text['label-voicemail_option_4']['fr-fr'] = "Option 4";
+$text['label-voicemail_option_4']['pt-br'] = "Option 4";
+$text['label-voicemail_option_4']['pl'] = "Option 4";
+$text['label-voicemail_option_4']['sv-se'] = "Option 4";
+$text['label-voicemail_option_4']['uk'] = "Option 4";
+$text['label-voicemail_option_4']['de-at'] = "Option 4";
+$text['label-voicemail_option_4']['it-it'] = "Option 4";
+
+$text['label-voicemail_option_5']['en-us'] = "Option 5";
+$text['label-voicemail_option_5']['es-cl'] = "Option 5";
+$text['label-voicemail_option_5']['pt-pt'] = "Option 5";
+$text['label-voicemail_option_5']['fr-fr'] = "Option 5";
+$text['label-voicemail_option_5']['pt-br'] = "Option 5";
+$text['label-voicemail_option_5']['pl'] = "Option 5";
+$text['label-voicemail_option_5']['sv-se'] = "Option 5";
+$text['label-voicemail_option_5']['uk'] = "Option 5";
+$text['label-voicemail_option_5']['de-at'] = "Option 5";
+$text['label-voicemail_option_5']['it-it'] = "Option 5";
+
+$text['label-voicemail_option_6']['en-us'] = "Option 6";
+$text['label-voicemail_option_6']['es-cl'] = "Option 6";
+$text['label-voicemail_option_6']['pt-pt'] = "Option 6";
+$text['label-voicemail_option_6']['fr-fr'] = "Option 6";
+$text['label-voicemail_option_6']['pt-br'] = "Option 6";
+$text['label-voicemail_option_6']['pl'] = "Option 6";
+$text['label-voicemail_option_6']['sv-se'] = "Option 6";
+$text['label-voicemail_option_6']['uk'] = "Option 6";
+$text['label-voicemail_option_6']['de-at'] = "Option 6";
+$text['label-voicemail_option_6']['it-it'] = "Option 6";
+
+$text['label-voicemail_option_7']['en-us'] = "Option 7";
+$text['label-voicemail_option_7']['es-cl'] = "Option 7";
+$text['label-voicemail_option_7']['pt-pt'] = "Option 7";
+$text['label-voicemail_option_7']['fr-fr'] = "Option 7";
+$text['label-voicemail_option_7']['pt-br'] = "Option 7";
+$text['label-voicemail_option_7']['pl'] = "Option 7";
+$text['label-voicemail_option_7']['sv-se'] = "Option 7";
+$text['label-voicemail_option_7']['uk'] = "Option 7";
+$text['label-voicemail_option_7']['de-at'] = "Option 7";
+$text['label-voicemail_option_7']['it-it'] = "Option 7";
+
+$text['label-voicemail_option_8']['en-us'] = "Option 8";
+$text['label-voicemail_option_8']['es-cl'] = "Option 8";
+$text['label-voicemail_option_8']['pt-pt'] = "Option 8";
+$text['label-voicemail_option_8']['fr-fr'] = "Option 8";
+$text['label-voicemail_option_8']['pt-br'] = "Option 8";
+$text['label-voicemail_option_8']['pl'] = "Option 8";
+$text['label-voicemail_option_8']['sv-se'] = "Option 8";
+$text['label-voicemail_option_8']['uk'] = "Option 8";
+$text['label-voicemail_option_8']['de-at'] = "Option 8";
+$text['label-voicemail_option_8']['it-it'] = "Option 8";
+
+$text['label-voicemail_option_9']['en-us'] = "Option 9";
+$text['label-voicemail_option_9']['es-cl'] = "Option 9";
+$text['label-voicemail_option_9']['pt-pt'] = "Option 9";
+$text['label-voicemail_option_9']['fr-fr'] = "Option 9";
+$text['label-voicemail_option_9']['pt-br'] = "Option 9";
+$text['label-voicemail_option_9']['pl'] = "Option 9";
+$text['label-voicemail_option_9']['sv-se'] = "Option 9";
+$text['label-voicemail_option_9']['uk'] = "Option 9";
+$text['label-voicemail_option_9']['de-at'] = "Option 9";
+$text['label-voicemail_option_9']['it-it'] = "Option 9";
+
 $text['label-voicemail_enabled']['en-us'] = "Enabled";
 $text['label-voicemail_enabled']['es-cl'] = "Enabled";
 $text['label-voicemail_enabled']['pt-pt'] = "Enabled";

+ 124 - 31
bulk_account_settings/bulk_account_settings_devices.php

@@ -121,6 +121,28 @@
 	$directory = $database->result;
 	unset($database,$result);
 
+//lookup the lines
+	$x = 0;
+	foreach ($directory as $key => $row) {
+		$sql = "SELECT * \n";
+		$sql .= "FROM v_device_lines \n";
+		$sql .= "WHERE domain_uuid = '$domain_uuid' \n";
+		$sql .= "and device_uuid = '".$row['device_uuid']."' ";
+		$sql .= "and line_number = '1' ";
+		$database = new database;
+		$database->select($sql);
+		$sqlview1 = $sql;
+		$result = $database->result;
+		$directory[$key]['line_1_server_address'] = $result[0]['server_address'];
+		$directory[$key]['line_1_outbound_proxy_primary'] = $result[0]['outbound_proxy_primary'];
+		$directory[$key]['line_1_sip_port'] = $result[0]['sip_port'];
+		$directory[$key]['line_1_sip_transport'] = $result[0]['sip_transport'];
+		$directory[$key]['line_1_register_expires'] = $result[0]['register_expires'];
+		$directory[$key]['line_1_outbound_proxy_secondary'] = $result[0]['outbound_proxy_secondary'];
+		unset($result,$database);
+		$x++;
+	}
+	
 //additional includes
 	require_once "resources/header.php";
 	$document['title'] = $text['title-devices_settings'];
@@ -129,7 +151,7 @@
 	$c = 0;
 	$row_style["0"] = "row_style0";
 	$row_style["1"] = "row_style1";
-	
+
 //show the content
 	echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
 	echo "  <tr>\n";
@@ -137,36 +159,78 @@
 	echo "		<b>".$text['header-devices']." (".$numeric_devices.")</b><br>\n";
 
 //options list
-		echo "<form name='frm' method='get' id=option_selected>\n";
-		echo "    <select class='formfld' name='option_selected'  onchange=\"this.form.submit();\">\n";
-		echo "    <option value=''>".$text['label-devices_null']."</option>\n";
-		if ($option_selected == "device_enabled") {
-			echo "    <option value='device_enabled' selected='selected'>".$text['label-enabled']."</option>\n";
-		}
-		else {
-			echo "    <option value='device_enabled'>".$text['label-enabled']."</option>\n";
-		}
-		if ($option_selected == "device_profile_uuid") {
-			echo "    <option value='device_profile_uuid' selected='selected'>".$text['label-device_profile']."</option>\n";
-		}
-		else {
-			echo "    <option value='device_profile_uuid'>".$text['label-device_profile']."</option>\n";
-		}
-		if ($option_selected == "device_template") {
-			echo "    <option value='device_template' selected='selected'>".$text['label-device_template']."</option>\n";
-		}
-		else {
-			echo "    <option value='device_template'>".$text['label-device_template']."</option>\n";
-		}
+	echo "<form name='frm' method='get' id=option_selected>\n";
+	echo "    <select class='formfld' name='option_selected'  onchange=\"this.form.submit();\">\n";
+	echo "    <option value=''>".$text['label-devices_null']."</option>\n";
+//Enabled		
+	if ($option_selected == "device_enabled") {
+		echo "    <option value='device_enabled' selected='selected'>".$text['label-enabled']."</option>\n";
+	}
+	else {
+		echo "    <option value='device_enabled'>".$text['label-enabled']."</option>\n";
+	}
+//Device Profile
+	if ($option_selected == "device_profile_uuid") {
+		echo "    <option value='device_profile_uuid' selected='selected'>".$text['label-device_profile']."</option>\n";
+	}
+	else {
+		echo "    <option value='device_profile_uuid'>".$text['label-device_profile']."</option>\n";
+	}
+//Device Template
+	if ($option_selected == "device_template") {
+		echo "    <option value='device_template' selected='selected'>".$text['label-device_template']."</option>\n";
+	}
+	else {
+		echo "    <option value='device_template'>".$text['label-device_template']."</option>\n";
+	}
+//Line 1 - Server Address
+	if ($option_selected == "line_1_server_address") {
+		echo "    <option value='line_1_server_address' selected='selected'>".$text['label-line_1_server_address']."</option>\n";
+	}
+	else {
+		echo "    <option value='line_1_server_address'>".$text['label-line_1_server_address']."</option>\n";
+	}
+//Line 1 - Outbound Proxy		
+	if ($option_selected == "line_1_outbound_proxy_primary") {
+		echo "    <option value='line_1_outbound_proxy_primary' selected='selected'>".$text['label-line_1_outbound_proxy_primary']."</option>\n";
+	}
+	else {
+		echo "    <option value='line_1_outbound_proxy_primary'>".$text['label-line_1_outbound_proxy_primary']."</option>\n";
+	}
+//Line 1 - SIP Port
+	if ($option_selected == "line_1_sip_port") {
+		echo "    <option value='line_1_sip_port' selected='selected'>".$text['label-line_1_sip_port']."</option>\n";
+	}
+	else {
+		echo "    <option value='line_1_sip_port'>".$text['label-line_1_sip_port']."</option>\n";
+	}
+//Line 1 - SIP Transport
+	if ($option_selected == "line_1_sip_transport") {
+		echo "    <option value='line_1_sip_transport' selected='selected'>".$text['label-line_1_sip_transport']."</option>\n";
+	}
+	else {
+		echo "    <option value='line_1_sip_transport'>".$text['label-line_1_sip_transport']."</option>\n";
+	}
+//Line 1 - Register Expires
+	if ($option_selected == "line_1_register_expires") {
+		echo "    <option value='line_1_register_expires' selected='selected'>".$text['label-line_1_register_expires']."</option>\n";
+	}
+	else {
+		echo "    <option value='line_1_register_expires'>".$text['label-line_1_register_expires']."</option>\n";
+	}
+//Line 1 - Outbound Proxy Secondary
+	if ($option_selected == "line_1_outbound_proxy_secondary") {
+		echo "    <option value='line_1_outbound_proxy_secondary' selected='selected'>".$text['label-line_1_outbound_proxy_secondary']."</option>\n";
+	}
+	else {
+		echo "    <option value='line_1_outbound_proxy_secondary'>".$text['label-line_1_outbound_proxy_secondary']."</option>\n";
+	}		
+	echo "    </select>\n";
+	echo "    </form>\n";
+	echo "<br />\n";
+	echo $text['description-device_settings_description']."\n";
+	echo "</td>\n";
 
-		echo "    </select>\n";
-		echo "    </form>\n";
-		echo "<br />\n";
-		echo $text['description-device_settings_description']."\n";
-		echo "</td>\n";
-	
-	
-	
 	echo "		<td align='right' width='100%' style='vertical-align: top;'>";
 	echo "		<form method='get' action=''>\n";
 	echo "			<td style='vertical-align: top; text-align: right; white-space: nowrap;'>\n";
@@ -273,6 +337,29 @@
 			echo "</td>\n";
 		}
 
+		//options with a free form input
+		if($option_selected == 'line_1_server_address' || $option_selected == 'line_1_outbound_proxy_primary' || $option_selected == 'line_1_sip_port' || $option_selected == 'line_1_register_expires' || $option_selected == 'line_1_outbound_proxy_secondary') {
+			echo "<td class='vtable' align='left'>\n";
+			echo "    <input class='formfld' type='text' name='new_setting' maxlength='255' value=\"$new_setting\">\n";
+			echo "<br />\n";
+			echo $text["description-".$option_selected.""]."\n";
+			echo "</td>\n";
+		}
+		
+		//option is transport
+		if($option_selected == 'line_1_sip_transport') {
+			echo "<td class='vtable' align='left'>\n";
+			echo "    <select class='formfld' name='new_setting'>\n";
+			echo "    <option value='tcp'>TCP</option>\n";
+			echo "    <option value='udp'>UDP</option>\n";
+			echo "    <option value='tls'>TLS</option>\n";
+			echo "    <option value='dns srv'>DNS SRV</option>\n";
+			echo "    </select>\n";
+			echo "    <br />\n";
+			echo $text["description-".$option_selected.""]."\n";
+			echo "</td>\n";
+		}
+
 		echo "<td align='left'>\n";
 		echo "<input type='button' class='btn' alt='".$text['button-submit']."' onclick=\"if (confirm('".$text['confirm-update']."')) { document.forms.devices.submit(); }\" value='".$text['button-submit']."'>\n";
 		echo "</td>\n";
@@ -286,7 +373,10 @@
 		echo "<th style='width: 30px; text-align: center; padding: 0px;'><input type='checkbox' id='chk_all' onchange=\"(this.checked) ? check('all') : check('none');\"></th>";
 	}
 	echo th_order_by('device_mac_address', $text['label-device_mac_address'], $order_by,$order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo th_order_by('device_label', $text['label-device_label'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");	
+	echo th_order_by('device_label', $text['label-device_label'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
+	if (preg_match ('/line_(.)/',$option_selected)) {
+			echo th_order_by($option_selected, $text["label-".$option_selected.""], $order_by,$order,'','',"option_selected=".$option_selected."&search=".$search."");
+		}
 	echo th_order_by('device_vendor', $text['label-device_vendor'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
 	echo th_order_by('device_template', $text['label-device_template'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
 	echo th_order_by('device_label', $text['label-device_profile'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
@@ -308,6 +398,9 @@ if (is_array($directory)) {
 			$device_ids[] = 'checkbox_'.$row['device_uuid'];
 			echo "	<td valign='top' class='".$row_style[$c]."'> ".$row['device_mac_address']."&nbsp;</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'> ".$row['device_label']."&nbsp;</td>\n";
+			if (preg_match ('/line_/',$option_selected)) {
+				echo "	<td valign='top' class='".$row_style[$c]."'> ".$row[$option_selected]."&nbsp;</td>\n";	
+			}
 			echo "	<td valign='top' class='".$row_style[$c]."'> ".$row['device_vendor']."&nbsp;</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'> ".$row['device_template']."&nbsp;</td>\n";
 			echo "	<td valign='top' class='".$row_style[$c]."'> ".$row['device_profile_name']."&nbsp;</td>\n";

+ 30 - 8
bulk_account_settings/bulk_account_settings_devices_update.php

@@ -48,29 +48,50 @@
 		$device_uuids = $_REQUEST["id"];
 		$option_selected = $_REQUEST["option_selected"];
 		$new_setting = $_REQUEST["new_setting"];
+
 		foreach($device_uuids as $device_uuid) {
 			$device_uuid = check_str($device_uuid);
 			if ($device_uuid != '') {
-				//get the devices array
-					$sql = "select * from v_devices ";
+				//line settings
+				if (preg_match ('/line/', $option_selected)) {
+					
+					preg_match ('/line_(.)/', $option_selected, $matches);
+					$line_number = $matches[1];
+					$matches = null;
+					preg_match ('/line_._(.*$)/', $option_selected, $matches);
+					$option_line = $matches[1];
+
+					$sql = "select * from v_device_lines ";
 					$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
 					$sql .= "and device_uuid = '".$device_uuid."' ";
+					$sql .= "and line_number = '".$line_number."' ";
 					$database = new database;
 					$database->select($sql);
 					$devices = $database->result;
 					if (is_array($devices)) { 
 						foreach ($devices as &$row) {
-							$device = $row["device"];
-							//$user_context = $row["user_context"];
+							$device_line_uuid = $row["device_line_uuid"];
 						}
 						unset ($prep_statement);
 					}
+					
+					$array["device_lines"][$i]["device_line_uuid"] = $device_line_uuid;
+					$array["device_lines"][$i][$option_line] = $new_setting;
+					$array["device_lines"][$i]["domain_uuid"] = $domain_uuid;
+					$array["device_lines"][$i]["device_uuid"] = $device_uuid;					
 
-						$array["devices"][$i]["domain_uuid"] = $domain_uuid;
-						$array["devices"][$i]["device_uuid"] = $device_uuid;
-						$array["devices"][$i][$option_selected] = $new_setting;
+					$database = new database;
+					$database->app_name = 'bulk_account_settings';
+					$database->app_uuid = null;
+					$database->save($array);
+					$message = $database->message;
+				}
+				//other device settings
+				else {
+					$array["devices"][$i]["domain_uuid"] = $domain_uuid;
+					$array["devices"][$i]["device_uuid"] = $device_uuid;
+					$array["devices"][$i][$option_selected] = $new_setting;
 
-				
 					$database = new database;
 					$database->app_name = 'bulk_account_settings';
 					$database->app_uuid = null;
@@ -81,6 +102,7 @@
 					//exit;
 					
 					unset($database,$array,$i);
+				}   
 			}
 		}
 	}