Prerelease 19.09.2017

Cisco Format Mac 
 Model Information 
 Device Right Menu
This commit is contained in:
PhantomVl 2017-09-19 18:36:29 +03:00
parent b017cd6789
commit 19585fed4c
14 changed files with 195 additions and 39 deletions

View file

@ -1,5 +1,8 @@
https://github.com/chan-sccp/chan-sccp/wiki/Adding-custom-background-images
> Real Time !
http://silver-golem.livejournal.com/431942.html
General Information
Cisco IP Phones support either colored or monochrom background images in various resolutions (depending on model). The background can either be set up in sccp.conf server side or the user can be enabled to select a background image from a defined list of backgrounds. The image has to be a graphic file with .PNG extension. Other requirements apply, depending on phone model (see below).
@ -40,3 +43,4 @@ The Image file is used for the background of the phone display. An additional th
</CiscoIPPhoneImageList>
While the resolution is fix, the phones are able to reduce the color depth if the original image uses too many colors.

View file

@ -8,6 +8,17 @@
// https://github.com/chan-sccp/chan-sccp/wiki/Conferencing
// https://github.com/chan-sccp/chan-sccp/wiki/Frequently-Asked-Questions
// http://chan-sccp-b.sourceforge.net/doc/_howto.xhtml#nf_adhoc_plar
/*
* ToDo:
* + Cisco Format Mac
* + Model Information
* + Device Right Menu
* - WiFi Config
* - suport kvstore ?????
* - Shared Line ????
* - bug Fix
*
*/
namespace FreePBX\modules;
@ -136,7 +147,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
}
if ((array) $this->xml_data) {
foreach ($this->xml_data->xpath('//page_group[@name="' . $grup_name . '"]') as $item) {
// $htmlret .= print_r($item,1);
$htmlret .= load_view(__DIR__ . '/views/formShow.php', array(
'itm' => $item, 'h_show' => $heder_show,
'form_prefix' => $form_prefix, 'fvalues' => $form_values,
@ -249,7 +259,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
'submit' => array(
'name' => 'ajaxsubmit',
'id' => 'ajaxsubmit',
'value' => _("Submit")
'value' => _("Save")
),
'Save' => array(
'name' => 'ajaxsubmit2',
'id' => 'ajaxsubmit2',
'stayonpage' => 'yes',
'value' => _("Save + Continue")
),
'cancel' => array(
'name' => 'cancel',
@ -411,6 +427,11 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
return $this->pagedata;
}
public function getRightNav($request) {
if(isset($request['tech_hardware']) && ($request['tech_hardware'] == 'cisco')) {
return load_view(__DIR__."/views/hardware.rnav.php",array('request' => $request));
}
}
public function ajaxRequest($req, &$setting) {
switch ($req) {
@ -676,7 +697,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
break;
case 'name':
if (!empty($get_settings[$hdr_prefix . 'mac'])) {
$value = 'SEP' . $get_settings[$hdr_prefix . 'mac'];
$value = $get_settings[$hdr_prefix . 'mac'];
$value = 'SEP' . strtoupper(str_replace(array('.','-',':'),'',$value)); // Delete mac Seporated from string
$name_dev = $value;
}
break;
@ -1855,9 +1877,10 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
function getSccp_model_information($get = "all", $validate = false, $format_list = "all", $filter = array()) {
global $db;
$file_ext = array('.loads','.sbn','.SBN');
$file_ext = array('.loads','.LOADS','.sbn','.SBN','.bin','.BIN');
$dir = $this->sccppath["tftp_path"];
$dir_tepl = $this->sccppath["tftp_templets"];
switch ($format_list) {
case "model":
$sel_inf = "model, vendor, dns, buttons";
@ -1900,20 +1923,39 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
$i = 0;
if ($validate) {
for ($i = 0; $i < count($raw_settings); $i++) {
$file = $dir . '/' . $raw_settings[$i]['loadimage'];
$raw_settings[$i]['validate'] = 'no';
if (strtolower($raw_settings[$i]['vendor']) == 'cisco') {
foreach ($file_ext as $value) {
if (file_exists($file.$value)) {
$raw_settings[$i]['validate'] = 'yes';
break;
$raw_settings[$i]['validate'] = '-;-';
if (!empty($raw_settings[$i]['loadimage'])) {
$file = $dir . '/' . $raw_settings[$i]['loadimage'];
if (is_dir($file)){
$file .= '/' . $raw_settings[$i]['loadimage'];
}
$raw_settings[$i]['validate'] = 'no;';
if (strtolower($raw_settings[$i]['vendor']) == 'cisco') {
foreach ($file_ext as $value) {
if (file_exists($file.$value)) {
$raw_settings[$i]['validate'] = 'yes;';
break;
}
}
} else {
if (file_exists($file)) {
$raw_settings[$i]['validate'] = 'yes;';
}
}
} else {
if (file_exists($file)) {
$raw_settings[$i]['validate'] = 'yes';
}
$raw_settings[$i]['validate'] = '-;';
}
if (!empty($raw_settings[$i]['nametemplet'])) {
$file = $dir_tepl . '/' . $raw_settings[$i]['nametemplet'];
if (file_exists($file)) {
$raw_settings[$i]['validate'] .= 'yes';
} else {
$raw_settings[$i]['validate'] .= 'no';
}
} else {
$raw_settings[$i]['validate'] .= '-';
}
}
}
return $raw_settings;

View file

@ -24,6 +24,37 @@ $(document).ready(function () {
}
});
$('#ajaxsubmit2').on('click', function (e) {
var vdata = '';
var snd_command = 'savesettings';
$('.fpbx-submit').each(function () {
vdata = vdata + $(this).serialize() + '&';
});
if ($('.fpbx-submit').data('id') == "hw_edit") {
snd_command = 'save_hardware';
}
$.ajax({
type: 'POST',
url: 'ajax.php?module=sccp_manager&command=' + snd_command,
data: vdata,
success: function (data) {
if (data.status === true) {
if (data.message) {
alert(data.message);
} else {
alert('Data Save');
}
} else {
if (Array.isArray(data.message)) {
data.message.forEach(function (entry) {
fpbxToast(entry, 'error', 'error');
});
}
}
}
});
});
$('#ajaxsubmit').on('click', function (e) {
var vdata = '';
var snd_command = 'savesettings';

View file

@ -137,7 +137,7 @@ class Sccp extends \FreePBX\modules\Core\Driver {
"flag" => $flag++
),
"dnd" => array(
"value" => "no",
"value" => "UserDefined",
"flag" => $flag++
),
"silencesuppression" => array(
@ -197,8 +197,8 @@ class Sccp extends \FreePBX\modules\Core\Driver {
unset($select);
$select[] = array('value' => 'yes', 'text' => 'Yes');
$select[] = array('value' => 'no', 'text' => 'No');
$tt = _("Silence Suppression.");
$tmparr['silencesuppression'] = array('prompttext' => _('Silence Suppression'), 'value' => 'yes', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio');
$tt = _("Silence Suppression. Asterisk Not suported");
$tmparr['silencesuppression'] = array('prompttext' => _('Silence Suppression'), 'value' => 'no', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio');
unset($select);
$select[] = array('value' => 'default', 'text' => _('default'));

View file

@ -10,7 +10,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-14 13:48+0300\n"
"PO-Revision-Date: 2017-09-15 12:55+0300\n"
"PO-Revision-Date: 2017-09-19 18:10+0300\n"
"Last-Translator: \n"
"Language-Team: LANGUAGE Alex\n"
"Language: ru\n"
@ -576,12 +576,12 @@ msgid "General Device configuration"
msgstr "Абонентского устройство"
#: views/sccpgeneral.xml:
msgid "Device ID SEP.[XXXXXXXXXXXX]=MAC"
msgstr "Устройство ID SEP : [XXXXXXXXXXXX]=MAC"
msgid "Device SEP ID.[XXXXXXXXXXXX]=MAC"
msgstr "Устройство SEP ID : [XXXXXXXXXXXX]=MAC"
#: views/sccpgeneral.xml:
msgid "The MAC address of the phone"
msgstr "Прямое подключение"
msgid "The MAC address of the phone. You must specify 12 characters in the format XXXX.XXXX.XXXX or XX-XX-XX-XX-XX-XX or XXXXXXXXXXXX"
msgstr "Укажите MAC устройства. 12 знаков MAC в формате XXXX.XXXX.XXXX / XX-XX-XX-XX-XX-XX / XXXXXXXXXXXX"
#: views/sccpgeneral.xml:
msgid "Type"
@ -603,6 +603,10 @@ msgstr "Модуль ресширения являются специфичны
msgid "Device Label"
msgstr "Название Устройства"
#: views/sccpgeneral.xml:
msgid "Device SEP ID"
msgstr "Идентификатор устройства SEP ID"
#: views/sccpgeneral.xml:
msgid "The information in the upper right corner of the device screen"
msgstr "Информация в правом верхнем углу экрана устройства"
@ -874,3 +878,19 @@ msgstr "Добавить шаблон как неактивный"
#: views/server.model:
msgid "Device is enabled"
msgstr "Устройство включено"
#: views/server.model: ----------------------------
msgid "Device Descriptions"
msgstr "Описание"
#: views/server.model:
msgid "Device type"
msgstr "Модель"
#: views/server.model:
msgid "Actions"
msgstr "Действие"
#: views/server.model:
msgid "Status"
msgstr "Статус"

View file

@ -668,11 +668,11 @@ msgid "General Device configuration"
msgstr ""
#: views/sccpgeneral.xml:
msgid "Device ID SEP.[XXXXXXXXXXXX]=MAC"
msgid "Device SEP ID.[XXXXXXXXXXXX]=MAC"
msgstr ""
#: views/sccpgeneral.xml:
msgid "The MAC address of the phone"
msgid "The MAC address of the phone. You must specify 12 characters in the format XXXX.XXXX.XXXX or XX-XX-XX-XX-XX-XX or XXXXXXXXXXXX"
msgstr ""
#: views/sccpgeneral.xml:
@ -702,6 +702,10 @@ msgstr ""
msgid "Device Label"
msgstr ""
#: views/sccpgeneral.xml:
msgid "Device SEP ID"
msgstr ""
#: views/sccpgeneral.xml:
msgid "The information in the upper right corner of the device screen"
msgstr ""
@ -1008,3 +1012,19 @@ msgstr ""
#: views/server.model:
msgid "Device is enabled"
msgstr ""
#: views/server.model: ----------------------------
msgid "Device Descriptions"
msgstr ""
#: views/server.model:
msgid "Device type"
msgstr ""
#: views/server.model:
msgid "Actions"
msgstr ""
#: views/server.model:
msgid "Status"
msgstr ""

View file

@ -145,7 +145,7 @@ if (!empty($version)) {
$sql = "REPLACE INTO `sccpdevmodel` (`model`, `vendor`, `dns`, `buttons`, `loadimage`, `loadinformationid`, `enabled`, `nametemplet`) VALUES ('12 SP', 'CISCO', 1, 1, '', 'loadInformation3', 0, NULL)," .
"('12 SP+', 'CISCO', 1, 1, '', 'loadInformation2', 0, NULL), ('30 SP+', 'CISCO', 1, 1, '', 'loadInformation1', 0, NULL), ('30 VIP', 'CISCO', 1, 1, '', 'loadInformation5', 0, NULL), ('3911', 'CISCO', 1, 1, '', 'loadInformation446', 0, NULL), ('3951', 'CISCO', 1, 1, '', 'loadInformation412', 0, ''), ('6901', 'CISCO', 1, 0, 'SCCP6901.9-2-1-a', 'loadInformation547', 0, NULL), ('6911', 'CISCO', 1, 0, 'SCCP6911.9-2-1-a', 'loadInformation548', 0, NULL), ('6921', 'CISCO', 1, 0, 'SCCP69xx.9-2-1-0', 'loadInformation496', 0, NULL), ('6941', 'CISCO', 1, 1, 'SCCP69xx.9-2-1-0', 'loadInformation495', 0, NULL), ('6945', 'CISCO', 1, 0, 'SCCP6945.9-2-1-0', 'loadInformation564', 0, NULL), ('6961', 'CISCO', 1, 0, 'SCCP69xx.9-2-1-0', 'loadInformation497', 0, NULL), ('7902', 'CISCO', 1, 1, 'CP7902080002SCCP060817A', 'loadInformation30008', 0, NULL), " .
"('7905', 'CISCO', 1, 1, 'CP7905080003SCCP070409A', 'loadInformation20000', 0, NULL), ('7906', 'CISCO', 1, 1, 'SCCP11.9-2-1S', 'loadInformation369', 1, 'SEP0000000000.cnf.xml_791x_template'), ('7910', 'CISCO', 1, 1, 'SCCP11.9-2-1S', 'loadInformation6', 1, 'SEP0000000000.cnf.xml_791x_template'), ('7911', 'CISCO', 1, 1, 'SCCP11.9-2-1S', 'loadInformation307', 1, 'SEP0000000000.cnf.xml_791x_template'), ('7912', 'CISCO', 1, 1, 'CP7912080004SCCP080108A', 'loadInformation30007', 0, NULL), ('7914', 'CISCO', 0, 14, 'S00105000400', 'loadInformation124', 1, NULL),('7914,7914', 'CISCO', 0, 28, 'S00105000400', 'loadInformation124', 1, NULL), ('7915', 'CISCO', 0, 24, 'B015-1-0-4', 'loadInformation227', 1, NULL), ('7915,7915', 'CISCO', 0, 48, 'B015-1-0-4', 'loadInformation228', 1, NULL), ('7916', 'CISCO', 0, 24, 'B015-1-0-4', 'loadInformation229', 1, NULL), " .
"('7916,7916', 'CISCO', 0, 48, 'B016-1-0-4', 'loadInformation230', 1, NULL), ('7920', 'CISCO', 1, 1, 'cmterm_7920.4.0-03-02', 'loadInformation30002', 0, NULL), ('7921', 'CISCO', 1, 1, 'CP7921G-1.4.1SR1', 'loadInformation365', 0, NULL),('7925', 'CISCO', 1, 2, 'CP7925G-1.4.1SR1', 'loadInformation484', 0, NULL), ('7926', 'CISCO', 1, 1, 'CP7926G-1.4.1SR1', 'loadInformation557', 0, NULL), ('7931', 'CISCO', 1, 34, 'SCCP31.9-2-1S', 'loadInformation348', 0, NULL), ('7935', 'CISCO', 1, 2, 'P00503021900', 'loadInformation9', 0, NULL), ('7936', 'CISCO', 1, 1, 'cmterm_7936.3-3-21-0', 'loadInformation30019', 0, NULL), ('7937', 'CISCO', 1, 1, 'apps37sccp.1-4-4-0', 'loadInformation431', 0, 'SEP0000000000.cnf.xml_7937_template'), ('7940', 'CISCO', 1, 2, 'P0030801SR02', 'loadInformation8', 1, 'SEP0000000000.cnf.xml_796x_template'), " .
"('7916,7916', 'CISCO', 0, 48, 'B016-1-0-4', 'loadInformation230', 1, NULL), ('7920', 'CISCO', 1, 1, 'cmterm_7920.4.0-03-02', 'loadInformation30002', 0, NULL), ('7921', 'CISCO', 1, 1, 'CP7921G-1.4.1SR1', 'loadInformation365', 0, NULL),('7925', 'CISCO', 1, 6, 'CP7925G-1.4.1SR1', 'loadInformation484', 0, NULL), ('7926', 'CISCO', 1, 1, 'CP7926G-1.4.1SR1', 'loadInformation557', 0, NULL), ('7931', 'CISCO', 1, 34, 'SCCP31.9-2-1S', 'loadInformation348', 0, NULL), ('7935', 'CISCO', 1, 2, 'P00503021900', 'loadInformation9', 0, NULL), ('7936', 'CISCO', 1, 1, 'cmterm_7936.3-3-21-0', 'loadInformation30019', 0, NULL), ('7937', 'CISCO', 1, 1, 'apps37sccp.1-4-4-0', 'loadInformation431', 0, 'SEP0000000000.cnf.xml_7937_template'), ('7940', 'CISCO', 1, 2, 'P0030801SR02', 'loadInformation8', 1, 'SEP0000000000.cnf.xml_796x_template'), " .
"('7941', 'CISCO', 1, 2, 'SCCP41.9-2-1S', 'loadInformation115', 0, 'SEP0000000000.cnf.xml_796x_template'),('7941G-GE', 'CISCO', 1, 2, 'SCCP41.9-2-1S', 'loadInformation309', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7942', 'CISCO', 1, 2, 'SCCP42.9-2-1S', 'loadInformation434', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7945', 'CISCO', 1, 2, 'SCCP45.9-2-1S', 'loadInformation435', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7960', 'CISCO', 3, 6, 'P0030801SR02', 'loadInformation7', 1, 'SEP0000000000.cnf.xml_796x_template'), ('7961', 'CISCO', 3, 6, 'SCCP41.9-2-1S', 'loadInformation30018', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7961G-GE', 'CISCO', 3, 6, 'SCCP41.9-2-1S', 'loadInformation308', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7962', 'CISCO', 3, 6, 'SCCP42.9-2-1S', 'loadInformation404', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7965', 'CISCO', 3, 6, 'SCCP45.9-2-1S', 'loadInformation436', 0, 'SEP0000000000.cnf.xml_796x_template'), ('7970', 'CISCO', 3, 8, 'SCCP70.9-2-1S', 'loadInformation30006', 0, NULL), ('7971', 'CISCO', 1, 2, 'SCCP75.9-2-1S', 'loadInformation119', 0, NULL), ('7975', 'CISCO', 3, 8, 'SCCP75.9-2-1S', 'loadInformation437', 0, NULL), ('7985', 'CISCO', 3, 8, 'cmterm_7985.4-1-7-0', 'loadInformation302', 0, NULL), ('8941', 'CISCO', 1, 0, 'SCCP894x.9-2-2-0', 'loadInformation586', 0, NULL), ('8945', 'CISCO', 1, 0, 'SCCP894x.9-2-2-0', 'loadInformation585', 0, NULL), ('ATA 186', 'CISCO', 1, 1, 'ATA030204SCCP090202A', 'loadInformation12', 0, NULL), ('ATA 187', 'CISCO', 1, 1, 'ATA187.9-2-3-1', 'loadInformation550', 0, NULL), ('CN622', 'MOTOROLA', 1, 1, '', 'loadInformation335', 0, NULL), ('Digital Access', 'CISCO', 1, 1, 'D001M022', 'loadInformation40', 0, NULL), ('Digital Access+', 'CISCO', 1, 1, 'D00303010033', 'loadInformation42', 0, NULL), ('E-Series', 'NOKIA', 1, 1, '', '', 0, NULL), ('ICC', 'NOKIA', 1, 1, '', '', 0, NULL), " .
"('IP Communicator', 'CISCO', 1, 1, '', 'loadInformation30016', 0, NULL), ('Nokia E', 'Nokia', 0, 28, '', 'loadInformation275', 0, NULL), ('VGC Phone', 'CISCO', 1, 1, '', 'loadInformation10', 0, NULL), ('VGC Virtual', 'CISCO', 1, 1, '', 'loadInformation11', 0, NULL);";
$check = $db->query($sql);

View file

@ -18,6 +18,7 @@ if (!empty($_REQUEST['id'])) {
case 'name':
$key = 'mac';
$val = str_replace('SEP', '', $val);
$val = implode('.',sscanf($val, '%4s%4s%4s')); // Convert to Cisco display Format
break;
case 'hwlang':
$tmpar = explode(":",$val);

View file

@ -6,7 +6,6 @@
*/
// vim: set ai ts=4 sw=4 ft=phtml:
?>
<div class="fpbx-container container-fluid">
@ -26,12 +25,12 @@
<i class="glyphicon glyphicon-ok"></i> <span><?php echo _('Reset Device') ?></span>
</button>
</div>
<table data-cookie="true" data-cookie-id-table="sccp-phone" data-url="ajax.php?module=sccp_manager&amp;command=getPhoneGrid&amp;type=sip" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-sip" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-striped ext-list" id="table-sip" data-id="mac">
<table data-cookie="true" data-cookie-id-table="sccp-phone" data-url="ajax.php?module=sccp_manager&amp;command=getPhoneGrid&amp;type=sccp" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-sip" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-striped ext-list" id="table-sip" data-id="mac">
<thead>
<tr>
<th data-checkbox="true"></th>
<th data-sortable="true" data-field="mac"><?php echo _('MAC') ?></th>
<th data-sortable="true" data-field="description"><?php echo _('Device Descr') ?></th>
<th data-sortable="true" data-field="mac"><?php echo _('Device SEP ID') ?></th>
<th data-sortable="true" data-field="description"><?php echo _('Device Descriptions') ?></th>
<th data-sortable="true" data-field="type"><?php echo _('Device type') ?></th>
<th data-sortable="false" data-field="button" data-formatter="LineFormatter"><?php echo _('Line') ?></th>
<th data-sortable="false" data-field="status"><?php echo _('Status') ?></th>

23
views/hardware.rnav.php Normal file
View file

@ -0,0 +1,23 @@
<div id="toolbar-sccpbnav">
<a href="config.php?display=sccp_phone#sccpdevice" class = "btn btn-default"><i class="fa fa-list"></i>&nbsp;<?php echo _("List Device")?></a>
<a href="config.php?display=sccp_phone&amp;tech_hardware=cisco" class = "btn btn-default"><i class="fa fa-plus"></i>&nbsp;<?php echo _("Add Device")?></a>
</div>
<table id="sccpnavgrid"
data-search="true"
data-toolbar="#toolbar-sccpnav"
data-url="ajax.php?module=sccp_manager&amp;command=getPhoneGrid&amp;type=sccp"
data-cache="false"
data-toggle="table"
class="table">
<thead>
<tr>
<th data-sortable="true" data-field="mac"><?php echo _('SEP ID') ?></th>
<th data-sortable="true" data-field="description"><?php echo _('Descriptions') ?></th>
</tr>
</thead>
</table>
<script type="text/javascript">
$("#sccpnavgrid").on('click-row.bs.table',function(e,row,elem){
window.location = '?display=sccp_phone&tech_hardware=cisco&id='+row['mac'];
})
</script>

View file

@ -528,13 +528,13 @@ and open the template in the editor.
</page_group>
<!-- Form add/ edit device -->
<page_group name="sccp_hw_dev"><label>General Device configuration</label>
<item type="IE" id="1" seq="99"><label>Device ID SEP.[XXXXXXXXXXXX]=MAC</label>
<item type="IE" id="1" seq="99"><label>Device SEP ID.[XXXXXXXXXXXX]=MAC</label>
<input>
<name>mac</name>
<default>000000000</default>
<class>sccp-custom</class>
</input>
<help>The MAC address of the phone</help>
<help>The MAC address of the phone. You must specify 12 characters in the format XXXX.XXXX.XXXX or XX-XX-XX-XX-XX-XX or XXXXXXXXXXXX</help>
</item>
<item type="SDM" id="2" seq="99">
@ -557,7 +557,7 @@ and open the template in the editor.
<page_group name="sccp_hw_dev_edit">
<label>General Device configuration</label>
<item type="IE" id="1" seq="99"><label>Device ID SEP.</label>
<item type="IE" id="1" seq="99"><label>Device SEP ID</label>
<input>
<name>mac</name>
<default>000000000</default>

View file

@ -15,7 +15,7 @@ if (!empty($_REQUEST['id'])) {
$db_res = $this->get_db_SccpTableData('get_sccpdevice_byid', array("id" => $dev_id));
if (!empty($db_res['allow'])) {
$i = 1;
foreach(explode(',', $db_res['allow']) as $c){
foreach(explode(';', $db_res['allow']) as $c){
$codec_list[$c] = $i;
$i ++;
}

View file

@ -41,9 +41,9 @@
<th data-sortable="true" data-field="vendor"><?php echo _('Vendor');?></th>
<th data-sortable="false" data-formatter="DisplayDnsFormatter" data-field="dns"><?php echo _('Expansion Module');?></th>
<th data-sortable="false" data-field="buttons"><?php echo _('Buttons');?></th>
<th data-sortable="false" data-field="loadimage"><?php echo _('Loadimage');?></th>
<th data-sortable="false" data-formatter="SetColColorFirm" data-field="loadimage"><?php echo _('Loadimage');?></th>
<th data-sortable="false" data-field="loadinformationid"><?php echo _('Loadinformation ID');?></th>
<th data-sortable="false" data-field="nametemplet"><?php echo _('Model templet');?></th>
<th data-sortable="false" data-formatter="SetColColorTempl" data-field="nametemplet"><?php echo _('Model templet');?></th>
<th data-field="actions" data-formatter="DispayActionsModelFormatter"><?php echo _('Actions');?></th>
</tr>
</thead>
@ -224,12 +224,28 @@
return exp_model;
}
function SetColColorFirm(value, row, index) {
if (row['validate'].split(';')[0] === 'no') {
return 'No found '+ value;
}
return value;
}
function SetColColorTempl(value, row, index) {
if (row['validate'].split(';')[1] === 'no') {
return 'No found ' + value ;
}
return value;
}
function SetRowColor(row, index) {
var tclass = "active";
if (row['enabled'] === 1) {
tclass = (index % 2 === 0) ? "info" : "info";
}
if (row['validate'] === 'no') {
if ((row['validate'] === 'yes;yes') || (row['validate'] === 'yes;-')) {
// tclass = (row['enabled'] === '1') ? "danger" : "warning";
} else {
tclass = (row['enabled'] === '1') ? "danger" : "warning";
}
return {classes: tclass};