function getDescriptionMarker(&$template, &$sims, &$rems) { $sims['###ADDITIONALJS_PRE###'] = ''; $sims['###ADDITIONALJS_POST###'] = ''; $sims['###ADDITIONALJS_SUBMIT###'] = ''; $sims['###DESCRIPTION###'] = ''; if ($this->isAllowed('description')) { $sims['###DESCRIPTION###'] = $this->cObj->stdWrap('<textarea name="tx_cal_controller[description]" id="cal_event_description">' . $this->object->getDescription() . '</textarea>', $this->conf['view.'][$this->conf['view'] . '.']['description_stdWrap.']); /* Start setting the RTE markers */ if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('tinymce_rte')) { require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('tinymce_rte') . 'pi1/class.tx_tinymce_rte_pi1.php'; // alternative RTE } if (!$this->RTEObj && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('rtehtmlarea')) { $this->RTEObj = new \TYPO3\CMS\Rtehtmlarea\Controller\FrontendRteController(); } else { if (!$this->RTEObj && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('tinymce_rte')) { $this->RTEObj = \TYPO3\CMS\Cal\Utility\Functions::makeInstance('tx_tinymce_rte_pi1'); // load alternative RTE } } if (is_object($this->RTEObj) && $this->RTEObj->isAvailable() && $this->conf['rights.'][$this->isEditMode ? 'edit.' : 'create.']['event.']['enableRTE']) { $this->RTEcounter++; $this->formName = 'tx_cal_controller'; $this->strEntryField = 'description'; $this->PA['itemFormElName'] = 'tx_cal_controller[description]'; $this->PA['itemFormElValue'] = $this->object->getDescription(); $this->thePidValue = $GLOBALS['TSFE']->id; if ($this->conf['view.'][$this->conf['view'] . '.']['rte.']['width'] > 0) { $this->RTEObj->RTEdivStyle = 'width:' . $this->conf['view.'][$this->conf['view'] . '.']['rte.']['width'] . 'px;'; } if ($this->conf['view.'][$this->conf['view'] . '.']['rte.']['height'] > 0) { $this->RTEObj->RTEdivStyle .= 'height:' . $this->conf['view.'][$this->conf['view'] . '.']['rte.']['height'] . 'px;'; } $RTEItem = $this->RTEObj->drawRTE($this, 'tx_cal_event', $this->strEntryField, $row = array(), $this->PA, $this->specConf, $this->thisConfig, $this->RTEtypeVal, '', $this->thePidValue); $sims['###ADDITIONALJS_PRE###'] = $this->additionalJS_initial . ' <script type="text/javascript">' . implode(chr(10), $this->additionalJS_pre) . ' </script>'; $sims['###ADDITIONALJS_POST###'] = ' <script type="text/javascript">' . implode(chr(10), $this->additionalJS_post) . ' </script>'; $sims['###ADDITIONALJS_SUBMIT###'] = implode(';', $this->additionalJS_submit); $sims['###DESCRIPTION###'] = $this->applyStdWrap($RTEItem, 'description_stdWrap'); } } }
function retrievePostData(&$insertFields) { $hidden = 0; if ($this->conf['rights.']['create.']['location.']['fields.']['hidden.']['default'] && !$this->rightsObj->isAllowedTo('create', 'location', 'hidden') && !$this->rightsObj->isAllowedTo('create', 'location', 'hidden')) { $hidden = $this->conf['rights.']['create.']['location.']['fields.']['hidden.']['default']; } else { if ($this->conf['rights.']['edit.']['location.']['fields.']['hidden.']['default'] && !$this->rightsObj->isAllowedTo('edit', 'location', 'hidden') && !$this->rightsObj->isAllowedTo('create', 'location', 'hidden')) { $hidden = $this->conf['rights.']['location.']['event.']['fields.']['hidden.']['default']; } else { if ($this->controller->piVars['hidden'] == 'true' && ($this->rightsObj->isAllowedTo('edit', 'location', 'hidden') || $this->rightsObj->isAllowedTo('create', 'location', 'hidden'))) { $hidden = 1; } } } $insertFields['hidden'] = $hidden; if ($this->rightsObj->isAllowedToEditLocationName() || $this->rightsObj->isAllowedToCreateLocationName()) { $insertFields['name'] = strip_tags($this->controller->piVars['name']); } if ($this->rightsObj->isAllowedToEditLocationDescription() || $this->rightsObj->isAllowedToCreateLocationDescription()) { $insertFields['description'] = $this->cObj->removeBadHTML($this->controller->piVars['description'], $this->conf); } if ($this->rightsObj->isAllowedToEditLocationStreet() || $this->rightsObj->isAllowedToCreateLocationStreet()) { $insertFields['street'] = strip_tags($this->controller->piVars['street']); } if ($this->rightsObj->isAllowedToEditLocationZip() || $this->rightsObj->isAllowedToCreateLocationZip()) { $insertFields['zip'] = strip_tags($this->controller->piVars['zip']); } if ($this->rightsObj->isAllowedToEditLocationCity() || $this->rightsObj->isAllowedToCreateLocationCity()) { $insertFields['city'] = strip_tags($this->controller->piVars['city']); } if ($this->rightsObj->isAllowedToEditLocationCountryZone() || $this->rightsObj->isAllowedToCreateLocationCountryZone()) { $insertFields['country_zone'] = strip_tags($this->controller->piVars['countryzone']); } if ($this->rightsObj->isAllowedToEditLocationCountry() || $this->rightsObj->isAllowedToCreateLocationCountry()) { $insertFields['country'] = strip_tags($this->controller->piVars['country']); } if ($this->rightsObj->isAllowedToEditLocationPhone() || $this->rightsObj->isAllowedToCreateLocationPhone()) { $insertFields['phone'] = strip_tags($this->controller->piVars['phone']); } if ($this->rightsObj->isAllowedTo('edit', 'location', 'fax') || $this->rightsObj->isAllowedTo('create', 'location', 'fax')) { $insertFields['fax'] = strip_tags($this->controller->piVars['fax']); } if ($this->rightsObj->isAllowedToEditLocationEmail() || $this->rightsObj->isAllowedToCreateLocationEmail()) { $insertFields['email'] = strip_tags($this->controller->piVars['email']); } if ($this->rightsObj->isAllowedTo('edit', 'location', 'link') || $this->rightsObj->isAllowedTo('create', 'location', 'link')) { $insertFields['link'] = strip_tags($this->controller->piVars['link']); } if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('wec_map') && ($insertFields['street'] != '' || $insertFields['city'] != '' || $insertFields['country_zone'] != '' || $insertFields['zip'] != '' || $insertFields['country'])) { /* Geocode the address */ $lookupTable = \TYPO3\CMS\Cal\Utility\Functions::makeInstance('tx_wecmap_cache'); $latlong = $lookupTable->lookup($insertFields['street'], $insertFields['city'], $insertFields['country_zone'], $insertFields['zip'], $insertFields['country']); $insertFields['latitude'] = $latlong['lat']; $insertFields['longitude'] = $latlong['long']; } }
public function getCountryzoneMarker(&$template, &$sims, &$rems) { // Initialise static info library $sims['###COUNTRYZONE###'] = ''; $sims['###COUNTRYZONE_VALUE###'] = ''; if ($this->isAllowed('countryzone')) { if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('static_info_tables')) { $staticInfo = \TYPO3\CMS\Cal\Utility\Functions::makeInstance('tx_staticinfotables_pi1'); $staticInfo->init(); $current = \SJBR\StaticInfoTables\Utility\LocalizationUtility::translate(array('uid' => $this->object->getCountryzone()), 'static_country_zones', FALSE); $sims['###COUNTRYZONE###'] = $this->applyStdWrap($current, 'countryzone_static_info_stdWrap'); $sims['###COUNTRYZONE_VALUE###'] = $this->object->getCountryZone(); } else { $sims['###COUNTRYZONE###'] = $this->applyStdWrap($this->object->getCountryZone(), 'countryzone_stdWrap'); $sims['###COUNTRYZONE_VALUE###'] = $this->object->getCountryZone(); } } }
function getCountryZoneMarker(&$template, &$sims, &$rems, &$wrapped, $view) { $this->initLocalCObject(); if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('static_info_tables')) { $staticInfo = \TYPO3\CMS\Cal\Utility\Functions::makeInstance('tx_staticinfotables_pi1'); $staticInfo->init(); $current = \SJBR\StaticInfoTables\Utility\LocalizationUtility::translate(array('uid' => $this->getCountryzone()), 'static_country_zones', FALSE); $this->local_cObj->setCurrentVal($current); $sims['###COUNTRYZONE###'] = $this->local_cObj->cObjGetSingle($this->conf['view.'][$this->conf['view'] . '.'][$this->getObjectType() . '.']['countryzoneStaticInfo'], $this->conf['view.'][$this->conf['view'] . '.'][$this->getObjectType() . '.']['countryzoneStaticInfo.']); } else { $current = $this->getCountryzone(); $this->local_cObj->setCurrentVal($current); $sims['###COUNTRYZONE###'] = $this->local_cObj->cObjGetSingle($this->conf['view.'][$this->conf['view'] . '.'][$this->getObjectType() . '.']['countryzone'], $this->conf['view.'][$this->conf['view'] . '.'][$this->getObjectType() . '.']['countryzone.']); } }
public function getCountryzoneMarker(&$template, &$sims, &$rems, $view) { // Initialise static info library $sims['###COUNTRYZONE###'] = ''; if ($this->isAllowed('countryzone')) { if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('static_info_tables')) { $staticInfo = \TYPO3\CMS\Cal\Utility\Functions::makeInstance('tx_staticinfotables_pi1'); $staticInfo->init(); $sims['###COUNTRYZONE###'] = $this->applyStdWrap($staticInfo->buildStaticInfoSelector('SUBDIVISIONS', 'tx_cal_controller[countryzone]', '', $this->object->getCountryZone(), $this->object->getCountry()), 'countryzone_static_info_stdWrap'); } else { $sims['###COUNTRYZONE###'] = $this->applyStdWrap($this->object->getCountryZone(), 'countryzone_stdWrap'); $sims['###COUNTRYZONE_VALUE###'] = $this->object->getCountryZone(); } } }
function processDatamap_postProcessFieldArray($status, $table, $id, &$fieldArray, &$tce) { /* If we have an existing calendar event */ if ($table == 'tx_cal_event' && count($fieldArray) > 1) { if ($fieldArray['start_date']) { $fieldArray['start_date'] = $this->convertBackendDateToYMD($fieldArray['start_date']); } if ($fieldArray['end_date']) { $fieldArray['end_date'] = $this->convertBackendDateToYMD($fieldArray['end_date']); } /* If the end date is blank or earlier than the start date */ if ($fieldArray['end_date'] < $fieldArray['start_date']) { $fieldArray['end_date'] = $fieldArray['start_date']; } if ($fieldArray['until']) { $fieldArray['until'] = $this->convertBackendDateToYMD($fieldArray['until']); } if ($status != 'new') { $event = BackendUtility::getRecord('tx_cal_event', $id); // Do to our JS, these values get recalculated each time, but they may not have changed! if ($event['start_date'] == $fieldArray['start_date']) { unset($fieldArray['start_date']); } if ($event['end_date'] == $fieldArray['end_date']) { unset($fieldArray['end_date']); } if ($event['until'] == $fieldArray['until']) { unset($fieldArray['until']); } /* If we're in a workspace, don't notify anyone about the event */ if ($event['pid'] > 0 && count($fieldArray) > 1 && !$GLOBALS['BE_USER']->workspace) { if ($fieldArray['calendar_id'] && $event['calendar_id'] != $fieldArray['calendar_id']) { $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_cal_event_category_mm', 'uid_local=' . intval($id)); } /* Check Page TSConfig for a preview page that we should use */ $pageTSConf = BackendUtility::getPagesTSconfig($event['pid']); if ($pageTSConf['options.']['tx_cal_controller.']['pageIDForPlugin']) { $pageIDForPlugin = $pageTSConf['options.']['tx_cal_controller.']['pageIDForPlugin']; } else { $pageIDForPlugin = $event['pid']; } // @todo Should we have an else case for notifying when the doktype is 254? $page = BackendUtility::getRecord('pages', intval($pageIDForPlugin), 'doktype'); if ($page['doktype'] != 254) { /* Notify of changes to existing event */ $tx_cal_api = GeneralUtility::makeInstance('TYPO3\\CMS\\Cal\\Controller\\Api'); $tx_cal_api =& $tx_cal_api->tx_cal_api_without($pageIDForPlugin); $notificationService =& \TYPO3\CMS\Cal\Utility\Functions::getNotificationService(); $oldPath =& $notificationService->conf['view.']['event.']['eventModelTemplate']; $extPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('cal'); $oldPath = str_replace('EXT:cal/', $extPath, $oldPath); // $oldPath = str_replace(PATH_site, '', $oldPath); $tx_cal_api->conf['view.']['event.']['eventModelTemplate'] = $oldPath; $oldBackPath = $GLOBALS['TSFE']->tmpl->getFileName_backPath; $GLOBALS['TSFE']->tmpl->getFileName_backPath = ''; $fileInfo = GeneralUtility::split_fileref($oldPath); $GLOBALS['TSFE']->tmpl->allowedPaths[] = $fileInfo['path']; $notificationService->controller->getDateTimeObject = new \TYPO3\CMS\Cal\Model\CalDate($event['start_date'] . '000000'); $notificationService->notifyOfChanges($event, $fieldArray); if ($fieldArray['send_invitation']) { $notificationService->invite($event); $fieldArray['send_invitation'] = 0; } $GLOBALS['TSFE']->tmpl->getFileName_backPath = $oldBackPath; } } } } if ($table == 'tx_cal_exception_event' && count($fieldArray) > 1) { if ($fieldArray['start_date']) { $fieldArray['start_date'] = $this->convertBackendDateToYMD($fieldArray['start_date']); } if ($fieldArray['end_date']) { $fieldArray['end_date'] = $this->convertBackendDateToYMD($fieldArray['end_date']); } /* If the end date is blank or earlier than the start date */ if ($fieldArray['end_date'] < $fieldArray['start_date']) { $fieldArray['end_date'] = $fieldArray['start_date']; } if ($fieldArray['until']) { $fieldArray['until'] = $this->convertBackendDateToYMD($fieldArray['until']); } } /* If we're working with a calendar and an ICS file or URL has been posted, try to import it */ if ($table == 'tx_cal_calendar') { $calendar = BackendUtility::getRecord('tx_cal_calendar', $id); /** @var \TYPO3\CMS\Cal\Service\ICalendarService $service */ $service = GeneralUtility::makeInstance('TYPO3\\CMS\\Cal\\Service\\ICalendarService'); if ($calendar['type'] == 1 or $calendar['type'] == 2) { $this->processICS($calendar, $fieldArray, $service); } } if ($table == 'tx_cal_fe_user_event_monitor_mm') { $values = explode('_', $fieldArray['uid_foreign']); $fieldArray['uid_foreign'] = array_pop($values); $fieldArray['tablenames'] = implode('_', $values); } if ($table == 'tx_cal_location' && count($fieldArray) > 0 && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('wec_map')) { $location = BackendUtility::getRecord('tx_cal_location', $id); if (is_array($location)) { $location = array_merge($location, $fieldArray); } else { $location = $fieldArray; } /* Geocode the address */ $lookupTable = \TYPO3\CMS\Cal\Utility\Functions::makeInstance('tx_wecmap_cache'); $latlong = $lookupTable->lookup($location['street'], $location['city'], $location['state'], $location['zip'], $location['country']); $fieldArray['latitude'] = $latlong['lat']; $fieldArray['longitude'] = $latlong['long']; } }