0) { $resources = $result; } $affected_resources = array_filter($resources, function($resource) use ($action) { return rse_workflow_validate_action($action, $resource); }); $affected_resources_count = count($affected_resources); if($ajax && $process_action) { if(empty($affected_resources)) { ajax_send_response(200, ajax_response_ok_no_data()); } $r_refs = array_column($affected_resources, 'ref'); $r_states = array_column($affected_resources, 'archive'); update_archive_status($r_refs, $action['statusto'], $r_states); // send user a message of confirmation with link to all resources in that new wf state $url = generateURL( "{$baseurl}/pages/search.php", array( "search" => "", "archive" => $action["statusto"], "resetrestypes" => "true", )); $text = str_replace("%wf_name", $to_wf_state["name"], $lang["rse_workflow_confirm_resources_moved_to_state"]); message_add($userref, $text, $url); ajax_send_response(200, ajax_response_ok(array_column($affected_resources, "ref"))); } $form_action = generateURL($baseurl_short . 'plugins/rse_workflow/pages/batch_action.php', array( "search" => $search, "restypes" => $restypes, "order_by" => $order_by, "archive" => $archive, "access" => $access, "per_page" => $per_page, "offset" => $offset, "sort" => $sort, "recent_search_daylimit" => $recent_search_daylimit, "go" => $go, "action" => $action["ref"], "collection" => $collection, ), $form_action_extra ); $action_csrf_data = " data-csrf-token-identifier=\"{$CSRF_token_identifier}\""; $action_csrf_data .= " data-csrf-token=\"" . generateCSRFToken($usersession, "process_wf_action{$action["ref"]}") . "\""; include_once '../../../include/header.php'; ?>