@@ -17,10 +17,10 @@ |
||
17 | 17 | } |
18 | 18 | //-------------------------------------------------------------------- |
19 | 19 | /** |
20 | - * @param $ids |
|
21 | - * |
|
22 | - * @return bool |
|
23 | - */ |
|
20 | + * @param $ids |
|
21 | + * |
|
22 | + * @return bool |
|
23 | + */ |
|
24 | 24 | function deleteEvents($ids) |
25 | 25 | { |
26 | 26 | $eventHandler = xoops_getmodulehandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
@@ -51,180 +51,198 @@ discard block |
||
51 | 51 | |
52 | 52 | switch ($op) { |
53 | 53 | |
54 | - case 'enreg': |
|
55 | - |
|
56 | - $eventHandler = xoops_getmodulehandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
57 | - $fileHandler = xoops_getmodulehandler(_EXTCAL_CLS_FILE, _EXTCAL_MODULE); |
|
58 | -// $t = print_r($_POST,true); |
|
59 | -// echo "<pre>{$t}</pre><br>"; |
|
60 | -// exit; |
|
61 | - // If the date format is wrong |
|
62 | -// if ( |
|
63 | -// !preg_match(_EXTCAL_MOTIF_DATE, $_POST['event_start']['date']) |
|
64 | -// || !preg_match(_EXTCAL_MOTIF_DATE, $_POST['event_end']['date']) |
|
65 | -// ) { |
|
66 | -// redirect_header( |
|
67 | -// 'event.php', 3, _MD_EXTCAL_WRONG_DATE_FORMAT . "<br />" |
|
68 | -// . implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()) |
|
69 | -// ); |
|
70 | -// exit; |
|
71 | -// } |
|
72 | - |
|
73 | -//exit; |
|
74 | - /////////////////////////////////////////////////////////////////////////////// |
|
75 | - extcal_loadImg($_REQUEST, $event_picture1, $event_picture2); |
|
76 | - /////////////////////////////////////////////////////////////////////////////// |
|
77 | - $data = array( |
|
78 | - 'event_title' => $_POST['event_title'], |
|
79 | - 'cat_id' => $_POST['cat_id'], |
|
80 | - 'event_desc' => $_POST['event_desc'], |
|
81 | - 'event_nbmember' => $_POST['event_nbmember'], |
|
82 | - 'event_organisateur' => $_POST['event_organisateur'], |
|
83 | - 'event_contact' => $_POST['event_contact'], |
|
84 | - 'event_url' => $_POST['event_url'], |
|
85 | - 'event_email' => $_POST['event_email'], |
|
86 | - 'event_address' => $_POST['event_address'], |
|
87 | - 'event_approved' => 1, |
|
88 | - 'event_start' => $_POST['event_start'], |
|
89 | - 'have_end' => $_POST['have_end'], |
|
90 | - 'event_end' => $_POST['event_end'], |
|
91 | - 'event_picture1' => @$event_picture1, |
|
92 | - 'event_picture2' => @$event_picture2, |
|
93 | - 'event_price' => @$_POST['event_price'], |
|
94 | - 'event_etablissement' => $_POST['event_etablissement'], |
|
95 | - 'dohtml' => $extcalConfig['allow_html'], |
|
96 | - 'event_icone' => $_POST['event_icone'] |
|
97 | - ); |
|
98 | - |
|
99 | - // Event edited |
|
100 | - if (isset($_POST['event_id'])) { |
|
101 | - |
|
102 | - if (!$eventHandler->modifyEvent($_POST['event_id'], $data)) { |
|
103 | - redirect_header("event.php", 3, _AM_EXTCAL_EVENT_EDIT_FAILED, false); |
|
54 | + case 'enreg': |
|
55 | + |
|
56 | + $eventHandler = xoops_getmodulehandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
57 | + $fileHandler = xoops_getmodulehandler(_EXTCAL_CLS_FILE, _EXTCAL_MODULE); |
|
58 | + // $t = print_r($_POST,true); |
|
59 | + // echo "<pre>{$t}</pre><br>"; |
|
60 | + // exit; |
|
61 | + // If the date format is wrong |
|
62 | + // if ( |
|
63 | + // !preg_match(_EXTCAL_MOTIF_DATE, $_POST['event_start']['date']) |
|
64 | + // || !preg_match(_EXTCAL_MOTIF_DATE, $_POST['event_end']['date']) |
|
65 | + // ) { |
|
66 | + // redirect_header( |
|
67 | + // 'event.php', 3, _MD_EXTCAL_WRONG_DATE_FORMAT . "<br />" |
|
68 | + // . implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()) |
|
69 | + // ); |
|
70 | + // exit; |
|
71 | + // } |
|
72 | + |
|
73 | + //exit; |
|
74 | + /////////////////////////////////////////////////////////////////////////////// |
|
75 | + extcal_loadImg($_REQUEST, $event_picture1, $event_picture2); |
|
76 | + /////////////////////////////////////////////////////////////////////////////// |
|
77 | + $data = array( |
|
78 | + 'event_title' => $_POST['event_title'], |
|
79 | + 'cat_id' => $_POST['cat_id'], |
|
80 | + 'event_desc' => $_POST['event_desc'], |
|
81 | + 'event_nbmember' => $_POST['event_nbmember'], |
|
82 | + 'event_organisateur' => $_POST['event_organisateur'], |
|
83 | + 'event_contact' => $_POST['event_contact'], |
|
84 | + 'event_url' => $_POST['event_url'], |
|
85 | + 'event_email' => $_POST['event_email'], |
|
86 | + 'event_address' => $_POST['event_address'], |
|
87 | + 'event_approved' => 1, |
|
88 | + 'event_start' => $_POST['event_start'], |
|
89 | + 'have_end' => $_POST['have_end'], |
|
90 | + 'event_end' => $_POST['event_end'], |
|
91 | + 'event_picture1' => @$event_picture1, |
|
92 | + 'event_picture2' => @$event_picture2, |
|
93 | + 'event_price' => @$_POST['event_price'], |
|
94 | + 'event_etablissement' => $_POST['event_etablissement'], |
|
95 | + 'dohtml' => $extcalConfig['allow_html'], |
|
96 | + 'event_icone' => $_POST['event_icone'] |
|
97 | + ); |
|
98 | + |
|
99 | + // Event edited |
|
100 | + if (isset($_POST['event_id'])) { |
|
101 | + |
|
102 | + if (!$eventHandler->modifyEvent($_POST['event_id'], $data)) { |
|
103 | + redirect_header("event.php", 3, _AM_EXTCAL_EVENT_EDIT_FAILED, false); |
|
104 | + } else { |
|
105 | + $fileHandler->createFile(intval($_POST['event_id'])); |
|
106 | + redirect_header("event.php", 3, _AM_EXTCAL_EVENT_EDITED, false); |
|
107 | + } |
|
108 | + |
|
109 | + // New event |
|
104 | 110 | } else { |
105 | - $fileHandler->createFile(intval($_POST['event_id'])); |
|
106 | - redirect_header("event.php", 3, _AM_EXTCAL_EVENT_EDITED, false); |
|
111 | + $notificationHandler =& xoops_gethandler('notification'); |
|
112 | + $catHandler = xoops_getmodulehandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE); |
|
113 | + |
|
114 | + $data['event_submitter'] = ($xoopsUser) ? $xoopsUser->getVar('uid') : 0; |
|
115 | + $data['event_submitdate'] = time(); |
|
116 | + |
|
117 | + if ($eventHandler->createEvent($data, $_POST)) { |
|
118 | + |
|
119 | + $fileHandler->createFile($eventHandler->getInsertId()); |
|
120 | + $cat = $catHandler->getCat($_POST['cat_id'], $xoopsUser, 'all'); |
|
121 | + $notificationHandler->triggerEvent('global', 0, 'new_event', array('EVENT_TITLE' => $_POST['event_title'])); |
|
122 | + $notificationHandler->triggerEvent('cat', $_POST['cat_id'], 'new_event_cat', array('EVENT_TITLE' => $_POST['event_title'], 'CAT_NAME' => $cat->getVar('cat_name'))); |
|
123 | + redirect_header("event.php", 3, _AM_EXTCAL_EVENT_CREATED, false); |
|
124 | + } else { |
|
125 | + redirect_header("event.php", 3, _AM_EXTCAL_EVENT_CREATE_FAILED, false); |
|
126 | + } |
|
127 | + |
|
107 | 128 | } |
129 | + break; |
|
108 | 130 | |
109 | - // New event |
|
110 | - } else { |
|
111 | - $notificationHandler =& xoops_gethandler('notification'); |
|
112 | - $catHandler = xoops_getmodulehandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE); |
|
131 | + case 'clone': /* sur validation du formulaire */ |
|
132 | + case 'modify': |
|
133 | + $action = (($op == 'clone') ? 'clone' : 'edit'); |
|
134 | + xoops_cp_header(); |
|
135 | + //================================================ |
|
136 | + // include_once (XOOPS_ROOT_PATH . '/class/xoopsform/tc_calendar/formtccalendar.php'); |
|
137 | + // |
|
138 | + // // Call the calendar constructor - use the desired form and format, according to the instructions/samples provided on triconsole.com |
|
139 | + // $dateBirthday = new XoopsTcCalendar("datez1", true, false); |
|
140 | + // //$dateBirthday->setIcon("/images/iconCalendar.gif"); |
|
141 | + // $dateBirthday->setIcon("/class/xoopsform/tc_calendar/images/iconCalendar.gif"); |
|
142 | + // //$dateBirthday->rtl=false; |
|
143 | + // $dateBirthday->setAutoHide(false); |
|
144 | + // |
|
145 | + // //$myCalendar->setDate(date('d'), date('m'), date('Y')); |
|
146 | + // //$dateBirthday->setDate($p['date1_day'], $p['date1_month'], $p['date1_year']); |
|
147 | + // $dateBirthday->setDate(date('d'), date('m'), date('Y')); |
|
148 | + // |
|
149 | + // $dateBirthday->setPath(XOOPS_URL . "/class/xoopsform/tc_calendar/"); |
|
150 | + // $dateBirthday->zindex = 150; //default 1 |
|
151 | + // $dateBirthday->setYearInterval(1995, date('Y')); |
|
152 | + // $dateBirthday->dateAllow('1960-03-01', date('Y-m-d')); |
|
153 | + // //$dateBirthday->autoSubmit(true, "calendar"); |
|
154 | + // $dateBirthday->disabledDay("sat"); |
|
155 | + // $dateBirthday->disabledDay("sun"); |
|
156 | + // $dateBirthday->setSpecificDate(array("2011-04-14", "2010-12-25"), 0, 'month'); |
|
157 | + // $dateBirthday->setSpecificDate(array("2011-04-01"), 0, 'year'); |
|
158 | + // $dateBirthday->setAlignment('right', 'bottom'); //optional |
|
159 | + // echo "<table><tr><td>zzzzz</td><td></td><td>"; |
|
160 | + // echo $dateBirthday->render(); |
|
161 | + // echo "</td></tr></table>"; |
|
162 | + //echo $dateBirthday->render(); |
|
163 | + //================================================ |
|
164 | + // @author Gregory Mage (Aka Mage) |
|
165 | + //*************************************************************************************** |
|
166 | + // include_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php"; |
|
167 | + $eventAdmin = new ModuleAdmin(); |
|
168 | + echo $eventAdmin->addNavigation('event.php'); |
|
169 | + //*************************************************************************************** |
|
113 | 170 | |
114 | - $data['event_submitter'] = ($xoopsUser) ? $xoopsUser->getVar('uid') : 0; |
|
115 | - $data['event_submitdate'] = time(); |
|
171 | + $eventId = $_GET['event_id']; |
|
172 | + $eventHandler = xoops_getmodulehandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
116 | 173 | |
117 | - if ($eventHandler->createEvent($data, $_POST)) { |
|
174 | + echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _MD_EXTCAL_EDIT_EVENT . '</legend>'; |
|
118 | 175 | |
119 | - $fileHandler->createFile($eventHandler->getInsertId()); |
|
120 | - $cat = $catHandler->getCat($_POST['cat_id'], $xoopsUser, 'all'); |
|
121 | - $notificationHandler->triggerEvent('global', 0, 'new_event', array('EVENT_TITLE' => $_POST['event_title'])); |
|
122 | - $notificationHandler->triggerEvent('cat', $_POST['cat_id'], 'new_event_cat', array('EVENT_TITLE' => $_POST['event_title'], 'CAT_NAME' => $cat->getVar('cat_name'))); |
|
123 | - redirect_header("event.php", 3, _AM_EXTCAL_EVENT_CREATED, false); |
|
124 | - } else { |
|
125 | - redirect_header("event.php", 3, _AM_EXTCAL_EVENT_CREATE_FAILED, false); |
|
176 | + if ($form = $eventHandler->getEventForm('admin', $action, array('event_id' => $eventId))) { |
|
177 | + $form->display(); |
|
126 | 178 | } |
127 | 179 | |
128 | - } |
|
129 | - break; |
|
130 | - |
|
131 | - case 'clone': /* sur validation du formulaire */ |
|
132 | - case 'modify': |
|
133 | - $action = (($op == 'clone') ? 'clone' : 'edit'); |
|
134 | - xoops_cp_header(); |
|
135 | -//================================================ |
|
136 | -// include_once (XOOPS_ROOT_PATH . '/class/xoopsform/tc_calendar/formtccalendar.php'); |
|
137 | -// |
|
138 | -// // Call the calendar constructor - use the desired form and format, according to the instructions/samples provided on triconsole.com |
|
139 | -// $dateBirthday = new XoopsTcCalendar("datez1", true, false); |
|
140 | -// //$dateBirthday->setIcon("/images/iconCalendar.gif"); |
|
141 | -// $dateBirthday->setIcon("/class/xoopsform/tc_calendar/images/iconCalendar.gif"); |
|
142 | -// //$dateBirthday->rtl=false; |
|
143 | -// $dateBirthday->setAutoHide(false); |
|
144 | -// |
|
145 | -// //$myCalendar->setDate(date('d'), date('m'), date('Y')); |
|
146 | -// //$dateBirthday->setDate($p['date1_day'], $p['date1_month'], $p['date1_year']); |
|
147 | -// $dateBirthday->setDate(date('d'), date('m'), date('Y')); |
|
148 | -// |
|
149 | -// $dateBirthday->setPath(XOOPS_URL . "/class/xoopsform/tc_calendar/"); |
|
150 | -// $dateBirthday->zindex = 150; //default 1 |
|
151 | -// $dateBirthday->setYearInterval(1995, date('Y')); |
|
152 | -// $dateBirthday->dateAllow('1960-03-01', date('Y-m-d')); |
|
153 | -// //$dateBirthday->autoSubmit(true, "calendar"); |
|
154 | -// $dateBirthday->disabledDay("sat"); |
|
155 | -// $dateBirthday->disabledDay("sun"); |
|
156 | -// $dateBirthday->setSpecificDate(array("2011-04-14", "2010-12-25"), 0, 'month'); |
|
157 | -// $dateBirthday->setSpecificDate(array("2011-04-01"), 0, 'year'); |
|
158 | -// $dateBirthday->setAlignment('right', 'bottom'); //optional |
|
159 | -// echo "<table><tr><td>zzzzz</td><td></td><td>"; |
|
160 | -// echo $dateBirthday->render(); |
|
161 | -// echo "</td></tr></table>"; |
|
162 | -//echo $dateBirthday->render(); |
|
163 | -//================================================ |
|
164 | - // @author Gregory Mage (Aka Mage) |
|
165 | - //*************************************************************************************** |
|
166 | -// include_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php"; |
|
167 | - $eventAdmin = new ModuleAdmin(); |
|
168 | - echo $eventAdmin->addNavigation('event.php'); |
|
169 | - //*************************************************************************************** |
|
170 | - |
|
171 | - $eventId = $_GET['event_id']; |
|
172 | - $eventHandler = xoops_getmodulehandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
173 | - |
|
174 | - echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _MD_EXTCAL_EDIT_EVENT . '</legend>'; |
|
175 | - |
|
176 | - if ($form = $eventHandler->getEventForm('admin', $action, array('event_id' => $eventId))) { |
|
177 | - $form->display(); |
|
178 | - } |
|
180 | + echo '</fieldset><br />'; |
|
179 | 181 | |
180 | - echo '</fieldset><br />'; |
|
182 | + xoops_cp_footer(); |
|
181 | 183 | |
182 | - xoops_cp_footer(); |
|
184 | + break; |
|
183 | 185 | |
184 | - break; |
|
186 | + case 'clone2': /* sur clique de l'icone du formulaire*/ |
|
185 | 187 | |
186 | - case 'clone2': /* sur clique de l'icone du formulaire*/ |
|
188 | + //$newEventId = 1; |
|
189 | + $eventId = $_GET['event_id']; |
|
190 | + $eventHandler = xoops_getmodulehandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
191 | + $event = $eventHandler->getEvent($eventId); |
|
192 | + $t = $event->getVars(); |
|
193 | + $data = array(); |
|
194 | + while (list($key, $val) = each($t)) { |
|
195 | + $data[$key] = $val['value']; |
|
196 | + } |
|
187 | 197 | |
188 | - //$newEventId = 1; |
|
189 | - $eventId = $_GET['event_id']; |
|
190 | - $eventHandler = xoops_getmodulehandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
191 | - $event = $eventHandler->getEvent($eventId); |
|
192 | - $t = $event->getVars(); |
|
193 | - $data = array(); |
|
194 | - while (list($key, $val) = each($t)) { |
|
195 | - $data[$key] = $val['value']; |
|
196 | - } |
|
198 | + $data['event_id'] = 0; |
|
199 | + $data['event_title'] .= ' (' . _AM_EXTCAL_CLONE_OF . $eventId . ')'; |
|
197 | 200 | |
198 | - $data['event_id'] = 0; |
|
199 | - $data['event_title'] .= ' (' . _AM_EXTCAL_CLONE_OF . $eventId . ')'; |
|
201 | + $newEvent = $eventHandler->create(); |
|
202 | + $newEvent->setVars($data); |
|
203 | + $t = $eventHandler->insert($newEvent, true); |
|
200 | 204 | |
201 | - $newEvent = $eventHandler->create(); |
|
202 | - $newEvent->setVars($data); |
|
203 | - $t = $eventHandler->insert($newEvent, true); |
|
205 | + $newEventId = $newEvent->getVar('event_id'); |
|
206 | + $ts = print_r($newEventId, true); |
|
204 | 207 | |
205 | - $newEventId = $newEvent->getVar('event_id'); |
|
206 | - $ts = print_r($newEventId, true); |
|
208 | + redirect_header("event.php?op=modify&event_id={$newEventId}", 3, _AM_EXTCAL_EVENT_DELETED, false); |
|
209 | + break; |
|
207 | 210 | |
208 | - redirect_header("event.php?op=modify&event_id={$newEventId}", 3, _AM_EXTCAL_EVENT_DELETED, false); |
|
209 | - break; |
|
211 | + case 'delete': |
|
210 | 212 | |
211 | - case 'delete': |
|
213 | + if (isset($_POST['confirm'])) { |
|
214 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
215 | + redirect_header( |
|
216 | + 'index.php', |
|
217 | + 3, |
|
218 | + _NOPERM . "<br />" . implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()) |
|
219 | + ); |
|
220 | + exit; |
|
221 | + } |
|
222 | + // $eventHandler = xoops_getmodulehandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
223 | + // $eventHandler->deleteEvent($_POST['event_id']); |
|
224 | + deleteEvents($_POST['event_id']); |
|
225 | + redirect_header("event.php", 3, _AM_EXTCAL_EVENT_DELETED, false); |
|
212 | 226 | |
213 | - if (isset($_POST['confirm'])) { |
|
214 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
215 | - redirect_header( |
|
216 | - 'index.php', |
|
217 | - 3, |
|
218 | - _NOPERM . "<br />" . implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()) |
|
219 | - ); |
|
220 | - exit; |
|
227 | + } else { |
|
228 | + xoops_cp_header(); |
|
229 | + // @author Gregory Mage (Aka Mage) |
|
230 | + //*************************************************************************************** |
|
231 | + //include_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php"; |
|
232 | + $eventAdmin = new ModuleAdmin(); |
|
233 | + echo $eventAdmin->addNavigation('event.php'); |
|
234 | + //*************************************************************************************** |
|
235 | + |
|
236 | + $hiddens = array('event_id' => $_GET['event_id'], 'form_delete' => '', 'confirm' => 1); |
|
237 | + xoops_confirm($hiddens, 'event.php?op=delete', _AM_EXTCAL_CONFIRM_DELETE_EVENT, _DELETE, 'event.php'); |
|
238 | + |
|
239 | + xoops_cp_footer(); |
|
221 | 240 | } |
222 | -// $eventHandler = xoops_getmodulehandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
223 | -// $eventHandler->deleteEvent($_POST['event_id']); |
|
224 | - deleteEvents($_POST['event_id']); |
|
225 | - redirect_header("event.php", 3, _AM_EXTCAL_EVENT_DELETED, false); |
|
226 | 241 | |
227 | - } else { |
|
242 | + break; |
|
243 | + |
|
244 | + case 'deleteSelection': |
|
245 | + |
|
228 | 246 | xoops_cp_header(); |
229 | 247 | // @author Gregory Mage (Aka Mage) |
230 | 248 | //*************************************************************************************** |
@@ -232,197 +250,179 @@ discard block |
||
232 | 250 | $eventAdmin = new ModuleAdmin(); |
233 | 251 | echo $eventAdmin->addNavigation('event.php'); |
234 | 252 | //*************************************************************************************** |
253 | + if (isset($_POST['deleteSelection'][0])) { |
|
254 | + $msg = _AM_EXTCAL_CONFIRM_DELETE_ALL; |
|
255 | + $ids = array_keys($_POST['deleteAllEvents']); |
|
235 | 256 | |
236 | - $hiddens = array('event_id' => $_GET['event_id'], 'form_delete' => '', 'confirm' => 1); |
|
237 | - xoops_confirm($hiddens, 'event.php?op=delete', _AM_EXTCAL_CONFIRM_DELETE_EVENT, _DELETE, 'event.php'); |
|
257 | + } else { |
|
258 | + $msg = _AM_EXTCAL_CONFIRM_DELETE_SELECTION; |
|
259 | + $ids = array_keys($_POST['deleteEvents']); |
|
260 | + |
|
261 | + } |
|
262 | + |
|
263 | + // $msg = ((isset($_POST['deleteSelection'][0])) ? _AM_EXTCAL_CONFIRM_DELETE_ALL : _AM_EXTCAL_CONFIRM_DELETE_SELECTION); |
|
264 | + // $ids = array_keys($_POST['deleteEvents']); |
|
265 | + $ids = implode(',', $ids); |
|
266 | + //echo $ids.'<br>'; |
|
267 | + $hiddens = array('event_ids' => $ids, 'form_delete' => '', 'confirm' => 1); |
|
268 | + //$hiddens = array('event_ids' => $_POST['deleteEvents'], 'form_delete' => '', 'confirm' => 1); |
|
269 | + xoops_confirm($hiddens, 'event.php?op=deleteSelectionOK', $msg, _DELETE, 'event.php'); |
|
238 | 270 | |
239 | 271 | xoops_cp_footer(); |
240 | - } |
|
241 | 272 | |
242 | - break; |
|
273 | + break; |
|
243 | 274 | |
244 | - case 'deleteSelection': |
|
275 | + case 'deleteSelectionOK': |
|
276 | + //----------------------------------------- |
|
277 | + // $t = print_r($_GET,true); |
|
278 | + // echo "<hr><pre>{$t}</pre><hr>"; |
|
279 | + // |
|
280 | + // $t = print_r($_POST,true); |
|
281 | + // echo "<hr><pre>{$t}</pre><hr>"; |
|
282 | + // exit; |
|
283 | + //----------------------------------------- |
|
245 | 284 | |
246 | - xoops_cp_header(); |
|
247 | - // @author Gregory Mage (Aka Mage) |
|
248 | - //*************************************************************************************** |
|
249 | - //include_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php"; |
|
250 | - $eventAdmin = new ModuleAdmin(); |
|
251 | - echo $eventAdmin->addNavigation('event.php'); |
|
252 | - //*************************************************************************************** |
|
253 | - if (isset($_POST['deleteSelection'][0])) { |
|
254 | - $msg = _AM_EXTCAL_CONFIRM_DELETE_ALL; |
|
255 | - $ids = array_keys($_POST['deleteAllEvents']); |
|
285 | + if (isset($_POST['deleteSelection'][0])) { |
|
256 | 286 | |
257 | - } else { |
|
258 | - $msg = _AM_EXTCAL_CONFIRM_DELETE_SELECTION; |
|
259 | - $ids = array_keys($_POST['deleteEvents']); |
|
287 | + } else { |
|
288 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
289 | + redirect_header( |
|
290 | + 'index.php', |
|
291 | + 3, |
|
292 | + _NOPERM . "<br />" . implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()) |
|
293 | + ); |
|
294 | + exit; |
|
295 | + } |
|
260 | 296 | |
261 | - } |
|
297 | + deleteEvents($_POST['event_ids']); |
|
298 | + |
|
299 | + redirect_header("event.php", 3, _AM_EXTCAL_EVENTS_DELETED, false); |
|
262 | 300 | |
263 | -// $msg = ((isset($_POST['deleteSelection'][0])) ? _AM_EXTCAL_CONFIRM_DELETE_ALL : _AM_EXTCAL_CONFIRM_DELETE_SELECTION); |
|
264 | -// $ids = array_keys($_POST['deleteEvents']); |
|
265 | - $ids = implode(',', $ids); |
|
266 | - //echo $ids.'<br>'; |
|
267 | - $hiddens = array('event_ids' => $ids, 'form_delete' => '', 'confirm' => 1); |
|
268 | - //$hiddens = array('event_ids' => $_POST['deleteEvents'], 'form_delete' => '', 'confirm' => 1); |
|
269 | - xoops_confirm($hiddens, 'event.php?op=deleteSelectionOK', $msg, _DELETE, 'event.php'); |
|
270 | - |
|
271 | - xoops_cp_footer(); |
|
272 | - |
|
273 | - break; |
|
274 | - |
|
275 | - case 'deleteSelectionOK': |
|
276 | -//----------------------------------------- |
|
277 | -// $t = print_r($_GET,true); |
|
278 | -// echo "<hr><pre>{$t}</pre><hr>"; |
|
279 | -// |
|
280 | -// $t = print_r($_POST,true); |
|
281 | -// echo "<hr><pre>{$t}</pre><hr>"; |
|
282 | -// exit; |
|
283 | -//----------------------------------------- |
|
284 | - |
|
285 | - if (isset($_POST['deleteSelection'][0])) { |
|
286 | - |
|
287 | - } else { |
|
288 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
289 | - redirect_header( |
|
290 | - 'index.php', |
|
291 | - 3, |
|
292 | - _NOPERM . "<br />" . implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()) |
|
293 | - ); |
|
294 | - exit; |
|
295 | 301 | } |
296 | 302 | |
297 | - deleteEvents($_POST['event_ids']); |
|
303 | + break; |
|
298 | 304 | |
299 | - redirect_header("event.php", 3, _AM_EXTCAL_EVENTS_DELETED, false); |
|
305 | + case 'default': |
|
306 | + default: |
|
300 | 307 | |
301 | - } |
|
308 | + //global $extcalConfig; |
|
309 | + $extcalConfig = ExtcalConfig::getHandler(); |
|
310 | + $xoopsModuleConfig = $extcalConfig->getModuleConfig(); |
|
302 | 311 | |
303 | - break; |
|
304 | - |
|
305 | - case 'default': |
|
306 | - default: |
|
307 | - |
|
308 | - //global $extcalConfig; |
|
309 | - $extcalConfig = ExtcalConfig::getHandler(); |
|
310 | - $xoopsModuleConfig = $extcalConfig->getModuleConfig(); |
|
311 | - |
|
312 | - $start = (isset($_GET['start'])) ? $_GET['start'] : 0; |
|
313 | - $nbEventsByPage = $xoopsModuleConfig['nbEventsByPage']; |
|
314 | - |
|
315 | - xoops_cp_header(); |
|
316 | - // @author Gregory Mage (Aka Mage) |
|
317 | - //*************************************************************************************** |
|
318 | - |
|
319 | - $eventAdmin = new ModuleAdmin(); |
|
320 | - echo $eventAdmin->addNavigation('event.php'); |
|
321 | - //*************************************************************************************** |
|
322 | - |
|
323 | - $eventHandler = xoops_getmodulehandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
324 | - $events = $eventHandler->objectToArray($eventHandler->getNewEvent($start, $nbEventsByPage, 0, true), array('cat_id')); |
|
325 | - $eventHandler->formatEventsDate($events, _SHORTDATESTRING); |
|
326 | - |
|
327 | - echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_APPROVED_EVENT . '</legend>'; |
|
328 | - echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _AM_EXTCAL_INFORMATION . '</legend>'; |
|
329 | - //echo'<img src='. XOOPS_URL .'/'. $moduleInfo->getInfo('dirmoduleadmin').'/assets/images/action/edit.png' .' '.'style=vertical-align:middle;/> ' . _AM_EXTCAL_INFO_EDIT . '<br />'; |
|
330 | - //echo'<img src='. XOOPS_URL .'/'. $moduleInfo->getInfo('dirmoduleadmin').'/assets/images/action/delete.png'. ' '."style=vertical-align:middle;/> ". _AM_EXTCAL_INFO_DELETE; |
|
331 | - |
|
332 | - echo '<img src=' . $pathIcon16 . '/edit.png' . ' ' . 'style=vertical-align:middle;/> ' . _AM_EXTCAL_INFO_EDIT . '<br />'; |
|
333 | - echo '<img src=' . $pathIcon16 . '/delete.png' . ' ' . 'style=vertical-align:middle;/> ' . _AM_EXTCAL_INFO_DELETE . '<br />'; |
|
334 | - |
|
335 | - echo '</fieldset><br />'; |
|
336 | - |
|
337 | - echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _MD_EXTCAL_SUBMITED_EVENT . '</legend>'; |
|
338 | - |
|
339 | - echo '<form method="POST" action="event.php">'; |
|
340 | - echo '<input type="hidden" name="op" value="deleteSelection" />'; |
|
341 | - |
|
342 | - echo '<table class="outer" style="width:100%;">'; |
|
343 | - echo '<tr style="text-align:center;">'; |
|
344 | - echo '<th>' . _AM_EXTCAL_DELETE . '</th>'; |
|
345 | - echo '<th>#</th>'; |
|
346 | - echo '<th>' . _AM_EXTCAL_CATEGORY . '</th>'; |
|
347 | - echo '<th>' . _AM_EXTCAL_TITLE . '</th>'; |
|
348 | - echo '<th>' . _AM_EXTCAL_START_DATE . '</th>'; |
|
349 | - echo '<th>' . _AM_EXTCAL_END_DATE . '</th>'; |
|
350 | - echo '<th>' . _AM_EXTCAL_RECURRENT . '</th>'; |
|
351 | - echo '<th>' . _AM_EXTCAL_START_RULES . '</th>'; |
|
352 | - echo '<th>' . _AM_EXTCAL_ACTION . '</th>'; |
|
353 | - |
|
354 | - echo '</tr>'; |
|
355 | - |
|
356 | - if (count($events) > 0) { |
|
357 | - $i = 0; |
|
358 | - foreach ( |
|
359 | - $events as $event |
|
360 | - ) { |
|
361 | - $class = (++$i % 2 == 0) ? 'even' : 'odd'; |
|
362 | - echo '<tr style="text-align:left;" class="' . $class . '">'; |
|
363 | - echo "<td width='10%' align='center'>"; |
|
364 | - echo "<input type='checkbox' name='deleteEvents[{$event['event_id']}]' value='1' >"; |
|
365 | - echo "<input type='hidden' name='deleteAllEvents[{$event['event_id']}]' value='1' />"; |
|
366 | - echo "</td>"; |
|
367 | - echo "<td align = 'center' width='5%'>" . $event['event_id'] . '</td>'; |
|
368 | - echo "<td width='10%'>" . '<a href=cat.php?op=modify&cat_id=' . $event['cat']['cat_id'] . '&form_modify' . '>' . $event['cat']['cat_name'] . '</a>' . '</td>'; |
|
369 | - |
|
370 | - echo '<td>' . '<a href=event.php?op=modify&event_id=' . $event['event_id'] . '>' . $event['event_title'] . '</a>' . '</td>'; |
|
371 | - |
|
372 | -// if ($event['event_isrecur']) { |
|
373 | -// echo '<td>' . $event['formated_reccur_rule'] . '</td>'; |
|
374 | -// } else { |
|
375 | -// echo '<td>' . $event['formated_event_start'] . '</td>'; |
|
376 | -// } |
|
377 | - |
|
378 | - |
|
379 | - echo "<td align = 'center' width='10%'>" . $event['formated_event_start'] . '</td>'; |
|
380 | - echo "<td align = 'center' width='10%'>" . $event['formated_event_end'] . '</td>'; |
|
381 | - echo '<td align="center">' . (($event['event_isrecur'] == 1) ? _YES : _NO) . '</td>'; |
|
382 | - if (!isset($event['formated_reccur_rule'])) { |
|
383 | - $event['formated_reccur_rule'] = ''; |
|
384 | - } |
|
385 | - echo '<td>' . $event['formated_reccur_rule'] . '</td>'; |
|
312 | + $start = (isset($_GET['start'])) ? $_GET['start'] : 0; |
|
313 | + $nbEventsByPage = $xoopsModuleConfig['nbEventsByPage']; |
|
386 | 314 | |
387 | - echo '<td style="width:10%; text-align:center;">'; |
|
388 | - echo '<a href=event.php?op=modify&event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/edit.png' title='" . _AM_EXTCAL_ICONE_EDIT . "' /></a> "; |
|
389 | - echo '<a href=event.php?op=delete&event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/delete.png' title='" . _AM_EXTCAL_ICONE_DELETE . "' /></a> "; |
|
390 | - echo '<a href=event.php?op=clone&event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/editcopy.png' title='" . _AM_EXTCAL_ICONE_CLONE . "' /></a>"; |
|
391 | - echo '</td>'; |
|
315 | + xoops_cp_header(); |
|
316 | + // @author Gregory Mage (Aka Mage) |
|
317 | + //*************************************************************************************** |
|
392 | 318 | |
393 | - echo '</tr>'; |
|
394 | - } |
|
395 | - //--------------------------------------------------------- |
|
396 | - $pageNav = new XoopsPageNav($eventHandler->getCountNewEvent(), $nbEventsByPage, $start); |
|
319 | + $eventAdmin = new ModuleAdmin(); |
|
320 | + echo $eventAdmin->addNavigation('event.php'); |
|
321 | + //*************************************************************************************** |
|
322 | + |
|
323 | + $eventHandler = xoops_getmodulehandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
324 | + $events = $eventHandler->objectToArray($eventHandler->getNewEvent($start, $nbEventsByPage, 0, true), array('cat_id')); |
|
325 | + $eventHandler->formatEventsDate($events, _SHORTDATESTRING); |
|
326 | + |
|
327 | + echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_APPROVED_EVENT . '</legend>'; |
|
328 | + echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _AM_EXTCAL_INFORMATION . '</legend>'; |
|
329 | + //echo'<img src='. XOOPS_URL .'/'. $moduleInfo->getInfo('dirmoduleadmin').'/assets/images/action/edit.png' .' '.'style=vertical-align:middle;/> ' . _AM_EXTCAL_INFO_EDIT . '<br />'; |
|
330 | + //echo'<img src='. XOOPS_URL .'/'. $moduleInfo->getInfo('dirmoduleadmin').'/assets/images/action/delete.png'. ' '."style=vertical-align:middle;/> ". _AM_EXTCAL_INFO_DELETE; |
|
397 | 331 | |
398 | - echo '<tr><td colspan="2" style="text-align: right;">'; |
|
399 | - echo $pageNav->renderNav(2); |
|
400 | - echo '</td>'; |
|
332 | + echo '<img src=' . $pathIcon16 . '/edit.png' . ' ' . 'style=vertical-align:middle;/> ' . _AM_EXTCAL_INFO_EDIT . '<br />'; |
|
333 | + echo '<img src=' . $pathIcon16 . '/delete.png' . ' ' . 'style=vertical-align:middle;/> ' . _AM_EXTCAL_INFO_DELETE . '<br />'; |
|
401 | 334 | |
402 | - echo '<td colspan="2" style="text-align: right;">'; |
|
335 | + echo '</fieldset><br />'; |
|
403 | 336 | |
404 | - echo '<input type="submit" value="' . _AM_EXTCAL_DELETE_ALL . '" name="deleteSelection[0]">'; |
|
405 | - echo '<input type="submit" value="' . _AM_EXTCAL_DELETE_SELECTION . '" name="deleteSelection[1]">'; |
|
337 | + echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _MD_EXTCAL_SUBMITED_EVENT . '</legend>'; |
|
338 | + |
|
339 | + echo '<form method="POST" action="event.php">'; |
|
340 | + echo '<input type="hidden" name="op" value="deleteSelection" />'; |
|
341 | + |
|
342 | + echo '<table class="outer" style="width:100%;">'; |
|
343 | + echo '<tr style="text-align:center;">'; |
|
344 | + echo '<th>' . _AM_EXTCAL_DELETE . '</th>'; |
|
345 | + echo '<th>#</th>'; |
|
346 | + echo '<th>' . _AM_EXTCAL_CATEGORY . '</th>'; |
|
347 | + echo '<th>' . _AM_EXTCAL_TITLE . '</th>'; |
|
348 | + echo '<th>' . _AM_EXTCAL_START_DATE . '</th>'; |
|
349 | + echo '<th>' . _AM_EXTCAL_END_DATE . '</th>'; |
|
350 | + echo '<th>' . _AM_EXTCAL_RECURRENT . '</th>'; |
|
351 | + echo '<th>' . _AM_EXTCAL_START_RULES . '</th>'; |
|
352 | + echo '<th>' . _AM_EXTCAL_ACTION . '</th>'; |
|
406 | 353 | |
407 | - echo '</td>'; |
|
408 | 354 | echo '</tr>'; |
409 | - } else { |
|
410 | - echo '<tr><td colspan="5">' . _AM_EXTCAL_NO_PENDING_EVENT . '</td></tr>'; |
|
411 | - } |
|
412 | - echo '</table>'; |
|
413 | - echo '</form>'; |
|
414 | 355 | |
415 | - echo '</fieldset>'; |
|
416 | - echo '</fieldset><br /><br />'; |
|
417 | - //Fin de la liste des evennement ------------------------------------- |
|
418 | - echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _MD_EXTCAL_SUBMIT_EVENT . '</legend>'; |
|
356 | + if (count($events) > 0) { |
|
357 | + $i = 0; |
|
358 | + foreach ( |
|
359 | + $events as $event |
|
360 | + ) { |
|
361 | + $class = (++$i % 2 == 0) ? 'even' : 'odd'; |
|
362 | + echo '<tr style="text-align:left;" class="' . $class . '">'; |
|
363 | + echo "<td width='10%' align='center'>"; |
|
364 | + echo "<input type='checkbox' name='deleteEvents[{$event['event_id']}]' value='1' >"; |
|
365 | + echo "<input type='hidden' name='deleteAllEvents[{$event['event_id']}]' value='1' />"; |
|
366 | + echo "</td>"; |
|
367 | + echo "<td align = 'center' width='5%'>" . $event['event_id'] . '</td>'; |
|
368 | + echo "<td width='10%'>" . '<a href=cat.php?op=modify&cat_id=' . $event['cat']['cat_id'] . '&form_modify' . '>' . $event['cat']['cat_name'] . '</a>' . '</td>'; |
|
369 | + |
|
370 | + echo '<td>' . '<a href=event.php?op=modify&event_id=' . $event['event_id'] . '>' . $event['event_title'] . '</a>' . '</td>'; |
|
371 | + |
|
372 | + // if ($event['event_isrecur']) { |
|
373 | + // echo '<td>' . $event['formated_reccur_rule'] . '</td>'; |
|
374 | + // } else { |
|
375 | + // echo '<td>' . $event['formated_event_start'] . '</td>'; |
|
376 | + // } |
|
377 | + |
|
378 | + |
|
379 | + echo "<td align = 'center' width='10%'>" . $event['formated_event_start'] . '</td>'; |
|
380 | + echo "<td align = 'center' width='10%'>" . $event['formated_event_end'] . '</td>'; |
|
381 | + echo '<td align="center">' . (($event['event_isrecur'] == 1) ? _YES : _NO) . '</td>'; |
|
382 | + if (!isset($event['formated_reccur_rule'])) { |
|
383 | + $event['formated_reccur_rule'] = ''; |
|
384 | + } |
|
385 | + echo '<td>' . $event['formated_reccur_rule'] . '</td>'; |
|
386 | + |
|
387 | + echo '<td style="width:10%; text-align:center;">'; |
|
388 | + echo '<a href=event.php?op=modify&event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/edit.png' title='" . _AM_EXTCAL_ICONE_EDIT . "' /></a> "; |
|
389 | + echo '<a href=event.php?op=delete&event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/delete.png' title='" . _AM_EXTCAL_ICONE_DELETE . "' /></a> "; |
|
390 | + echo '<a href=event.php?op=clone&event_id=' . $event['event_id'] . "><img src='" . $pathIcon16 . "/editcopy.png' title='" . _AM_EXTCAL_ICONE_CLONE . "' /></a>"; |
|
391 | + echo '</td>'; |
|
392 | + |
|
393 | + echo '</tr>'; |
|
394 | + } |
|
395 | + //--------------------------------------------------------- |
|
396 | + $pageNav = new XoopsPageNav($eventHandler->getCountNewEvent(), $nbEventsByPage, $start); |
|
397 | + |
|
398 | + echo '<tr><td colspan="2" style="text-align: right;">'; |
|
399 | + echo $pageNav->renderNav(2); |
|
400 | + echo '</td>'; |
|
401 | + |
|
402 | + echo '<td colspan="2" style="text-align: right;">'; |
|
403 | + |
|
404 | + echo '<input type="submit" value="' . _AM_EXTCAL_DELETE_ALL . '" name="deleteSelection[0]">'; |
|
405 | + echo '<input type="submit" value="' . _AM_EXTCAL_DELETE_SELECTION . '" name="deleteSelection[1]">'; |
|
419 | 406 | |
420 | - $form = $eventHandler->getEventForm('admin'); |
|
421 | - $form->display(); |
|
407 | + echo '</td>'; |
|
408 | + echo '</tr>'; |
|
409 | + } else { |
|
410 | + echo '<tr><td colspan="5">' . _AM_EXTCAL_NO_PENDING_EVENT . '</td></tr>'; |
|
411 | + } |
|
412 | + echo '</table>'; |
|
413 | + echo '</form>'; |
|
414 | + |
|
415 | + echo '</fieldset>'; |
|
416 | + echo '</fieldset><br /><br />'; |
|
417 | + //Fin de la liste des evennement ------------------------------------- |
|
418 | + echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _MD_EXTCAL_SUBMIT_EVENT . '</legend>'; |
|
419 | + |
|
420 | + $form = $eventHandler->getEventForm('admin'); |
|
421 | + $form->display(); |
|
422 | 422 | |
423 | - echo '</fieldset>'; |
|
423 | + echo '</fieldset>'; |
|
424 | 424 | |
425 | - include_once __DIR__ . '/admin_footer.php'; |
|
425 | + include_once __DIR__ . '/admin_footer.php'; |
|
426 | 426 | |
427 | - break; |
|
427 | + break; |
|
428 | 428 | } |
@@ -108,7 +108,7 @@ |
||
108 | 108 | |
109 | 109 | // New event |
110 | 110 | } else { |
111 | - $notificationHandler =& xoops_gethandler('notification'); |
|
111 | + $notificationHandler = & xoops_gethandler('notification'); |
|
112 | 112 | $catHandler = xoops_getmodulehandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE); |
113 | 113 | |
114 | 114 | $data['event_submitter'] = ($xoopsUser) ? $xoopsUser->getVar('uid') : 0; |
@@ -48,11 +48,11 @@ |
||
48 | 48 | echo $permAdmin->addNavigation('permissions.php'); |
49 | 49 | //*************************************************************************************** |
50 | 50 | |
51 | - $memberHandler =& xoops_gethandler('member'); |
|
52 | - $groupPermissionHandler =& xoops_gethandler('groupperm'); |
|
51 | + $memberHandler = & xoops_gethandler('member'); |
|
52 | + $groupPermissionHandler = & xoops_gethandler('groupperm'); |
|
53 | 53 | |
54 | 54 | // Retriving the group list |
55 | - $glist =& $memberHandler->getGroupList(); |
|
55 | + $glist = & $memberHandler->getGroupList(); |
|
56 | 56 | |
57 | 57 | // Retriving Public category permission mask |
58 | 58 | $viewGroup = $groupPermissionHandler->getGroupIds('extcal_perm_mask', 1, $moduleId); |
@@ -1,21 +1,21 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * **************************************************************************** |
|
4 | - * - TDMAds By TDM - TEAM DEV MODULE FOR XOOPS |
|
5 | - * - Licence PRO Copyright (c) (http://www.tdmxoops.net) |
|
6 | - * |
|
7 | - * Cette licence, contient des limitations!!! |
|
8 | - * |
|
9 | - * 1. Vous devez posséder une permission d'exécuter le logiciel, pour n'importe quel usage. |
|
10 | - * 2. Vous ne devez pas l' étudier, |
|
11 | - * 3. Vous ne devez pas le redistribuer ni en faire des copies, |
|
12 | - * 4. Vous n'avez pas la liberté de l'améliorer et de rendre publiques les modifications |
|
13 | - * |
|
14 | - * @license TDMFR PRO license |
|
15 | - * @author TDMFR ; TEAM DEV MODULE |
|
16 | - * |
|
17 | - * **************************************************************************** |
|
18 | - */ |
|
3 | + * **************************************************************************** |
|
4 | + * - TDMAds By TDM - TEAM DEV MODULE FOR XOOPS |
|
5 | + * - Licence PRO Copyright (c) (http://www.tdmxoops.net) |
|
6 | + * |
|
7 | + * Cette licence, contient des limitations!!! |
|
8 | + * |
|
9 | + * 1. Vous devez posséder une permission d'exécuter le logiciel, pour n'importe quel usage. |
|
10 | + * 2. Vous ne devez pas l' étudier, |
|
11 | + * 3. Vous ne devez pas le redistribuer ni en faire des copies, |
|
12 | + * 4. Vous n'avez pas la liberté de l'améliorer et de rendre publiques les modifications |
|
13 | + * |
|
14 | + * @license TDMFR PRO license |
|
15 | + * @author TDMFR ; TEAM DEV MODULE |
|
16 | + * |
|
17 | + * **************************************************************************** |
|
18 | + */ |
|
19 | 19 | |
20 | 20 | // Include xoops admin header |
21 | 21 | include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php'; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | xoops_loadLanguage('admin', 'system'); |
50 | 50 | xoops_loadLanguage('admin', $xoopsModule->getVar('dirname', 'e')); |
51 | 51 | xoops_loadLanguage('modinfo', $xoopsModule->getVar('dirname', 'e')); |
52 | -$myts =& MyTextSanitizer::getInstance(); |
|
52 | +$myts = & MyTextSanitizer::getInstance(); |
|
53 | 53 | |
54 | 54 | //appel des class |
55 | 55 | $etablissementHandler = xoops_getmodulehandler(_EXTCAL_CLS_ETABLISSEMENT, _EXTCAL_MODULE); |
@@ -144,13 +144,13 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | // Affichage du formulaire |
147 | - $obj =& $etablissementHandler->create(); |
|
147 | + $obj = & $etablissementHandler->create(); |
|
148 | 148 | $form = $obj->getForm(false); |
149 | 149 | break; |
150 | 150 | |
151 | 151 | // permet de suprimmer le rapport de téléchargment brisé |
152 | 152 | case "delete_etablissement": |
153 | - $obj =& $etablissementHandler->get($_REQUEST['etablissement_id']); |
|
153 | + $obj = & $etablissementHandler->get($_REQUEST['etablissement_id']); |
|
154 | 154 | if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) { |
155 | 155 | if (!$GLOBALS['xoopsSecurity']->check()) { |
156 | 156 | redirect_header('etablissement.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | redirect_header("etablissement.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); |
180 | 180 | } |
181 | 181 | if (isset($_REQUEST["etablissement_id"])) { |
182 | - $obj =& $etablissementHandler->get($_REQUEST["etablissement_id"]); |
|
182 | + $obj = & $etablissementHandler->get($_REQUEST["etablissement_id"]); |
|
183 | 183 | } else { |
184 | - $obj =& $etablissementHandler->create(); |
|
184 | + $obj = & $etablissementHandler->create(); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | $obj->setVar("nom", $_REQUEST["nom"]); |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | //include_once("../include/forms.php"); |
237 | 237 | echo $obj->getHtmlErrors(); |
238 | - $form =& $obj->getForm(false, 0); |
|
238 | + $form = & $obj->getForm(false, 0); |
|
239 | 239 | //echo "<hr>exit <<<<<<<<<<<<<<<<<<<<";exit; |
240 | 240 | redirect_header("etablissement.php", 2, _AM_EXTCAL_FORMOK); |
241 | 241 |
@@ -101,11 +101,11 @@ |
||
101 | 101 | |
102 | 102 | $fromemail = !empty($xoopsConfig['adminmail']) ? $xoopsConfig['adminmail'] : $xoopsUser->getVar("email", "E"); |
103 | 103 | $subjectCaption |
104 | - = |
|
104 | + = |
|
105 | 105 | _AM_EXTCAL_SUBJECT . "<br /><br /><span style='font-size:x-small;font-weight:bold;'>" . _AM_EXTCAL_USEFUL_TAGS . "</span><br /><span style='font-size:x-small;font-weight:normal;'>" |
106 | 106 | . _AM_EXTCAL_MAILTAGS6 . "<br />" . _AM_EXTCAL_MAILTAGS2 . "</span> "; |
107 | 107 | $bodyCaption |
108 | - = |
|
108 | + = |
|
109 | 109 | _AM_EXTCAL_BODY . "<br /><br /><span style='font-size:x-small;font-weight:bold;'>" . _AM_EXTCAL_USEFUL_TAGS . "</span><br /><span style='font-size:x-small;font-weight:normal;'>" |
110 | 110 | . _AM_EXTCAL_MAILTAGS1 . "<br />" . _AM_EXTCAL_MAILTAGS2 . "<br />" . _AM_EXTCAL_MAILTAGS3 . "<br />" . _AM_EXTCAL_MAILTAGS4 . "<br />" . _AM_EXTCAL_MAILTAGS5 . "<br />" |
111 | 111 | . _AM_EXTCAL_MAILTAGS6 . "<br />" . _AM_EXTCAL_MAILTAGS7 . "<br />" . _AM_EXTCAL_MAILTAGS8 . "<br />" . _AM_EXTCAL_MAILTAGS9 . "</span> "; |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | |
37 | 37 | switch ($op) { |
38 | 38 | |
39 | - case 'notification': |
|
39 | + case 'notification': |
|
40 | 40 | |
41 | - switch ($fct) { |
|
41 | + switch ($fct) { |
|
42 | 42 | |
43 | 43 | case 'send': |
44 | 44 | |
@@ -132,81 +132,81 @@ discard block |
||
132 | 132 | |
133 | 133 | break; |
134 | 134 | |
135 | - } |
|
135 | + } |
|
136 | 136 | |
137 | 137 | break; |
138 | 138 | |
139 | - default: |
|
140 | - case 'default': |
|
141 | - // @author Gregory Mage (Aka Mage) |
|
142 | - //*************************************************************************************** |
|
143 | - xoops_cp_header(); |
|
144 | -// include_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php"; |
|
145 | - $catHandler = xoops_getmodulehandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE); |
|
146 | - $eventHandler = xoops_getmodulehandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
147 | - $indexAdmin = new ModuleAdmin(); |
|
148 | - $indexAdmin->addInfoBox(_MI_EXTCAL_DASHBOARD); |
|
149 | - $indexAdmin->addInfoBoxLine(_MI_EXTCAL_DASHBOARD, "<infolabel>" . _AM_EXTCAL_INDEX_CATEGORIES . "</infolabel>", $catHandler->getCount(), 'Green'); |
|
150 | - $indexAdmin->addInfoBoxLine(_MI_EXTCAL_DASHBOARD, "<infolabel>" . _AM_EXTCAL_INDEX_EVENT . "</infolabel>", $eventHandler->getCount(new Criteria('event_approved', 1)), 'Green'); |
|
151 | - $indexAdmin->addInfoBoxLine(_MI_EXTCAL_DASHBOARD, "<infolabel>" . _AM_EXTCAL_INDEX_PENDING . "</infolabel>", $eventHandler->getCount(new Criteria('event_approved', 0)), 'Red'); |
|
152 | - $criteriaCompo = new CriteriaCompo(); |
|
153 | - $criteriaCompo->add(new Criteria('event_approved', 1)); |
|
154 | - $criteriaCompo->add(new Criteria('event_start', time(), '>=')); |
|
155 | - $indexAdmin->addInfoBoxLine(_MI_EXTCAL_DASHBOARD, "<infolabel>" . _AM_EXTCAL_INDEX_APPROVED . "</infolabel><infotext>", $eventHandler->getCount($criteriaCompo) . "</infotext>", 'Green'); |
|
156 | - |
|
157 | - $indexAdmin->addConfigBoxLine(); |
|
158 | - $indexAdmin->addConfigBoxLine(_AM_EXTCAL_PEAR_PATH); |
|
159 | - $indexAdmin->addConfigBoxLine(_EXTCAL_PEAR_ROOT, 'folder'); |
|
160 | - |
|
161 | -//JJD |
|
162 | -// $indexAdmin->addConfigBoxLine(XOOPS_ROOT_PATH,'folder'); |
|
163 | - |
|
164 | -// $indexAdmin->addLineConfigLabel(_AM_EXTCAL_CONFIG_PHP, $xoopsModule->getInfo("min_php"), 'php'); |
|
165 | -// $indexAdmin->addLineConfigLabel(_AM_EXTCAL_CONFIG_XOOPS, $xoopsModule->getInfo("min_xoops"), 'xoops'); |
|
166 | - echo $indexAdmin->addNavigation('index.php'); |
|
167 | - echo $indexAdmin->renderIndex(); |
|
168 | - //*************************************************************************************** |
|
169 | - $pendingEvent = $eventHandler->objectToArray($eventHandler->getPendingEvent(), array('cat_id')); |
|
170 | - $eventHandler->formatEventsDate($pendingEvent, 'd/m/Y'); |
|
171 | - |
|
172 | - echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_PENDING_EVENT . '</legend>'; |
|
173 | - echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _AM_EXTCAL_INFORMATION . '</legend>'; |
|
174 | -// echo '<img src="../assets/images/icons/on.png" /> '._AM_EXTCAL_INFO_APPROVE_PENDING_EVENT.'<br />'; |
|
175 | - echo '<img src=' . $pathIcon16 . '/edit.png /> ' . _AM_EXTCAL_INFO_EDIT_PENDING_EVENT . '<br />'; |
|
176 | - echo '<img src=' . $pathIcon16 . '/delete.png /> ' . _AM_EXTCAL_INFO_DELETE_PENDING_EVENT . '<br />'; |
|
177 | - echo '</fieldset><br />'; |
|
178 | - |
|
179 | - echo '<table class="outer" style="width:100%;">'; |
|
180 | - echo '<tr style="text-align:center;">'; |
|
181 | - echo '<th>' . _AM_EXTCAL_CATEGORY . '</th>'; |
|
182 | - echo '<th>' . _AM_EXTCAL_TITLE . '</th>'; |
|
183 | - echo '<th>' . _AM_EXTCAL_START_DATE . '</th>'; |
|
184 | - echo '<th>' . _AM_EXTCAL_ACTION . '</th>'; |
|
185 | - echo '</tr>'; |
|
186 | - |
|
187 | - if (count($pendingEvent) > 0) { |
|
188 | - $i = 0; |
|
189 | - foreach ( |
|
190 | - $pendingEvent as $event |
|
191 | - ) { |
|
192 | - $class = (++$i % 2 == 0) ? 'even' : 'odd'; |
|
193 | - echo '<tr style="text-align:center;" class="' . $class . '">'; |
|
194 | - echo '<td>' . $event['cat']['cat_name'] . '</td>'; |
|
195 | - echo '<td>' . $event['event_title'] . '</td>'; |
|
196 | - echo '<td>' . $event['formated_event_start'] . '</td>'; |
|
197 | - echo '<td style="width:10%; text-align:center;">'; |
|
198 | - echo '<a href="event.php?op=modify&event_id=' . $event['event_id'] . '"><img src=' . $pathIcon16 . '/edit.png /></a> '; |
|
199 | - echo '<a href="event.php?op=delete&event_id=' . $event['event_id'] . '"><img src=' . $pathIcon16 . '/delete.png /></a>'; |
|
200 | - echo '</td>'; |
|
201 | - echo '</tr>'; |
|
139 | + default: |
|
140 | + case 'default': |
|
141 | + // @author Gregory Mage (Aka Mage) |
|
142 | + //*************************************************************************************** |
|
143 | + xoops_cp_header(); |
|
144 | + // include_once XOOPS_ROOT_PATH . "/modules/extcal/class/admin.php"; |
|
145 | + $catHandler = xoops_getmodulehandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE); |
|
146 | + $eventHandler = xoops_getmodulehandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
|
147 | + $indexAdmin = new ModuleAdmin(); |
|
148 | + $indexAdmin->addInfoBox(_MI_EXTCAL_DASHBOARD); |
|
149 | + $indexAdmin->addInfoBoxLine(_MI_EXTCAL_DASHBOARD, "<infolabel>" . _AM_EXTCAL_INDEX_CATEGORIES . "</infolabel>", $catHandler->getCount(), 'Green'); |
|
150 | + $indexAdmin->addInfoBoxLine(_MI_EXTCAL_DASHBOARD, "<infolabel>" . _AM_EXTCAL_INDEX_EVENT . "</infolabel>", $eventHandler->getCount(new Criteria('event_approved', 1)), 'Green'); |
|
151 | + $indexAdmin->addInfoBoxLine(_MI_EXTCAL_DASHBOARD, "<infolabel>" . _AM_EXTCAL_INDEX_PENDING . "</infolabel>", $eventHandler->getCount(new Criteria('event_approved', 0)), 'Red'); |
|
152 | + $criteriaCompo = new CriteriaCompo(); |
|
153 | + $criteriaCompo->add(new Criteria('event_approved', 1)); |
|
154 | + $criteriaCompo->add(new Criteria('event_start', time(), '>=')); |
|
155 | + $indexAdmin->addInfoBoxLine(_MI_EXTCAL_DASHBOARD, "<infolabel>" . _AM_EXTCAL_INDEX_APPROVED . "</infolabel><infotext>", $eventHandler->getCount($criteriaCompo) . "</infotext>", 'Green'); |
|
156 | + |
|
157 | + $indexAdmin->addConfigBoxLine(); |
|
158 | + $indexAdmin->addConfigBoxLine(_AM_EXTCAL_PEAR_PATH); |
|
159 | + $indexAdmin->addConfigBoxLine(_EXTCAL_PEAR_ROOT, 'folder'); |
|
160 | + |
|
161 | + //JJD |
|
162 | + // $indexAdmin->addConfigBoxLine(XOOPS_ROOT_PATH,'folder'); |
|
163 | + |
|
164 | + // $indexAdmin->addLineConfigLabel(_AM_EXTCAL_CONFIG_PHP, $xoopsModule->getInfo("min_php"), 'php'); |
|
165 | + // $indexAdmin->addLineConfigLabel(_AM_EXTCAL_CONFIG_XOOPS, $xoopsModule->getInfo("min_xoops"), 'xoops'); |
|
166 | + echo $indexAdmin->addNavigation('index.php'); |
|
167 | + echo $indexAdmin->renderIndex(); |
|
168 | + //*************************************************************************************** |
|
169 | + $pendingEvent = $eventHandler->objectToArray($eventHandler->getPendingEvent(), array('cat_id')); |
|
170 | + $eventHandler->formatEventsDate($pendingEvent, 'd/m/Y'); |
|
171 | + |
|
172 | + echo '<fieldset><legend style="font-weight:bold; color:#990000;">' . _AM_EXTCAL_PENDING_EVENT . '</legend>'; |
|
173 | + echo '<fieldset><legend style="font-weight:bold; color:#0A3760;">' . _AM_EXTCAL_INFORMATION . '</legend>'; |
|
174 | + // echo '<img src="../assets/images/icons/on.png" /> '._AM_EXTCAL_INFO_APPROVE_PENDING_EVENT.'<br />'; |
|
175 | + echo '<img src=' . $pathIcon16 . '/edit.png /> ' . _AM_EXTCAL_INFO_EDIT_PENDING_EVENT . '<br />'; |
|
176 | + echo '<img src=' . $pathIcon16 . '/delete.png /> ' . _AM_EXTCAL_INFO_DELETE_PENDING_EVENT . '<br />'; |
|
177 | + echo '</fieldset><br />'; |
|
178 | + |
|
179 | + echo '<table class="outer" style="width:100%;">'; |
|
180 | + echo '<tr style="text-align:center;">'; |
|
181 | + echo '<th>' . _AM_EXTCAL_CATEGORY . '</th>'; |
|
182 | + echo '<th>' . _AM_EXTCAL_TITLE . '</th>'; |
|
183 | + echo '<th>' . _AM_EXTCAL_START_DATE . '</th>'; |
|
184 | + echo '<th>' . _AM_EXTCAL_ACTION . '</th>'; |
|
185 | + echo '</tr>'; |
|
186 | + |
|
187 | + if (count($pendingEvent) > 0) { |
|
188 | + $i = 0; |
|
189 | + foreach ( |
|
190 | + $pendingEvent as $event |
|
191 | + ) { |
|
192 | + $class = (++$i % 2 == 0) ? 'even' : 'odd'; |
|
193 | + echo '<tr style="text-align:center;" class="' . $class . '">'; |
|
194 | + echo '<td>' . $event['cat']['cat_name'] . '</td>'; |
|
195 | + echo '<td>' . $event['event_title'] . '</td>'; |
|
196 | + echo '<td>' . $event['formated_event_start'] . '</td>'; |
|
197 | + echo '<td style="width:10%; text-align:center;">'; |
|
198 | + echo '<a href="event.php?op=modify&event_id=' . $event['event_id'] . '"><img src=' . $pathIcon16 . '/edit.png /></a> '; |
|
199 | + echo '<a href="event.php?op=delete&event_id=' . $event['event_id'] . '"><img src=' . $pathIcon16 . '/delete.png /></a>'; |
|
200 | + echo '</td>'; |
|
201 | + echo '</tr>'; |
|
202 | + } |
|
203 | + } else { |
|
204 | + echo '<tr><td colspan="4">' . _AM_EXTCAL_NO_PENDING_EVENT . '</td></tr>'; |
|
202 | 205 | } |
203 | - } else { |
|
204 | - echo '<tr><td colspan="4">' . _AM_EXTCAL_NO_PENDING_EVENT . '</td></tr>'; |
|
205 | - } |
|
206 | 206 | |
207 | - echo '</table></fieldset><br />'; |
|
207 | + echo '</table></fieldset><br />'; |
|
208 | 208 | |
209 | - include_once __DIR__ . '/admin_footer.php'; |
|
209 | + include_once __DIR__ . '/admin_footer.php'; |
|
210 | 210 | |
211 | - break; |
|
211 | + break; |
|
212 | 212 | } |
@@ -53,13 +53,13 @@ |
||
53 | 53 | xoops_cp_header(); |
54 | 54 | adminMenu(1); |
55 | 55 | |
56 | - $myts =& MyTextSanitizer::getInstance(); |
|
57 | - $xoopsMailer =& getMailer(); |
|
56 | + $myts = & MyTextSanitizer::getInstance(); |
|
57 | + $xoopsMailer = & getMailer(); |
|
58 | 58 | $catHandler = xoops_getmodulehandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE); |
59 | 59 | $eventHandler = xoops_getmodulehandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
60 | 60 | $eventMemberHandler = xoops_getmodulehandler(_EXTCAL_CLS_MEMBER, _EXTCAL_MODULE); |
61 | 61 | $extcalTime = ExtcalTime::getHandler(); |
62 | - $extcalConfig =& ExtcalConfig::getHandler(); |
|
62 | + $extcalConfig = & ExtcalConfig::getHandler(); |
|
63 | 63 | $xoopsModuleConfig = $extcalConfig->getModuleConfig(); |
64 | 64 | |
65 | 65 | $event = $eventHandler->getEvent($_POST['event_id'], $xoopsUser, true); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | include dirname(dirname(__DIR__)) . '/mainfile.php'; |
4 | 4 | include_once __DIR__ . '/include/constantes.php'; |
5 | -$params = array( |
|
5 | +$params = array( |
|
6 | 6 | 'view' => _EXTCAL_NAV_SEARCH, |
7 | 7 | 'file' => _EXTCAL_FILE_SEARCH |
8 | 8 | ); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | } |
145 | 145 | |
146 | -$eventsArray = array_merge((array)$eventsArray, (array)$recurEventsArray); |
|
146 | +$eventsArray = array_merge((array) $eventsArray, (array) $recurEventsArray); |
|
147 | 147 | |
148 | 148 | // Sort event array by event start |
149 | 149 | //usort($eventsArray, "orderEvents"); |
@@ -31,7 +31,7 @@ |
||
31 | 31 | 'cat' => $cat, |
32 | 32 | 'externalKeys' => 'cat_id' |
33 | 33 | ); |
34 | -$events = $eventHandler->getEventsOnPeriode($criteres); |
|
34 | +$events = $eventHandler->getEventsOnPeriode($criteres); |
|
35 | 35 | /**********************************************************************/ |
36 | 36 | |
37 | 37 | // Calculating timestamp for the begin and the end of the month |
@@ -31,7 +31,7 @@ |
||
31 | 31 | 'cat' => $cat, |
32 | 32 | 'externalKeys' => 'cat_id' |
33 | 33 | ); |
34 | -$events = $eventHandler->getEventsOnPeriode($criteres); |
|
34 | +$events = $eventHandler->getEventsOnPeriode($criteres); |
|
35 | 35 | /**********************************************************************/ |
36 | 36 | |
37 | 37 | // Calculating timestamp for the begin and the end of the month |
@@ -31,7 +31,7 @@ |
||
31 | 31 | 'cat' => $cat, |
32 | 32 | 'externalKeys' => 'cat_id' |
33 | 33 | ); |
34 | -$events = $eventHandler->getEventsOnPeriode($criteres); |
|
34 | +$events = $eventHandler->getEventsOnPeriode($criteres); |
|
35 | 35 | /**********************************************************************/ |
36 | 36 | |
37 | 37 | // Calculating timestamp for the begin and the end of the month |
@@ -31,7 +31,7 @@ |
||
31 | 31 | 'cat' => $cat, |
32 | 32 | 'externalKeys' => 'cat_id' |
33 | 33 | ); |
34 | -$events = $eventHandler->getEventsOnPeriode($criteres); |
|
34 | +$events = $eventHandler->getEventsOnPeriode($criteres); |
|
35 | 35 | /**********************************************************************/ |
36 | 36 | |
37 | 37 | // Calculating timestamp for the begin and the end of the month |