contact_view.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. <?php
  2. /*
  3. FusionPBX
  4. Version: MPL 1.1
  5. The contents of this file are subject to the Mozilla Public License Version
  6. 1.1 (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.mozilla.org/MPL/
  9. Software distributed under the License is distributed on an "AS IS" basis,
  10. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. for the specific language governing rights and limitations under the
  12. License.
  13. The Original Code is FusionPBX
  14. The Initial Developer of the Original Code is
  15. Mark J Crane <[email protected]>
  16. Portions created by the Initial Developer are Copyright (C) 2008-2020
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Mark J Crane <[email protected]>
  20. */
  21. //includes
  22. require_once "root.php";
  23. require_once "resources/require.php";
  24. require_once "resources/check_auth.php";
  25. //check permissions
  26. if (permission_exists('contact_view')) {
  27. //access granted
  28. }
  29. else {
  30. echo "access denied";
  31. exit;
  32. }
  33. //add multi-lingual support
  34. $language = new text;
  35. $text = $language->get();
  36. //action add or update
  37. if (is_uuid($_REQUEST["id"])) {
  38. $contact_uuid = $_REQUEST["id"];
  39. }
  40. else {
  41. header("Location: contacts.php");
  42. }
  43. //main contact details
  44. $sql = "select * from v_contacts ";
  45. $sql .= "where domain_uuid = :domain_uuid ";
  46. $sql .= "and contact_uuid = :contact_uuid ";
  47. $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
  48. $parameters['contact_uuid'] = $contact_uuid;
  49. $database = new database;
  50. $row = $database->select($sql, $parameters, 'row');
  51. if (is_array($row) && @sizeof($row) != 0) {
  52. $contact_type = $row["contact_type"];
  53. $contact_organization = $row["contact_organization"];
  54. $contact_name_prefix = $row["contact_name_prefix"];
  55. $contact_name_given = $row["contact_name_given"];
  56. $contact_name_middle = $row["contact_name_middle"];
  57. $contact_name_family = $row["contact_name_family"];
  58. $contact_name_suffix = $row["contact_name_suffix"];
  59. $contact_nickname = $row["contact_nickname"];
  60. $contact_title = $row["contact_title"];
  61. $contact_category = $row["contact_category"];
  62. $contact_role = $row["contact_role"];
  63. $contact_time_zone = $row["contact_time_zone"];
  64. $contact_note = $row["contact_note"];
  65. }
  66. unset($sql, $parameters, $row);
  67. //get the available users for this contact
  68. $sql = "select * from v_users ";
  69. $sql .= "where domain_uuid = :domain_uuid ";
  70. $sql .= "order by username asc ";
  71. $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
  72. $database = new database;
  73. $users = $database->select($sql, $parameters, 'all');
  74. unset($sql, $parameters);
  75. //determine if contact assigned to a user
  76. if (is_array($users) && sizeof($users) != 0) {
  77. foreach ($users as $user) {
  78. if ($user['contact_uuid'] == $contact_uuid) {
  79. $contact_user_uuid = $user['user_uuid'];
  80. break;
  81. }
  82. }
  83. }
  84. //get the assigned users that can view this contact
  85. $sql = "select u.username, u.user_uuid, a.contact_user_uuid from v_contacts as c, v_users as u, v_contact_users as a ";
  86. $sql .= "where c.contact_uuid = :contact_uuid ";
  87. $sql .= "and c.domain_uuid = :domain_uuid ";
  88. $sql .= "and u.user_uuid = a.user_uuid ";
  89. $sql .= "and c.contact_uuid = a.contact_uuid ";
  90. $sql .= "order by u.username asc ";
  91. $parameters['contact_uuid'] = $contact_uuid;
  92. $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
  93. $database = new database;
  94. $contact_users_assigned = $database->select($sql, $parameters, 'all');
  95. unset($sql, $parameters);
  96. //get the assigned groups that can view this contact
  97. $sql = "select g.*, cg.contact_group_uuid ";
  98. $sql .= "from v_groups as g, v_contact_groups as cg ";
  99. $sql .= "where cg.group_uuid = g.group_uuid ";
  100. $sql .= "and cg.domain_uuid = :domain_uuid ";
  101. $sql .= "and cg.contact_uuid = :contact_uuid ";
  102. $sql .= "and cg.group_uuid <> :group_uuid ";
  103. $sql .= "order by g.group_name asc ";
  104. $parameters['domain_uuid'] = $domain_uuid;
  105. $parameters['contact_uuid'] = $contact_uuid;
  106. $parameters['group_uuid'] = $_SESSION["user_uuid"];
  107. $database = new database;
  108. $contact_groups_assigned = $database->select($sql, $parameters, 'all');
  109. if (is_array($contact_groups_assigned) && @sizeof($contact_groups_assigned) != 0) {
  110. foreach ($contact_groups_assigned as $field) {
  111. $contact_groups[] = "'".$field['group_uuid']."'";
  112. }
  113. }
  114. unset($sql, $parameters);
  115. //get the available groups for this contact
  116. $sql = "select group_uuid, group_name from v_groups ";
  117. $sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
  118. if (is_array($contact_groups) && @sizeof($contact_groups) != 0) {
  119. $sql .= "and group_uuid not in (".implode(',', $contact_groups).") ";
  120. }
  121. $sql .= "order by group_name asc ";
  122. $parameters['domain_uuid'] = $domain_uuid;
  123. $database = new database;
  124. $contact_groups_available = $database->select($sql, $parameters, 'all');
  125. unset($sql, $parameters, $contact_groups);
  126. //determine title name
  127. if ($contact_name_given || $contact_name_family) {
  128. $contact_name = $contact_name_prefix ? escape($contact_name_prefix).' ' : null;
  129. $contact_name .= $contact_name_given ? escape($contact_name_given).' ' : null;
  130. $contact_name .= $contact_name_middle ? escape($contact_name_middle).' ' : null;
  131. $contact_name .= $contact_name_family ? escape($contact_name_family).' ' : null;
  132. $contact_name .= $contact_name_suffix ? escape($contact_name_suffix).' ' : null;
  133. }
  134. else {
  135. $contact_name = $contact_organization;
  136. }
  137. //show the header
  138. $document['title'] = $text['title-contact-edit'].($contact_name ? ': '.$contact_name : null);
  139. require_once "resources/header.php";
  140. //determine qr branding
  141. if ($_SESSION['theme']['qr_brand_type']['text'] == 'image' && $_SESSION['theme']['qr_brand_image']['text'] != '') {
  142. echo "<img id='img-buffer' style='display: none;' src='".$_SESSION["theme"]["qr_brand_image"]["text"]."'>";
  143. $qr_option = "image: $('#img-buffer')[0],";
  144. $qr_mode = '4';
  145. $qr_size = '0.2';
  146. }
  147. else if ($_SESSION['theme']['qr_brand_type']['text'] == 'text' && $_SESSION['theme']['qr_brand_text']['text'] != '') {
  148. $qr_option = 'label: "'.$_SESSION['theme']['qr_brand_text']['text'].'"';
  149. $qr_mode = '2';
  150. $qr_size = '0.05';
  151. }
  152. else {
  153. echo "<img id='img-buffer' style='display: none;' src='".PROJECT_PATH."/themes/".$_SESSION["domain"]["template"]["name"]."/images/qr_code.png'>";
  154. $qr_option = "image: $('#img-buffer')[0],";
  155. $qr_mode = '4';
  156. $qr_size = '0.2';
  157. }
  158. //qr code generation
  159. $_GET['type'] = "text";
  160. $qr_vcard = true;
  161. include "contacts_vcard.php";
  162. echo "<input type='hidden' id='qr_vcard' value=\"".$qr_vcard."\">";
  163. echo "<style>";
  164. echo " #qr_code_container {";
  165. echo " z-index: 999999; ";
  166. echo " position: absolute; ";
  167. echo " left: 0; ";
  168. echo " top: 0; ";
  169. echo " right: 0; ";
  170. echo " bottom: 0; ";
  171. echo " text-align: center; ";
  172. echo " vertical-align: middle;";
  173. echo " }";
  174. echo " #qr_code {";
  175. echo " display: block; ";
  176. echo " width: 650px; ";
  177. echo " height: 650px; ";
  178. echo " -webkit-box-shadow: 0px 1px 20px #888; ";
  179. echo " -moz-box-shadow: 0px 1px 20px #888; ";
  180. echo " box-shadow: 0px 1px 20px #888;";
  181. echo " }";
  182. echo "</style>";
  183. echo "<script src='".PROJECT_PATH."/resources/jquery/jquery-qrcode.min.js'></script>";
  184. echo "<script language='JavaScript' type='text/javascript'>";
  185. echo " $(document).ready(function() {";
  186. echo " $('#qr_code').qrcode({ ";
  187. echo " render: 'canvas', ";
  188. echo " minVersion: 6, ";
  189. echo " maxVersion: 40, ";
  190. echo " ecLevel: 'H', ";
  191. echo " size: 650, ";
  192. echo " radius: 0.2, ";
  193. echo " quiet: 6, ";
  194. echo " background: '#fff', ";
  195. echo " mode: ".$qr_mode.", ";
  196. echo " mSize: ".$qr_size.", ";
  197. echo " mPosX: 0.5, ";
  198. echo " mPosY: 0.5, ";
  199. echo " text: document.getElementById('qr_vcard').value, ";
  200. echo " ".$qr_option;
  201. echo " });";
  202. echo " });";
  203. echo "</script>";
  204. //show the content
  205. echo "<div class='action_bar' id='action_bar'>\n";
  206. echo " <div class='heading'><b>".($contact_name ? $contact_name : $text['header-contact-edit'])."</b></div>\n";
  207. echo " <div class='actions'>\n";
  208. echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','collapse'=>'hide-sm-dn','style'=>'margin-right: 15px;','link'=>'contacts.php']);
  209. if (permission_exists('contact_time_add')) {
  210. //detect timer state (and start time)
  211. $sql = "select ";
  212. $sql .= "time_start ";
  213. $sql .= "from v_contact_times ";
  214. $sql .= "where domain_uuid = :domain_uuid ";
  215. $sql .= "and user_uuid = :user_uuid ";
  216. $sql .= "and contact_uuid = :contact_uuid ";
  217. $sql .= "and time_start is not null ";
  218. $sql .= "and time_stop is null ";
  219. $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
  220. $parameters['user_uuid'] = $_SESSION['user']['user_uuid'];
  221. $parameters['contact_uuid'] = $contact_uuid;
  222. $database = new database;
  223. $time_start = $database->select($sql, $parameters, 'column');
  224. $btn_style = $time_start ? 'color: #fff; background-color: #3693df; background-image: none;' : null;
  225. unset($sql, $parameters);
  226. echo button::create(['type'=>'button','label'=>$text['button-timer'],'icon'=>'clock','style'=>$btn_style,'title'=>$time_start,'collapse'=>'hide-sm-dn','onclick'=>"window.open('contact_timer.php?domain_uuid=".urlencode($domain_uuid)."&contact_uuid=".urlencode($contact_uuid)."','contact_time_".escape($contact_uuid)."','width=300, height=375, top=30, left='+(screen.width - 350)+', menubar=no, scrollbars=no, status=no, toolbar=no, resizable=no');"]);
  227. }
  228. echo button::create(['type'=>'button','label'=>$text['button-qr_code'],'icon'=>'qrcode','collapse'=>'hide-sm-dn','onclick'=>"$('#qr_code_container').fadeIn(400);"]);
  229. echo button::create(['type'=>'button','label'=>$text['button-vcard'],'icon'=>'address-card','collapse'=>'hide-sm-dn','link'=>'contacts_vcard.php?id='.urlencode($contact_uuid).'&type=download']);
  230. if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/invoices')) {
  231. echo button::create(['type'=>'button','label'=>$text['button-invoices'],'icon'=>'file-invoice-dollar','collapse'=>'hide-sm-dn','link'=>'../invoices/invoices.php?id='.urlencode($contact_uuid)]);
  232. }
  233. if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/certificates')) {
  234. echo button::create(['type'=>'button','label'=>$text['button-certificate'],'icon'=>'certificate','collapse'=>'hide-sm-dn','link'=>'../certificates/index.php?name='.urlencode($contact_name_given." ".$contact_name_family)]);
  235. }
  236. if (permission_exists('user_edit') && is_uuid($contact_user_uuid)) {
  237. echo button::create(['type'=>'button','label'=>$text['button-user'],'icon'=>'user','collapse'=>'hide-sm-dn','link'=>'../../core/users/user_edit.php?id='.urlencode($contact_user_uuid)]);
  238. }
  239. if (
  240. permission_exists('contact_phone_add') ||
  241. permission_exists('contact_address_add') ||
  242. permission_exists('contact_email_add') ||
  243. permission_exists('contact_url_add') ||
  244. permission_exists('contact_relation_add') ||
  245. permission_exists('contact_note_add') ||
  246. permission_exists('contact_time_add') ||
  247. permission_exists('contact_setting_add') ||
  248. permission_exists('contact_attachment_add')
  249. ) {
  250. echo "<select class='formfld' style='width: auto; margin-left: 15px;' id='select_add' onchange=\"document.location.href='contact_' + (this.options[this.selectedIndex].value) + '_edit.php?contact_uuid=".urlencode($contact_uuid)."';\">\n";
  251. echo " <option value=''>".$text['button-add']."...</option>\n";
  252. if (permission_exists('contact_phone_add')) { echo "<option value='phone'>".$text['label-phone_number']."</option>\n"; }
  253. if (permission_exists('contact_address_add')) { echo "<option value='address'>".$text['label-address_address']."</option>\n"; }
  254. if (permission_exists('contact_email_add')) { echo "<option value='email'>".$text['label-email']."</option>\n"; }
  255. if (permission_exists('contact_url_add')) { echo "<option value='url'>".$text['label-url']."</option>\n"; }
  256. if (permission_exists('contact_relation_add')) { echo "<option value='relation'>".$text['label-contact_relation_label']."</option>\n"; }
  257. if (permission_exists('contact_note_add')) { echo "<option value='note'>".$text['label-contact_note']."</option>\n"; }
  258. if (permission_exists('contact_time_add')) { echo "<option value='time'>".$text['label-time_time']."</option>\n"; }
  259. if (permission_exists('contact_setting_add')) { echo "<option value='setting'>".$text['label-setting']."</option>\n"; }
  260. if (permission_exists('contact_attachment_add')) { echo "<option value='attachment'>".$text['label-attachment']."</option>\n"; }
  261. echo " </select>";
  262. }
  263. if (permission_exists('contact_edit')) {
  264. echo button::create(['type'=>'button','label'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'id'=>'btn_edit','style'=>'margin-left: 15px;','collapse'=>'hide-sm-dn','link'=>'contact_edit.php?id='.urlencode($contact_uuid)]);
  265. }
  266. echo " </div>\n";
  267. echo " <div style='clear: both;'></div>\n";
  268. echo "</div>\n";
  269. if (
  270. $action == "update" && (
  271. permission_exists('contact_delete') ||
  272. permission_exists('contact_user_delete') ||
  273. permission_exists('contact_group_delete') ||
  274. permission_exists('contact_phone_delete') ||
  275. permission_exists('contact_address_delete') ||
  276. permission_exists('contact_email_delete') ||
  277. permission_exists('contact_url_delete') ||
  278. permission_exists('contact_relation_delete') ||
  279. permission_exists('contact_note_delete') ||
  280. permission_exists('contact_time_delete') ||
  281. permission_exists('contact_setting_delete') ||
  282. permission_exists('contact_attachment_delete')
  283. )) {
  284. echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'delete','onclick'=>"modal_close();"])]);
  285. }
  286. if ($contact_title || $contact_organization) {
  287. echo ($contact_title ? '<i>'.$contact_title.'</i>' : null).($contact_title && $contact_organization ? ', ' : null).($contact_organization ? '<strong>'.$contact_organization.'</strong>' : null)."\n";
  288. }
  289. else {
  290. echo $contact_note."\n";
  291. }
  292. echo "<br /><br />\n";
  293. echo "<div class='grid' style='grid-gap: 15px; grid-template-columns: repeat(auto-fill, minmax(375px, 1fr));'>\n";
  294. //general info
  295. echo " <div class='box contact-details'>\n";
  296. echo " <div class='grid contact-details'>\n";
  297. echo " <div class='box'><b class='fas fa-user fa-fw fa-lg'></b></div>\n";
  298. echo " <div class='box'>\n";
  299. echo " <div class='grid' style='grid-template-columns: 70px auto;'>\n";
  300. //nickname
  301. if ($contact_nickname) {
  302. echo "<div class='box contact-details-label'>".$text['label-contact_nickname']."</div>\n";
  303. echo "<div class='box'>\"".escape($contact_nickname)."\"</div>\n";
  304. }
  305. //contact type
  306. if ($contact_type) {
  307. echo "<div class='box contact-details-label'>".$text['label-contact_type']."</div>\n";
  308. echo "<div class='box'>";
  309. if (is_array($_SESSION["contact"]["type"])) {
  310. sort($_SESSION["contact"]["type"]);
  311. foreach ($_SESSION["contact"]["type"] as $type) {
  312. if ($contact_type == $type) {
  313. echo escape($type);
  314. }
  315. }
  316. }
  317. else if ($text['option-contact_type_'.$contact_type]) {
  318. echo $text['option-contact_type_'.$contact_type];
  319. }
  320. else {
  321. echo escape($contact_type);
  322. }
  323. echo "</div>\n";
  324. }
  325. //category
  326. if ($contact_category) {
  327. echo "<div class='box contact-details-label'>".$text['label-contact_category']."</div>\n";
  328. echo "<div class='box'>";
  329. if (is_array($_SESSION["contact"]["category"])) {
  330. sort($_SESSION["contact"]["category"]);
  331. foreach ($_SESSION["contact"]["category"] as $category) {
  332. if ($contact_category == $category) {
  333. echo escape($category);
  334. break;
  335. }
  336. }
  337. }
  338. else {
  339. echo escape($contact_category);
  340. }
  341. echo "</div>\n";
  342. }
  343. //role
  344. if ($contact_role) {
  345. echo "<div class='box contact-details-label'>".$text['label-contact_role']."</div>\n";
  346. echo "<div class='box'>";
  347. if (is_array($_SESSION["contact"]["role"])) {
  348. sort($_SESSION["contact"]["role"]);
  349. foreach ($_SESSION["contact"]["role"] as $role) {
  350. if ($contact_role == $role) {
  351. echo escape($role);
  352. break;
  353. }
  354. }
  355. }
  356. else {
  357. echo escape($contact_role);
  358. }
  359. echo "</div>\n";
  360. }
  361. //time_zone
  362. if ($contact_time_zone) {
  363. echo "<div class='box contact-details-label'>".$text['label-contact_time_zone']."</div>\n";
  364. echo "<div class='box'>";
  365. echo $contact_time_zone."<br>\n";
  366. echo "</div>\n";
  367. }
  368. //users (viewing contact)
  369. if (permission_exists('contact_user_view') && is_array($contact_users_assigned) && @sizeof($contact_users_assigned) != 0) {
  370. echo "<div class='box contact-details-label'>".$text['label-users']."</div>\n";
  371. echo "<div class='box'>";
  372. foreach ($contact_users_assigned as $field) {
  373. echo escape($field['username'])."<br>\n";
  374. }
  375. echo "</div>\n";
  376. }
  377. //groups (viewing contact)
  378. if (permission_exists('contact_group_view') && is_array($contact_groups_assigned) && @sizeof($contact_groups_assigned) != 0) {
  379. echo "<div class='box contact-details-label'>".$text['label-groups']."</div>\n";
  380. echo "<div class='box'>";
  381. foreach ($contact_groups_assigned as $field) {
  382. echo escape($field['group_name'])."<br>\n";
  383. }
  384. echo "</div>\n";
  385. }
  386. echo " </div>\n";
  387. echo " </div>\n";
  388. echo " </div>\n";
  389. echo " </div>\n";
  390. //numbers
  391. if (permission_exists('contact_phone_view')) {
  392. echo " <div class='box contact-details'>\n";
  393. echo " <div class='grid contact-details'>\n";
  394. echo " <div class='box' title=\"".$text['label-phone_numbers']."\"><b class='fas fa-hashtag fa-fw fa-lg'></b></div>\n";
  395. echo " <div class='box'>\n";
  396. require 'contact_phones_view.php';
  397. echo " </div>\n";
  398. echo " </div>\n";
  399. echo " </div>\n";
  400. }
  401. //emails
  402. if (permission_exists('contact_email_view')) {
  403. echo " <div class='box contact-details'>\n";
  404. echo " <div class='grid contact-details'>\n";
  405. echo " <div class='box' title=\"".$text['label-emails']."\"><b class='fas fa-envelope fa-fw fa-lg'></b></div>\n";
  406. echo " <div class='box'>\n";
  407. require 'contact_emails_view.php';
  408. echo " </div>\n";
  409. echo " </div>\n";
  410. echo " </div>\n";
  411. }
  412. //addresses
  413. if (permission_exists('contact_address_view')) {
  414. echo " <div class='box contact-details'>\n";
  415. echo " <div class='grid contact-details'>\n";
  416. echo " <div class='box' title=\"".$text['label-addresses']."\"><b class='fas fa-map-marker-alt fa-fw fa-lg'></b></div>\n";
  417. echo " <div class='box'>\n";
  418. require 'contact_addresses_view.php';
  419. echo " </div>\n";
  420. echo " </div>\n";
  421. echo " </div>\n";
  422. }
  423. //urls
  424. if (permission_exists('contact_url_view')) {
  425. echo " <div class='box contact-details'>\n";
  426. echo " <div class='grid contact-details'>\n";
  427. echo " <div class='box' title=\"".$text['label-urls']."\"><b class='fas fa-link fa-fw fa-lg'></b></div>\n";
  428. echo " <div class='box'>\n";
  429. require "contact_urls_view.php";
  430. echo " </div>\n";
  431. echo " </div>\n";
  432. echo " </div>\n";
  433. }
  434. //relations
  435. if (permission_exists('contact_relation_view')) {
  436. echo " <div class='box contact-details'>\n";
  437. echo " <div class='grid contact-details'>\n";
  438. echo " <div class='box' title=\"".$text['header-contact_relations']."\"><b class='fas fa-project-diagram fa-fw fa-lg'></b></div>\n";
  439. echo " <div class='box'>\n";
  440. require "contact_relations_view.php";
  441. echo " </div>\n";
  442. echo " </div>\n";
  443. echo " </div>\n";
  444. }
  445. //attachments
  446. if (permission_exists('contact_attachment_view')) {
  447. echo " <div class='box contact-details'>\n";
  448. echo " <div class='grid contact-details'>\n";
  449. echo " <div class='box' title=\"".$text['label-attachments']."\"><b class='fas fa-paperclip fa-fw fa-lg'></b></div>\n";
  450. echo " <div class='box'>\n";
  451. require "contact_attachments_view.php";
  452. echo " </div>\n";
  453. echo " </div>\n";
  454. echo " </div>\n";
  455. }
  456. //times
  457. if (permission_exists('contact_time_view')) {
  458. echo " <div class='box contact-details'>\n";
  459. echo " <div class='grid contact-details'>\n";
  460. echo " <div class='box' title=\"".$text['header_contact_times']."\"><b class='fas fa-clock fa-fw fa-lg'></b></div>\n";
  461. echo " <div class='box'>\n";
  462. require "contact_times_view.php";
  463. echo " </div>\n";
  464. echo " </div>\n";
  465. echo " </div>\n";
  466. }
  467. //extensions
  468. if (permission_exists('contact_extension_view')) {
  469. echo " <div class='box contact-details'>\n";
  470. echo " <div class='grid contact-details'>\n";
  471. echo " <div class='box' title=\"".$text['label-contact_extensions']."\"><b class='fas fa-fax fa-fw fa-lg'></b></div>\n";
  472. echo " <div class='box'>\n";
  473. require "contact_extensions_view.php";
  474. echo " </div>\n";
  475. echo " </div>\n";
  476. echo " </div>\n";
  477. }
  478. echo "</div>\n";
  479. echo "<div class='grid' style='margin-top: 15px; grid-template-columns: auto;'>\n";
  480. //notes
  481. if (permission_exists('contact_note_view')) {
  482. echo " <div class='box contact-details'>\n";
  483. echo " <div class='grid contact-details'>\n";
  484. echo " <div class='box' title=\"".$text['label-contact_notes']."\"><b class='fas fa-sticky-note fa-fw fa-lg'></b></div>\n";
  485. echo " <div class='box'>\n";
  486. require "contact_notes_view.php";
  487. echo " </div>\n";
  488. echo " </div>\n";
  489. echo " </div>\n";
  490. }
  491. echo "</div>\n";
  492. echo "<br><br>\n";
  493. //include the footer
  494. require_once "resources/footer.php";
  495. ?>