<li><?php frl_task_candidate_markup($candidate, 4); ?> </li> <?php } ?> </ul> </div> <?php } ?> </div> <?php } elseif (!$is_curr_users_task && tst_is_user_candidate() >= 1) { ?> <div id=""> <a href="#" id="task-remove-offer" class="btn btn-danger btn-lg widefat" <?php echo $post->post_status == 'publish' || $post->post_status == 'in_work' ? '' : 'disabled="disabled"'; ?> ><?php _e('Refuse helping', 'tst'); ?> </a> <div id="task-status" class="text-center help-block"><em>(<?php switch ($post->post_status) { case 'publish': _e('You have offered your help, wait for the task author to approve it', 'tst');
/** Close task */ function ajax_close_task() { $_POST['nonce'] = empty($_POST['nonce']) ? '' : trim($_POST['nonce']); if (empty($_POST['task-id']) || empty($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'task-close-by-author')) { die(json_encode(array('status' => 'fail', 'message' => __('<strong>Error:</strong> wrong data given.', 'tst')))); } wp_update_post(array('ID' => $_POST['task-id'], 'post_status' => 'closed')); $task = get_post($_POST['task-id']); if ($task) { $users = get_users(array('connected_type' => 'task-doers', 'connected_items' => $task)); foreach ($users as $user) { if (tst_is_user_candidate($user->ID, $task->ID)) { tst_actualize_member_role($user); } } } /** @todo Send emails to all task doers... */ die(json_encode(array('status' => 'ok'))); }