| @@ 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()); |
|
| @@ 1249-1265 (lines=17) @@ | ||
| 1246 | { |
|
| 1247 | $success = 1; |
|
| 1248 | // checkboxes? |
|
| 1249 | if (! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
| 1250 | // if array has more than one element then success message should be plural |
|
| 1251 | $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
| 1252 | // cycle thru the boxes |
|
| 1253 | while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
| 1254 | // delete |
|
| 1255 | if (! $this->_delete_the_ticket($TKT_ID)) { |
|
| 1256 | $success = 0; |
|
| 1257 | } |
|
| 1258 | } |
|
| 1259 | } else { |
|
| 1260 | // grab single id and trash |
|
| 1261 | $TKT_ID = absint($this->_req_data['TKT_ID']); |
|
| 1262 | if (! $this->_delete_the_ticket($TKT_ID)) { |
|
| 1263 | $success = 0; |
|
| 1264 | } |
|
| 1265 | } |
|
| 1266 | $action_desc = 'deleted'; |
|
| 1267 | $query_args = array( |
|
| 1268 | 'action' => 'ticket_list_table', |
|