コード例 #1
0
ファイル: edit.php プロジェクト: heptalium/flyspray
 function action_edit()
 {
     foreach (Get::val('ids') as $task_id) {
         // Edit or close? If we have a resolution_reason, then close! otherwise, edit.
         if (Post::val('resolution_reason')) {
             Backend::close_task($task_id, Post::val('resolution_reason'), Post::val('closure_comment'), Post::val('mark100'));
         } elseif (count(Post::val('changes'))) {
             $task = Flyspray::GetTaskDetails($task_id);
             $args = $task;
             // import previous values
             foreach (Post::val('changes') as $change) {
                 $args[$change] = Post::val($change);
             }
             if (is_array($args['assigned_to'])) {
                 $args['assigned_to'] = implode(';', $task['assigned_to_uname']);
             }
             Backend::edit_task($task, $args);
         }
     }
     return array(SUBMIT_OK, L('masseditsuccessful'));
 }
コード例 #2
0
ファイル: details.php プロジェクト: negram/flyspray
 function action_edit_task($task)
 {
     global $user;
     if (Post::val('notifyme') == '1') {
         // If the user wanted to watch this task for changes
         Backend::add_notification($user->id, $task['task_id']);
     }
     return Backend::edit_task($task, $_POST);
 }
コード例 #3
0
ファイル: savequickedit.php プロジェクト: negram/flyspray
    $args['assigned_to'] = implode(';', $task['assigned_to_uname']);
}
$fieldname = Post::val('field');
switch ($fieldname) {
    case 'summary':
        $args['item_summary'] = Post::val('value');
        break;
    case 'project':
        $args['project_id'] = Post::num('value');
        break;
    case 'progress':
        $args['percent_complete'] = Post::num('value');
        break;
    case 'assigned_to':
        $args['assigned_to'] = Post::val('value');
        $fieldname = 'assignedto';
        break;
    default:
        // now all the custom fields
        $field = new Field(substr($fieldname, 5));
        if ($field->id) {
            $args[$fieldname] = Post::val('value');
        }
}
// Let our backend function do the rest
Backend::edit_task($task, $args);
// let's get the updated value
$task = Flyspray::GetTaskDetails(Post::val('task_id'));
$task['num_assigned'] = count($task['assigned_to']);
$task['assigned_to_name'] = reset($task['assigned_to_name']);
echo tpl_draw_cell($task, $fieldname, '<span class="%s %s">%s</span>');