本文整理汇总了PHP中Tasks::setProgress方法的典型用法代码示例。如果您正苦于以下问题:PHP Tasks::setProgress方法的具体用法?PHP Tasks::setProgress怎么用?PHP Tasks::setProgress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tasks
的用法示例。
在下文中一共展示了Tasks::setProgress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeXlsTasksImport
//.........这里部分代码省略.........
case 'TasksPriority':
if ($id = app::getCfgItemIdByName($v, 'TasksPriority')) {
$t->setTasksPriorityId($id);
} else {
$cfg = new TasksPriority();
$cfg->setName($v);
$cfg->save();
$t->setTasksPriorityId($cfg->getId());
}
break;
case 'TasksLabels':
if ($id = app::getCfgItemIdByName($v, 'TasksLabels')) {
$t->setTasksLabelId($id);
} else {
$cfg = new TasksLabels();
$cfg->setName($v);
$cfg->save();
$t->setTasksLabelId($cfg->getId());
}
break;
case 'name':
$t->setName($v);
break;
case 'TasksStatus':
if ($id = app::getCfgItemIdByName($v, 'TasksStatus')) {
$t->setTasksStatusId($id);
} else {
$cfg = new TasksStatus();
$cfg->setName($v);
$cfg->save();
$t->setTasksStatusId($cfg->getId());
}
break;
case 'TasksTypes':
if ($id = app::getCfgItemIdByName($v, 'TasksTypes')) {
$t->setTasksTypeId($id);
} else {
$cfg = new TasksTypes();
$cfg->setName($v);
$cfg->save();
$t->setTasksTypeId($cfg->getId());
}
break;
break;
case 'assigned_to':
$assigned_to = array();
foreach (explode(',', $v) as $n) {
if ($user = Doctrine_Core::getTable('Users')->createQuery()->addWhere('name=?', trim($n))->fetchOne()) {
$assigned_to[] = $user->getId();
}
}
$t->setAssignedTo(implode(',', $assigned_to));
break;
case 'estimated_time':
$t->setEstimatedTime($v);
break;
case 'start_date':
$t->setStartDate(date('Y-m-d', strtotime($v)));
break;
case 'due_date':
$t->setDueDate(date('Y-m-d', strtotime($v)));
break;
case 'progress':
$t->setProgress($v);
break;
}
if (strstr($import_fields[$j], 'extra_field_')) {
$extra_fields[str_replace('extra_field_', '', $import_fields[$j])] = $v;
}
}
}
$t->save();
foreach ($extra_fields as $id => $v) {
$f = new ExtraFieldsList();
$f->setBindId($t->getId());
$f->setExtraFieldsId($id);
$f->setValue($v);
$f->save();
}
}
$this->getUser()->setFlash('userNotices', t::__('Spreadsheet imported'));
$this->redirect('tasks/index?projects_id=' . $request->getParameter('projects_id'));
}
} elseif (($projects_id = $request->getParameter('projects_id')) > 0) {
$f = $request->getFiles();
if ($f['import_file']) {
$this->getUser()->setAttribute('import_fields', array());
move_uploaded_file($f['import_file']['tmp_name'], sfConfig::get('sf_upload_dir') . '/' . $f['import_file']['name']);
$this->import_file = $f['import_file']['name'];
if (is_file($import_spreadsheet_file = sfConfig::get('sf_upload_dir') . '/' . $this->import_file)) {
$this->data = new Spreadsheet_Excel_Reader($import_spreadsheet_file);
$this->setTemplate('xlsTasksImportBind');
} else {
$this->getUser()->setFlash('userNotices', array('type' => 'error', 'text' => t::__('There is an error with uploading file. Please try again with less file size.')));
$this->redirect('tools/xlsTasksImport');
}
}
}
}
}