/** * Extracts the plaintext out of a html code * * @param mixed $html The html code as string or an array containing * multiple html code strings * @return mixed The plaintext of the provided html code */ function contrexx_html2plaintext($html) { if (is_array($html)) { $arr = array(); foreach ($html as $i => $_html) { $arr[$i] = contrexx_html2plaintext($_html); } return $arr; } // ensure that no html-notations are left in place $html = html_entity_decode($html, ENT_QUOTES, CONTREXX_CHARSET); // remove all placeholders, script- and style-tags $html = preg_replace(array('/\\{[a-zA-Z0-9_]+\\}/', '/\\[\\[[a-zA-Z0-9_]+\\]\\]/', '/<script[^>]+>.*?<\\/script>/ms', '/<style[^>]+>.*?<\\/style>/ms'), '', $html); // remove all remaining html&php tags $plaintext = strip_tags($html); // remove white-space sequences $plaintext = trim(preg_replace('/\\s+/msu', ' ', $plaintext)); return $plaintext; }
/** * Shorten and format the search result content * * Strips template placeholders and blocks, as well as certain tags, * and fixes the character encoding * @param string $content The content * @param integer $max_length The maximum allowed length of the * preview content, in characters(*) * @return string The formatted content * @todo (*) I think these are actually bytes. */ public static function shortenSearchContent($content, $max_length = NULL) { $content = contrexx_html2plaintext($content); // Omit the content when there is no letter in it if (!preg_match('/\\w/', $content)) { return ''; } $max_length = intval($max_length); if (strlen($content) > $max_length) { $content = substr($content, 0, $max_length); $arrayContent = explode(' ', $content); array_pop($arrayContent); $content = join(' ', $arrayContent) . ' ...'; } return $content; }
/** * Sets the placeholders used for the event list view * * @param object $objTpl Template object * @param integer $type Event type * * @return null */ function showEventList($objTpl, $type = '') { global $objInit, $_ARRAYLANG, $_LANGID; parent::getFrontendLanguages(); //if($objInit->mode == 'backend') { $i = 0; foreach ($this->eventList as $key => $objEvent) { $objCategory = new \Cx\Modules\Calendar\Controller\CalendarCategory(intval($objEvent->catId)); $showIn = explode(",", $objEvent->showIn); $languages = ''; if (count(\FWLanguage::getActiveFrontendLanguages()) > 1) { $langState = array(); foreach ($this->arrFrontendLanguages as $langKey => $arrLang) { if (in_array($arrLang['id'], $showIn)) { $langState[$langKey] = 'active'; } } $languages = \Html::getLanguageIcons($langState, 'index.php?cmd=Calendar&act=modify_event&id=' . $objEvent->id . '&langId=%1$d' . ($type == 'confirm' ? "&confirm=1" : "")); if ($type == 'confirm' && $objTpl->blockExists('txt_languages_block_confirm_list')) { $objTpl->touchBlock('txt_languages_block_confirm_list'); } elseif ($objTpl->blockExists('txt_languages_block')) { $objTpl->touchBlock('txt_languages_block'); } } else { if ($type == 'confirm' && $objTpl->blockExists('txt_languages_block_confirm_list')) { $objTpl->hideBlock('txt_languages_block_confirm_list'); } elseif ($objTpl->blockExists('txt_languages_block')) { $objTpl->hideBlock('txt_languages_block'); } } list($priority, $priorityImg) = $this->getPriorityImage($objEvent); $plainDescription = contrexx_html2plaintext($objEvent->description); if (strlen($plainDescription) > 100) { $points = '...'; } else { $points = ''; } $parts = explode("\n", wordwrap($plainDescription, 100, "\n")); $attachNamePos = strrpos($objEvent->attach, '/'); $attachNamelength = strlen($objEvent->attach); $attachName = substr($objEvent->attach, $attachNamePos + 1, $attachNamelength); if ($objEvent->external) { $objHost = new \Cx\Modules\Calendar\Controller\CalendarHost($objEvent->hostId); if (substr($objHost->uri, -1) != '/') { $hostUri = $objHost->uri . '/'; } else { $hostUri = $objHost->uri; } if (substr($hostUri, 0, 7) != 'http://') { $hostUri = "http://" . $hostUri; } } $copyLink = ''; if ($objInit->mode == 'backend') { $editLink = 'index.php?cmd=' . $this->moduleName . '&act=modify_event&id=' . $objEvent->id . ($type == 'confirm' ? "&confirm=1" : ""); $copyLink = $editLink . "&copy=1"; } else { $editLink = CONTREXX_DIRECTORY_INDEX . '?section=' . $this->moduleName . '&cmd=edit&id=' . $objEvent->id; } $picThumb = file_exists(\Env::get('cx')->getWebsitePath() . "{$objEvent->pic}.thumb") ? "{$objEvent->pic}.thumb" : ($objEvent->pic != '' ? $objEvent->pic : ''); $placeLink = $objEvent->place_link != '' ? "<a href='" . $objEvent->place_link . "' target='_blank' >" . $objEvent->place_link . "</a>" : ""; $placeLinkSource = $objEvent->place_link; if ($this->arrSettings['placeData'] > 1 && $objEvent->locationType == 2) { $objEvent->loadPlaceFromMediadir($objEvent->place_mediadir_id, 'place'); list($placeLink, $placeLinkSource) = $objEvent->loadPlaceLinkFromMediadir($objEvent->place_mediadir_id, 'place'); } $hostLink = $objEvent->org_link != '' ? "<a href='" . $objEvent->org_link . "' target='_blank' >" . $objEvent->org_link . "</a>" : ""; $hostLinkSource = $objEvent->org_link; if ($this->arrSettings['placeDataHost'] > 1 && $objEvent->hostType == 2) { $objEvent->loadPlaceFromMediadir($objEvent->host_mediadir_id, 'host'); list($hostLink, $hostLinkSource) = $objEvent->loadPlaceLinkFromMediadir($objEvent->host_mediadir_id, 'host'); } $objTpl->setVariable(array($this->moduleLangVar . '_EVENT_ROW' => $i % 2 == 0 ? 'row1' : 'row2', $this->moduleLangVar . '_EVENT_LED' => $objEvent->status == 0 ? 'red' : 'green', $this->moduleLangVar . '_EVENT_STATUS' => $objEvent->status == 0 ? $_ARRAYLANG['TXT_CALENDAR_INACTIVE'] : $_ARRAYLANG['TXT_CALENDAR_ACTIVE'], $this->moduleLangVar . '_EVENT_ID' => $objEvent->id, $this->moduleLangVar . '_EVENT_TITLE' => $objEvent->title, $this->moduleLangVar . '_EVENT_PICTURE' => $objEvent->pic != '' ? '<img src="' . $objEvent->pic . '" alt="' . $objEvent->title . '" title="' . $objEvent->title . '" />' : '', $this->moduleLangVar . '_EVENT_PICTURE_SOURCE' => $objEvent->pic, $this->moduleLangVar . '_EVENT_THUMBNAIL' => $objEvent->pic != '' ? '<img src="' . $picThumb . '" alt="' . $objEvent->title . '" title="' . $objEvent->title . '" />' : '', $this->moduleLangVar . '_EVENT_PRIORITY' => $priority, $this->moduleLangVar . '_EVENT_PRIORITY_IMG' => $priorityImg, $this->moduleLangVar . '_EVENT_PLACE' => $objEvent->place, $this->moduleLangVar . '_EVENT_DESCRIPTION' => $objEvent->description, $this->moduleLangVar . '_EVENT_SHORT_DESCRIPTION' => $parts[0] . $points, $this->moduleLangVar . '_EVENT_LINK' => $objEvent->link ? "<a href='" . $objEvent->link . "' target='_blank' >" . $objEvent->link . "</a>" : "", $this->moduleLangVar . '_EVENT_LINK_SOURCE' => $objEvent->link, $this->moduleLangVar . '_EVENT_ATTACHMENT' => $objEvent->attach != '' ? '<a href="' . $hostUri . $objEvent->attach . '" target="_blank" >' . $attachName . '</a>' : '', $this->moduleLangVar . '_EVENT_ATTACHMENT_SOURCE' => $objEvent->attach, $this->moduleLangVar . '_EVENT_START' => date(parent::getDateFormat() . " H:i", $objEvent->startDate), $this->moduleLangVar . '_EVENT_END' => date(parent::getDateFormat() . " H:i", $objEvent->endDate), $this->moduleLangVar . '_EVENT_DATE' => date(parent::getDateFormat(), $objEvent->startDate), $this->moduleLangVar . '_EVENT_START_DATE' => date(parent::getDateFormat(), $objEvent->startDate), $this->moduleLangVar . '_EVENT_START_TIME' => date("H:i", $objEvent->startDate), $this->moduleLangVar . '_EVENT_END_DATE' => date(parent::getDateFormat(), $objEvent->endDate), $this->moduleLangVar . '_EVENT_END_TIME' => date("H:i", $objEvent->endDate), $this->moduleLangVar . '_EVENT_LANGUAGES' => $languages, $this->moduleLangVar . '_EVENT_CATEGORY' => $objCategory->name, $this->moduleLangVar . '_EVENT_DETAIL_LINK' => $objEvent->type == 0 ? self::_getDetailLink($objEvent) : $objEvent->arrData['redirect'][$_LANGID], $this->moduleLangVar . '_EVENT_EDIT_LINK' => $editLink, $this->moduleLangVar . '_EVENT_COPY_LINK' => $copyLink, $this->moduleLangVar . '_EVENT_DETAIL_TARGET' => $objEvent->type == 0 ? '_self' : '_blank', $this->moduleLangVar . '_EVENT_SERIES' => $objEvent->seriesStatus == 1 ? '<img src="' . ASCMS_MODULE_WEB_PATH . '/' . $this->moduleName . '/View/Media/Repeat.png" border="0"/>' : '<i>' . $_ARRAYLANG['TXT_CALENDAR_NO_SERIES'] . '</i>', $this->moduleLangVar . '_EVENT_FREE_PLACES' => $objEvent->freePlaces, $this->moduleLangVar . '_EVENT_ACCESS' => $_ARRAYLANG['TXT_CALENDAR_EVENT_ACCESS_' . $objEvent->access])); $hasPlaceMap = !empty($objEvent->place_map) && file_exists(\Env::get('cx')->getWebsitePath() . $objEvent->place_map); if ($hasPlaceMap) { $arrInfo = getimagesize(\Env::get('cx')->getWebsitePath() . $objEvent->place_map); $picWidth = $arrInfo[0] + 20; $picHeight = $arrInfo[1] + 20; } $map_thumb_name = file_exists(\Env::get('cx')->getWebsitePath() . $objEvent->place_map . ".thumb") ? $objEvent->place_map . ".thumb" : $objEvent->place_map; $objTpl->setVariable(array($this->moduleLangVar . '_EVENT_LOCATION_PLACE' => $objEvent->place, $this->moduleLangVar . '_EVENT_LOCATION_ADDRESS' => $objEvent->place_street, $this->moduleLangVar . '_EVENT_LOCATION_ZIP' => $objEvent->place_zip, $this->moduleLangVar . '_EVENT_LOCATION_CITY' => $objEvent->place_city, $this->moduleLangVar . '_EVENT_LOCATION_COUNTRY' => $objEvent->place_country, $this->moduleLangVar . '_EVENT_LOCATION_LINK' => $placeLink, $this->moduleLangVar . '_EVENT_LOCATION_LINK_SOURCE' => $placeLinkSource, $this->moduleLangVar . '_EVENT_LOCATION_MAP_LINK' => $hasPlaceMap ? '<a href="' . $objEvent->place_map . '" onClick="window.open(this.href,\'\',\'resizable=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,fullscreen=no,dependent=no,width=' . $picWidth . ',height=' . $picHeight . ',status\'); return false">' . $_ARRAYLANG['TXT_CALENDAR_MAP'] . '</a>' : "", $this->moduleLangVar . '_EVENT_LOCATION_MAP_THUMBNAIL' => $hasPlaceMap ? '<a href="' . $objEvent->place_map . '" onClick="window.open(this.href,\'\',\'resizable=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,fullscreen=no,dependent=no,width=' . $picWidth . ',height=' . $picHeight . ',status\'); return false"><img src="' . $map_thumb_name . '" border="0" alt="' . $objEvent->place_map . '" /></a>' : "", $this->moduleLangVar . '_EVENT_LOCATION_MAP_SOURCE' => $hasPlaceMap ? $objEvent->place_map : '', $this->moduleLangVar . '_EVENT_HOST' => $objEvent->org_name, $this->moduleLangVar . '_EVENT_HOST_ADDRESS' => $objEvent->org_street, $this->moduleLangVar . '_EVENT_HOST_ZIP' => $objEvent->org_zip, $this->moduleLangVar . '_EVENT_HOST_CITY' => $objEvent->org_city, $this->moduleLangVar . '_EVENT_HOST_COUNTRY' => $objEvent->org_country, $this->moduleLangVar . '_EVENT_HOST_LINK' => $hostLink, $this->moduleLangVar . '_EVENT_HOST_LINK_SOURCE' => $hostLinkSource, $this->moduleLangVar . '_EVENT_HOST_EMAIL' => $objEvent->org_email != '' ? "<a href='mailto:" . $objEvent->org_email . "' >" . $objEvent->org_email . "</a>" : "", $this->moduleLangVar . '_EVENT_HOST_EMAIL_SOURCE' => $objEvent->org_email)); if ($objInit->mode == 'backend') { $objTpl->setVariable(array($this->moduleLangVar . '_EVENT_COUNT_REG' => $objEvent->registrationCount, $this->moduleLangVar . '_EVENT_COUNT_DEREG' => $objEvent->cancellationCount, $this->moduleLangVar . '_EVENT_COUNT_WAITLIST' => $objEvent->waitlistCount)); } $i++; // show date block if ($objTpl->blockExists('calendarDateList')) { $showStartDateList = $objEvent->useCustomDateDisplay ? $objEvent->showStartDateList : $this->arrSettings['showStartDateList'] == 1; $showEndDateList = $objEvent->useCustomDateDisplay ? $objEvent->showEndDateList : $this->arrSettings['showEndDateList'] == 1; $showStartTimeList = $objEvent->all_day ? false : ($objEvent->useCustomDateDisplay ? $objEvent->showStartTimeList : $this->arrSettings['showStartTimeList'] == 1); $showEndTimeList = $objEvent->all_day ? false : ($objEvent->useCustomDateDisplay ? $objEvent->showEndTimeList : $this->arrSettings['showEndTimeList'] == 1); $showTimeTypeList = $objEvent->useCustomDateDisplay ? $objEvent->showTimeTypeList : 1; // get date for several days format > show starttime with startdate and endtime with enddate > only if several days event and all values (dates/times) are displayed if (date(parent::getDateFormat(), $objEvent->startDate) != date(parent::getDateFormat(), $objEvent->endDate) && ($showStartDateList && $showEndDateList && $showStartTimeList && $showEndTimeList)) { //part 1 $part = 1; $this->getMultiDateBlock($objEvent, $this->arrSettings['separatorDateTimeList'], $this->arrSettings['separatorSeveralDaysList'], $this->arrSettings['showClockList'] == 1, $part); $objTpl->setVariable(array($this->moduleLangVar . '_DATE_LIST' => $this->date, $this->moduleLangVar . '_SEP_DATE_TIME_LIST' => $this->sepDateTime, $this->moduleLangVar . '_TIME_LIST' => $this->time, 'TXT_' . $this->moduleLangVar . '_CLOCK_LIST' => $this->clock)); $objTpl->parse('calendarDateList'); //part 2 $part = 2; $this->getMultiDateBlock($objEvent, $this->arrSettings['separatorDateTimeList'], $this->arrSettings['separatorSeveralDaysList'], $this->arrSettings['showClockList'] == 1, $part); $objTpl->setVariable(array($this->moduleLangVar . '_DATE_LIST' => $this->date, $this->moduleLangVar . '_SEP_DATE_TIME_LIST' => $this->sepDateTime, $this->moduleLangVar . '_TIME_LIST' => $this->time, 'TXT_' . $this->moduleLangVar . '_CLOCK_LIST' => $this->clock)); $objTpl->parse('calendarDateList'); } else { // get date for single day format $this->getSingleDateBlock($objEvent, $showStartDateList, $showEndDateList, $this->arrSettings['separatorDateList'], $showTimeTypeList, $showStartTimeList, $showEndTimeList, $this->arrSettings['separatorDateTimeList'], $this->arrSettings['separatorTimeList'], $this->arrSettings['showClockList'] == 1); $objTpl->setVariable(array($this->moduleLangVar . '_DATE_LIST' => $this->date, $this->moduleLangVar . '_SEP_DATE_TIME_LIST' => $this->sepDateTime, $this->moduleLangVar . '_TIME_LIST' => $this->time, 'TXT_' . $this->moduleLangVar . '_CLOCK_LIST' => $this->clock)); $objTpl->parse('calendarDateList'); } } if ($type == 'confirm') { if ($objTpl->blockExists('eventConfirmList')) { $objTpl->parse('eventConfirmList'); } } else { if ($objTpl->blockExists('eventList')) { $objTpl->parse('eventList'); } if ($objTpl->blockExists('calendar_headlines_row')) { $objTpl->parse('calendar_headlines_row'); } } } if (count($this->eventList) == 0 && $type != 'confirm') { $objTpl->hideBlock('eventList'); $objTpl->setVariable(array('TXT_' . $this->moduleLangVar . '_NO_EVENTS' => $_ARRAYLANG['TXT_CALENDAR_EVENTS_NO'])); $objTpl->parse('emptyEventList'); } //} }
/** * add /edit task * * @global array $_ARRAYLANG * @global object $objDatabase * @return true */ public function _modifyTask() { global $_ARRAYLANG, $objDatabase, $objJs, $objFWUser; \JS::registerCSS("modules/Crm/View/Style/contact.css"); if (gettype($objFWUser) === 'NULL') { $objFWUser = \FWUser::getFWUserObject(); } $objtpl = $this->_objTpl; $_SESSION['pageTitle'] = empty($_GET['id']) ? $_ARRAYLANG['TXT_CRM_ADDTASK'] : $_ARRAYLANG['TXT_CRM_EDITTASK']; $this->_objTpl->loadTemplateFile('module_' . $this->moduleNameLC . '_addtasks.html'); $objtpl->setGlobalVariable("MODULE_NAME", $this->moduleName); $settings = $this->getSettings(); $id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : ''; $date = date('Y-m-d H:i:s'); $title = isset($_POST['taskTitle']) ? contrexx_input2raw($_POST['taskTitle']) : ''; $type = isset($_POST['taskType']) ? (int) $_POST['taskType'] : 0; $customer = isset($_REQUEST['customerId']) ? (int) $_REQUEST['customerId'] : ''; $duedate = isset($_POST['date']) ? $_POST['date'] : $date; $assignedto = isset($_POST['assignedto']) ? intval($_POST['assignedto']) : 0; $description = isset($_POST['description']) ? contrexx_input2raw($_POST['description']) : ''; $notify = isset($_POST['notify']); $taskId = isset($_REQUEST['searchType']) ? intval($_REQUEST['searchType']) : 0; $taskTitle = isset($_REQUEST['searchTitle']) ? contrexx_input2raw($_REQUEST['searchTitle']) : ''; $redirect = isset($_REQUEST['redirect']) ? $_REQUEST['redirect'] : base64_encode('&act=task'); // check permission if (!empty($id)) { $objResult = $objDatabase->Execute("SELECT `added_by`,\n `assigned_to`\n FROM `" . DBPREFIX . "module_{$this->moduleNameLC}_task`\n WHERE `id` = '{$id}'\n "); $added_user = (int) $objResult->fields['added_by']; $assigned_user = (int) $objResult->fields['assigned_to']; if ($objResult) { list($task_edit_permission) = $this->getTaskPermission($added_user, $assigned_user); if (!$task_edit_permission) { \Permission::noAccess(); } } } if (isset($_POST['addtask'])) { if (!empty($id)) { if ($objFWUser->objUser->getAdminStatus() || $added_user == $objFWUser->objUser->getId() || $assigned_user == $assignedto) { $fields = array('task_title' => $title, 'task_type_id' => $type, 'customer_id' => $customer, 'due_date' => $duedate, 'assigned_to' => $assignedto, 'description' => $description); $query = \SQL::update("module_{$this->moduleNameLC}_task", $fields, array('escape' => true)) . " WHERE `id` = {$id}"; $_SESSION['strOkMessage'] = $_ARRAYLANG['TXT_CRM_TASK_UPDATE_MESSAGE']; } else { $_SESSION['strErrMessage'] = $_ARRAYLANG['TXT_CRM_TASK_RESPONSIBLE_ERR']; } } else { $addedDate = date('Y-m-d H:i:s'); $fields = array('task_title' => $title, 'task_type_id' => $type, 'customer_id' => $customer, 'due_date' => $duedate, 'assigned_to' => $assignedto, 'added_by' => $objFWUser->objUser->getId(), 'added_date_time' => $addedDate, 'task_status' => '0', 'description' => $description); $query = \SQL::insert("module_{$this->moduleNameLC}_task", $fields, array('escape' => true)); $_SESSION['strOkMessage'] = $_ARRAYLANG['TXT_CRM_TASK_OK_MESSAGE']; } $db = $objDatabase->Execute($query); if ($db) { if ($notify) { $cx = \Cx\Core\Core\Controller\Cx::instanciate(); $id = !empty($id) ? $id : $objDatabase->INSERT_ID(); $info['substitution'] = array('CRM_ASSIGNED_USER_NAME' => contrexx_raw2xhtml(\FWUser::getParsedUserTitle($assignedto)), 'CRM_ASSIGNED_USER_EMAIL' => $objFWUser->objUser->getUser($assignedto)->getEmail(), 'CRM_DOMAIN' => ASCMS_PROTOCOL . "://{$_SERVER['HTTP_HOST']}" . $cx->getCodeBaseOffsetPath(), 'CRM_TASK_NAME' => $title, 'CRM_TASK_LINK' => "<a href='" . ASCMS_PROTOCOL . "://{$_SERVER['HTTP_HOST']}" . $cx->getCodeBaseOffsetPath() . $cx->getBackendFolderName() . "/index.php?cmd=" . $this->moduleName . "&act=task&tpl=modify&id={$id}'>{$title}</a>", 'CRM_TASK_URL' => ASCMS_PROTOCOL . "://{$_SERVER['HTTP_HOST']}" . $cx->getCodeBaseOffsetPath() . $cx->getBackendFolderName() . "/index.php?cmd=" . $this->moduleName . "&act=task&tpl=modify&id={$id}", 'CRM_TASK_DUE_DATE' => $duedate, 'CRM_TASK_CREATED_USER' => contrexx_raw2xhtml(\FWUser::getParsedUserTitle($objFWUser->objUser->getId())), 'CRM_TASK_DESCRIPTION_TEXT_VERSION' => contrexx_html2plaintext($description), 'CRM_TASK_DESCRIPTION_HTML_VERSION' => $description); //setting email template lang id $availableMailTempLangAry = $this->getActiveEmailTemLangId('Crm', CRM_EVENT_ON_TASK_CREATED); $availableLangId = $this->getEmailTempLang($availableMailTempLangAry, $objFWUser->objUser->getUser($assignedto)->getEmail()); $info['lang_id'] = $availableLangId; $dispatcher = CrmEventDispatcher::getInstance(); $dispatcher->triggerEvent(CRM_EVENT_ON_TASK_CREATED, null, $info); } \Cx\Core\Csrf\Controller\Csrf::header("Location:./index.php?cmd=" . $this->moduleName . base64_decode($redirect)); exit; } } elseif (!empty($id)) { $objValue = $objDatabase->Execute("SELECT task_id,\n task_title,\n task_type_id,\n due_date,\n assigned_to,\n description,\n c.id,\n c.customer_name,\n c.contact_familyname\n FROM `" . DBPREFIX . "module_{$this->moduleNameLC}_task` AS t\n LEFT JOIN `" . DBPREFIX . "module_{$this->moduleNameLC}_contacts` AS c\n ON t.customer_id = c.id\n WHERE t.id='{$id}'"); $title = $objValue->fields['task_title']; $type = $objValue->fields['task_type_id']; $customer = $objValue->fields['id']; $customerName = !empty($objValue->fields['customer_name']) ? $objValue->fields['customer_name'] . " " . $objValue->fields['contact_familyname'] : ''; $duedate = $objValue->fields['due_date']; $assignedto = $objValue->fields['assigned_to']; $description = $objValue->fields['description']; $taskAutoId = $objValue->fields['task_id']; } $this->_getResourceDropDown('Members', $assignedto, $settings['emp_default_user_group']); $this->taskTypeDropDown($objtpl, $type); if (!empty($customer)) { // Get customer Name $objCustomer = $objDatabase->Execute("SELECT customer_name, contact_familyname FROM `" . DBPREFIX . "module_crm_contacts` WHERE id = {$customer}"); $customerName = $objCustomer->fields['customer_name'] . " " . $objCustomer->fields['contact_familyname']; } $objtpl->setVariable(array('CRM_LOGGED_USER_ID' => $objFWUser->objUser->getId(), 'CRM_TASK_AUTOID' => contrexx_raw2xhtml($taskAutoId), 'CRM_TASK_ID' => (int) $id, 'CRM_TASKTITLE' => contrexx_raw2xhtml($title), 'CRM_DUE_DATE' => contrexx_raw2xhtml($duedate), 'CRM_CUSTOMER_ID' => intval($customer), 'CRM_CUSTOMER_NAME' => contrexx_raw2xhtml($customerName), 'CRM_TASK_DESC' => new \Cx\Core\Wysiwyg\Wysiwyg('description', contrexx_raw2xhtml($description)), 'CRM_BACK_LINK' => base64_decode($redirect), 'TXT_CRM_ADD_TASK' => empty($id) ? $_ARRAYLANG['TXT_CRM_ADD_TASK'] : $_ARRAYLANG['TXT_CRM_EDITTASK'], 'TXT_CRM_TASK_ID' => $_ARRAYLANG['TXT_CRM_TASK_ID'], 'TXT_CRM_TASK_TITLE' => $_ARRAYLANG['TXT_CRM_TASK_TITLE'], 'TXT_CRM_TASK_TYPE' => $_ARRAYLANG['TXT_CRM_TASK_TYPE'], 'TXT_CRM_SELECT_TASK_TYPE' => $_ARRAYLANG['TXT_CRM_SELECT_TASK_TYPE'], 'TXT_CRM_CUSTOMER_NAME' => $_ARRAYLANG['TXT_CRM_CUSTOMER_NAME'], 'TXT_CRM_TASK_DUE_DATE' => $_ARRAYLANG['TXT_CRM_TASK_DUE_DATE'], 'TXT_CRM_TASK_RESPONSIBLE' => $_ARRAYLANG['TXT_CRM_TASK_RESPONSIBLE'], 'TXT_CRM_SELECT_MEMBER_NAME' => $_ARRAYLANG['TXT_CRM_SELECT_MEMBER_NAME'], 'TXT_CRM_OVERVIEW' => $_ARRAYLANG['TXT_CRM_OVERVIEW'], 'TXT_CRM_TASK_DESCRIPTION' => $_ARRAYLANG['TXT_CRM_TASK_DESCRIPTION'], 'TXT_CRM_FIND_COMPANY_BY_NAME' => $_ARRAYLANG['TXT_CRM_FIND_COMPANY_BY_NAME'], 'TXT_CRM_SAVE' => $_ARRAYLANG['TXT_CRM_SAVE'], 'TXT_CRM_BACK' => $_ARRAYLANG['TXT_CRM_BACK'], 'TXT_CRM_NOTIFY' => $_ARRAYLANG['TXT_CRM_NOTIFY'], 'TXT_CRM_MANDATORY_FIELDS_NOT_FILLED_OUT' => $_ARRAYLANG['TXT_CRM_MANDATORY_FIELDS_NOT_FILLED_OUT'])); }