mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Added extension password to operator details
This commit is contained in:
@@ -59,6 +59,7 @@ if (isset($_POST['operator']))
|
||||
$lastname = $db->qstr($_POST['lastname'],get_magic_quotes_gpc());
|
||||
$time_zone_name = $db->qstr($_POST['Time_zone_name'],get_magic_quotes_gpc());
|
||||
$extension = $db->qstr($_POST['extension'],get_magic_quotes_gpc());
|
||||
$extensionp = $db->qstr($_POST['extensionp'],get_magic_quotes_gpc());
|
||||
$supervisor = 0;
|
||||
$temporary = 0;
|
||||
$refusal = 0;
|
||||
@@ -70,8 +71,8 @@ if (isset($_POST['operator']))
|
||||
if (!empty($_POST['operator']))
|
||||
{
|
||||
$sql = "INSERT INTO operator
|
||||
(`operator_id` ,`username` ,`firstName` ,`lastName`, `extension`, `Time_zone_name`,`voip`)
|
||||
VALUES (NULL , $operator, $firstname , $lastname, $extension, $time_zone_name, $voip);";
|
||||
(`operator_id` ,`username` ,`firstName` ,`lastName`, `extension`,`extension_password`, `Time_zone_name`,`voip`)
|
||||
VALUES (NULL , $operator, $firstname , $lastname, $extension, $extensionp, $time_zone_name, $voip);";
|
||||
|
||||
if ($db->Execute($sql))
|
||||
{
|
||||
@@ -125,6 +126,7 @@ if ($a)
|
||||
<p><? echo T_("Enter the surname of an operator to add:"); ?> <input name="lastname" type="text"/></p>
|
||||
<p><? echo T_("Enter the Time Zone of an operator to add:"); ?> <input name="Time_zone_name" type="text" value="<? echo DEFAULT_TIME_ZONE; ?>"/></p>
|
||||
<p><? echo T_("Enter the telephone extension number:"); ?> <input name="extension" type="text"/></p>
|
||||
<p><? echo T_("Enter the telephone extension password:"); ?> <input name="extensionp" type="text"/></p>
|
||||
<p><? echo T_("Will this operator be using VoIP?"); ?> <input name="voip" type="checkbox" checked="checked"/></p>
|
||||
<p><? echo T_("Is the operator a normal interviewer?"); ?> <input name="temporary" type="checkbox" checked="checked"/></p>
|
||||
<p><? echo T_("Is the operator a supervisor?"); ?> <input name="supervisor" type="checkbox"/></p>
|
||||
|
||||
@@ -302,6 +302,7 @@ CREATE TABLE `operator` (
|
||||
`firstName` varchar(255) NOT NULL,
|
||||
`lastName` varchar(255) NOT NULL,
|
||||
`extension` varchar(10) NOT NULL,
|
||||
`extension_password` varchar(255),
|
||||
`Time_zone_name` char(64) NOT NULL,
|
||||
`enabled` tinyint(1) NOT NULL default '1',
|
||||
`voip` tinyint(1) NOT NULL default '1',
|
||||
|
||||
@@ -402,7 +402,7 @@ function get_case_id($operator_id, $create = false)
|
||||
$db->Execute("SET @row := 0");
|
||||
|
||||
$sql = "INSERT INTO contact_phone (case_id,priority,phone,description)
|
||||
SELECT $case_id as case_id,@row := @row + 1 AS priority,extension as phone, CONCAT(firstName, ' ', lastName)
|
||||
SELECT $case_id as case_id,@row := @row + 1 AS priority,SUBSTRING_INDEX(extension,'/',-1) as phone, CONCAT(firstName, ' ', lastName)
|
||||
FROM operator";
|
||||
|
||||
$db->Execute($sql);
|
||||
@@ -537,6 +537,26 @@ function get_call_number($call_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the extension password of an operator
|
||||
*
|
||||
* @param int $operator_id The queXS Operator ID
|
||||
* @return string|bool the extension password or false if cannot find
|
||||
*
|
||||
*/
|
||||
function get_extension_password($operator_id)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql = "SELECT o.extension_password
|
||||
FROM `operator` as o
|
||||
WHERE o.operator_id = '$operator_id'";
|
||||
|
||||
$rs = $db->GetRow($sql);
|
||||
if (!empty($rs) && isset($rs['extension_password'])) return $rs['extension_password'];
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the extension of an operator
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user