Skip to content

Commit

Permalink
Adding Initial Files
Browse files Browse the repository at this point in the history
  • Loading branch information
tm1000 committed Jul 8, 2011
0 parents commit 3dc0f5a
Show file tree
Hide file tree
Showing 50 changed files with 1,276 additions and 0 deletions.
Binary file added ._functions.inc.php
Binary file not shown.
Binary file added ._install.php
Binary file not shown.
Binary file added ._module.xml
Binary file not shown.
Binary file added ._page.advanced_settings.php
Binary file not shown.
Binary file added ._page.blacklist_mod.php
Binary file not shown.
Binary file added ._uninstall.php
Binary file not shown.
126 changes: 126 additions & 0 deletions functions.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?php

function sak_hook_core($viewing_itemid, $target_menuid) {
global $db;
$sak_settings =& $db->getAssoc("SELECT var_name, value FROM sak_settings");
if (($target_menuid == 'routing') && ($sak_settings['dial_plan'])) {
$html = '<tr><td colspan="2"><h5>';
$html .= _("Bulk Dial Patterns");
$html .= '<hr></h5></td></tr>';
$html .= '<tr><td colspan="2">This Effectively Disables the \'Dial Plan Wizard\' Below. <br/>Entering Anything in the \'Dial Plan Wizard\' will be ignored</td></tr>';
$html .= '<tr>';
$html .= '<td><a href="#" class="info">';
$html .= _("Source").'<span>'._("Each Pattern Should Be Entered On A New Line").'.</span></a>:</td>';
$html .= '<td><textarea name="bulk_patterns" rows="10" cols="40">';
if(isset($_REQUEST['extdisplay'])) {
$sql = 'SELECT `match_pattern_pass` FROM `outbound_route_patterns` WHERE `route_id` = '. $_REQUEST['extdisplay'];
$result = $db->query($sql);
while($row =& $result->fetchRow(DB_FETCHMODE_ASSOC)) {
$html .= $row['match_pattern_pass']."\n";
}

}
$html .= '</textarea></td></tr>';
return $html;
}
}

function sak_hookProcess_core($viewing_itemid, $request) {
global $db;
$sak_settings =& $db->getAssoc("SELECT var_name, value FROM sak_settings");
if (($request['display'] == 'routing') && ($sak_settings['dial_plan']) && (isset($request['bulk_patterns']))) {
$_POST['pattern_pass'] = "";
$data = explode("\n",$request['bulk_patterns']);
$_POST['pattern_pass'] = $data;
$count = count($data);
$_POST['prepend_digit'] = array_fill(0, $count, '');
$_POST['pattern_prefix'] = array_fill(0, $count, '');
$_POST['match_cid'] = array_fill(0, $count, '');

/*
$sql = 'DELETE FROM `outbound_route_patterns` WHERE `outbound_route_patterns`.`route_id` = '.$_REQUEST['extdisplay'];
$db->query($sql);
foreach($data as $value){
$sql = "INSERT INTO outbound_route_patterns (route_id, match_pattern_pass) VALUES ('".$_REQUEST['extdisplay']."','".$value."')";
$db->query($sql);
}
*/
}
}

