本文整理汇总了PHP中date::buildTimeList方法的典型用法代码示例。如果您正苦于以下问题:PHP date::buildTimeList方法的具体用法?PHP date::buildTimeList怎么用?PHP date::buildTimeList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类date
的用法示例。
在下文中一共展示了date::buildTimeList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: export
/**
* Get data to export
*
* @param string $productID
* @param string $orderBy
* @access public
* @return void
*/
public function export($account, $orderBy)
{
if ($_POST) {
$todoLang = $this->lang->todo;
$todoConfig = $this->config->todo;
/* Create field lists. */
$fields = explode(',', $todoConfig->list->exportFields);
foreach ($fields as $key => $fieldName) {
$fieldName = trim($fieldName);
$fields[$fieldName] = isset($todoLang->{$fieldName}) ? $todoLang->{$fieldName} : $fieldName;
unset($fields[$key]);
}
unset($fields['idvalue']);
unset($fields['private']);
/* Get bugs. */
$todos = $this->dao->select('*')->from(TABLE_TODO)->where($this->session->todoReportCondition)->beginIF($this->post->exportType == 'selected')->andWhere('id')->in($this->cookie->checkedItem)->fi()->orderBy($orderBy)->fetchAll('id');
/* Get users, bugs, tasks and times. */
$users = $this->loadModel('user')->getPairs('noletter');
$bugs = $this->loadModel('bug')->getUserBugPairs($account);
$tasks = $this->loadModel('task')->getUserTaskPairs($account);
$times = date::buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta);
foreach ($todos as $todo) {
/* fill some field with useful value. */
if (isset($users[$todo->account])) {
$todo->account = $users[$todo->account];
}
if (isset($times[$todo->begin])) {
$todo->begin = $times[$todo->begin];
}
if (isset($times[$todo->end])) {
$todo->end = $times[$todo->end];
}
if ($todo->type == 'bug') {
$todo->name = isset($bugs[$todo->idvalue]) ? $bugs[$todo->idvalue] . "(#{$todo->idvalue})" : '';
}
if ($todo->type == 'task') {
$todo->name = isset($tasks[$todo->idvalue]) ? $tasks[$todo->idvalue] . "(#{$todo->idvalue})" : '';
}
if (isset($todoLang->typeList[$todo->type])) {
$todo->type = $todoLang->typeList[$todo->type];
}
if (isset($todoLang->priList[$todo->pri])) {
$todo->pri = $todoLang->priList[$todo->pri];
}
if (isset($todoLang->statusList[$todo->status])) {
$todo->status = $todoLang->statusList[$todo->status];
}
if ($todo->private == 1) {
$todo->desc = $this->lang->todo->thisIsPrivate;
}
/* drop some field that is not needed. */
unset($todo->idvalue);
unset($todo->private);
}
$this->post->set('fields', $fields);
$this->post->set('rows', $todos);
$this->post->set('kind', 'todo');
$this->fetch('file', 'export2' . $this->post->fileType, $_POST);
}
$this->display();
}
示例2: assignTo
/**
* Assign one todo to someone.
*
* @param int $todoID
* @access public
* @return void
*/
public function assignTo($todoID)
{
$todo = $this->todo->getById($todoID);
$this->checkPriv($todo, 'assignTo');
if ($_POST) {
$changes = $this->todo->assignTo($todoID);
if (!empty($changes)) {
$actionID = $this->loadModel('action')->create('todo', $todo->id, 'Assigned', '', $this->post->assignedTo);
$this->action->logHistory($actionID, $changes);
$this->sendmail($todoID, $actionID);
}
if (dao::isError()) {
$this->send(array('result' => 'fail', 'message' => dao::getError()));
}
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => 'true', 'locate' => 'reload'));
}
if ($todo->date != '00000000') {
$todo->date = strftime("%Y-%m-%d", strtotime($todo->date));
}
$this->view->title = $this->lang->todo->assignTo;
$this->view->todo = $todo;
$this->view->users = $this->loadModel('user')->getPairs('nodeleted,noclosed');
$this->view->times = date::buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta);
$this->display();
}