ggoffy /
wgevents
| 1 | <?php declare(strict_types=1); |
||
| 2 | |||
| 3 | /* |
||
| 4 | You may not change or alter any portion of this comment or credits |
||
| 5 | of supporting developers from this source code or any supporting source code |
||
| 6 | which is considered copyrighted (c) material of the original comment or credit authors. |
||
| 7 | |||
| 8 | This program is distributed in the hope that it will be useful, |
||
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
| 11 | */ |
||
| 12 | |||
| 13 | /** |
||
| 14 | * wgEvents module for xoops |
||
| 15 | * |
||
| 16 | * @copyright 2021 XOOPS Project (https://xoops.org) |
||
| 17 | * @license GPL 2.0 or later |
||
| 18 | * @package wgevents |
||
| 19 | * @author Goffy - Wedega - Email:[email protected] - Website:https://xoops.wedega.com |
||
| 20 | */ |
||
| 21 | |||
| 22 | use Xmf\Request; |
||
| 23 | use XoopsModules\Wgevents; |
||
| 24 | use XoopsModules\Wgevents\ { |
||
| 25 | Constants, |
||
| 26 | Utility, |
||
| 27 | Common, |
||
| 28 | MailHandler |
||
| 29 | }; |
||
| 30 | |||
| 31 | require __DIR__ . '/header.php'; |
||
| 32 | $GLOBALS['xoopsOption']['template_main'] = 'wgevents_event.tpl'; |
||
| 33 | require_once \XOOPS_ROOT_PATH . '/header.php'; |
||
| 34 | |||
| 35 | // Permission |
||
| 36 | if (!$permissionsHandler->getPermEventsView()) { |
||
| 37 | \redirect_header('index.php', 0); |
||
| 38 | } |
||
| 39 | $permSubmit = $permissionsHandler->getPermEventsSubmit(); |
||
| 40 | $GLOBALS['xoopsTpl']->assign('permSubmit', $permSubmit); |
||
| 41 | $permApprove = $permissionsHandler->getPermEventsApprove(); |
||
| 42 | $GLOBALS['xoopsTpl']->assign('permApprove', $permApprove); |
||
| 43 | $permRegister = $permissionsHandler->getPermRegistrationsSubmit(); |
||
| 44 | $GLOBALS['xoopsTpl']->assign('permRegister', $permRegister); |
||
| 45 | |||
| 46 | $op = Request::getCmd('op', 'list'); |
||
| 47 | $evId = Request::getInt('id'); |
||
| 48 | $filter = Request::getString('filter'); |
||
| 49 | $start = Request::getInt('start'); |
||
| 50 | $limit = Request::getInt('limit', $helper->getConfig('userpager')); |
||
| 51 | $GLOBALS['xoopsTpl']->assign('start', $start); |
||
| 52 | $GLOBALS['xoopsTpl']->assign('limit', $limit); |
||
| 53 | $catId = Request::getInt('catid'); |
||
| 54 | $filterCats = Request::getArray('filter_cats'); |
||
| 55 | if ($catId > 0 && 0 == \count($filterCats)) { |
||
| 56 | $filterCats[$catId] = $catId; |
||
| 57 | } |
||
| 58 | $urlCats = Request::getString('cats'); |
||
| 59 | if (0 == \count($filterCats) && '' != $urlCats) { |
||
| 60 | $filterCats = \explode(',', $urlCats); |
||
| 61 | } |
||
| 62 | |||
| 63 | // Define Stylesheet |
||
| 64 | $GLOBALS['xoTheme']->addStylesheet($style, null); |
||
| 65 | // Paths |
||
| 66 | $GLOBALS['xoopsTpl']->assign('xoops_icons32_url', \XOOPS_ICONS32_URL); |
||
| 67 | $GLOBALS['xoopsTpl']->assign('wgevents_url', \WGEVENTS_URL); |
||
| 68 | // JS |
||
| 69 | $GLOBALS['xoTheme']->addScript(\WGEVENTS_URL . '/assets/js/forms.js'); |
||
| 70 | // Keywords |
||
| 71 | $keywords = []; |
||
| 72 | // Breadcrumbs |
||
| 73 | $xoBreadcrumbs[] = ['title' => \_MA_WGEVENTS_INDEX, 'link' => 'index.php']; |
||
| 74 | |||
| 75 | //preferences |
||
| 76 | $gmapsEnableEvent = false; |
||
| 77 | $gmapsHeight = false; |
||
| 78 | $useGMaps = (bool)$helper->getConfig('use_gmaps'); |
||
| 79 | if ($useGMaps) { |
||
| 80 | $gmapsPositionList = (string)$helper->getConfig('gmaps_enableevent'); |
||
| 81 | $gmapsEnableEvent = ('top' == $gmapsPositionList || 'bottom' == $gmapsPositionList); |
||
| 82 | $gmapsHeight = $helper->getConfig('gmaps_height'); |
||
| 83 | } |
||
| 84 | $eventDisplayCats = (string)$helper->getConfig('event_displaycats'); |
||
| 85 | $GLOBALS['xoopsTpl']->assign('event_displaycats', $eventDisplayCats); |
||
| 86 | |||
| 87 | //misc |
||
| 88 | $uidCurrent = 0; |
||
| 89 | $userIsAdmin = false; |
||
| 90 | if (\is_object($GLOBALS['xoopsUser'])) { |
||
| 91 | $uidCurrent = $GLOBALS['xoopsUser']->uid(); |
||
| 92 | $userIsAdmin = $GLOBALS['xoopsUser']->isAdmin(); |
||
| 93 | } |
||
| 94 | |||
| 95 | $showItem = ($evId > 0); |
||
| 96 | $GLOBALS['xoopsTpl']->assign('showItem', $showItem); |
||
| 97 | |||
| 98 | switch ($op) { |
||
| 99 | case 'show': |
||
| 100 | case 'list': |
||
| 101 | case 'past': |
||
| 102 | default: |
||
| 103 | $GLOBALS['xoopsTpl']->assign('wgevents_upload_eventlogos_url', \WGEVENTS_UPLOAD_EVENTLOGOS_URL); |
||
| 104 | $GLOBALS['xoopsTpl']->assign('wgevents_upload_catlogos_url', \WGEVENTS_UPLOAD_CATLOGOS_URL); |
||
| 105 | $GLOBALS['xoopsTpl']->assign('wgevents_icons_url_24', \WGEVENTS_ICONS_URL_24 . '/'); |
||
| 106 | $GLOBALS['xoopsTpl']->assign('filter', $filter); |
||
| 107 | |||
| 108 | $GLOBALS['xoTheme']->addScript(\WGEVENTS_URL . '/assets/js/expander/jquery.expander.min.js'); |
||
| 109 | $GLOBALS['xoopsTpl']->assign('user_maxchar', $helper->getConfig('user_maxchar')); |
||
| 110 | $useGroups = (bool)$helper->getConfig('use_groups'); |
||
| 111 | $GLOBALS['xoopsTpl']->assign('use_groups', $useGroups); |
||
| 112 | |||
| 113 | // get categories if they should be displayed |
||
| 114 | if ('none' != $eventDisplayCats && !$showItem) { |
||
| 115 | $categories = $categoryHandler->getCategoriesForFilter($eventDisplayCats, $filterCats, $op, $useGroups, $filter); |
||
| 116 | $GLOBALS['xoopsTpl']->assign('categories', $categories); |
||
| 117 | } |
||
| 118 | |||
| 119 | // determine whether there are |
||
| 120 | // - past events if coming are shown |
||
| 121 | // - coming events if past are shown |
||
| 122 | switch($op) { |
||
| 123 | case 'show': |
||
| 124 | default: |
||
| 125 | $listDescr = ''; |
||
| 126 | break; |
||
| 127 | case 'list': |
||
| 128 | // get events from the past |
||
| 129 | $crEventArchieve = new \CriteriaCompo(); |
||
| 130 | $crEventArchieve->add(new \Criteria('datefrom', \time(), '<')); |
||
| 131 | $eventsCountArchieve = $eventHandler->getCount($crEventArchieve); |
||
| 132 | unset($crEventArchieve); |
||
| 133 | $GLOBALS['xoopsTpl']->assign('showBtnPast', $eventsCountArchieve > 0); |
||
| 134 | $listDescr = \_MA_WGEVENTS_EVENTS_LISTCOMING; |
||
| 135 | if ('form' == $eventDisplayCats) { |
||
| 136 | $formCatsCb = $categoryHandler->getFormCatsCb($filterCats, $op, $filter); |
||
| 137 | $GLOBALS['xoopsTpl']->assign('formCatsCb', $formCatsCb->render()); |
||
| 138 | } |
||
| 139 | break; |
||
| 140 | case 'past': |
||
| 141 | $GLOBALS['xoopsTpl']->assign('showBtnComing', true); |
||
| 142 | $listDescr = \_MA_WGEVENTS_EVENTS_LISTPAST; |
||
| 143 | if ('form' == $eventDisplayCats) { |
||
| 144 | $formCatsCb = $categoryHandler->getFormCatsCb($filterCats, $op, $filter); |
||
| 145 | $GLOBALS['xoopsTpl']->assign('formCatsCb', $formCatsCb->render()); |
||
| 146 | } |
||
| 147 | break; |
||
| 148 | } |
||
| 149 | $GLOBALS['xoopsTpl']->assign('listDescr', $listDescr); |
||
| 150 | |||
| 151 | //misc for displaying events |
||
| 152 | $crEvent = new \CriteriaCompo(); |
||
| 153 | if ($showItem) { |
||
| 154 | $GLOBALS['xoopsTpl']->assign('showList', false); |
||
| 155 | $xoBreadcrumbs[] = ['title' => \_MA_WGEVENTS_EVENT_DETAILS]; |
||
| 156 | } else { |
||
| 157 | $GLOBALS['xoopsTpl']->assign('showList', true); |
||
| 158 | $xoBreadcrumbs[] = ['title' => $listDescr]; |
||
| 159 | } |
||
| 160 | |||
| 161 | // get events |
||
| 162 | $eventsArr = $eventHandler->getEvents($start, $limit, \time(), 0, '', '', $op, $evId, $filter, $filterCats); |
||
| 163 | |||
| 164 | $eventsCount = $eventsArr['count']; |
||
| 165 | $GLOBALS['xoopsTpl']->assign('eventsCount', $eventsCount); |
||
| 166 | if ($eventsCount > 0) { |
||
| 167 | $eventsAll = $eventsArr['eventsAll']; |
||
| 168 | $events = []; |
||
| 169 | $eventsMap = []; |
||
| 170 | $evName = ''; |
||
| 171 | // Get All Event |
||
| 172 | foreach (\array_keys($eventsAll) as $i) { |
||
| 173 | $events[$i] = $eventsAll[$i]->getValuesEvents(); |
||
| 174 | |||
| 175 | $permEdit = $permissionsHandler->getPermEventsEdit($eventsAll[$i]->getVar('submitter'), $eventsAll[$i]->getVar('status')) || $uidCurrent == $eventsAll[$i]->getVar('submitter'); |
||
| 176 | $events[$i]['permEdit'] = $permEdit; |
||
| 177 | $crQuestion = new \CriteriaCompo(); |
||
| 178 | $crQuestion->add(new \Criteria('evid', $i)); |
||
| 179 | $events[$i]['nb_questions'] = $questionHandler->getCount($crQuestion); |
||
| 180 | $crRegistration = new \CriteriaCompo(); |
||
| 181 | $crRegistration->add(new \Criteria('evid', $i)); |
||
| 182 | $numberRegCurr = $registrationHandler->getCount($crRegistration); |
||
| 183 | $events[$i]['nb_registrations'] = $numberRegCurr; |
||
| 184 | $registerMax = (int)$events[$i]['register_max']; |
||
| 185 | $events[$i]['regmax'] = $registerMax; |
||
| 186 | if ($registerMax > 0) { |
||
| 187 | $events[$i]['regmax'] = $registerMax; |
||
| 188 | $proportion = $numberRegCurr / $registerMax; |
||
| 189 | if ($proportion >= 1) { |
||
| 190 | $events[$i]['regcurrent'] = \_MA_WGEVENTS_REGISTRATIONS_FULL; |
||
| 191 | } else if (0 == $numberRegCurr) { |
||
| 192 | $events[$i]['regcurrent'] = \_MA_WGEVENTS_REGISTRATIONS_NBCURR_0; |
||
| 193 | } else { |
||
| 194 | $events[$i]['regcurrent'] = \sprintf(\_MA_WGEVENTS_REGISTRATIONS_NBCURR_INDEX, $numberRegCurr, $registerMax); |
||
| 195 | } |
||
| 196 | $events[$i]['regcurrent_text'] = $events[$i]['regcurrent']; |
||
| 197 | $events[$i]['regcurrent_tip'] = true; |
||
| 198 | if ($proportion < 0.75) { |
||
| 199 | $events[$i]['regcurrentstate'] = 'success'; |
||
| 200 | } elseif ($proportion < 1) { |
||
| 201 | $events[$i]['regcurrentstate'] = 'warning'; |
||
| 202 | } else { |
||
| 203 | $events[$i]['regcurrentstate'] = 'danger'; |
||
| 204 | $events[$i]['regcurrent_tip'] = false; |
||
| 205 | } |
||
| 206 | $events[$i]['regpercentage'] = (int)($proportion * 100); |
||
| 207 | } else if ('show' == $op) { |
||
| 208 | $events[$i]['regcurrent'] = $numberRegCurr; |
||
| 209 | } |
||
| 210 | $events[$i]['regenabled'] = $permEdit || (\time() >= $events[$i]['register_from'] && \time() <= $events[$i]['register_to']); |
||
| 211 | $events[$i]['locked'] = (Constants::STATUS_LOCKED == $events[$i]['status']); |
||
| 212 | $events[$i]['canceled'] = (Constants::STATUS_CANCELED == $events[$i]['status']); |
||
| 213 | $evName = $eventsAll[$i]->getVar('name'); |
||
| 214 | if ($useGMaps && $gmapsEnableEvent && (float)$eventsAll[$i]->getVar('locgmlat') > 0) { |
||
| 215 | $eventsMap[$i] = [ |
||
| 216 | 'name' => $evName, |
||
| 217 | 'location' => $events[$i]['location_text_user'], |
||
| 218 | 'from' => $events[$i]['datefrom_text'], |
||
| 219 | 'url' => 'event.php?op=show&id=' . $i, |
||
| 220 | 'lat' => (float)$eventsAll[$i]->getVar('locgmlat'), |
||
| 221 | 'lon' => (float)$eventsAll[$i]->getVar('locgmlon') |
||
| 222 | ]; |
||
| 223 | } |
||
| 224 | $keywords[$i] = $evName; |
||
| 225 | } |
||
| 226 | $GLOBALS['xoopsTpl']->assign('events', $events); |
||
| 227 | if ('show' == $op && $useGMaps) { |
||
| 228 | $GLOBALS['xoopsTpl']->assign('gmapsShow', true); |
||
| 229 | } |
||
| 230 | if ($useGMaps && count($eventsMap) > 0) { |
||
| 231 | $GLOBALS['xoopsTpl']->assign('gmapsShowList', true); |
||
| 232 | $GLOBALS['xoopsTpl']->assign('gmapsEnableEvent', $gmapsEnableEvent); |
||
| 233 | $GLOBALS['xoopsTpl']->assign('gmapsHeight', $gmapsHeight); |
||
| 234 | $GLOBALS['xoopsTpl']->assign('gmapsPositionList', $gmapsPositionList); |
||
| 235 | $GLOBALS['xoopsTpl']->assign('api_key', $helper->getConfig('gmaps_api')); |
||
| 236 | $GLOBALS['xoopsTpl']->assign('eventsMap', $eventsMap); |
||
| 237 | } |
||
| 238 | unset($events, $eventMaps); |
||
| 239 | // Display Navigation |
||
| 240 | if ($eventsCount > $limit) { |
||
| 241 | $urlCats = \implode(',', $filterCats); |
||
| 242 | require_once \XOOPS_ROOT_PATH . '/class/pagenav.php'; |
||
| 243 | $pagenav = new \XoopsPageNav($eventsCount, $limit, $start, 'start', 'op=list&filter=' . $filter . '&limit=' . $limit . '&cats=' . $urlCats); |
||
| 244 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
||
| 245 | } |
||
| 246 | $GLOBALS['xoopsTpl']->assign('table_type', $helper->getConfig('table_type')); |
||
| 247 | $GLOBALS['xoopsTpl']->assign('start', $start); |
||
| 248 | $GLOBALS['xoopsTpl']->assign('limit', $limit); |
||
| 249 | |||
| 250 | if ('show' == $op && '' != $evName) { |
||
| 251 | $GLOBALS['xoopsTpl']->assign('xoops_pagetitle', \strip_tags($evName . ' - ' . $GLOBALS['xoopsModule']->getVar('name'))); |
||
| 252 | } |
||
| 253 | } |
||
| 254 | break; |
||
| 255 | case 'save': |
||
| 256 | // Security Check |
||
| 257 | if (!$GLOBALS['xoopsSecurity']->check()) { |
||
| 258 | \redirect_header('event.php', 3, \implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
||
| 259 | } |
||
| 260 | // Check permissions |
||
| 261 | if (!$permissionsHandler->getPermEventsSubmit()) { |
||
| 262 | \redirect_header('index.php?op=list', 3, \_NOPERM); |
||
| 263 | } |
||
| 264 | if ($evId > 0) { |
||
| 265 | $eventObj = $eventHandler->get($evId); |
||
| 266 | $eventObjOld = $eventHandler->get($evId); |
||
| 267 | // Check permissions |
||
| 268 | if (!$permissionsHandler->getPermEventsEdit($eventObj->getVar('submitter'), $eventObj->getVar('status'))) { |
||
| 269 | \redirect_header('index.php?op=list', 3, \_NOPERM); |
||
| 270 | } |
||
| 271 | } else { |
||
| 272 | $eventObj = $eventHandler->create(); |
||
| 273 | } |
||
| 274 | |||
| 275 | $uploaderErrors = ''; |
||
| 276 | $catId = Request::getInt('catid'); |
||
| 277 | $evSubmitter = Request::getInt('submitter'); |
||
| 278 | |||
| 279 | $eventObj->setVar('catid', $catId); |
||
| 280 | $subCats = \serialize(Request::getArray('subcats')); |
||
| 281 | $eventObj->setVar('subcats', $subCats); |
||
| 282 | $eventObj->setVar('name', Request::getString('name')); |
||
| 283 | // Set Var logo |
||
| 284 | require_once \XOOPS_ROOT_PATH . '/class/uploader.php'; |
||
| 285 | $filename = $_FILES['logo']['name']; |
||
| 286 | $imgMimetype = $_FILES['logo']['type']; |
||
| 287 | $imgNameDef = Request::getString('name'); |
||
| 288 | $uploadPath = \WGEVENTS_UPLOAD_EVENTLOGOS_PATH . '/' . $uidCurrent . '/'; |
||
| 289 | $uploader = new \XoopsMediaUploader($uploadPath, |
||
| 290 | $helper->getConfig('mimetypes_image'), |
||
| 291 | $helper->getConfig('maxsize_image'), null, null); |
||
| 292 | if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { |
||
| 293 | $extension = \preg_replace('/^.+\.([^.]+)$/sU', '', $filename); |
||
| 294 | $imgName = \str_replace(' ', '', $imgNameDef) . '.' . $extension; |
||
| 295 | $uploader->setPrefix($imgName); |
||
| 296 | $uploader->fetchMedia($_POST['xoops_upload_file'][0]); |
||
| 297 | if ($uploader->upload()) { |
||
| 298 | $savedFilename = $uploader->getSavedFileName(); |
||
| 299 | $maxwidth = (int)$helper->getConfig('maxwidth_image'); |
||
| 300 | $maxheight = (int)$helper->getConfig('maxheight_image'); |
||
| 301 | if ($maxwidth > 0 && $maxheight > 0) { |
||
| 302 | // Resize image |
||
| 303 | $imgHandler = new Wgevents\Common\Resizer(); |
||
| 304 | $imgHandler->sourceFile = $uploadPath . $savedFilename; |
||
| 305 | $imgHandler->endFile = $uploadPath . $savedFilename; |
||
| 306 | $imgHandler->imageMimetype = $imgMimetype; |
||
| 307 | $imgHandler->maxWidth = $maxwidth; |
||
| 308 | $imgHandler->maxHeight = $maxheight; |
||
| 309 | $result = $imgHandler->resizeImage(); |
||
| 310 | } |
||
| 311 | $filename = $savedFilename; |
||
| 312 | $eventObj->setVar('logo', $savedFilename); |
||
| 313 | } else { |
||
| 314 | $uploaderErrors .= '<br>' . $uploader->getErrors(); |
||
| 315 | } |
||
| 316 | } else { |
||
| 317 | if ($filename > '') { |
||
| 318 | $uploaderErrors .= '<br>' . $uploader->getErrors(); |
||
| 319 | } |
||
| 320 | $filename = Request::getString('logo'); |
||
| 321 | if ('' != $filename) { |
||
| 322 | $eventObj->setVar('logo', $filename); |
||
| 323 | } |
||
| 324 | } |
||
| 325 | if ($evSubmitter !== $uidCurrent) { |
||
| 326 | //if someone creates/save event for someone else then copy logo |
||
| 327 | $submitterDirectory = \WGEVENTS_UPLOAD_EVENTLOGOS_PATH . '/' . $evSubmitter; |
||
| 328 | if (!\file_exists($submitterDirectory)) { |
||
| 329 | Utility::createFolder($submitterDirectory); |
||
| 330 | \chmod($submitterDirectory, 0777); |
||
| 331 | $source = \WGEVENTS_PATH . '/assets/images/blank.gif'; |
||
| 332 | $dest = $submitterDirectory . '/blank.gif'; |
||
| 333 | Utility::copyFile($source, $dest); |
||
| 334 | } |
||
| 335 | $dest = \WGEVENTS_UPLOAD_EVENTLOGOS_PATH . '/' . $evSubmitter . '/' . $filename; |
||
| 336 | if (!\file_exists($dest)) { |
||
| 337 | Utility::copyFile($uploadPath . $filename, $dest); |
||
| 338 | } |
||
| 339 | } |
||
| 340 | $eventObj->setVar('desc', Request::getText('desc')); |
||
| 341 | $eventDatefromArr = Request::getArray('datefrom'); |
||
| 342 | $eventDatefromObj = \DateTime::createFromFormat(\_SHORTDATESTRING, $eventDatefromArr['date']); |
||
| 343 | $eventDatefromObj->setTime(0, 0); |
||
| 344 | $eventDatefrom = $eventDatefromObj->getTimestamp() + (int)$eventDatefromArr['time']; |
||
| 345 | $eventObj->setVar('datefrom', $eventDatefrom); |
||
| 346 | $eventDatetoArr = Request::getArray('dateto'); |
||
| 347 | $eventDatetoObj = \DateTime::createFromFormat(\_SHORTDATESTRING, $eventDatetoArr['date']); |
||
| 348 | $eventDatetoObj->setTime(0, 0); |
||
| 349 | $eventDateto = $eventDatetoObj->getTimestamp() + (int)$eventDatetoArr['time']; |
||
| 350 | $eventObj->setVar('dateto', $eventDateto); |
||
| 351 | $eventObj->setVar('allday', Request::getInt('allday')); |
||
| 352 | $eventObj->setVar('contact', Request::getString('contact')); |
||
| 353 | $eventObj->setVar('email', Request::getString('email')); |
||
| 354 | $eventObj->setVar('url', Request::getString('url')); |
||
| 355 | $eventObj->setVar('location', Request::getString('location')); |
||
| 356 | $eventObj->setVar('locgmlat', Request::getFloat('locgmlat')); |
||
| 357 | $eventObj->setVar('locgmlon', Request::getFloat('locgmlon')); |
||
| 358 | $eventObj->setVar('locgmzoom', Request::getInt('locgmzoom')); |
||
| 359 | $evFeeAmountArr = Request::getArray('fee'); |
||
| 360 | $evFeeDescArr = Request::getArray('feedesc'); |
||
| 361 | $evFeeArr = []; |
||
| 362 | foreach ($evFeeAmountArr as $key => $evFeeAmount) { |
||
| 363 | $evFeeArr[] = [Utility::StringToFloat($evFeeAmount), $evFeeDescArr[$key]]; |
||
| 364 | } |
||
| 365 | // remove last array item, as this is from hidden group |
||
| 366 | \array_pop($evFeeArr); |
||
| 367 | $evFee = \json_encode($evFeeArr); |
||
| 368 | $eventObj->setVar('fee', $evFee); |
||
| 369 | $eventObj->setVar('paymentinfo', Request::getText('paymentinfo')); |
||
| 370 | $evRegisterUse = Request::getInt('register_use'); |
||
| 371 | $eventObj->setVar('register_use', $evRegisterUse); |
||
| 372 | if ($evRegisterUse) { |
||
| 373 | $evRegisterfromArr = Request::getArray('register_from'); |
||
| 374 | $evRegisterfromObj = \DateTime::createFromFormat(\_SHORTDATESTRING, $evRegisterfromArr['date']); |
||
| 375 | $evRegisterfromObj->setTime(0, 0); |
||
| 376 | $evRegisterfrom = $evRegisterfromObj->getTimestamp() + (int)$evRegisterfromArr['time']; |
||
| 377 | $eventObj->setVar('register_from', $evRegisterfrom); |
||
| 378 | $evRegistertoArr = Request::getArray('register_to'); |
||
| 379 | $evRegistertoObj = \DateTime::createFromFormat(\_SHORTDATESTRING, $evRegistertoArr['date']); |
||
| 380 | $evRegistertoObj->setTime(0, 0); |
||
| 381 | $evRegisterto = $evRegistertoObj->getTimestamp() + (int)$evRegistertoArr['time']; |
||
| 382 | $eventObj->setVar('register_to', $evRegisterto); |
||
| 383 | $eventObj->setVar('register_max', Request::getInt('register_max')); |
||
| 384 | $eventObj->setVar('register_listwait', Request::getInt('register_listwait')); |
||
| 385 | $eventObj->setVar('register_autoaccept', Request::getInt('register_autoaccept')); |
||
| 386 | $eventObj->setVar('register_notify', Request::getString('register_notify')); |
||
| 387 | $eventObj->setVar('register_forceverif', Request::getInt('register_forceverif')); |
||
| 388 | $evRegisterSendermail = Request::getString('register_sendermail'); |
||
| 389 | if ('' == $evRegisterSendermail) { |
||
| 390 | // Get Form Error |
||
| 391 | $GLOBALS['xoopsTpl']->assign('error', \_MA_WGEVENTS_EVENT_REGISTER_SENDERMAIL_ERR); |
||
| 392 | $form = $eventObj->getForm(); |
||
| 393 | $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
||
| 394 | break; |
||
| 395 | } |
||
| 396 | $eventObj->setVar('register_sendermail', $evRegisterSendermail); |
||
| 397 | $eventObj->setVar('register_sendername', Request::getString('register_sendername')); |
||
| 398 | $eventObj->setVar('register_signature', Request::getString('register_signature')); |
||
| 399 | } else { |
||
| 400 | //reset previous values |
||
| 401 | $eventObj->setVar('register_to', 0); |
||
| 402 | $eventObj->setVar('register_max', 0); |
||
| 403 | $eventObj->setVar('register_listwait', 0); |
||
| 404 | $eventObj->setVar('register_autoaccept', 0); |
||
| 405 | $eventObj->setVar('register_notify', ''); |
||
| 406 | $eventObj->setVar('register_sendermail', ''); |
||
| 407 | $eventObj->setVar('register_sendername', ''); |
||
| 408 | $eventObj->setVar('register_signature', ''); |
||
| 409 | $eventObj->setVar('register_forceverif', 0); |
||
| 410 | } |
||
| 411 | $eventObj->setVar('status', Request::getInt('status')); |
||
| 412 | $eventObj->setVar('galid', Request::getInt('galid')); |
||
| 413 | $arrGroups = Request::getArray('groups'); |
||
| 414 | if (in_array('00000', $arrGroups)) { |
||
| 415 | $eventObj->setVar('groups', '00000'); |
||
| 416 | } else { |
||
| 417 | $eventObj->setVar('groups', implode("|", $arrGroups)); |
||
| 418 | } |
||
| 419 | if (Request::hasVar('datecreated_int')) { |
||
| 420 | $eventObj->setVar('datecreated', Request::getInt('datecreated_int')); |
||
| 421 | } else { |
||
| 422 | $eventDatecreatedObj = \DateTime::createFromFormat(\_SHORTDATESTRING, Request::getString('datecreated')); |
||
| 423 | $eventObj->setVar('datecreated', $eventDatecreatedObj->getTimestamp()); |
||
| 424 | } |
||
| 425 | $eventObj->setVar('submitter', Request::getInt('submitter')); |
||
| 426 | // Insert Data |
||
| 427 | if ($eventHandler->insert($eventObj)) { |
||
| 428 | $newEvId = $evId > 0 ? $evId : $eventObj->getNewInsertedId(); |
||
| 429 | // create unique identifier if new event and identifier exists |
||
| 430 | if (0 == $evId) { |
||
| 431 | $categoryObj = $categoryHandler->get($catId); |
||
| 432 | $identifier = (string)$categoryObj->getVar('identifier'); |
||
| 433 | if ('' !== $identifier){ |
||
| 434 | if (\substr($identifier, -1) !== '_') { |
||
| 435 | $identifier .= '_'; |
||
| 436 | } |
||
| 437 | $identifier .= $eventDatefromObj->format('Y') . '_'; |
||
| 438 | $crEvent = new \CriteriaCompo(); |
||
| 439 | $crEvent->add(new \Criteria('identifier', $identifier . '%', 'LIKE')); |
||
| 440 | $eventsCount = $eventHandler->getCount($crEvent) + 1; |
||
| 441 | $eventIdentifierObj = $eventHandler->get($newEvId); |
||
| 442 | $eventIdentifierObj->setVar('identifier', $identifier . ($eventsCount)); |
||
| 443 | $eventHandler->insert($eventIdentifierObj); |
||
| 444 | unset($eventIdentifierObj); |
||
| 445 | } |
||
| 446 | } else { |
||
| 447 | $eventIdentifierObj = $eventHandler->get($evId); |
||
| 448 | $eventIdentifierObj->setVar('identifier', Request::getString('identifier')); |
||
| 449 | $eventHandler->insert($eventIdentifierObj); |
||
| 450 | unset($eventIdentifierObj); |
||
| 451 | } |
||
| 452 | |||
| 453 | // Handle notification |
||
| 454 | /* |
||
| 455 | $evName = $eventObj->getVar('name'); |
||
| 456 | $evStatus = $eventObj->getVar('status'); |
||
| 457 | $tags = []; |
||
| 458 | $tags['ITEM_NAME'] = $evName; |
||
| 459 | $tags['ITEM_URL'] = \XOOPS_URL . '/modules/wgevents/event.php?op=show&id=' . $evId; |
||
| 460 | $notificationHandler = \xoops_getHandler('notification'); |
||
| 461 | if (Constants::STATUS_SUBMITTED == $evStatus) { |
||
| 462 | // Event approve notification |
||
| 463 | $notificationHandler->triggerEvent('global', 0, 'global_approve', $tags); |
||
| 464 | $notificationHandler->triggerEvent('events', $newEvId, 'event_approve', $tags); |
||
| 465 | } else { |
||
| 466 | if ($evId > 0) { |
||
| 467 | // Event modify notification |
||
| 468 | $notificationHandler->triggerEvent('global', 0, 'global_modify', $tags); |
||
| 469 | $notificationHandler->triggerEvent('events', $newEvId, 'event_modify', $tags); |
||
| 470 | } else { |
||
| 471 | // Event new notification |
||
| 472 | $notificationHandler->triggerEvent('global', 0, 'global_new', $tags); |
||
| 473 | } |
||
| 474 | } |
||
| 475 | */ |
||
| 476 | |||
| 477 | // check whether there are important changes of the event |
||
| 478 | // if yes then send notifications to all participants |
||
| 479 | if ($evId > 0) { |
||
| 480 | // find changes in table events |
||
| 481 | $infotext = $eventHandler->getEventsCompare($eventObjOld, $eventObj); |
||
| 482 | if ('' != $infotext) { |
||
| 483 | $typeConfirm = Constants::MAIL_EVENT_NOTIFY_MODIFY; |
||
| 484 | $crRegistration = new \CriteriaCompo(); |
||
| 485 | $crRegistration->add(new \Criteria('evid', $evId)); |
||
| 486 | $registrationsCount = $registrationHandler->getCount($crRegistration); |
||
| 487 | if ($registrationsCount > 0) { |
||
| 488 | $registrationsAll = $registrationHandler->getAll($crRegistration); |
||
| 489 | foreach (\array_keys($registrationsAll) as $regId) { |
||
| 490 | // Event delete notification |
||
| 491 | /* |
||
| 492 | $tags = []; |
||
| 493 | $tags['ITEM_NAME'] = $regEvid; |
||
| 494 | $notificationHandler = \xoops_getHandler('notification'); |
||
| 495 | $notificationHandler->triggerEvent('global', 0, 'global_delete', $tags); |
||
| 496 | $notificationHandler->triggerEvent('registrations', $regId, 'registration_delete', $tags); |
||
| 497 | */ |
||
| 498 | $informModif = Request::getBool('informModif'); |
||
| 499 | if ($informModif) { |
||
| 500 | // send notifications emails, only to participants |
||
| 501 | $regEmail = (string)$registrationsAll[$regId]->getVar('email'); |
||
| 502 | if ('' != $regEmail) { |
||
| 503 | // send confirmation |
||
| 504 | $mailsHandler = new MailHandler(); |
||
| 505 | $mailParams = $mailsHandler->getMailParam($evId, $regId); |
||
| 506 | $mailParams['infotext'] = $infotext; |
||
| 507 | $mailParams['recipients'] = $regEmail; |
||
| 508 | $mailsHandler->setParams($mailParams); |
||
| 509 | $mailsHandler->setType($typeConfirm); |
||
| 510 | $mailsHandler->setHtml(true); |
||
| 511 | $mailsHandler->executeReg(); |
||
|
0 ignored issues
–
show
|
|||
| 512 | unset($mailsHandler); |
||
| 513 | } |
||
| 514 | } |
||
| 515 | } |
||
| 516 | } |
||
| 517 | } |
||
| 518 | } |
||
| 519 | // redirect after insert |
||
| 520 | if ('' !== $uploaderErrors) { |
||
| 521 | \redirect_header('event.php?op=edit&id=' . $newEvId, 5, $uploaderErrors); |
||
| 522 | } else if ($evRegisterUse) { |
||
| 523 | // clone questions, if event is clone of other event |
||
| 524 | $idEvSource = Request::getInt('id_source'); |
||
| 525 | $cloneQuestions = Request::getBool('clone_question'); |
||
| 526 | if ($cloneQuestions) { |
||
| 527 | $crQuestion = new \CriteriaCompo(); |
||
| 528 | $crQuestion->add(new \Criteria('evid', $idEvSource)); |
||
| 529 | $questionsCount = $questionHandler->getCount($crQuestion); |
||
| 530 | if ($questionsCount > 0) { |
||
| 531 | $questionsAllSource = $questionHandler->getAll($crQuestion); |
||
| 532 | foreach ($questionsAllSource as $questionObjSource) { |
||
| 533 | $questionObjNew = $questionHandler->create(); |
||
| 534 | $vars = $questionObjSource->getVars(); |
||
| 535 | foreach (\array_keys($vars) as $var) { |
||
| 536 | switch ($var) { |
||
| 537 | case 'id': |
||
| 538 | break; |
||
| 539 | case 'evid': |
||
| 540 | $questionObjNew->setVar('evid', $newEvId); |
||
| 541 | break; |
||
| 542 | case 'datecreated': |
||
| 543 | $questionObjNew->setVar('datecreated', \time()); |
||
| 544 | break; |
||
| 545 | case 'submitter': |
||
| 546 | $questionObjNew->setVar('submitter', $uidCurrent); |
||
| 547 | break; |
||
| 548 | case '': |
||
| 549 | default: |
||
| 550 | $questionObjNew->setVar($var, $questionObjSource->getVar($var)); |
||
| 551 | break; |
||
| 552 | } |
||
| 553 | } |
||
| 554 | $questionHandler->insert($questionObjNew); |
||
| 555 | } |
||
| 556 | } |
||
| 557 | } |
||
| 558 | if (Request::hasVar('continue_questions')) { |
||
| 559 | \redirect_header('question.php?op=list&evid=' . $newEvId . '&start=' . $start . '&limit=' . $limit, 2, \_MA_WGEVENTS_FORM_OK); |
||
| 560 | } |
||
| 561 | if ($evId > 0 || !$cloneQuestions) { |
||
| 562 | \redirect_header('event.php?op=show&id=' . $evId . '&start=' . $start . '&limit=' . $limit, 2, \_MA_WGEVENTS_FORM_OK); |
||
| 563 | } else { |
||
| 564 | // check whether there are already question infos |
||
| 565 | $crQuestion = new \CriteriaCompo(); |
||
| 566 | $crQuestion->add(new \Criteria('evid', $newEvId)); |
||
| 567 | if ($questionHandler->getCount($crQuestion) > 0) { |
||
| 568 | // set of questions already existing |
||
| 569 | \redirect_header('question.php?op=list&evid=' . $newEvId, 2, \_MA_WGEVENTS_FORM_OK); |
||
| 570 | } else { |
||
| 571 | // redirect to question.php in order to add default set of questions |
||
| 572 | \redirect_header('question.php?op=newset&evid=' . $newEvId, 0, \_MA_WGEVENTS_FORM_OK); |
||
| 573 | } |
||
| 574 | } |
||
| 575 | } else { |
||
| 576 | if ($evId > 0) { |
||
| 577 | $registrationHandler->cleanupRegistrations($evId); |
||
| 578 | $questionHandler->cleanupQuestions($evId); |
||
| 579 | $answerHandler->cleanupAnswers($evId); |
||
| 580 | } |
||
| 581 | \redirect_header('event.php?op=list&start=' . $start . '&limit=' . $limit, 2, \_MA_WGEVENTS_FORM_OK); |
||
| 582 | } |
||
| 583 | } |
||
| 584 | // Get Form Error |
||
| 585 | $GLOBALS['xoopsTpl']->assign('error', $eventObj->getHtmlErrors()); |
||
| 586 | $form = $eventObj->getForm(); |
||
| 587 | $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
||
| 588 | break; |
||
| 589 | case 'new': |
||
| 590 | // Breadcrumbs |
||
| 591 | $xoBreadcrumbs[] = ['title' => \_MA_WGEVENTS_EVENT_ADD]; |
||
| 592 | // Check permissions |
||
| 593 | if (!$permissionsHandler->getPermEventsSubmit()) { |
||
| 594 | \redirect_header('event.php?op=list', 3, \_NOPERM); |
||
| 595 | } |
||
| 596 | if ($useGMaps) { |
||
| 597 | $GLOBALS['xoopsTpl']->assign('gmapsModalSave', $permissionsHandler->getPermEventsSubmit()); |
||
| 598 | $GLOBALS['xoopsTpl']->assign('gmapsModal', true); |
||
| 599 | $GLOBALS['xoopsTpl']->assign('api_key', $helper->getConfig('gmaps_api')); |
||
| 600 | } |
||
| 601 | // Form Create |
||
| 602 | $eventObj = $eventHandler->create(); |
||
| 603 | $eventDate = Request::getInt('eventDate', \time()); |
||
| 604 | $eventObj->setVar('datefrom', $eventDate); |
||
| 605 | $eventObj->setVar('dateto', $eventDate); |
||
| 606 | $eventObj->start = $start; |
||
| 607 | $eventObj->limit = $limit; |
||
| 608 | $form = $eventObj->getForm(); |
||
| 609 | $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
||
| 610 | break; |
||
| 611 | case 'edit': |
||
| 612 | // Breadcrumbs |
||
| 613 | $xoBreadcrumbs[] = ['title' => \_MA_WGEVENTS_EVENT_EDIT]; |
||
| 614 | // Check params |
||
| 615 | if (0 == $evId) { |
||
| 616 | \redirect_header('event.php?op=list', 3, \_MA_WGEVENTS_INVALID_PARAM); |
||
| 617 | } |
||
| 618 | $eventObj = $eventHandler->get($evId); |
||
| 619 | // Check permissions |
||
| 620 | $permEdit = !$permissionsHandler->getPermEventsEdit($eventObj->getVar('submitter'), $eventObj->getVar('status')); |
||
| 621 | if ($permEdit) { |
||
| 622 | \redirect_header('index.php?op=list', 3, \_NOPERM); |
||
| 623 | } |
||
| 624 | if ($useGMaps) { |
||
| 625 | $GLOBALS['xoopsTpl']->assign('gmapsModalSave', $permEdit); |
||
| 626 | $GLOBALS['xoopsTpl']->assign('gmapsModal', true); |
||
| 627 | $GLOBALS['xoopsTpl']->assign('api_key', $helper->getConfig('gmaps_api')); |
||
| 628 | } |
||
| 629 | // Get Form |
||
| 630 | $eventObj = $eventHandler->get($evId); |
||
| 631 | $eventObj->start = $start; |
||
| 632 | $eventObj->limit = $limit; |
||
| 633 | $form = $eventObj->getForm(); |
||
| 634 | $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
||
| 635 | break; |
||
| 636 | case 'clone': |
||
| 637 | // Check permissions |
||
| 638 | if (!$permissionsHandler->getPermEventsSubmit()) { |
||
| 639 | \redirect_header('event.php?op=list', 3, \_NOPERM); |
||
| 640 | } |
||
| 641 | |||
| 642 | // Request source |
||
| 643 | $evIdSource = Request::getInt('id_source'); |
||
| 644 | // Check params |
||
| 645 | if (0 == $evIdSource) { |
||
| 646 | \redirect_header('event.php?op=list', 3, \_MA_WGEVENTS_INVALID_PARAM); |
||
| 647 | } |
||
| 648 | |||
| 649 | // Breadcrumbs |
||
| 650 | $xoBreadcrumbs[] = ['title' => \_MA_WGEVENTS_EVENT_CLONE]; |
||
| 651 | |||
| 652 | if ($useGMaps) { |
||
| 653 | $GLOBALS['xoopsTpl']->assign('gmapsModalSave', $permissionsHandler->getPermEventsSubmit()); |
||
| 654 | $GLOBALS['xoopsTpl']->assign('gmapsModal', true); |
||
| 655 | $GLOBALS['xoopsTpl']->assign('api_key', $helper->getConfig('gmaps_api')); |
||
| 656 | } |
||
| 657 | |||
| 658 | // Get Form |
||
| 659 | $eventObjSource = $eventHandler->get($evIdSource); |
||
| 660 | $eventObjClone = $eventHandler->create(); |
||
| 661 | $vars = $eventObjSource->getVars(); |
||
| 662 | foreach (\array_keys($vars) as $var) { |
||
| 663 | $eventObjClone->setVar($var, $eventObjSource->getVar($var)); |
||
| 664 | } |
||
| 665 | $eventObjClone->idSource = $evIdSource; |
||
| 666 | $form = $eventObjClone->getForm(); |
||
| 667 | $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
||
| 668 | break; |
||
| 669 | case 'delete': |
||
| 670 | // Breadcrumbs |
||
| 671 | $xoBreadcrumbs[] = ['title' => \_MA_WGEVENTS_EVENT_DELETE]; |
||
| 672 | // Check permissions |
||
| 673 | if (!$permissionsHandler->getPermEventsSubmit()) { |
||
| 674 | \redirect_header('event.php?op=list', 3, \_NOPERM); |
||
| 675 | } |
||
| 676 | // Check params |
||
| 677 | if (0 == $evId) { |
||
| 678 | \redirect_header('event.php?op=list', 3, \_MA_WGEVENTS_INVALID_PARAM); |
||
| 679 | } |
||
| 680 | $crRegistration = new \CriteriaCompo(); |
||
| 681 | $crRegistration->add(new \Criteria('evid', $evId)); |
||
| 682 | $registrationsCount = $registrationHandler->getCount($crRegistration); |
||
| 683 | if ($registrationsCount > 0) { |
||
| 684 | \redirect_header('event.php?op=list', 3, \_MA_WGEVENTS_EVENT_DELETE_ERR); |
||
| 685 | } |
||
| 686 | $eventObj = $eventHandler->get($evId); |
||
| 687 | $evName = $eventObj->getVar('name'); |
||
| 688 | if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) { |
||
| 689 | if (!$GLOBALS['xoopsSecurity']->check()) { |
||
| 690 | \redirect_header('event.php', 3, \implode(', ', $GLOBALS['xoopsSecurity']->getErrors())); |
||
| 691 | } |
||
| 692 | $registrationHandler->cleanupRegistrations($evId); |
||
| 693 | $questionHandler->cleanupQuestions($evId); |
||
| 694 | $answerHandler->cleanupAnswers($evId); |
||
| 695 | if ($eventHandler->delete($eventObj)) { |
||
| 696 | // Event delete notification |
||
| 697 | /* |
||
| 698 | $tags = []; |
||
| 699 | $tags['ITEM_NAME'] = $evName; |
||
| 700 | $notificationHandler = \xoops_getHandler('notification'); |
||
| 701 | $notificationHandler->triggerEvent('global', 0, 'global_delete', $tags); |
||
| 702 | $notificationHandler->triggerEvent('events', $evId, 'event_delete', $tags); |
||
| 703 | */ |
||
| 704 | \redirect_header('event.php', 3, \_MA_WGEVENTS_FORM_DELETE_OK); |
||
| 705 | } else { |
||
| 706 | $GLOBALS['xoopsTpl']->assign('error', $eventObj->getHtmlErrors()); |
||
| 707 | } |
||
| 708 | } else { |
||
| 709 | $customConfirm = new Common\Confirm( |
||
| 710 | ['ok' => 1, 'id' => $evId, 'start' => $start, 'limit' => $limit, 'op' => 'delete'], |
||
| 711 | $_SERVER['REQUEST_URI'], |
||
| 712 | \sprintf(\_MA_WGEVENTS_CONFIRMDELETE_EVENT, $eventObj->getVar('name')), \_MA_WGEVENTS_CONFIRMDELETE_TITLE, \_MA_WGEVENTS_CONFIRMDELETE_LABEL); |
||
| 713 | $form = $customConfirm->getFormConfirm(); |
||
| 714 | $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
||
| 715 | } |
||
| 716 | break; |
||
| 717 | case 'cancel': |
||
| 718 | // Breadcrumbs |
||
| 719 | $xoBreadcrumbs[] = ['title' => \_MA_WGEVENTS_EVENT_CANCEL]; |
||
| 720 | // Check permissions |
||
| 721 | if (!$permissionsHandler->getPermEventsSubmit()) { |
||
| 722 | \redirect_header('event.php?op=list', 3, \_NOPERM); |
||
| 723 | } |
||
| 724 | // Check params |
||
| 725 | if (0 == $evId) { |
||
| 726 | \redirect_header('event.php?op=list', 3, \_MA_WGEVENTS_INVALID_PARAM); |
||
| 727 | } |
||
| 728 | $eventObj = $eventHandler->get($evId); |
||
| 729 | $evName = $eventObj->getVar('name'); |
||
| 730 | if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) { |
||
| 731 | if (!$GLOBALS['xoopsSecurity']->check()) { |
||
| 732 | \redirect_header('event.php', 3, \implode(', ', $GLOBALS['xoopsSecurity']->getErrors())); |
||
| 733 | } |
||
| 734 | $eventObj->setVar('status', Constants::STATUS_CANCELED); |
||
| 735 | $eventObj->setVar('datecreated', \time()); |
||
| 736 | $eventObj->setVar('submitter', $uidCurrent); |
||
| 737 | // delete all questions/registrations/answers |
||
| 738 | $registrationHandler->cleanupRegistrations($evId); |
||
| 739 | $questionHandler->cleanupQuestions($evId); |
||
| 740 | $answerHandler->cleanupAnswers($evId); |
||
| 741 | // Insert Data |
||
| 742 | if ($eventHandler->insert($eventObj)) { |
||
| 743 | // Event delete notification |
||
| 744 | /* |
||
| 745 | $tags = []; |
||
| 746 | $tags['ITEM_NAME'] = $evName; |
||
| 747 | $notificationHandler = \xoops_getHandler('notification'); |
||
| 748 | $notificationHandler->triggerEvent('global', 0, 'global_delete', $tags); |
||
| 749 | $notificationHandler->triggerEvent('events', $evId, 'event_delete', $tags); |
||
| 750 | */ |
||
| 751 | \redirect_header('event.php', 3, \_MA_WGEVENTS_FORM_CANCEL_OK); |
||
| 752 | } else { |
||
| 753 | $GLOBALS['xoopsTpl']->assign('error', $eventObj->getHtmlErrors()); |
||
| 754 | } |
||
| 755 | } else { |
||
| 756 | $customConfirm = new Common\Confirm( |
||
| 757 | ['ok' => 1, 'id' => $evId, 'start' => $start, 'limit' => $limit, 'op' => 'cancel'], |
||
| 758 | $_SERVER['REQUEST_URI'], |
||
| 759 | \sprintf(\_MA_WGEVENTS_CONFIRMCANCEL_EVENT, $eventObj->getVar('name')), \_MA_WGEVENTS_CONFIRMCANCEL_TITLE, \_MA_WGEVENTS_CONFIRMCANCEL_LABEL); |
||
| 760 | $form = $customConfirm->getFormConfirm(); |
||
| 761 | $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
||
| 762 | } |
||
| 763 | break; |
||
| 764 | } |
||
| 765 | |||
| 766 | // Keywords |
||
| 767 | wgeventsMetaKeywords($helper->getConfig('keywords') . ', ' . \implode(',', $keywords)); |
||
| 768 | unset($keywords); |
||
| 769 | |||
| 770 | // Description |
||
| 771 | wgeventsMetaDescription(\_MA_WGEVENTS_EVENTS_DESC); |
||
| 772 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', \WGEVENTS_URL.'/event.php'); |
||
| 773 | $GLOBALS['xoopsTpl']->assign('wgevents_upload_url', \WGEVENTS_UPLOAD_URL); |
||
| 774 | |||
| 775 | require __DIR__ . '/footer.php'; |
||
| 776 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.