当前位置: 首页>>代码示例>>PHP>>正文


PHP Backend::close_task方法代码示例

本文整理汇总了PHP中Backend::close_task方法的典型用法代码示例。如果您正苦于以下问题:PHP Backend::close_task方法的具体用法?PHP Backend::close_task怎么用?PHP Backend::close_task使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Backend的用法示例。


在下文中一共展示了Backend::close_task方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: action_edit

 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'));
 }
开发者ID:heptalium,项目名称:flyspray,代码行数:21,代码来源:edit.php

示例2: VALUES

                                     VALUES  (?, ?)', array($id, $assignee));
                            }
                        }
                    }
                }
                // set success message
                $_SESSION['SUCCESS'] = L('tasksupdated');
                break;
            } else {
                if (!Post::val('resolution_reason')) {
                    Flyspray::show_error(L('noclosereason'));
                    break;
                }
                $task_ids = Post::val('ids');
                foreach ($task_ids as $task_id) {
                    $task = Flyspray::GetTaskDetails($task_id);
                    if (!$user->can_close_task($task)) {
                        continue;
                    }
                    if ($task['is_closed']) {
                        continue;
                    }
                    Backend::close_task($task_id, Post::val('resolution_reason'), Post::val('closure_comment', ''), Post::val('mark100', false));
                }
                $_SESSION['SUCCESS'] = L('taskclosedmsg');
                break;
            }
        } else {
            Flyspray::show_error(L('massopsdisabled'));
        }
}
开发者ID:kandran,项目名称:flyspray,代码行数:31,代码来源:modify.inc.php

示例3: foreach

            }
            foreach (array('opened', 'closed', 'reopened', 'assigned') as $type) {
                if (count(${$type})) {
                    $message .= L($type . 'tasks') . ':' . "\n" . implode("\n", ${$type}) . "\n\n";
                }
            }
            if (Notifications::send_now($pms, ADDRESS_USER, NOTIFY_DIGEST, array('message' => $message))) {
                $db->x->execParam('UPDATE {projects} SET last_digest = ? WHERE project_id = ?', array(time(), $project['project_id']));
            }
        }
        ############ Task four: Close tasks ############
        $tasks = $db->query('SELECT t.*, c.date_added, max(c.date_added) FROM {tasks} t
                        LEFT JOIN {comments} c ON t.task_id = c.task_id
                            WHERE is_closed = 0 AND close_after > 0
                         GROUP BY t.task_id');
        while ($row = $tasks->FetchRow()) {
            if (max($row['date_added'], $row['last_edited_time']) + $row['close_after'] < time()) {
                Backend::close_task($row['task_id'], $row['resolution_reason'], $row['closure_comment'], false);
                $db->x->execParam('UPDATE {tasks} SET close_after = 0 WHERE task_id = ?', $row['task_id']);
            }
        }
        //wait 10 minutes for the next loop.
        if (php_sapi_name() !== 'cli') {
            sleep(600);
        }
    } while (php_sapi_name() !== 'cli');
    //forever ¡¡¡ ( oh well. a least will not stop unless killed or the server restarted)
    @register_shutdown_function('unlink', Flyspray::get_tmp_dir() . '/flysprayreminders.run');
} else {
    die('You are not authorized to start the remider daemon.');
}
开发者ID:negram,项目名称:flyspray,代码行数:31,代码来源:schedule.php

示例4: action_close

 function action_close($task)
 {
     global $user, $db, $fs, $proj;
     if (!$user->can_close_task($task)) {
         return array(ERROR_PERMS);
     }
     if ($task['is_closed']) {
         return array(ERROR_INPUT, L('taskalreadyclosed'));
     }
     if (!Post::val('resolution_reason')) {
         return array(ERROR_RECOVER, L('noclosereason'));
     }
     if (Post::num('close_after_num') && Post::num('close_after_type')) {
         // prepare auto close
         $db->x->execParam('UPDATE  {tasks}
                          SET  closed_by = ?, closure_comment = ?,
                               resolution_reason = ?, last_edited_time = ?,
                               last_edited_by = ?, close_after = ?, percent_complete = ?
                        WHERE  task_id = ?', array($user->id, Post::val('closure_comment', ''), Post::val('resolution_reason'), time(), $user->id, Post::num('close_after_num') * Post::num('close_after_type'), (bool) Post::num('mark100') * 100, $task['task_id']));
         return array(SUBMIT_OK, L('taskautoclosedmsg'));
     }
     Backend::close_task($task['task_id'], Post::val('resolution_reason'), Post::val('closure_comment', ''), Post::val('mark100', false));
     return array(SUBMIT_OK, L('taskclosedmsg'));
 }
开发者ID:negram,项目名称:flyspray,代码行数:24,代码来源:details.php


注:本文中的Backend::close_task方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。