@@ 291-308 (lines=18) @@ | ||
288 | $TKT = EEM_Ticket::instance(); |
|
289 | ||
290 | // checkboxes? |
|
291 | if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
292 | // if array has more than one element then success message should be plural |
|
293 | $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
294 | ||
295 | // cycle thru the boxes |
|
296 | while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
297 | // delete |
|
298 | if (! $this->_delete_the_ticket($TKT_ID)) { |
|
299 | $success = 0; |
|
300 | } |
|
301 | } |
|
302 | } else { |
|
303 | // grab single id and trash |
|
304 | $TKT_ID = absint($this->_req_data['TKT_ID']); |
|
305 | if (! $this->_delete_the_ticket($TKT_ID)) { |
|
306 | $success = 0; |
|
307 | } |
|
308 | } |
|
309 | ||
310 | $action_desc = 'deleted'; |
|
311 | $this->_redirect_after_action($success, 'Tickets', $action_desc, array()); |
@@ 1386-1402 (lines=17) @@ | ||
1383 | { |
|
1384 | $success = 1; |
|
1385 | // checkboxes? |
|
1386 | if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
1387 | // if array has more than one element then success message should be plural |
|
1388 | $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
1389 | // cycle thru the boxes |
|
1390 | foreach ($this->_req_data['checkbox'] as $TKT_ID) { |
|
1391 | // delete |
|
1392 | if (! $this->_delete_the_ticket($TKT_ID)) { |
|
1393 | $success = 0; |
|
1394 | } |
|
1395 | } |
|
1396 | } else { |
|
1397 | // grab single id and trash |
|
1398 | $TKT_ID = absint($this->_req_data['TKT_ID']); |
|
1399 | if (! $this->_delete_the_ticket($TKT_ID)) { |
|
1400 | $success = 0; |
|
1401 | } |
|
1402 | } |
|
1403 | $action_desc = 'deleted'; |
|
1404 | $query_args = array( |
|
1405 | 'action' => 'ticket_list_table', |