| @@ 1128-1145 (lines=18) @@ | ||
| 1125 | $TKT = EEM_Ticket::instance(); |
|
| 1126 | ||
| 1127 | //checkboxes? |
|
| 1128 | if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) { |
|
| 1129 | //if array has more than one element then success message should be plural |
|
| 1130 | $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
| 1131 | ||
| 1132 | //cycle thru the boxes |
|
| 1133 | while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) { |
|
| 1134 | //delete |
|
| 1135 | if ( ! $this->_delete_the_ticket( $TKT_ID ) ) { |
|
| 1136 | $success = 0; |
|
| 1137 | } |
|
| 1138 | } |
|
| 1139 | } else { |
|
| 1140 | //grab single id and trash |
|
| 1141 | $TKT_ID = absint( $this->_req_data['TKT_ID'] ); |
|
| 1142 | if ( ! $this->_delete_the_ticket( $TKT_ID ) ) { |
|
| 1143 | $success = 0; |
|
| 1144 | } |
|
| 1145 | } |
|
| 1146 | ||
| 1147 | $action_desc = 'deleted'; |
|
| 1148 | $query_args = array( |
|
| @@ 280-297 (lines=18) @@ | ||
| 277 | $TKT = EEM_Ticket::instance(); |
|
| 278 | ||
| 279 | //checkboxes? |
|
| 280 | if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) { |
|
| 281 | //if array has more than one element then success message should be plural |
|
| 282 | $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
| 283 | ||
| 284 | //cycle thru the boxes |
|
| 285 | while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) { |
|
| 286 | //delete |
|
| 287 | if ( ! $this->_delete_the_ticket( $TKT_ID ) ) { |
|
| 288 | $success = 0; |
|
| 289 | } |
|
| 290 | } |
|
| 291 | } else { |
|
| 292 | //grab single id and trash |
|
| 293 | $TKT_ID = absint( $this->_req_data['TKT_ID'] ); |
|
| 294 | if ( ! $this->_delete_the_ticket( $TKT_ID ) ) { |
|
| 295 | $success = 0; |
|
| 296 | } |
|
| 297 | } |
|
| 298 | ||
| 299 | $action_desc = 'deleted'; |
|
| 300 | $this->_redirect_after_action( $success, 'Tickets', $action_desc, array() ); |
|