Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * StreamWIDE SmartMS
- *
- * @category Streamwide
- * @package WebChatFrontend
- * @subpackage Layout
- * @copyright Copyright (c) 2014 StreamWIDE
- * @author Silviu Ghita <sghita@streamwide.ro>
- */
- use SwSmartMS\WebChatFrontend\WebApplication\Util\Registry;
- use SwSmartMS\WebChatFrontend\WebApplication\Util\AuthenticatedUser;
- use SwSmartMS\WebChatFrontend\WebApplication\Application\Resource\Session;
- use SwSmartMS\WebChatFrontend\WebApplication\Acl\Role;
- use SwSmartMS\WebChatFrontend\WebApplication\Application\Resource\Cookie;
- use SwSmartMS\WebChatFrontend\WebApplication\Service\Organization\OrganizationRetrievalService;
- $config = Registry::getConfig();
- $skinResource = Registry::getSkinResource();
- $assetsUrl = $this->pluginGetAssetsUrlForJS();
- $this->headMeta()
- ->appendHttpEquiv('X-UA-Compatible', 'IE=edge')
- ->setName('viewport', 'width=1260, user-scalable=no')
- ->appendHttpEquiv('content-type', 'text/html; charset=' . $this->getEncoding());
- // the request object which is sused to provide details about urls and language
- $request = Registry::getRequest();
- $account = AuthenticatedUser::getSubscriberAccount();
- $mapProvider = null;
- if (AuthenticatedUser::isAuthenticated()) {
- $mapProvider = $account['Organization']['MapProvider'];
- }
- $useGoogleReCaptchaApis = AuthenticatedUser::canUseGoogleReCaptchaApis();
- $myBusinessFeatureAllowed = $account['AllowMyBusiness'];
- $commonStyles = array(
- '/common/styles/jquery-ui-1.10/jquery-ui-1.10.4.custom.css',
- '/common/styles/bootstrap-3.3.6/bootstrap.css',
- '/common/styles/bootstrap-3.3.6/bootstrap-theme.css',
- '/common/styles/intlTelInput.css',
- '/common/styles/perfect-scrollbar.min.css',
- '/common/styles/select2/select2.css'
- );
- if (AuthenticatedUser::isAuthenticated()) {
- $commonStyles[] = '/common/styles/drawingboard/drawingboard.min.css';
- }
- krsort($commonStyles);
- $this->pluginPrependStyles($commonStyles);
- $this->headScript()->appendFile(
- '/common/js/html5shiv.3.7.0.min.js',
- 'text/javascript',
- array('conditional' => 'lt IE 9')
- );
- $this->headScript()->appendFile(
- '/common/js/respond.1.4.2.min.js',
- 'text/javascript',
- array('conditional' => 'lt IE 9')
- );
- $moduleSources = $skinResource->getEmbeddedFiles();
- if (AuthenticatedUser::isAuthenticated()) {
- // emoji
- $this->headLink()->appendStylesheet('/common/styles/emoji.css');
- $this->headLink()->appendStylesheet('/common/styles/jquery.emojiarea.css');
- $this->headLink()->appendStylesheet('/common/js/datetimepicker/bootstrapjs/bootstrap-datetimepicker.min.css');
- $this->headScript()->prependScript('var colorCodes = ' . $skinResource->exportColorsToJs());
- // media players
- $this->headLink()->appendStylesheet('/common/styles/jplayer/audio.player.css');
- $this->headLink()->appendStylesheet('/common/styles/jplayer/video.player.css');
- $this->headScript()->prependScript($this->getHelper('TemplateConsolidator')->getScript());
- // leaflet
- $this->headLink()->appendStylesheet('/common/js/leaflet/leaflet.css');
- $this->headLink()->appendStylesheet('/common/js/leaflet/leaflet.markercluster.css');
- // spectrum (jQuery color-picker)
- $this->headLink()->appendStylesheet('/common/js/spectrum/spectrum.css');
- }
- foreach($moduleSources as $source) {
- $this->headLink()->appendStylesheet($source);
- }
- if (AuthenticatedUser::isAuthenticated()) {
- $this->headScript()->appendFile('/common/js/webrtc/swsipvoip.js');
- $this->headScript()->appendFile('/js/unified/common.js');
- $this->headScript()->appendFile('/js/unified/base.js');
- if ($myBusinessFeatureAllowed) {
- $this->headScript()->appendFile('/js/unified/mybusiness.js');
- }
- } else {
- $this->headScript()->appendFile('/js/unified/login-common.js');
- $this->headScript()->appendFile('/js/unified/login.js');
- }
- // A container
- $pageData = new \stdClass();
- $pageData->baseUrl = rtrim($this->baseUrl(), '/') . '/';
- $pageData->simpleLayout = (isset($this->simpleLayout) || true == $this->simpleLayout);
- // Fix SRCs and HREFs
- $headData = str_replace(
- array(
- 'src="/',
- 'href="/'
- ),
- array(
- 'src="' . $pageData->baseUrl,
- 'href="' . $pageData->baseUrl
- ),
- "{$this->headMeta()}\n{$this->headLink()}\n{$this->headScript()}" // Newlines keep the page source a bit cleaner
- );
- // Add versioning for js and css
- $headData = str_replace(
- array(
- '.css"',
- '.js"'
- ),
- array(
- '.css?stwv=' . $config['version'] . '"',
- '.js?stwv=' . $config['version'] . '"',
- ),
- $headData
- );
- $defaultLocation = $config['location']['coords']['default'];
- $lang = explode('_', $this->translate()->getTranslator()->getLocale());
- // parameters for the tooltip display
- $messageStorageTime = $account['Settings']['MessageStorageMaxage'];
- $processStorageTime = $account['Settings']['ProcessStorageMaxage'];
- if ($config['force']['display']['conversation']['tooltip']) {
- $messageStorageTime = $config['force']['message']['storage']['maxage'];
- }
- $clientLogEnabled = $config['client']['log']['enabled'];
- $clientLogVerbose = $config['client']['log']['verbose'];
- $clientLogvoipEnabled = $config['client']['logvoip']['enabled'];
- $clientRemoteLogEnabled = $config['client']['remotelog']['enabled'];
- // compute the google URIs
- if (AuthenticatedUser::isAuthenticated()) {
- $googleMapConfig = $this->pluginGetGoogleMapConfig();
- // actvate the console log for certain subscribers if needed
- if (strlen($config['client']['log']['console']['msisdn']['list']) > 0) {
- $msisdnsList = explode(',', $config['client']['log']['console']['msisdn']['list']);
- if (in_array($account['Msisdn'], $msisdnsList)) {
- $clientLogEnabled = true;
- $clientLogvoipEnabled = true;
- }
- }
- // actvate the console log for certain subscribers if needed and send it to the backend
- if (strlen($config['client']['remotelog']['msisdn']['list']) > 0) {
- $msisdnsList = explode(',', $config['client']['remotelog']['msisdn']['list']);
- if (in_array($account['Msisdn'], $msisdnsList)) {
- $clientLogEnabled = true;
- $clientLogvoipEnabled = true;
- $clientRemoteLogEnabled = true;
- }
- }
- } else {
- // build the recaptcha uri and inject the language
- $googleRecaptchaUri = $config['googleRecaptcha']['uri'];
- $googleRecaptchaUri = str_replace('KEYWORD_LANGUAGE', $lang[0], $googleRecaptchaUri);
- }
- // Various data echoed below is idented with zero spaces and followed by a blank line
- // to avoid breaking identation of the outputed content
- ?>
- <!DOCTYPE html>
- <html lang="<?php echo str_replace('_', '-', $this->translate()->getTranslator()->getLocale()) ?>"
- skin="<?php echo $config['resources']['skin']['defaultSkin'];?>">
- <head>
- <meta name="description" content="" >
- <?php if ($request->getActionName() != 'nojavascript') { ?>
- <noscript><meta http-equiv="refresh" content="0; url=<?php echo $pageData->baseUrl; ?>index/nojavascript" /></noscript>
- <?php } ?>
- <?php echo $this->headTitle() ?>
- <link rel="shortcut icon" id="favicon-img" href="<?php echo $skinResource->getAssetUrl('favicon.ico');?>">
- <link rel="apple-touch-icon" href="<?php echo $skinResource->getAssetUrl('mobile-icons/touch-icon-iphone.png');?>">
- <link rel="apple-touch-icon" sizes="76x76" href="<?php echo $skinResource->getAssetUrl('mobile-icons/touch-icon-ipad.png');?>">
- <link rel="apple-touch-icon" sizes="120x120" href="<?php echo $skinResource->getAssetUrl('mobile-icons/touch-icon-iphone-retina.png');?>">
- <link rel="apple-touch-icon" sizes="152x152" href="<?php echo $skinResource->getAssetUrl('mobile-icons/touch-icon-ipad-retina.png');?>">
- <link rel="apple-touch-startup-image" href="<?php echo $skinResource->getAssetUrl('mobile-icons/startup.png');?>">
- <?php if (!AuthenticatedUser::isAuthenticated() && $useGoogleReCaptchaApis):?>
- <script src="<?php echo $googleRecaptchaUri;?>" async defer></script>
- <?php endif;?>
- <script type="text/javascript">
- var AbsoluteURL = "<?php echo $pageData->baseUrl; ?>";
- var ControllerName = "<?php echo $this->controllerName(); ?>";
- var ControllerAbsoluteURL = AbsoluteURL + ControllerName;
- var CountryCode = "<?php echo AuthenticatedUser::getCountryCode(); ?>";
- var FallbackCountryCode = "<?php echo $config['countryCode']['default']?>";
- var SocketToken = "<?php echo Session::getSocketIoKey();?>"
- var LogEnabled = <?php echo (($clientLogEnabled) ? 'true' : 'false');?>;
- var LogVerbose = <?php echo (($clientLogVerbose) ? 'true' : 'false');?>;
- var ProfilerEnabled = <?php echo (($config['client']['profiler']['enabled']) ? 'true' : 'false');?>;
- var CacheEnabled = <?php echo (($config['client']['cache']['enabled']) ? 'true' : 'false');?>;
- var AjaxTimeout = <?php echo $config['client']['ajaxTimeout'];?> * 1000;
- var CookiePrefix = "<?php echo $config['resources']['session']['name']; ?>";
- var CookieGlobalDomain = "<?php echo '.' . implode('.', array_slice(explode('.', $config['fqdn']), -2, 2)); ?>";
- var CookieNoExpirationPeriod = <?php echo 365 * $config['resources']['cookie']['no_expiration']; ?>;
- var CookieOnlySecure = <?php echo Cookie::onlySecureCookies() ? 'true' : 'false'; ?>;
- var LogoHideHeight = 650;
- var MinAudioRecordingDurationSeconds = <?php echo $config['client']['audio']['recording']['minDurationSeconds'] ?>;
- var MaxAudioRecordingDurationMinutes = <?php echo $config['client']['audio']['recording']['maxDurationMinutes'] ?>;
- var UserLocation = {
- latitude: <?php echo $defaultLocation['latitude']; ?>,
- longitude: <?php echo $defaultLocation['longitude']; ?>
- };
- <?php if (AuthenticatedUser::isAuthenticated()):?>
- var MapProvider = <?php echo $mapProvider;?>;
- var PasswordSecurityConfig = {
- minLength: <?php echo $config['account']['passwordSecurity']['minLength']; ?>,
- minLatinLowercase: <?php echo $config['account']['passwordSecurity']['minLatinLowercase']; ?>,
- minLatinUppercase: <?php echo $config['account']['passwordSecurity']['minLatinUppercase']; ?>,
- minArabicNumeral: <?php echo $config['account']['passwordSecurity']['minArabicNumeral']; ?>,
- specialCharsMin: <?php echo $config['account']['passwordSecurity']['specialChars']['min']; ?>,
- specialCharsList: <?php echo json_encode($config['account']['passwordSecurity']['specialChars']['list']); ?>
- };
- <?php
- switch($mapProvider) {
- case OrganizationRetrievalService::MAP_PROVIDER_GOOGLE:
- $providerName = 'googleMaps';
- break;
- case OrganizationRetrievalService::MAP_PROVIDER_OSM:
- $providerName = 'osm';
- break;
- case OrganizationRetrievalService::MAP_PROVIDER_ARCGIS_ADDOK_FACADE:
- $providerName = 'arcgisAddokFacade';
- break;
- }
- ?>
- var GeolocConfig = {
- map: {
- defaultZoom: <?php echo $config['mapProviders'][$providerName]['map']['defaultZoom'];?>
- },
- cluster: {
- maxZoom: <?php echo $config['mapProviders'][$providerName]['cluster']['maxZoom'];?>,
- maxZoomItinerary: <?php echo $config['mapProviders'][$providerName]['cluster']['maxZoomItinerary'];?>
- }
- };
- var GoogleConfig = {
- clusterGridSize: <?php echo $config['mapProviders']['googleMaps']['cluster']['gridSize'];?>,
- canUseMapsApis: <?php echo ($googleMapConfig['canUseMapsApis']) ? 'true' : 'false'?>,
- mapsApiUri: "<?php echo $googleMapConfig['mapsApiUri'];?>",
- mapsUri: "<?php echo $googleMapConfig['mapsUri']; ?>",
- additionalFiles: [
- "common/js/google/markerclusterer.min.js",
- "common/js/google/markerwithlabel.js",
- "common/js/google/richmarker.js"
- ]
- };
- var OsmConfig = {
- searchUri: "<?php echo $account['Settings']['OpenStreetMap']['SearchUrl']; ?>",
- tileUri: "<?php echo $account['Settings']['OpenStreetMap']['TilesUrl']; ?>",
- reverseGeocodingUri: "<?php echo $account['Settings']['OpenStreetMap']['GeocodingUrl']; ?>",
- additionalFiles: [
- "common/js/leaflet/leaflet.js",
- "common/js/leaflet/leaflet.markercluster.js",
- "common/js/leaflet/draw/draw.js",
- "common/js/leaflet/draw/Tooltip.js",
- "common/js/leaflet/draw/GeometryUtil.js",
- "common/js/leaflet/draw/Draw.Event.js",
- "common/js/leaflet/draw/Draw.Feature.js",
- "common/js/leaflet/draw/Draw.SimpleShape.js",
- "common/js/leaflet/draw/Draw.Rectangle.js",
- "common/js/leaflet/draw/Control.Draw.js"
- ]
- };
- <?php
- // the server may not be corectly configured
- $arcgisMaxZoom = !empty($account['Settings']['ArcgisAddokFacade']['MaxZoom']) ? $account['Settings']['ArcgisAddokFacade']['MaxZoom'] : 0;
- ?>
- var ArcgisConfig = {
- searchUri: "<?php echo $account['Settings']['ArcgisAddokFacade']['SearchUrl']; ?>",
- tileUri: "<?php echo $account['Settings']['ArcgisAddokFacade']['TilesUrl']; ?>",
- reverseGeocodingUri: "<?php echo $account['Settings']['ArcgisAddokFacade']['GeocodingUrl']; ?>",
- maxZoom: "<?php echo $arcgisMaxZoom; ?>",
- additionalFiles: [
- "common/js/leaflet/leaflet.js",
- "common/js/leaflet/leaflet.markercluster.js",
- "common/js/leaflet/draw/draw.js",
- "common/js/leaflet/draw/Tooltip.js",
- "common/js/leaflet/draw/GeometryUtil.js",
- "common/js/leaflet/draw/Draw.Event.js",
- "common/js/leaflet/draw/Draw.Feature.js",
- "common/js/leaflet/draw/Draw.SimpleShape.js",
- "common/js/leaflet/draw/Draw.Rectangle.js",
- "common/js/leaflet/draw/Control.Draw.js"
- ]
- };
- var DispatcherPinConfig = {
- defaultIcon: "<?php echo $config['dispatcherPin']['defaultIcon'];?>",
- defaultColor: "<?php echo $config['dispatcherPin']['defaultColor'];?>",
- sendSinglePinAsAddress: <?php echo ($config['dispatcherPin']['sendSinglePinAsAddress']) ? 'true' : 'false';?>
- };
- var NodeJsPort = <?php echo $config['port']; ?>;
- var NodeJsIp = "<?php echo $config['fqdn']; ?>";
- var NodeJsProtocol = "<?php echo $config['nodejs']['protocol']; ?>";
- var LogVoipEnabled = <?php echo (($clientLogvoipEnabled) ? 'true' : 'false');?>;
- var RemoteLogEnabled = <?php echo (($clientRemoteLogEnabled) ? 'true' : 'false');?>;
- var RemoteLogBatchSize = "<?php echo $config['client']['remotelog']['batchSize'];?>";
- var RemoteLogTimeInterval = "<?php echo $config['client']['remotelog']['timeInterval'];?>";
- var Msisdn = "<?php echo $account['Msisdn']; ?>";
- var LoggedInMsisdn = "<?php echo $account['Msisdn']; ?>";
- var LoggedInFqdn = "<?php echo $account['Fqdn']; ?>";
- <?php
- $loggedInName = addslashes(json_encode($account['FirstName'] . ' ' . $account['LastName']));
- ?>
- var LoggedInName = '<?php echo $loggedInName; ?>';
- var LoggedInRole = "<?php echo AuthenticatedUser::getRole(); ?>";
- var Emoji = [<?php echo '"' . implode('","', array_keys($config['emoji'])) . '"'; ?>];
- var EmojiUnicode = [<?php echo '"' . implode('","', array_values($config['emoji'])) . '"'; ?>];
- var DesktopNotificationPopup = <?php echo $config['desktopNotifications']['popup']; ?>;
- var DesktopNotificationSound = <?php echo $config['desktopNotifications']['sound']; ?>;
- var CallNotificationPopupDisplayTime = <?php echo $config['callNotifications']['popupDisplayTime']; ?>;
- var ClientActiveTtl = <?php echo $config['client']['active']['timeout']; ?>;
- var ClientBroadcastGroup = <?php echo (($config['client']['broadcast']['group']) ? 'true' : 'false'); ?>;
- var ClientSubscriberDataInfoDisplayTime = <?php echo $config['client']['subscriberData']['refresh']['infoDisplayTime']; ?>;
- var ClientSubscriberDataRequestTimeout = <?php echo $config['client']['subscriberData']['refresh']['requestTimeout']; ?>;
- var ClientSubscriberDataRecentRequestsLifetime = <?php echo $config['client']['subscriberData']['refresh']['recentRequestsLifetime']; ?>;
- var ClientSubscriberDataOldIfOlderThan = <?php echo $config['client']['subscriberData']['oldIfOlderThan']; ?>;
- var ClientMessagesRecordsOnPage = <?php echo $config['client']['messages']['recordsOnPage'];?>;
- var ClientMessagesRecordsOnPageBeforAndAfter = <?php echo $config['client']['messages']['recordsOnPageBeforeAndAfter'];?>;
- var ClientMessagesAreaAutoResizeLines = <?php echo ($config['client']['messages']['areaAutoResizeLines']); ?>;
- var ClientDefaultDistanceUnit = "<?php echo $config['settings']['dispatchConsole']['distanceUnit'][Session::getLanguage()];?>";
- // DEPRECATED VARIABLES
- var ClientConversationsRecordsOnPageFirstRun = 0;
- var ClientConversationsRecordsOnPageExtraRun = 0;
- var ClientConversationsRecordsOnPage = <?php echo $config['client']['conversations']['recordsOnPage'];?>;
- var ClientAggregationFreeCall = <?php echo (($config['client']['aggregation']['freeCall']['enabled']) ? 'true' : 'false');?>;
- var ClientAggregationWalkieTalkie = <?php echo (($config['client']['aggregation']['walkieTalkie']['enabled']) ? 'true' : 'false');?>;
- var ClientDefaultPage = "<?php echo $config['settings']['defaultPage']['default'];?>";
- var MessageMaxSizeWithThumbnail = <?php echo $config['message']['maxSize']['withThumbnail']; ?>;
- var MessageMaxSizeWithoutThumbnail = <?php echo $config['message']['maxSize']['withoutThumbnail']; ?>;
- var MessageMaxRecipients = <?php echo $account['Settings']['MessageRecipientsMax']; ?>;
- var MessageTimeout = <?php echo $config['message']['timeout'] * 1000; ?>;
- var MessageStorageTime = <?php echo $messageStorageTime; ?>;
- var ProcessStorageTime = <?php echo $processStorageTime; ?>;
- var LinkPreviewIntegrationEnabled = <?php echo (($config['embedly']['key'] != '') ? 'true' : 'false'); ?>;
- var STWV = "<?php echo $config['version']; ?>";
- var EmailForwardingWithAttachment = <?php echo (($config['forward']['email']['message']['attachment']['enabled']) ? 'true' : 'false'); ?>;
- var UserPictureWidthMax = <?php echo $config['user']['picture']['width']['max']; ?>;
- var UserPictureHeightMax = <?php echo $config['user']['picture']['height']['max']; ?>;
- var WtFloorSoundsEnabled = <?php echo (($config['client']['wt']['floorSounds']['enabled']) ? 'true' : 'false'); ?>;
- var ChannelsFloorKeys = [<?php echo '"' . implode('","', array_values($config['channels']['floorKeys'])) . '"'; ?>];
- var SoundList = [<?php echo '"' . implode('","', $this->pluginGetSoundsList()) . '"'; ?>];
- var AssetsUrls = {};
- var EmergencyAlert = {
- dropAllCalls: <?php echo (($config['emergencyAlert']['dropAllCalls']) ? 'true' : 'false'); ?>
- }
- var StreamingConfig = {
- popupWidth: <?php echo $config['client']['streaming']['popup']['width']; ?>,
- popupHeight: <?php echo $config['client']['streaming']['popup']['height']; ?>
- };//emergencyAlert.sound.volumeDefault
- var Formatting = <?php echo json_encode(isset($config['formatting'][$this->translate()->getTranslator()->getLocale()]) ? $config['formatting'][$this->translate()->getTranslator()->getLocale()] : $config['formatting']['default']); ?>;
- var SoundVolume = {
- emergencyAlertDefault: <?php echo $config['soundVolume']['emergencyAlert']['default'];?>,
- emergencyAlertWhileInCall: <?php echo $config['soundVolume']['emergencyAlert']['whileInCall'];?>,
- pttFloorControl: <?php echo $config['soundVolume']['ptt']['floorControl'];?>,
- voipRingTone: <?php echo $config['soundVolume']['ringTone']['voip'];?> ,
- pttRingTone: <?php echo $config['soundVolume']['ringTone']['ptt'];?>
- }
- <?php
- foreach($assetsUrl as $assetName => $assetUrl) {
- echo ' AssetsUrls["' . $assetName . '"] = "' . $assetUrl . '";' . PHP_EOL;
- }
- ?>
- var WebRtcConfig = {
- webSocketServerPattern: "<?php
- if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS'])) {
- echo $config['webrtc']['webSocketServerSecurePattern'];
- } else {
- echo $config['webrtc']['webSocketServerPattern'];
- }
- ?>",
- serverUriPattern: "<?php echo $config['webrtc']['serverUriPattern'] ?>",
- serverUriIsAlivePattern: "<?php echo $config['webrtc']['serverUriIsAlivePattern'] ?>",
- callBannerinfoDisplayTime: <?php echo $config['webrtc']['callBanner']['infoDisplayTime'] ?>,
- callMaxParticipants: <?php echo $account['Settings']['CallRecipientsMax']; ?>,
- hideAllSupervisorsSameLevel: <?php echo $config['webrtc']['callBanner']['hideAllSupervisorsSameLevel']; ?>,
- keepAliveTimeout: <?php echo $config['webrtc']['keepAliveTimeout']; ?>
- };
- var CallOutConfig = {
- dialerKeysSound: <?php echo (empty ($config['callOut']['dialer']['keysSound']) ? 'null' : ('"' . $config['callOut']['dialer']['keysSound'] . '"')); ?>
- };
- var WebchatURI = "<?php echo $config["uri"]; ?>";
- var Settings = {
- desktopNotificationSound: "<?php echo $config['settings']['desktopNotifications']['default']['sound']; ?>",
- desktopNotificationSoundMyBusiness: "<?php echo $config['settings']['desktopNotifications']['default']['sound']; ?>",
- voipRingToneSound: "<?php echo $config['settings']['voipRingTone']['default']['sound']; ?>",
- walkieTalkieRingToneSound: "<?php echo $config['settings']['pttRingTone']['default']['sound']; ?>",
- walkieTalkieAutoresponse: "<?php echo $config['settings']['walkieTalkie']['autoresponse']['default']; ?>",
- callAutoresponse: "<?php echo $config['settings']['call']['autoresponse']['default']; ?>",
- interfaceLanguage: "<?php echo $this->translate()->getTranslator()->getLocale(); ?>",
- contactClickDefaultAction: "<?php echo $config['settings']['contactActionClick']['default']; ?>",
- defaultSendButton: "<?php echo $config['settings']['defaultSendButton']['default']; ?>",
- defaultPage: "<?php echo $config['settings']['defaultPage']['default']; ?>",
- defaultMyBusinessTab: "<?php echo $config['settings']['defaultMyBusinessTab']['default']; ?>",
- channelsPlaybackMode: "<?php echo $config['settings']['channelsPlaybackMode']['priority']; ?>",
- hearOtherChannelsWhileTalking : "<?php echo $config['settings']['channelsPlaybackMode']['hearOthersWhileRalking']; ?>",
- conversationWithOnDutyContacts : "<?php echo $config['settings']['conversationWithOnDutyContacts']['default']; ?>",
- }
- <?php if (isset($account['ProcessReports'])) : ?>
- Settings['CanRequestProcessReports'] = true;
- Settings['WithAttachments'] = <?php echo (
- isset($account['ProcessReports']['WithAttachments']) && $account['ProcessReports']['WithAttachments']
- ) ? '1' : '0'; ?>;
- <?php endif; ?>
- <?php if (AuthenticatedUser::getRole() == Role::ROLE_DISPATCH_MANAGER):?>
- Settings.dispatchConsoleDistanceUnit = "<?php echo Cookie::getDistanceUnit(); ?>";
- <?php endif;?>
- <?php endif;?>
- var LdapActive = <?php echo (($config['authentication']['ldap']['active']) ? 'true' : 'false'); ?>;
- var MyBusinessFeatureAllowed = <?php echo (($myBusinessFeatureAllowed) ? 'true' : 'false'); ?>;
- var MyBusinessCfg = {
- processesRecordsOnPage: <?php echo $config['myBusiness']['processesRecordsOnPage']?>,
- dueStateTimeout: <?php echo $config['myBusiness']['dueStateTimeout'];?>,
- expirationStateTimeout: <?php echo $config['myBusiness']['expirationStateTimeout'];?>,
- notificationsCheckInterval: <?php echo $config['myBusiness']['notificationsCheckInterval'];?>,
- historyCompareMaxVersionsNumber: <?php echo $config['myBusiness']['historyCompareMaxVersionsNumber'];?>,
- maxSuggestions: <?php echo $config['myBusiness']['maxSuggestions'];?>,
- gridDebug: <?php echo (((bool) $config['myBusiness']['gridDebug']) ? 'true' : 'false'); ?>,
- saveProcessOnWindowClose: <?php echo (((bool) $config['client']['myBusiness']['process']['saveOnWindowClose']) ? 'true' : 'false'); ?>,
- reportingDefaultFilterInterval: <?php echo $config['myBusiness']['reporting']['defaultFilterInterval'];?>,
- reportingMaxUsersInDropdown: <?php echo $config['myBusiness']['reporting']['maxUsersInDropdown'];?>,
- reportingBatchSize: <?php echo $config['myBusiness']['reporting']['batchSize'];?>,
- allowProcessCreationFromCSV: <?php echo (isset($account['MyBusiness']['ImportCsv']) && $account['MyBusiness']['ImportCsv']) ? 'true' : 'false'; ?>,
- lastProcessExportDate: <?php $date = AuthenticatedUser::getSubscriberProperty('LastProcessExportDate'); echo (is_null($date)) ? 'null' : '"' . $date . '"'?>,
- externalSystem: {
- tokenTtl: {
- direct: <?php echo $config['myBusiness']['externalSystem']['tokenTtl']['direct']; ?>,
- selection: <?php echo $config['myBusiness']['externalSystem']['tokenTtl']['selection']; ?>
- }
- },
- processesCleaning: {
- dayOfTheWeek: <?php echo $config['myBusiness']['processesCleaning']['dayOfTheWeek']; ?>,
- dayOfTheMonth: <?php echo $config['myBusiness']['processesCleaning']['dayOfTheMonth']; ?>
- },
- processesExport: {
- downloadAlias: "<?php echo $config['myBusiness']['processesExport']['downloadAlias']; ?>"
- }
- };
- var SearchContactsCfg = {
- minKeywordLength: <?php echo $config['contactsSearch']['minKeywordLength']?>,
- triggerTimerTimeout: <?php echo $config['contactsSearch']['triggerTimerTimeout']?>,
- recordsOnPage: <?php echo $config['contactsSearch']['recordsOnPage']?>
- }
- var BellNotificationsCfg = {
- maxDisplayedItems: <?php echo $config['bellNotifications']['maxDisplayedItems']?>
- }
- </script>
- <?php
- echo $this->pluginInsertConversationSearchSettings();
- echo $this->pluginInjectLocale();
- echo $headData . PHP_EOL;
- ?>
- <base href="<?php echo $pageData->baseUrl; ?>">
- </head>
- <?php
- $bodyClass = $this->translate()->getTranslator()->getLocale();
- $userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, 'UTF-8') : '';
- preg_match('/Firefox\/[0-9\.]+/', $userAgent, $matches);
- if (count($matches)) {
- // there are IMPORTANT customers like PCSTorm which uses ancient versions of Firefox
- // those versions requires hacks in order to work properly
- $firefoxVersion = (float) explode('/', $matches[0])[1];
- if ($firefoxVersion <= 52) {
- $bodyClass .= ' firefox-old';
- }
- }
- ?>
- <?php echo '
- <!--[if IE 8]><body class="ie8 ' . $bodyClass . '"><![endif]-->
- <!--[if IE 9]><body class="ie9 ' . $bodyClass . '"><![endif]-->
- <!--[if gt IE 9]><!--><body class="' . $bodyClass . '"><!--<![endif]-->
- '; ?>
- <?php echo '<!-- Detect if IE -->'; ?>
- <?php if (preg_match('~MSIE|Internet Explorer~i', $userAgent) || preg_match('/Edge/i', $userAgent) || (strpos($userAgent, 'Trident/7.0; rv:11.0') !== false)): ?>
- <?php
- $alert = $this->translate('global_ie_not_supported');
- echo("<script type='text/javascript'> alert('" . str_replace("%skin%", $this->translate('js_all_skin'), $alert) . "'); </script>");
- ?>
- <?php else: ?>
- <?php echo '<!-- -->'; ?>
- <div id="images-cache" style="display:none">
- <img width="1" height="1" alt="" src="<?php echo rtrim($this->baseUrl(), '/') . '/' . 'styles/skin-base/assets/';?>disconnect-wheel.png">
- </div>
- <?php if (AuthenticatedUser::isAuthenticated()):?>
- <div class="webrtc-media">
- <audio id="webrtc-local-media"></audio>
- <audio id="webrtc-remote-media"></audio>
- </div>
- <?php endif;?>
- <?php echo '<!-- Preload all the fonts -->'; ?>
- <div style="visibility: hidden; position: absolute">
- <span style="font-family: 'Specific-font', Arial, Helvetica, sans-serif;"></span>
- <span style="font-family: 'Specific-font-bold', Arial, Helvetica, sans-serif;"></span>
- <span style="font-family: 'General-font', Arial, Helvetica, sans-serif;"></span>
- <span style="font-family: 'General-font-bold', Arial, Helvetica, sans-serif;"></span>
- <span style="font-family: 'General-font-select', Arial, Helvetica, sans-serif;"></span>
- </div>
- <?php echo '<!-- Top menu bar -->'; ?>
- <?php if ($request->getActionName() != 'login' && $request->getActionName() != 'error' && $request->getActionName() != 'nojavascript') : ?>
- <?php include(__DIR__ . '/_include/main-menu.phtml')?>
- <?php endif; ?>
- <?php echo '<!-- The jPlayer div must not be hidden. Keep it at the root of the body element to avoid any such problems. -->'; ?>
- <div class="container body-container">
- <div class="fixed-layout">
- <div class="areas-splitter"></div>
- <div class="controllers-space"></div>
- <?php echo $this->layout()->content;?>
- </div>
- </div>
- <?php
- if (AuthenticatedUser::isAuthenticated()) {
- include(__DIR__ . '/conversations/global-layout.phtml');
- include(__DIR__ . '/mybusiness/global-layout.phtml');
- include(__DIR__ . '/geolocation/global-layout.phtml');
- ?>
- <div id="call-banner-manager"></div>
- <?php include(__DIR__ . '/forwarder/forwarder.phtml');?>
- <?php
- }
- ?>
- <div class="modal-dialogs">
- <div class="background"></div>
- <div class="dialogs container-fluid"></div>
- </div>
- <div id="js-templates">
- <?php include(__DIR__ . '/_include/js_information_dialog.phtml')?>
- <?php include(__DIR__ . '/_include/js_confirmation_dialog.phtml')?>
- <?php include(__DIR__ . '/_include/js_call_notification_dialog.phtml')?>
- <?php include(__DIR__ . '/_include/js_dialog_container.phtml')?>
- <?php include(__DIR__ . '/_include/js_error_notification.phtml')?>
- <?php include(__DIR__ . '/_include/js_popover-menu.phtml')?>
- <?php include(__DIR__ . '/geolocation/dispatcher-pin-icons-selector.phtml')?>
- <?php include(__DIR__ . '/notifications/notifications-panel.phtml') ?>
- <div style="display: none">
- <?php include(__DIR__ . '/notifications/notification-item.phtml')?>
- <?php include(__DIR__ . '/messages/attachment-caption-layer.phtml')?>
- <?php include(__DIR__ . '/messages/unread-monitor-layer-controls.phtml')?>
- <?php include(__DIR__ . '/contacts-selector-layer/contacts-selector-layer.phtml')?>
- <?php include(__DIR__ . '/contacts-selector-layer/contacts-selector-item.phtml')?>
- <?php include(__DIR__ . '/call-out/call-out-button.phtml')?>
- <?php include(__DIR__ . '/call-out/call-out-keyboard.phtml')?>
- <?php include(__DIR__ . '/_include/sliding-layer-slide.phtml')?>
- <?php include(__DIR__ . '/quota/quota-renderer.phtml')?>
- <?php include(__DIR__ . '/mybusiness/import-export/processes-exporting-modal.phtml')?>
- </div>
- </div>
- <div id="popup-templates" style="display: none">
- <?php include(__DIR__ . '/_include/call-popup.phtml')?>
- </div>
- <div id="popover-menu-global-container"></div>
- <?php echo '<!-- End page content -->'; ?>
- <?php endif; ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement