function show_tasks() { page_head("File transfers"); table_start(); table_header(array("ID", "Created", "File", "Local", "Remote", "Status", "Last error")); $tasks = task_enum(); foreach ($tasks as $task) { $store = store_lookup_id($task->local_store_id); table_row(array($task->id, time_str($task->create_time), $task->file_name, $store->name, $task->remote_site . ': ' . $task->remote_store, task_status($task), $task->last_error . ' (' . time_str($task->last_error_time) . ')')); } table_end(); if (count($tasks) == 0) { echo "No tasks"; } page_tail(); }
<th class="red">Task</th> <th class="blue">User</th> <th class="green">Duration</th> <th class="orange">Priority</th> <th class="purple">Status</th> </thead> <?php for ($i = 0; $i < $project_task_history_number; $i++) { $tid = $db_array_task[$i]['tid']; $task = $db_array_task[$i]['name']; $start = time_uk($db_array_task[$i]['start']); $end = time_uk($db_array_task[$i]['end']); $array_user = fetch_user($db_array_task[$i]['uid']); $user = $array_user[0]['name_nickname'] . ' (' . $array_user[0]['name_first'] . ' ' . $array_user[0]['name_last'] . ')'; $priority = $db_array_task[$i]['priority']; $status = task_status($db_array_task[$i]['tid']); echo '<tr class="td_link" onclick="location.href=\'task.php?t=' . $tid . '\'"><td class="black">'; echo "<strong>" . $task . "</strong>"; echo "</td><td>"; echo $user; echo "</td><td>"; echo "[" . $start . "] → [" . $end . "]"; echo "</td><td>"; echo $priority; echo "</td><td>"; echo $status; echo "</td></tr>"; } echo '</table>'; } ?>
<thead> <th class="red">Project</th> <th class="blue">Task</th> <th class="green">Due</th> <th class="purple">Priority</th> </thead> <?php for ($i = 0; $i < $array_task_waiting_number; $i++) { $tid = $array_task_waiting[$i]['tid']; $array_project = fetch_task_project($array_task_waiting[$i]['tid']); $project = $array_project[0]['name']; $task = $array_task_waiting[$i]['name']; $end = date_uk($array_task_waiting[$i]['end']); $array_task_waiting_history = fetch_task_history($array_task_waiting[$i]['tid']); $priority = $array_task_waiting[$i]['priority']; $status = task_status($array_task_waiting[$i]['tid']); echo '<tr class="td_link" onclick="location.href=\'task.php?t=' . $tid . '\'"><td class="black">'; echo $project; echo '</td><td class="black">'; echo "<strong>" . $task . "</strong>"; echo "</td><td>"; echo "[" . $end . "]"; echo "</td><td>"; echo $priority; echo "</td></tr>"; } ?> </table> <?php } ?>
echo ""; } else { foreach ($__LIST__ as $key => $item) { $mod = $i % 2; ++$i; ?> <li class="tbody"> <span class="col-15 text-center"> <?php echo get_user_ssk($item["assigner"]); ?> 分配给 <?php echo $item["executor_name"]; ?> </span> <span class="col-9 text-center"> <?php echo task_status($item["status"]); ?> </span> <span class="col-9 text-center"> <?php echo $item["transactor_name"]; ?> </span> <span class="col-9 text-center"> <?php if ($item["limit_time"] == "0000-00-00 00:00:00") { } else { echo $item["limit_time"]; } ?> </span> <span class="col-15 text-center"> <?php echo $item["finish_time"];
function make_popup_list($result) { $conf_popup_task = $result['popup-task']; $conf_users = $result['users']; $conf_messages = $result['messages']; $conf_keywords = $result['keywords']; $conf_positions = $result['positions']; $result = array(); foreach ($conf_popup_task as $name => $task) { $target_users = @$task['目标人群']; $target_messages = @$task['消息集合']; if (empty($target_messages)) { continue; } $new_target = get_user_selected($conf_users, $target_users); $pick_message = get_user_selected($conf_messages, $target_messages); foreach ($pick_message as $name => $msg) { if ($msg['消息形式'] === '弹出显示') { continue; } unset($pick_message[$name]); } $task['目标人群'] = format_targets($new_target, $conf_keywords); $task['消息集合'] = format_message($pick_message, $conf_positions); $task['运行状态'] = task_status($task['运行状态']); $task['消息样式'] = pop_style($task['消息样式']); $task['开始时间'] = trans_time($task['开始时间']); $task['结束时间'] = trans_time($task['结束时间']); $task['执行次数'] = intval($task['执行次数']); $task['间隔模式'] = internal_mode($task['间隔模式']); $task['每次间隔'] = intval($task['每次间隔']); $task['前距时间'] = intval($task['前距时间']); $task['消息顺序'] = pop_sequence($task['消息顺序']); $task['任务互斥'] = pop_repel($task['任务互斥']); $result[$name] = $task; } return $result; }