function sak_blacklist_list() {
global $amp_conf;
global $astman;

$ast_ge_16 = version_compare($amp_conf['ASTVERSION'], "1.6", "ge");
if ($astman) {
$list = $astman->database_show('blacklist');
if($ast_ge_16) {
foreach ($list as $k => $v) {
$numbers = substr($k, 11);
$blacklisted[] = array('number' => $numbers, 'description' => $v);
}
if (isset($blacklisted) && is_array($blacklisted))
// Why this sorting? When used it does not yield the result I want
// natsort($blacklisted);
return isset($blacklisted)?$blacklisted:null;
} else {
foreach ($list as $k => $v) {
$numbers[substr($k, 11)] = substr($k, 11);
}
if (isset($numbers) && is_array($numbers))
natcasesort($numbers);
return isset($numbers)?$numbers:null;
}
} else {
fatal("Cannot connect to Asterisk Manager with ".$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"]);
}
}

function sak_blacklist_del($number){
global $amp_conf;
global $astman;
if ($astman) {
$astman->database_del("blacklist",$number);
} else {
fatal("Cannot connect to Asterisk Manager with ".$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"]);
}
}

function sak_blacklist_add($post){
global $amp_conf;
global $astman;

$ast_ge_16 = version_compare($amp_conf['ASTVERSION'], "1.6", "ge");

if(!sak_blacklist_chk($post))
return false;

extract($post);
if ($astman) {
if ($ast_ge_16) {
$post['description']==""?$post['description'] = '1':$post['description'];
$astman->database_put("blacklist",$post['number'], '"'.$post['description'].'"');
} else {
$astman->database_put("blacklist",$number, '1');
}
// Remove filtering for blocked/unknown cid
$astman->database_del("blacklist","blocked");
// Add it back if it's checked
if($post['blocked'] == "1") {
$astman->database_put("blacklist","blocked", "1");
needreload();
}
} else {
fatal("Cannot connect to Asterisk Manager with ".$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"]);
}
}


// ensures post vars is valid
function sak_blacklist_chk($post){
return true;
}

?>
Binary file added i18n/._blacklist.pot
Binary file not shown.
Binary file added i18n/bg_BG/LC_MESSAGES/._blacklist.mo
Binary file not shown.
Binary file added i18n/bg_BG/LC_MESSAGES/._blacklist.po
Binary file not shown.
Binary file added i18n/bg_BG/LC_MESSAGES/blacklist.mo
Binary file not shown.
70 changes: 70 additions & 0 deletions i18n/bg_BG/LC_MESSAGES/blacklist.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: FreePBX v2.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-02-27 17:34+0100\n"
"PO-Revision-Date: 2008-11-02 20:34+0200\n"
"Last-Translator: \n"
"Language-Team: Chavdar Iliev <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: Bulgarian\n"
"X-Poedit-Country: BULGARIA\n"
"X-Poedit-SourceCharset: utf-8\n"

msgid "Blacklist"
msgstr "Черен Списък"

msgid "Inbound Call Control"
msgstr ""

msgid "Blacklist a number"
msgstr "Въведи номер в Черен Списък"

msgid "Remove a number from the blacklist"
msgstr "Извади номер от Черен Списък"

msgid "Blacklist the last caller"
msgstr "Въведи последния обадил се в Черен Списък"

msgid "Blacklist entry"
msgstr "Въведен в Черен Списък"

msgid "deleted"
msgstr "изтрит"

msgid "Blacklist entries"
msgstr "Въведени в Черен Списък"

msgid "Number"
msgstr "Номер"

msgid "Delete"
msgstr "Изтрий"

msgid "Edit"
msgstr "Редактирай"

msgid "Add or replace entry"
msgstr "Добави или замени въведен номер"

msgid "Number:"
msgstr "Номер:"

msgid "Enter the number you want to block"
msgstr "Въведете номер който искате да блокирате"

msgid "Block Unknown/Blocked Caller ID:"
msgstr ""

msgid "Check here to catch Unknown/Blocked Caller ID"
msgstr ""

msgid "Submit Changes"
msgstr "Приеми Промените"
89 changes: 89 additions & 0 deletions i18n/blacklist.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# This file is part of FreePBX.
#
# FreePBX is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# FreePBX is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with FreePBX. If not, see <http://www.gnu.org/licenses/>.
#
# FreePBX language template for blacklist
# Copyright (C) 2008, 2009, 2010, 2011 Bandwith.com
#
msgid ""
msgstr ""
"Project-Id-Version: FreePBX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-03-10 22:46+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "Blacklist"
msgstr ""

msgid "Inbound Call Control"
msgstr ""

msgid "Blacklist a number"
msgstr ""

msgid "Remove a number from the blacklist"
msgstr ""

msgid "Blacklist the last caller"
msgstr ""

msgid "Blacklist entry"
msgstr ""

msgid "deleted"
msgstr ""

msgid "Blacklist entries"
msgstr ""

msgid "Number"
msgstr ""

msgid "Description"
msgstr ""

msgid "Delete"
msgstr ""

msgid "Edit"
msgstr ""

msgid "Add or replace entry"
msgstr ""

msgid "Number:"
msgstr ""

msgid "Enter the number you want to block"
msgstr ""

msgid "Description:"
msgstr ""

msgid "Enter a description for the number you want to block"
msgstr ""

msgid "Block Unknown/Blocked Caller ID:"
msgstr ""

msgid "Check here to catch Unknown/Blocked Caller ID"
msgstr ""

msgid "Submit Changes"
msgstr ""
Binary file added i18n/es_ES/LC_MESSAGES/._blacklist.mo
Binary file not shown.
Binary file added i18n/es_ES/LC_MESSAGES/._blacklist.po
Binary file not shown.
Binary file added i18n/es_ES/LC_MESSAGES/blacklist.mo
Binary file not shown.
65 changes: 65 additions & 0 deletions i18n/es_ES/LC_MESSAGES/blacklist.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
msgid ""
msgstr ""
"Project-Id-Version: FreePBX - módulo blacklist module spanish translation\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-02-27 17:34+0100\n"
"PO-Revision-Date: 2009-01-22 01:08+0100\n"
"Last-Translator: Juan Asensio Sánchez <[email protected]>\n"
"Language-Team: Juan Asensio Sánchez <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: Spanish\n"
"X-Poedit-Country: SPAIN\n"
"X-Poedit-SourceCharset: utf-8\n"

msgid "Blacklist"
msgstr "Lista negra"

msgid "Inbound Call Control"
msgstr ""

msgid "Blacklist a number"
msgstr "Añadir un número a la lista negra"

msgid "Remove a number from the blacklist"
msgstr "Eliminar un número de la lista negra"

msgid "Blacklist the last caller"
msgstr "Añadir a la lista negra el último número llamado"

msgid "Blacklist entry"
msgstr "Elemento de la lista negra"

msgid "deleted"
msgstr "eliminada"

msgid "Blacklist entries"
msgstr "Elementos de la lista negra"

msgid "Number"
msgstr "Número"

msgid "Delete"
msgstr "Eliminar"

msgid "Edit"
msgstr "Editar"

msgid "Add or replace entry"
msgstr "Añadir o modificar elemento"

msgid "Number:"
msgstr "Número:"

msgid "Enter the number you want to block"
msgstr "Introduzca el número que desea bloquear"

msgid "Block Unknown/Blocked Caller ID:"
msgstr ""

msgid "Check here to catch Unknown/Blocked Caller ID"
msgstr ""

msgid "Submit Changes"
msgstr "Enviar cambios"
Binary file added i18n/fr_FR/LC_MESSAGES/._blacklist.mo
Binary file not shown.
Binary file added i18n/fr_FR/LC_MESSAGES/._blacklist.po
Binary file not shown.
Binary file added i18n/fr_FR/LC_MESSAGES/blacklist.mo
Binary file not shown.
Loading

0 comments on commit 3dc0f5a

Please sign in to comment.