diff --git a/!Readme.txt/bacgroundImage.txt b/!Readme.txt/bacgroundImage.txt index 48b877e..61e7c02 100644 --- a/!Readme.txt/bacgroundImage.txt +++ b/!Readme.txt/bacgroundImage.txt @@ -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). @@ -39,4 +42,5 @@ The Image file is used for the background of the phone display. An additional th URL="TFTP:Desktops/640x480x24/sccp_2.png"/> -While the resolution is fix, the phones are able to reduce the color depth if the original image uses too many colors. \ No newline at end of file +While the resolution is fix, the phones are able to reduce the color depth if the original image uses too many colors. + diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index 1febe12..6ed1c82 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -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,7 +427,12 @@ 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) { case 'savesettings': @@ -675,8 +696,9 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $value = $get_settings[$hdr_prefix . $key . '_net'] . '/' . $get_settings[$hdr_prefix . $key . '_mask']; break; case 'name': - if (!empty($get_settings[$hdr_prefix . 'mac'])) { - $value = 'SEP' . $get_settings[$hdr_prefix . 'mac']; + if (!empty($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; diff --git a/assets/js/sccp_manager.js b/assets/js/sccp_manager.js index bfac029..30e6108 100644 --- a/assets/js/sccp_manager.js +++ b/assets/js/sccp_manager.js @@ -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'; diff --git a/conf/Sccp.class.php b/conf/Sccp.class.php index 18bb044..052cabb 100644 --- a/conf/Sccp.class.php +++ b/conf/Sccp.class.php @@ -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')); diff --git a/i18n/ru_RU/LC_MESSAGES/sccp_manager.mo b/i18n/ru_RU/LC_MESSAGES/sccp_manager.mo index 51025a3..39dfed4 100644 Binary files a/i18n/ru_RU/LC_MESSAGES/sccp_manager.mo and b/i18n/ru_RU/LC_MESSAGES/sccp_manager.mo differ diff --git a/i18n/ru_RU/LC_MESSAGES/sccp_manager.po b/i18n/ru_RU/LC_MESSAGES/sccp_manager.po index 2e4e382..7257167 100644 --- a/i18n/ru_RU/LC_MESSAGES/sccp_manager.po +++ b/i18n/ru_RU/LC_MESSAGES/sccp_manager.po @@ -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 "Статус" diff --git a/i18n/sccp_manager.pot b/i18n/sccp_manager.pot index a056200..5dff382 100644 --- a/i18n/sccp_manager.pot +++ b/i18n/sccp_manager.pot @@ -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 "" diff --git a/install.php b/install.php index 9d5da4c..d9f6c25 100644 --- a/install.php +++ b/install.php @@ -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); diff --git a/views/form.adddevice.php b/views/form.adddevice.php index 3c8011e..344bba5 100644 --- a/views/form.adddevice.php +++ b/views/form.adddevice.php @@ -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); diff --git a/views/hardware.phone.php b/views/hardware.phone.php index c9ea9de..f1cb060 100644 --- a/views/hardware.phone.php +++ b/views/hardware.phone.php @@ -6,7 +6,6 @@ */ // vim: set ai ts=4 sw=4 ft=phtml: - ?>