2014-11-19 04:44:41 +01:00
|
|
|
<?php
|
|
|
|
|
/*
|
|
|
|
|
FusionPBX
|
|
|
|
|
Version: MPL 1.1
|
|
|
|
|
|
|
|
|
|
The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
|
1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
http://www.mozilla.org/MPL/
|
|
|
|
|
|
|
|
|
|
Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
|
for the specific language governing rights and limitations under the
|
|
|
|
|
License.
|
|
|
|
|
|
|
|
|
|
The Original Code is FusionPBX
|
|
|
|
|
|
|
|
|
|
The Initial Developer of the Original Code is
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
2018-06-08 08:29:09 +02:00
|
|
|
Portions created by the Initial Developer are Copyright (C) 2008-2018
|
2014-11-19 04:44:41 +01:00
|
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
Contributor(s):
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
|
|
|
|
*/
|
2018-06-08 08:29:09 +02:00
|
|
|
|
|
|
|
|
//includes
|
|
|
|
|
require_once "root.php";
|
|
|
|
|
require_once "resources/require.php";
|
|
|
|
|
require_once "resources/check_auth.php";
|
|
|
|
|
|
|
|
|
|
//check permissions
|
|
|
|
|
if (permission_exists('contact_url_view')) {
|
|
|
|
|
//access granted
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "access denied";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
2014-11-19 04:44:41 +01:00
|
|
|
|
|
|
|
|
//show the content
|
|
|
|
|
echo "<table width='100%' border='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td width='50%' align='left' nowrap='nowrap'><b>".$text['label-urls']."</b></td>\n";
|
|
|
|
|
echo "<td width='50%' align='right'> </td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
|
|
|
|
|
//get the contact list
|
|
|
|
|
$sql = "select * from v_contact_urls ";
|
2019-07-26 17:41:41 +02:00
|
|
|
$sql .= "where domain_uuid = :domain_uuid ";
|
|
|
|
|
$sql .= "and contact_uuid = :contact_uuid ";
|
2014-11-19 04:44:41 +01:00
|
|
|
$sql .= "order by url_primary desc, url_label asc ";
|
2019-07-26 17:41:41 +02:00
|
|
|
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
|
|
|
|
$parameters['contact_uuid'] = $contact_uuid;
|
|
|
|
|
$database = new database;
|
|
|
|
|
$result = $database->select($sql, $parameters, 'all');
|
|
|
|
|
unset($sql, $parameters);
|
2014-11-19 04:44:41 +01:00
|
|
|
|
|
|
|
|
$c = 0;
|
|
|
|
|
$row_style["0"] = "row_style0";
|
|
|
|
|
$row_style["1"] = "row_style1";
|
|
|
|
|
|
2015-03-26 20:47:57 +01:00
|
|
|
echo "<table class='tr_hover' style='margin-bottom: 20px;' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
2014-11-19 04:44:41 +01:00
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<th>".$text['label-url_label']."</th>\n";
|
|
|
|
|
echo "<th>".$text['label-url_address']."</th>\n";
|
|
|
|
|
echo "<th>".$text['label-url_description']."</th>\n";
|
|
|
|
|
echo "<td class='list_control_icons'>";
|
2015-03-27 05:35:21 +01:00
|
|
|
if (permission_exists('contact_url_add')) {
|
|
|
|
|
echo "<a href='contact_url_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
|
|
|
|
}
|
2014-11-19 04:44:41 +01:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2019-07-26 17:41:41 +02:00
|
|
|
if (is_array($result) && @sizeof($result) != 0) {
|
2014-11-19 04:44:41 +01:00
|
|
|
foreach($result as $row) {
|
2015-03-27 05:35:21 +01:00
|
|
|
if (permission_exists('contact_url_edit')) {
|
2018-06-08 08:29:09 +02:00
|
|
|
$tr_link = "href='contact_url_edit.php?contact_uuid=".escape($row['contact_uuid'])."&id=".escape($row['contact_url_uuid'])."'";
|
2015-03-27 05:35:21 +01:00
|
|
|
}
|
2019-07-26 17:41:41 +02:00
|
|
|
echo "<tr ".$tr_link." ".(escape($row['url_primary']) ? "style='font-weight: bold;'" : null).">\n";
|
2018-06-08 08:29:09 +02:00
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['url_label'])." </td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]." tr_link_void' style='width: 40%; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;'><a href='".escape($row['url_address'])."' target='_blank'>".str_replace("http://", "", str_replace("https://", "", escape($row['url_address'])))."</a> </td>\n";
|
|
|
|
|
echo " <td valign='top' class='row_stylebg'>".escape($row['url_description'])." </td>\n";
|
2014-11-19 04:44:41 +01:00
|
|
|
echo " <td class='list_control_icons'>";
|
2015-03-27 05:35:21 +01:00
|
|
|
if (permission_exists('contact_url_edit')) {
|
2018-08-27 23:12:28 +02:00
|
|
|
echo "<a href='contact_url_edit.php?contact_uuid=".escape($row['contact_uuid'])."&id=".escape($row['contact_url_uuid'])."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
|
2015-03-27 05:35:21 +01:00
|
|
|
}
|
|
|
|
|
if (permission_exists('contact_url_delete')) {
|
2018-06-08 08:29:09 +02:00
|
|
|
echo "<a href='contact_url_delete.php?contact_uuid=".escape($row['contact_uuid'])."&id=".escape($row['contact_url_uuid'])."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
2015-03-27 05:35:21 +01:00
|
|
|
}
|
2014-11-19 04:44:41 +01:00
|
|
|
echo " </td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2019-07-26 17:41:41 +02:00
|
|
|
$c = $c ? 0 : 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
unset($result, $row);
|
2014-11-19 04:44:41 +01:00
|
|
|
|
2015-03-26 20:47:57 +01:00
|
|
|
echo "</table>\n";
|
2014-11-19 04:44:41 +01:00
|
|
|
|
2018-06-08 08:29:09 +02:00
|
|
|
?>
|