當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tasks::setStartDate方法代碼示例

本文整理匯總了PHP中Tasks::setStartDate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tasks::setStartDate方法的具體用法?PHP Tasks::setStartDate怎麽用?PHP Tasks::setStartDate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tasks的用法示例。


在下文中一共展示了Tasks::setStartDate方法的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');
                 }
             }
         }
     }
 }
開發者ID:noikiy,項目名稱:qdpm,代碼行數:101,代碼來源:actions.class.php


注:本文中的Tasks::setStartDate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。