| @@ 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() ); | |
| @@ 1144-1161 (lines=18) @@ | ||
| 1141 | $TKT = EEM_Ticket::instance(); | |
| 1142 | ||
| 1143 | //checkboxes? | |
| 1144 | 		if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) { | |
| 1145 | //if array has more than one element then success message should be plural | |
| 1146 | $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; | |
| 1147 | ||
| 1148 | //cycle thru the boxes | |
| 1149 | 			while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) { | |
| 1150 | //delete | |
| 1151 | 				if ( ! $this->_delete_the_ticket( $TKT_ID ) ) { | |
| 1152 | $success = 0; | |
| 1153 | } | |
| 1154 | } | |
| 1155 | 		} else { | |
| 1156 | //grab single id and trash | |
| 1157 | $TKT_ID = absint( $this->_req_data['TKT_ID'] ); | |
| 1158 | 			if ( ! $this->_delete_the_ticket( $TKT_ID ) ) { | |
| 1159 | $success = 0; | |
| 1160 | } | |
| 1161 | } | |
| 1162 | ||
| 1163 | $action_desc = 'deleted'; | |
| 1164 | $query_args = array( | |