mambax7 /
extcal
This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include, or for example
via PHP's auto-loading mechanism.
| 1 | <?php |
||||
| 2 | |||||
| 3 | use XoopsModules\Extcal\{Helper, |
||||
| 4 | Utility, |
||||
| 5 | CategoryHandler, |
||||
| 6 | EventHandler, |
||||
| 7 | Time |
||||
| 8 | }; |
||||
| 9 | use Xmf\Request; |
||||
| 10 | |||||
| 11 | require_once __DIR__ . '/include/constantes.php'; |
||||
| 12 | $params = ['view' => _EXTCAL_NAV_AGENDA_DAY, 'file' => _EXTCAL_FILE_AGENDA_DAY]; |
||||
| 13 | $GLOBALS['xoopsOption']['template_main'] = "extcal_view_{$params['view']}.tpl"; |
||||
| 14 | require_once __DIR__ . '/header.php'; |
||||
| 15 | |||||
| 16 | global $xoopsUser, $xoopsTpl; |
||||
| 17 | |||||
| 18 | /** @var Time $timeHandler */ |
||||
| 19 | /** @var CategoryHandler $categoryHandler */ |
||||
| 20 | /** @var EventHandler $eventHandler */ |
||||
| 21 | /** @var Helper $helper */ |
||||
| 22 | $helper = Helper::getInstance(); |
||||
| 23 | |||||
| 24 | /* ========================================================================== */ |
||||
| 25 | //recupe des variables get |
||||
| 26 | $year = Request::getInt('year', date('Y'), 'GET'); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 27 | $month = Request::getInt('month', date('n'), 'GET'); |
||||
| 28 | $day = Request::getInt('day', date('j'), 'GET'); |
||||
| 29 | $cat = Request::getInt('cat', 0, 'GET'); |
||||
| 30 | /* ========================================================================== */ |
||||
| 31 | |||||
| 32 | //echo "{$params['view']}-{$year}-{$month}-{$day}<hr>extcal_{$params['view']}.html<br>"; |
||||
| 33 | |||||
| 34 | $form = new \XoopsSimpleForm('', 'navigSelectBox', $params['file'], 'get'); |
||||
| 35 | $form->addElement(getListYears($year, $helper->getConfig('agenda_nb_years_before'), $helper->getConfig('agenda_nb_years_after'))); |
||||
| 36 | $form->addElement(getListMonths($month)); |
||||
| 37 | $form->addElement(getListDays($day)); |
||||
| 38 | $form->addElement(Utility::getListCategories($cat)); |
||||
| 39 | $form->addElement(new \XoopsFormButton('', '', _SUBMIT, 'submit')); |
||||
| 40 | |||||
| 41 | //------------------------------------------------------ |
||||
| 42 | // Assigning the form to the template |
||||
| 43 | $form->assign($xoopsTpl); |
||||
| 44 | |||||
| 45 | $mTranche = $helper->getConfig('agenda_tranche_minutes'); //minutes |
||||
| 46 | $hStart = $helper->getConfig('agenda_start_hour'); //heure debut de journee |
||||
| 47 | $hEnd = $helper->getConfig('agenda_end_hour'); //heure fin de journee |
||||
| 48 | $nbJours = $helper->getConfig('agenda_nb_days_day'); //nombre de jour |
||||
| 49 | |||||
| 50 | /**********************************************************************/ |
||||
| 51 | // Retriving events and formatting them |
||||
| 52 | //$events = $eventHandler->objectToArray($eventHandler->getEventWeek($day, $month, $year, $cat, $nbJours), array('cat_id')); |
||||
| 53 | $criteres = [ |
||||
| 54 | 'periode' => _EXTCAL_EVENTS_DAY, |
||||
| 55 | 'day' => $day, |
||||
| 56 | 'month' => $month, |
||||
| 57 | 'year' => $year, |
||||
| 58 | 'cat' => $cat, |
||||
| 59 | 'nbJours' => $nbJours, |
||||
| 60 | 'externalKeys' => 'cat_id', |
||||
| 61 | ]; |
||||
| 62 | $events = $eventHandler->getEventsOnPeriode($criteres); |
||||
| 63 | /**********************************************************************/ |
||||
| 64 | $eventsArray = $events; |
||||
| 65 | $startDay = mktime(0, 0, 0, $month, $day, $year); |
||||
| 66 | $endDay = $startDay + _EXTCAL_TS_DAY; |
||||
| 67 | // Formating date |
||||
| 68 | // $eventHandler->formatEventsDate($events, $helper->getConfig('event_date_year')); |
||||
| 69 | // |
||||
| 70 | // // Treatment for recurring event |
||||
| 71 | // |
||||
| 72 | // $eventsArray = []; |
||||
| 73 | // foreach ($events as $event) { |
||||
| 74 | // if (!$event['event_isrecur']) { |
||||
| 75 | // // Formating date |
||||
| 76 | // $eventHandler->formatEventDate($event, $helper->getConfig('event_date_week')); |
||||
| 77 | // $eventsArray[] = $event; |
||||
| 78 | // } else { |
||||
| 79 | // $recurEvents = $eventHandler->getRecurEventToDisplay($event, $startDay, $endDay); |
||||
| 80 | // // Formating date |
||||
| 81 | // $eventHandler->formatEventsDate($recurEvents, $helper->getConfig('event_date_week')); |
||||
| 82 | // $eventsArray = array_merge($eventsArray, $recurEvents); |
||||
| 83 | // } |
||||
| 84 | // } |
||||
| 85 | // |
||||
| 86 | // // Sort event array by event start |
||||
| 87 | // usort($eventsArray, "orderEvents"); |
||||
| 88 | // ------------------------------------------------------------------- |
||||
| 89 | // hack JJD pour affichage agenda |
||||
| 90 | // ------------------------------------------------------------------- |
||||
| 91 | |||||
| 92 | //------------------------------------------------------------------- |
||||
| 93 | // Assigning events to the template |
||||
| 94 | //------------------------------------------------------------------- |
||||
| 95 | |||||
| 96 | $tAgenda = agenda_getEvents($eventsArray, $startDay, $hStart, $hEnd, $mTranche, $nbJours); |
||||
| 97 | //$exp = print_r($eventsArray, true); |
||||
| 98 | $exp = print_r($tAgenda, true); |
||||
| 99 | //echo "<pre>{$exp}</pre>"; |
||||
| 100 | |||||
| 101 | $xoopsTpl->assign('agenda', $tAgenda); |
||||
| 102 | //$xoopsTpl->assign('events', $eventsArray); |
||||
| 103 | //------------------------------------------------------------------- |
||||
| 104 | |||||
| 105 | // Retriving categories |
||||
| 106 | $cats = $categoryHandler->objectToArray($categoryHandler->getAllCat($xoopsUser)); |
||||
| 107 | // Assigning categories to the template |
||||
| 108 | $xoopsTpl->assign('cats', $cats); |
||||
| 109 | |||||
| 110 | // Making navig data |
||||
| 111 | $dayCalObj = new Calendar_Day($year, $month, $day); |
||||
| 112 | $pDayCalObj = $dayCalObj->prevDay('object'); |
||||
| 113 | $nDayCalObj = $dayCalObj->nextDay('object'); |
||||
| 114 | |||||
| 115 | $navig = [ |
||||
| 116 | 'prev' => [ |
||||
| 117 | 'uri' => 'year=' . $pDayCalObj->thisYear() . '&month=' . $pDayCalObj->thisMonth() . '&day=' . $pDayCalObj->thisDay(), |
||||
|
0 ignored issues
–
show
The method
thisYear() does not exist on integer.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
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. Loading history...
|
|||||
| 118 | 'name' => $timeHandler->getFormatedDate($helper->getConfig('nav_date_day'), $pDayCalObj->getTimestamp()), |
||||
| 119 | ], |
||||
| 120 | 'this' => [ |
||||
| 121 | 'uri' => 'year=' . $dayCalObj->thisYear() . '&month=' . $dayCalObj->thisMonth() . '&day=' . $dayCalObj->thisDay(), |
||||
| 122 | 'name' => $timeHandler->getFormatedDate($helper->getConfig('nav_date_day'), $dayCalObj->getTimestamp()), |
||||
| 123 | ], |
||||
| 124 | 'next' => [ |
||||
| 125 | 'uri' => 'year=' . $nDayCalObj->thisYear() . '&month=' . $nDayCalObj->thisMonth() . '&day=' . $nDayCalObj->thisDay(), |
||||
|
0 ignored issues
–
show
The method
thisYear() does not exist on integer.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
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. Loading history...
|
|||||
| 126 | 'name' => $timeHandler->getFormatedDate($helper->getConfig('nav_date_day'), $nDayCalObj->getTimestamp()), |
||||
| 127 | ], |
||||
| 128 | ]; |
||||
| 129 | |||||
| 130 | // Title of the page |
||||
| 131 | $xoopsTpl->assign('xoops_pagetitle', $helper->getModule()->getVar('name') . ' ' . $navig['this']['name']); |
||||
| 132 | |||||
| 133 | // Assigning navig data to the template |
||||
| 134 | $xoopsTpl->assign('navig', $navig); |
||||
| 135 | |||||
| 136 | //Display tooltip |
||||
| 137 | $xoopsTpl->assign('showInfoBulle', $helper->getConfig('showInfoBulle')); |
||||
| 138 | $xoopsTpl->assign('showId', $helper->getConfig('showId')); |
||||
| 139 | |||||
| 140 | // Assigning current form navig data to the template |
||||
| 141 | $xoopsTpl->assign('selectedCat', $cat); |
||||
| 142 | $xoopsTpl->assign('year', $year); |
||||
| 143 | $xoopsTpl->assign('month', $month); |
||||
| 144 | $xoopsTpl->assign('day', $day); |
||||
| 145 | $xoopsTpl->assign('params', $params); |
||||
| 146 | |||||
| 147 | $tNavBar = getNavBarTabs($params['view']); |
||||
| 148 | $xoopsTpl->assign('tNavBar', $tNavBar); |
||||
| 149 | $xoopsTpl->assign('list_position', $helper->getConfig('list_position')); |
||||
| 150 | |||||
| 151 | // echoArray($tNavBar,true); |
||||
| 152 | |||||
| 153 | //mb missing for xBootstrap templates by Angelo |
||||
| 154 | $lang = [ |
||||
| 155 | 'start' => _MD_EXTCAL_START, |
||||
| 156 | 'end' => _MD_EXTCAL_END, |
||||
| 157 | 'calmonth' => _MD_EXTCAL_NAV_CALMONTH, |
||||
| 158 | 'calweek' => _MD_EXTCAL_NAV_CALWEEK, |
||||
| 159 | 'year' => _MD_EXTCAL_NAV_YEAR, |
||||
| 160 | 'month' => _MD_EXTCAL_NAV_MONTH, |
||||
| 161 | 'week' => _MD_EXTCAL_NAV_WEEK, |
||||
| 162 | 'day' => _MD_EXTCAL_NAV_DAY, |
||||
| 163 | 'agendaweek' => _MD_EXTCAL_NAV_AGENDA_WEEK, |
||||
| 164 | 'agendaday' => _MD_EXTCAL_NAV_AGENDA_DAY, |
||||
| 165 | 'search' => _MD_EXTCAL_NAV_SEARCH, |
||||
| 166 | 'newevent' => _MD_EXTCAL_NAV_NEW_EVENT, |
||||
| 167 | ]; |
||||
| 168 | // Assigning language data to the template |
||||
| 169 | $xoopsTpl->assign('lang', $lang); |
||||
| 170 | $xoopsTpl->assign('view', 'agendaday'); |
||||
| 171 | |||||
| 172 | require_once XOOPS_ROOT_PATH . '/footer.php'; |
||||
| 173 |