Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.26 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * StreamWIDE SmartMS
  5. *
  6. * @category Streamwide
  7. * @package WebChatFrontend
  8. * @subpackage Layout
  9. * @copyright Copyright (c) 2014 StreamWIDE
  10. * @author Silviu Ghita <sghita@streamwide.ro>
  11. */
  12.  
  13. use SwSmartMS\WebChatFrontend\WebApplication\Util\Registry;
  14. use SwSmartMS\WebChatFrontend\WebApplication\Util\AuthenticatedUser;
  15. use SwSmartMS\WebChatFrontend\WebApplication\Application\Resource\Session;
  16. use SwSmartMS\WebChatFrontend\WebApplication\Acl\Role;
  17. use SwSmartMS\WebChatFrontend\WebApplication\Application\Resource\Cookie;
  18. use SwSmartMS\WebChatFrontend\WebApplication\Service\Organization\OrganizationRetrievalService;
  19.  
  20. $config = Registry::getConfig();
  21. $skinResource = Registry::getSkinResource();
  22. $assetsUrl = $this->pluginGetAssetsUrlForJS();
  23.  
  24. $this->headMeta()
  25. ->appendHttpEquiv('X-UA-Compatible', 'IE=edge')
  26. ->setName('viewport', 'width=1260, user-scalable=no')
  27. ->appendHttpEquiv('content-type', 'text/html; charset=' . $this->getEncoding());
  28.  
  29. // the request object which is sused to provide details about urls and language
  30. $request = Registry::getRequest();
  31. $account = AuthenticatedUser::getSubscriberAccount();
  32. $mapProvider = null;
  33.  
  34. if (AuthenticatedUser::isAuthenticated()) {
  35. $mapProvider = $account['Organization']['MapProvider'];
  36. }
  37.  
  38. $useGoogleReCaptchaApis = AuthenticatedUser::canUseGoogleReCaptchaApis();
  39. $myBusinessFeatureAllowed = $account['AllowMyBusiness'];
  40.  
  41. $commonStyles = array(
  42. '/common/styles/jquery-ui-1.10/jquery-ui-1.10.4.custom.css',
  43. '/common/styles/bootstrap-3.3.6/bootstrap.css',
  44. '/common/styles/bootstrap-3.3.6/bootstrap-theme.css',
  45. '/common/styles/intlTelInput.css',
  46. '/common/styles/perfect-scrollbar.min.css',
  47. '/common/styles/select2/select2.css'
  48. );
  49.  
  50. if (AuthenticatedUser::isAuthenticated()) {
  51. $commonStyles[] = '/common/styles/drawingboard/drawingboard.min.css';
  52. }
  53.  
  54. krsort($commonStyles);
  55.  
  56. $this->pluginPrependStyles($commonStyles);
  57.  
  58. $this->headScript()->appendFile(
  59. '/common/js/html5shiv.3.7.0.min.js',
  60. 'text/javascript',
  61. array('conditional' => 'lt IE 9')
  62. );
  63.  
  64. $this->headScript()->appendFile(
  65. '/common/js/respond.1.4.2.min.js',
  66. 'text/javascript',
  67. array('conditional' => 'lt IE 9')
  68. );
  69.  
  70. $moduleSources = $skinResource->getEmbeddedFiles();
  71.  
  72. if (AuthenticatedUser::isAuthenticated()) {
  73. // emoji
  74. $this->headLink()->appendStylesheet('/common/styles/emoji.css');
  75. $this->headLink()->appendStylesheet('/common/styles/jquery.emojiarea.css');
  76.  
  77. $this->headLink()->appendStylesheet('/common/js/datetimepicker/bootstrapjs/bootstrap-datetimepicker.min.css');
  78.  
  79. $this->headScript()->prependScript('var colorCodes = ' . $skinResource->exportColorsToJs());
  80.  
  81.  
  82. // media players
  83. $this->headLink()->appendStylesheet('/common/styles/jplayer/audio.player.css');
  84. $this->headLink()->appendStylesheet('/common/styles/jplayer/video.player.css');
  85.  
  86. $this->headScript()->prependScript($this->getHelper('TemplateConsolidator')->getScript());
  87.  
  88. // leaflet
  89. $this->headLink()->appendStylesheet('/common/js/leaflet/leaflet.css');
  90. $this->headLink()->appendStylesheet('/common/js/leaflet/leaflet.markercluster.css');
  91.  
  92. // spectrum (jQuery color-picker)
  93. $this->headLink()->appendStylesheet('/common/js/spectrum/spectrum.css');
  94. }
  95.  
  96. foreach($moduleSources as $source) {
  97. $this->headLink()->appendStylesheet($source);
  98. }
  99.  
  100. if (AuthenticatedUser::isAuthenticated()) {
  101. $this->headScript()->appendFile('/common/js/webrtc/swsipvoip.js');
  102. $this->headScript()->appendFile('/js/unified/common.js');
  103. $this->headScript()->appendFile('/js/unified/base.js');
  104.  
  105. if ($myBusinessFeatureAllowed) {
  106. $this->headScript()->appendFile('/js/unified/mybusiness.js');
  107. }
  108.  
  109. } else {
  110. $this->headScript()->appendFile('/js/unified/login-common.js');
  111. $this->headScript()->appendFile('/js/unified/login.js');
  112. }
  113.  
  114. // A container
  115. $pageData = new \stdClass();
  116. $pageData->baseUrl = rtrim($this->baseUrl(), '/') . '/';
  117. $pageData->simpleLayout = (isset($this->simpleLayout) || true == $this->simpleLayout);
  118.  
  119. // Fix SRCs and HREFs
  120. $headData = str_replace(
  121. array(
  122. 'src="/',
  123. 'href="/'
  124. ),
  125. array(
  126. 'src="' . $pageData->baseUrl,
  127. 'href="' . $pageData->baseUrl
  128. ),
  129. "{$this->headMeta()}\n{$this->headLink()}\n{$this->headScript()}" // Newlines keep the page source a bit cleaner
  130. );
  131.  
  132. // Add versioning for js and css
  133. $headData = str_replace(
  134. array(
  135. '.css"',
  136. '.js"'
  137. ),
  138. array(
  139. '.css?stwv=' . $config['version'] . '"',
  140. '.js?stwv=' . $config['version'] . '"',
  141. ),
  142. $headData
  143. );
  144.  
  145. $defaultLocation = $config['location']['coords']['default'];
  146. $lang = explode('_', $this->translate()->getTranslator()->getLocale());
  147.  
  148. // parameters for the tooltip display
  149. $messageStorageTime = $account['Settings']['MessageStorageMaxage'];
  150. $processStorageTime = $account['Settings']['ProcessStorageMaxage'];
  151.  
  152. if ($config['force']['display']['conversation']['tooltip']) {
  153. $messageStorageTime = $config['force']['message']['storage']['maxage'];
  154. }
  155.  
  156. $clientLogEnabled = $config['client']['log']['enabled'];
  157. $clientLogVerbose = $config['client']['log']['verbose'];
  158. $clientLogvoipEnabled = $config['client']['logvoip']['enabled'];
  159. $clientRemoteLogEnabled = $config['client']['remotelog']['enabled'];
  160.  
  161. // compute the google URIs
  162.  
  163. if (AuthenticatedUser::isAuthenticated()) {
  164.  
  165. $googleMapConfig = $this->pluginGetGoogleMapConfig();
  166.  
  167. // actvate the console log for certain subscribers if needed
  168. if (strlen($config['client']['log']['console']['msisdn']['list']) > 0) {
  169. $msisdnsList = explode(',', $config['client']['log']['console']['msisdn']['list']);
  170.  
  171. if (in_array($account['Msisdn'], $msisdnsList)) {
  172. $clientLogEnabled = true;
  173. $clientLogvoipEnabled = true;
  174. }
  175. }
  176.  
  177. // actvate the console log for certain subscribers if needed and send it to the backend
  178. if (strlen($config['client']['remotelog']['msisdn']['list']) > 0) {
  179. $msisdnsList = explode(',', $config['client']['remotelog']['msisdn']['list']);
  180.  
  181. if (in_array($account['Msisdn'], $msisdnsList)) {
  182. $clientLogEnabled = true;
  183. $clientLogvoipEnabled = true;
  184. $clientRemoteLogEnabled = true;
  185. }
  186. }
  187. } else {
  188. // build the recaptcha uri and inject the language
  189. $googleRecaptchaUri = $config['googleRecaptcha']['uri'];
  190. $googleRecaptchaUri = str_replace('KEYWORD_LANGUAGE', $lang[0], $googleRecaptchaUri);
  191. }
  192.  
  193. // Various data echoed below is idented with zero spaces and followed by a blank line
  194. // to avoid breaking identation of the outputed content
  195. ?>
  196. <!DOCTYPE html>
  197. <html lang="<?php echo str_replace('_', '-', $this->translate()->getTranslator()->getLocale()) ?>"
  198. skin="<?php echo $config['resources']['skin']['defaultSkin'];?>">
  199. <head>
  200. <meta name="description" content="" >
  201. <?php if ($request->getActionName() != 'nojavascript') { ?>
  202. <noscript><meta http-equiv="refresh" content="0; url=<?php echo $pageData->baseUrl; ?>index/nojavascript" /></noscript>
  203. <?php } ?>
  204.  
  205. <?php echo $this->headTitle() ?>
  206.  
  207. <link rel="shortcut icon" id="favicon-img" href="<?php echo $skinResource->getAssetUrl('favicon.ico');?>">
  208. <link rel="apple-touch-icon" href="<?php echo $skinResource->getAssetUrl('mobile-icons/touch-icon-iphone.png');?>">
  209. <link rel="apple-touch-icon" sizes="76x76" href="<?php echo $skinResource->getAssetUrl('mobile-icons/touch-icon-ipad.png');?>">
  210. <link rel="apple-touch-icon" sizes="120x120" href="<?php echo $skinResource->getAssetUrl('mobile-icons/touch-icon-iphone-retina.png');?>">
  211. <link rel="apple-touch-icon" sizes="152x152" href="<?php echo $skinResource->getAssetUrl('mobile-icons/touch-icon-ipad-retina.png');?>">
  212. <link rel="apple-touch-startup-image" href="<?php echo $skinResource->getAssetUrl('mobile-icons/startup.png');?>">
  213.  
  214. <?php if (!AuthenticatedUser::isAuthenticated() && $useGoogleReCaptchaApis):?>
  215. <script src="<?php echo $googleRecaptchaUri;?>" async defer></script>
  216. <?php endif;?>
  217.  
  218. <script type="text/javascript">
  219. var AbsoluteURL = "<?php echo $pageData->baseUrl; ?>";
  220. var ControllerName = "<?php echo $this->controllerName(); ?>";
  221. var ControllerAbsoluteURL = AbsoluteURL + ControllerName;
  222. var CountryCode = "<?php echo AuthenticatedUser::getCountryCode(); ?>";
  223. var FallbackCountryCode = "<?php echo $config['countryCode']['default']?>";
  224. var SocketToken = "<?php echo Session::getSocketIoKey();?>"
  225. var LogEnabled = <?php echo (($clientLogEnabled) ? 'true' : 'false');?>;
  226. var LogVerbose = <?php echo (($clientLogVerbose) ? 'true' : 'false');?>;
  227. var ProfilerEnabled = <?php echo (($config['client']['profiler']['enabled']) ? 'true' : 'false');?>;
  228. var CacheEnabled = <?php echo (($config['client']['cache']['enabled']) ? 'true' : 'false');?>;
  229. var AjaxTimeout = <?php echo $config['client']['ajaxTimeout'];?> * 1000;
  230. var CookiePrefix = "<?php echo $config['resources']['session']['name']; ?>";
  231. var CookieGlobalDomain = "<?php echo '.' . implode('.', array_slice(explode('.', $config['fqdn']), -2, 2)); ?>";
  232. var CookieNoExpirationPeriod = <?php echo 365 * $config['resources']['cookie']['no_expiration']; ?>;
  233. var CookieOnlySecure = <?php echo Cookie::onlySecureCookies() ? 'true' : 'false'; ?>;
  234. var LogoHideHeight = 650;
  235. var MinAudioRecordingDurationSeconds = <?php echo $config['client']['audio']['recording']['minDurationSeconds'] ?>;
  236. var MaxAudioRecordingDurationMinutes = <?php echo $config['client']['audio']['recording']['maxDurationMinutes'] ?>;
  237.  
  238. var UserLocation = {
  239. latitude: <?php echo $defaultLocation['latitude']; ?>,
  240. longitude: <?php echo $defaultLocation['longitude']; ?>
  241. };
  242.  
  243. <?php if (AuthenticatedUser::isAuthenticated()):?>
  244.  
  245. var MapProvider = <?php echo $mapProvider;?>;
  246.  
  247. var PasswordSecurityConfig = {
  248. minLength: <?php echo $config['account']['passwordSecurity']['minLength']; ?>,
  249. minLatinLowercase: <?php echo $config['account']['passwordSecurity']['minLatinLowercase']; ?>,
  250. minLatinUppercase: <?php echo $config['account']['passwordSecurity']['minLatinUppercase']; ?>,
  251. minArabicNumeral: <?php echo $config['account']['passwordSecurity']['minArabicNumeral']; ?>,
  252. specialCharsMin: <?php echo $config['account']['passwordSecurity']['specialChars']['min']; ?>,
  253. specialCharsList: <?php echo json_encode($config['account']['passwordSecurity']['specialChars']['list']); ?>
  254. };
  255. <?php
  256.  
  257. switch($mapProvider) {
  258.  
  259. case OrganizationRetrievalService::MAP_PROVIDER_GOOGLE:
  260. $providerName = 'googleMaps';
  261. break;
  262.  
  263. case OrganizationRetrievalService::MAP_PROVIDER_OSM:
  264. $providerName = 'osm';
  265. break;
  266.  
  267. case OrganizationRetrievalService::MAP_PROVIDER_ARCGIS_ADDOK_FACADE:
  268. $providerName = 'arcgisAddokFacade';
  269. break;
  270. }
  271. ?>
  272. var GeolocConfig = {
  273. map: {
  274. defaultZoom: <?php echo $config['mapProviders'][$providerName]['map']['defaultZoom'];?>
  275. },
  276. cluster: {
  277. maxZoom: <?php echo $config['mapProviders'][$providerName]['cluster']['maxZoom'];?>,
  278. maxZoomItinerary: <?php echo $config['mapProviders'][$providerName]['cluster']['maxZoomItinerary'];?>
  279. }
  280. };
  281. var GoogleConfig = {
  282. clusterGridSize: <?php echo $config['mapProviders']['googleMaps']['cluster']['gridSize'];?>,
  283. canUseMapsApis: <?php echo ($googleMapConfig['canUseMapsApis']) ? 'true' : 'false'?>,
  284. mapsApiUri: "<?php echo $googleMapConfig['mapsApiUri'];?>",
  285. mapsUri: "<?php echo $googleMapConfig['mapsUri']; ?>",
  286. additionalFiles: [
  287. "common/js/google/markerclusterer.min.js",
  288. "common/js/google/markerwithlabel.js",
  289. "common/js/google/richmarker.js"
  290. ]
  291. };
  292. var OsmConfig = {
  293. searchUri: "<?php echo $account['Settings']['OpenStreetMap']['SearchUrl']; ?>",
  294. tileUri: "<?php echo $account['Settings']['OpenStreetMap']['TilesUrl']; ?>",
  295. reverseGeocodingUri: "<?php echo $account['Settings']['OpenStreetMap']['GeocodingUrl']; ?>",
  296. additionalFiles: [
  297. "common/js/leaflet/leaflet.js",
  298. "common/js/leaflet/leaflet.markercluster.js",
  299. "common/js/leaflet/draw/draw.js",
  300. "common/js/leaflet/draw/Tooltip.js",
  301. "common/js/leaflet/draw/GeometryUtil.js",
  302. "common/js/leaflet/draw/Draw.Event.js",
  303. "common/js/leaflet/draw/Draw.Feature.js",
  304. "common/js/leaflet/draw/Draw.SimpleShape.js",
  305. "common/js/leaflet/draw/Draw.Rectangle.js",
  306. "common/js/leaflet/draw/Control.Draw.js"
  307. ]
  308. };
  309. <?php
  310. // the server may not be corectly configured
  311. $arcgisMaxZoom = !empty($account['Settings']['ArcgisAddokFacade']['MaxZoom']) ? $account['Settings']['ArcgisAddokFacade']['MaxZoom'] : 0;
  312. ?>
  313.  
  314. var ArcgisConfig = {
  315. searchUri: "<?php echo $account['Settings']['ArcgisAddokFacade']['SearchUrl']; ?>",
  316. tileUri: "<?php echo $account['Settings']['ArcgisAddokFacade']['TilesUrl']; ?>",
  317. reverseGeocodingUri: "<?php echo $account['Settings']['ArcgisAddokFacade']['GeocodingUrl']; ?>",
  318. maxZoom: "<?php echo $arcgisMaxZoom; ?>",
  319. additionalFiles: [
  320. "common/js/leaflet/leaflet.js",
  321. "common/js/leaflet/leaflet.markercluster.js",
  322. "common/js/leaflet/draw/draw.js",
  323. "common/js/leaflet/draw/Tooltip.js",
  324. "common/js/leaflet/draw/GeometryUtil.js",
  325. "common/js/leaflet/draw/Draw.Event.js",
  326. "common/js/leaflet/draw/Draw.Feature.js",
  327. "common/js/leaflet/draw/Draw.SimpleShape.js",
  328. "common/js/leaflet/draw/Draw.Rectangle.js",
  329. "common/js/leaflet/draw/Control.Draw.js"
  330. ]
  331. };
  332. var DispatcherPinConfig = {
  333. defaultIcon: "<?php echo $config['dispatcherPin']['defaultIcon'];?>",
  334. defaultColor: "<?php echo $config['dispatcherPin']['defaultColor'];?>",
  335. sendSinglePinAsAddress: <?php echo ($config['dispatcherPin']['sendSinglePinAsAddress']) ? 'true' : 'false';?>
  336. };
  337. var NodeJsPort = <?php echo $config['port']; ?>;
  338. var NodeJsIp = "<?php echo $config['fqdn']; ?>";
  339. var NodeJsProtocol = "<?php echo $config['nodejs']['protocol']; ?>";
  340. var LogVoipEnabled = <?php echo (($clientLogvoipEnabled) ? 'true' : 'false');?>;
  341. var RemoteLogEnabled = <?php echo (($clientRemoteLogEnabled) ? 'true' : 'false');?>;
  342. var RemoteLogBatchSize = "<?php echo $config['client']['remotelog']['batchSize'];?>";
  343. var RemoteLogTimeInterval = "<?php echo $config['client']['remotelog']['timeInterval'];?>";
  344. var Msisdn = "<?php echo $account['Msisdn']; ?>";
  345. var LoggedInMsisdn = "<?php echo $account['Msisdn']; ?>";
  346. var LoggedInFqdn = "<?php echo $account['Fqdn']; ?>";
  347. <?php
  348. $loggedInName = addslashes(json_encode($account['FirstName'] . ' ' . $account['LastName']));
  349. ?>
  350. var LoggedInName = '<?php echo $loggedInName; ?>';
  351. var LoggedInRole = "<?php echo AuthenticatedUser::getRole(); ?>";
  352. var Emoji = [<?php echo '"' . implode('","', array_keys($config['emoji'])) . '"'; ?>];
  353. var EmojiUnicode = [<?php echo '"' . implode('","', array_values($config['emoji'])) . '"'; ?>];
  354. var DesktopNotificationPopup = <?php echo $config['desktopNotifications']['popup']; ?>;
  355. var DesktopNotificationSound = <?php echo $config['desktopNotifications']['sound']; ?>;
  356. var CallNotificationPopupDisplayTime = <?php echo $config['callNotifications']['popupDisplayTime']; ?>;
  357. var ClientActiveTtl = <?php echo $config['client']['active']['timeout']; ?>;
  358. var ClientBroadcastGroup = <?php echo (($config['client']['broadcast']['group']) ? 'true' : 'false'); ?>;
  359. var ClientSubscriberDataInfoDisplayTime = <?php echo $config['client']['subscriberData']['refresh']['infoDisplayTime']; ?>;
  360. var ClientSubscriberDataRequestTimeout = <?php echo $config['client']['subscriberData']['refresh']['requestTimeout']; ?>;
  361. var ClientSubscriberDataRecentRequestsLifetime = <?php echo $config['client']['subscriberData']['refresh']['recentRequestsLifetime']; ?>;
  362. var ClientSubscriberDataOldIfOlderThan = <?php echo $config['client']['subscriberData']['oldIfOlderThan']; ?>;
  363. var ClientMessagesRecordsOnPage = <?php echo $config['client']['messages']['recordsOnPage'];?>;
  364. var ClientMessagesRecordsOnPageBeforAndAfter = <?php echo $config['client']['messages']['recordsOnPageBeforeAndAfter'];?>;
  365. var ClientMessagesAreaAutoResizeLines = <?php echo ($config['client']['messages']['areaAutoResizeLines']); ?>;
  366. var ClientDefaultDistanceUnit = "<?php echo $config['settings']['dispatchConsole']['distanceUnit'][Session::getLanguage()];?>";
  367. // DEPRECATED VARIABLES
  368. var ClientConversationsRecordsOnPageFirstRun = 0;
  369. var ClientConversationsRecordsOnPageExtraRun = 0;
  370. var ClientConversationsRecordsOnPage = <?php echo $config['client']['conversations']['recordsOnPage'];?>;
  371. var ClientAggregationFreeCall = <?php echo (($config['client']['aggregation']['freeCall']['enabled']) ? 'true' : 'false');?>;
  372. var ClientAggregationWalkieTalkie = <?php echo (($config['client']['aggregation']['walkieTalkie']['enabled']) ? 'true' : 'false');?>;
  373. var ClientDefaultPage = "<?php echo $config['settings']['defaultPage']['default'];?>";
  374. var MessageMaxSizeWithThumbnail = <?php echo $config['message']['maxSize']['withThumbnail']; ?>;
  375. var MessageMaxSizeWithoutThumbnail = <?php echo $config['message']['maxSize']['withoutThumbnail']; ?>;
  376. var MessageMaxRecipients = <?php echo $account['Settings']['MessageRecipientsMax']; ?>;
  377. var MessageTimeout = <?php echo $config['message']['timeout'] * 1000; ?>;
  378. var MessageStorageTime = <?php echo $messageStorageTime; ?>;
  379. var ProcessStorageTime = <?php echo $processStorageTime; ?>;
  380. var LinkPreviewIntegrationEnabled = <?php echo (($config['embedly']['key'] != '') ? 'true' : 'false'); ?>;
  381. var STWV = "<?php echo $config['version']; ?>";
  382. var EmailForwardingWithAttachment = <?php echo (($config['forward']['email']['message']['attachment']['enabled']) ? 'true' : 'false'); ?>;
  383. var UserPictureWidthMax = <?php echo $config['user']['picture']['width']['max']; ?>;
  384. var UserPictureHeightMax = <?php echo $config['user']['picture']['height']['max']; ?>;
  385. var WtFloorSoundsEnabled = <?php echo (($config['client']['wt']['floorSounds']['enabled']) ? 'true' : 'false'); ?>;
  386. var ChannelsFloorKeys = [<?php echo '"' . implode('","', array_values($config['channels']['floorKeys'])) . '"'; ?>];
  387. var SoundList = [<?php echo '"' . implode('","', $this->pluginGetSoundsList()) . '"'; ?>];
  388. var AssetsUrls = {};
  389. var EmergencyAlert = {
  390. dropAllCalls: <?php echo (($config['emergencyAlert']['dropAllCalls']) ? 'true' : 'false'); ?>
  391. }
  392. var StreamingConfig = {
  393. popupWidth: <?php echo $config['client']['streaming']['popup']['width']; ?>,
  394. popupHeight: <?php echo $config['client']['streaming']['popup']['height']; ?>
  395. };//emergencyAlert.sound.volumeDefault
  396. var Formatting = <?php echo json_encode(isset($config['formatting'][$this->translate()->getTranslator()->getLocale()]) ? $config['formatting'][$this->translate()->getTranslator()->getLocale()] : $config['formatting']['default']); ?>;
  397. var SoundVolume = {
  398. emergencyAlertDefault: <?php echo $config['soundVolume']['emergencyAlert']['default'];?>,
  399. emergencyAlertWhileInCall: <?php echo $config['soundVolume']['emergencyAlert']['whileInCall'];?>,
  400. pttFloorControl: <?php echo $config['soundVolume']['ptt']['floorControl'];?>,
  401. voipRingTone: <?php echo $config['soundVolume']['ringTone']['voip'];?> ,
  402. pttRingTone: <?php echo $config['soundVolume']['ringTone']['ptt'];?>
  403. }
  404. <?php
  405. foreach($assetsUrl as $assetName => $assetUrl) {
  406. echo ' AssetsUrls["' . $assetName . '"] = "' . $assetUrl . '";' . PHP_EOL;
  407. }
  408. ?>
  409.  
  410. var WebRtcConfig = {
  411. webSocketServerPattern: "<?php
  412.  
  413. if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS'])) {
  414. echo $config['webrtc']['webSocketServerSecurePattern'];
  415. } else {
  416. echo $config['webrtc']['webSocketServerPattern'];
  417. }
  418.  
  419. ?>",
  420. serverUriPattern: "<?php echo $config['webrtc']['serverUriPattern'] ?>",
  421. serverUriIsAlivePattern: "<?php echo $config['webrtc']['serverUriIsAlivePattern'] ?>",
  422. callBannerinfoDisplayTime: <?php echo $config['webrtc']['callBanner']['infoDisplayTime'] ?>,
  423. callMaxParticipants: <?php echo $account['Settings']['CallRecipientsMax']; ?>,
  424. hideAllSupervisorsSameLevel: <?php echo $config['webrtc']['callBanner']['hideAllSupervisorsSameLevel']; ?>,
  425. keepAliveTimeout: <?php echo $config['webrtc']['keepAliveTimeout']; ?>
  426. };
  427. var CallOutConfig = {
  428. dialerKeysSound: <?php echo (empty ($config['callOut']['dialer']['keysSound']) ? 'null' : ('"' . $config['callOut']['dialer']['keysSound'] . '"')); ?>
  429.  
  430. };
  431. var WebchatURI = "<?php echo $config["uri"]; ?>";
  432.  
  433. var Settings = {
  434. desktopNotificationSound: "<?php echo $config['settings']['desktopNotifications']['default']['sound']; ?>",
  435. desktopNotificationSoundMyBusiness: "<?php echo $config['settings']['desktopNotifications']['default']['sound']; ?>",
  436. voipRingToneSound: "<?php echo $config['settings']['voipRingTone']['default']['sound']; ?>",
  437. walkieTalkieRingToneSound: "<?php echo $config['settings']['pttRingTone']['default']['sound']; ?>",
  438. walkieTalkieAutoresponse: "<?php echo $config['settings']['walkieTalkie']['autoresponse']['default']; ?>",
  439. callAutoresponse: "<?php echo $config['settings']['call']['autoresponse']['default']; ?>",
  440. interfaceLanguage: "<?php echo $this->translate()->getTranslator()->getLocale(); ?>",
  441. contactClickDefaultAction: "<?php echo $config['settings']['contactActionClick']['default']; ?>",
  442. defaultSendButton: "<?php echo $config['settings']['defaultSendButton']['default']; ?>",
  443. defaultPage: "<?php echo $config['settings']['defaultPage']['default']; ?>",
  444. defaultMyBusinessTab: "<?php echo $config['settings']['defaultMyBusinessTab']['default']; ?>",
  445. channelsPlaybackMode: "<?php echo $config['settings']['channelsPlaybackMode']['priority']; ?>",
  446. hearOtherChannelsWhileTalking : "<?php echo $config['settings']['channelsPlaybackMode']['hearOthersWhileRalking']; ?>",
  447. conversationWithOnDutyContacts : "<?php echo $config['settings']['conversationWithOnDutyContacts']['default']; ?>",
  448. }
  449.  
  450.  
  451. <?php if (isset($account['ProcessReports'])) : ?>
  452. Settings['CanRequestProcessReports'] = true;
  453. Settings['WithAttachments'] = <?php echo (
  454. isset($account['ProcessReports']['WithAttachments']) && $account['ProcessReports']['WithAttachments']
  455. ) ? '1' : '0'; ?>;
  456. <?php endif; ?>
  457.  
  458. <?php if (AuthenticatedUser::getRole() == Role::ROLE_DISPATCH_MANAGER):?>
  459. Settings.dispatchConsoleDistanceUnit = "<?php echo Cookie::getDistanceUnit(); ?>";
  460. <?php endif;?>
  461. <?php endif;?>
  462. var LdapActive = <?php echo (($config['authentication']['ldap']['active']) ? 'true' : 'false'); ?>;
  463. var MyBusinessFeatureAllowed = <?php echo (($myBusinessFeatureAllowed) ? 'true' : 'false'); ?>;
  464. var MyBusinessCfg = {
  465. processesRecordsOnPage: <?php echo $config['myBusiness']['processesRecordsOnPage']?>,
  466. dueStateTimeout: <?php echo $config['myBusiness']['dueStateTimeout'];?>,
  467. expirationStateTimeout: <?php echo $config['myBusiness']['expirationStateTimeout'];?>,
  468. notificationsCheckInterval: <?php echo $config['myBusiness']['notificationsCheckInterval'];?>,
  469. historyCompareMaxVersionsNumber: <?php echo $config['myBusiness']['historyCompareMaxVersionsNumber'];?>,
  470. maxSuggestions: <?php echo $config['myBusiness']['maxSuggestions'];?>,
  471. gridDebug: <?php echo (((bool) $config['myBusiness']['gridDebug']) ? 'true' : 'false'); ?>,
  472. saveProcessOnWindowClose: <?php echo (((bool) $config['client']['myBusiness']['process']['saveOnWindowClose']) ? 'true' : 'false'); ?>,
  473. reportingDefaultFilterInterval: <?php echo $config['myBusiness']['reporting']['defaultFilterInterval'];?>,
  474. reportingMaxUsersInDropdown: <?php echo $config['myBusiness']['reporting']['maxUsersInDropdown'];?>,
  475. reportingBatchSize: <?php echo $config['myBusiness']['reporting']['batchSize'];?>,
  476. allowProcessCreationFromCSV: <?php echo (isset($account['MyBusiness']['ImportCsv']) && $account['MyBusiness']['ImportCsv']) ? 'true' : 'false'; ?>,
  477. lastProcessExportDate: <?php $date = AuthenticatedUser::getSubscriberProperty('LastProcessExportDate'); echo (is_null($date)) ? 'null' : '"' . $date . '"'?>,
  478. externalSystem: {
  479. tokenTtl: {
  480. direct: <?php echo $config['myBusiness']['externalSystem']['tokenTtl']['direct']; ?>,
  481. selection: <?php echo $config['myBusiness']['externalSystem']['tokenTtl']['selection']; ?>
  482.  
  483. }
  484. },
  485. processesCleaning: {
  486. dayOfTheWeek: <?php echo $config['myBusiness']['processesCleaning']['dayOfTheWeek']; ?>,
  487. dayOfTheMonth: <?php echo $config['myBusiness']['processesCleaning']['dayOfTheMonth']; ?>
  488. },
  489. processesExport: {
  490. downloadAlias: "<?php echo $config['myBusiness']['processesExport']['downloadAlias']; ?>"
  491. }
  492. };
  493.  
  494. var SearchContactsCfg = {
  495. minKeywordLength: <?php echo $config['contactsSearch']['minKeywordLength']?>,
  496. triggerTimerTimeout: <?php echo $config['contactsSearch']['triggerTimerTimeout']?>,
  497. recordsOnPage: <?php echo $config['contactsSearch']['recordsOnPage']?>
  498. }
  499.  
  500. var BellNotificationsCfg = {
  501. maxDisplayedItems: <?php echo $config['bellNotifications']['maxDisplayedItems']?>
  502. }
  503.  
  504. </script>
  505. <?php
  506. echo $this->pluginInsertConversationSearchSettings();
  507. echo $this->pluginInjectLocale();
  508. echo $headData . PHP_EOL;
  509. ?>
  510. <base href="<?php echo $pageData->baseUrl; ?>">
  511. </head>
  512.  
  513. <?php
  514.  
  515. $bodyClass = $this->translate()->getTranslator()->getLocale();
  516.  
  517. $userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, 'UTF-8') : '';
  518.  
  519. preg_match('/Firefox\/[0-9\.]+/', $userAgent, $matches);
  520.  
  521. if (count($matches)) {
  522. // there are IMPORTANT customers like PCSTorm which uses ancient versions of Firefox
  523. // those versions requires hacks in order to work properly
  524. $firefoxVersion = (float) explode('/', $matches[0])[1];
  525.  
  526. if ($firefoxVersion <= 52) {
  527. $bodyClass .= ' firefox-old';
  528. }
  529.  
  530. }
  531. ?>
  532.  
  533. <?php echo '
  534. <!--[if IE 8]><body class="ie8 ' . $bodyClass . '"><![endif]-->
  535. <!--[if IE 9]><body class="ie9 ' . $bodyClass . '"><![endif]-->
  536. <!--[if gt IE 9]><!--><body class="' . $bodyClass . '"><!--<![endif]-->
  537. '; ?>
  538.  
  539. <?php echo '<!-- Detect if IE -->'; ?>
  540.  
  541. <?php if (preg_match('~MSIE|Internet Explorer~i', $userAgent) || preg_match('/Edge/i', $userAgent) || (strpos($userAgent, 'Trident/7.0; rv:11.0') !== false)): ?>
  542. <?php
  543. $alert = $this->translate('global_ie_not_supported');
  544. echo("<script type='text/javascript'> alert('" . str_replace("%skin%", $this->translate('js_all_skin'), $alert) . "'); </script>");
  545. ?>
  546. <?php else: ?>
  547. <?php echo '<!-- -->'; ?>
  548.  
  549. <div id="images-cache" style="display:none">
  550. <img width="1" height="1" alt="" src="<?php echo rtrim($this->baseUrl(), '/') . '/' . 'styles/skin-base/assets/';?>disconnect-wheel.png">
  551. </div>
  552.  
  553. <?php if (AuthenticatedUser::isAuthenticated()):?>
  554. <div class="webrtc-media">
  555. <audio id="webrtc-local-media"></audio>
  556. <audio id="webrtc-remote-media"></audio>
  557. </div>
  558. <?php endif;?>
  559. <?php echo '<!-- Preload all the fonts -->'; ?>
  560. <div style="visibility: hidden; position: absolute">
  561. <span style="font-family: 'Specific-font', Arial, Helvetica, sans-serif;"></span>
  562. <span style="font-family: 'Specific-font-bold', Arial, Helvetica, sans-serif;"></span>
  563. <span style="font-family: 'General-font', Arial, Helvetica, sans-serif;"></span>
  564. <span style="font-family: 'General-font-bold', Arial, Helvetica, sans-serif;"></span>
  565. <span style="font-family: 'General-font-select', Arial, Helvetica, sans-serif;"></span>
  566. </div>
  567. <?php echo '<!-- Top menu bar -->'; ?>
  568. <?php if ($request->getActionName() != 'login' && $request->getActionName() != 'error' && $request->getActionName() != 'nojavascript') : ?>
  569. <?php include(__DIR__ . '/_include/main-menu.phtml')?>
  570. <?php endif; ?>
  571. <?php echo '<!-- The jPlayer div must not be hidden. Keep it at the root of the body element to avoid any such problems. -->'; ?>
  572. <div class="container body-container">
  573. <div class="fixed-layout">
  574. <div class="areas-splitter"></div>
  575. <div class="controllers-space"></div>
  576. <?php echo $this->layout()->content;?>
  577. </div>
  578. </div>
  579.  
  580. <?php
  581. if (AuthenticatedUser::isAuthenticated()) {
  582. include(__DIR__ . '/conversations/global-layout.phtml');
  583. include(__DIR__ . '/mybusiness/global-layout.phtml');
  584. include(__DIR__ . '/geolocation/global-layout.phtml');
  585.  
  586. ?>
  587. <div id="call-banner-manager"></div>
  588. <?php include(__DIR__ . '/forwarder/forwarder.phtml');?>
  589. <?php
  590. }
  591. ?>
  592. <div class="modal-dialogs">
  593. <div class="background"></div>
  594. <div class="dialogs container-fluid"></div>
  595. </div>
  596. <div id="js-templates">
  597. <?php include(__DIR__ . '/_include/js_information_dialog.phtml')?>
  598. <?php include(__DIR__ . '/_include/js_confirmation_dialog.phtml')?>
  599. <?php include(__DIR__ . '/_include/js_call_notification_dialog.phtml')?>
  600. <?php include(__DIR__ . '/_include/js_dialog_container.phtml')?>
  601. <?php include(__DIR__ . '/_include/js_error_notification.phtml')?>
  602. <?php include(__DIR__ . '/_include/js_popover-menu.phtml')?>
  603. <?php include(__DIR__ . '/geolocation/dispatcher-pin-icons-selector.phtml')?>
  604. <?php include(__DIR__ . '/notifications/notifications-panel.phtml') ?>
  605. <div style="display: none">
  606. <?php include(__DIR__ . '/notifications/notification-item.phtml')?>
  607. <?php include(__DIR__ . '/messages/attachment-caption-layer.phtml')?>
  608. <?php include(__DIR__ . '/messages/unread-monitor-layer-controls.phtml')?>
  609. <?php include(__DIR__ . '/contacts-selector-layer/contacts-selector-layer.phtml')?>
  610. <?php include(__DIR__ . '/contacts-selector-layer/contacts-selector-item.phtml')?>
  611. <?php include(__DIR__ . '/call-out/call-out-button.phtml')?>
  612. <?php include(__DIR__ . '/call-out/call-out-keyboard.phtml')?>
  613. <?php include(__DIR__ . '/_include/sliding-layer-slide.phtml')?>
  614. <?php include(__DIR__ . '/quota/quota-renderer.phtml')?>
  615. <?php include(__DIR__ . '/mybusiness/import-export/processes-exporting-modal.phtml')?>
  616. </div>
  617. </div>
  618. <div id="popup-templates" style="display: none">
  619. <?php include(__DIR__ . '/_include/call-popup.phtml')?>
  620. </div>
  621. <div id="popover-menu-global-container"></div>
  622. <?php echo '<!-- End page content -->'; ?>
  623. <?php endif; ?>
  624. </body>
  625. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement