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


PHP Attachments::insertAttachments方法代码示例

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


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

示例1: processForm

 protected function processForm(sfWebRequest $request, sfForm $form)
 {
     $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
     if ($form->isValid()) {
         if ($form->getObject()->isNew()) {
             $tasks = Doctrine_Core::getTable('Tasks')->find($request->getParameter('tasks_id'));
             if ($form->getValue('tasks_priority_id') > 0) {
                 $tasks->setTasksPriorityId($form->getValue('tasks_priority_id'));
             } else {
                 unset($form['tasks_priority_id']);
             }
             if ($request->getParameter('tasks_labels_id') > 0) {
                 $tasks->setTasksLabelId($request->getParameter('tasks_labels_id'));
             }
             if ($request->getParameter('tasks_types_id') > 0) {
                 $tasks->setTasksTypeId($request->getParameter('tasks_types_id'));
             }
             if (strlen($form->getValue('due_date')) > 0) {
                 $tasks->setDueDate($form->getValue('due_date'));
             } else {
                 unset($form['due_date']);
             }
             if ($request->getParameter('progress') > 0) {
                 $tasks->setProgress($request->getParameter('progress'));
             }
             if ($form->getValue('tasks_status_id') > 0) {
                 $tasks->setTasksStatusId($form->getValue('tasks_status_id'));
                 if (in_array($form->getValue('tasks_status_id'), app::getStatusByGroup('closed', 'TasksStatus'))) {
                     $tasks->setClosedDate(date('Y-m-d H:i:s'));
                     $tasks->save();
                 }
                 if (!in_array($form->getValue('tasks_status_id'), app::getStatusByGroup('closed', 'TasksStatus'))) {
                     $tasks->setClosedDate(null);
                     $tasks->save();
                 }
             } else {
                 unset($form['tasks_status_id']);
             }
             $tasks->save();
         }
         if ($form->getObject()->isNew() and sfConfig::get('app_allow_adit_tasks_comments_date') != 'on') {
             $form->setFieldValue('created_at', date('Y-m-d H:i:s'));
         }
         $tasks_comments = $form->save();
         Attachments::insertAttachments($request->getFiles(), 'comments', $tasks_comments->getId(), $request->getParameter('attachments_info'), $this->getUser());
         TasksComments::sendNotification($this, $tasks_comments, $this->getUser());
         $this->redirect('tasksComments/index?projects_id=' . $request->getParameter('projects_id') . '&tasks_id=' . $request->getParameter('tasks_id'));
     }
 }
开发者ID:noikiy,项目名称:qdpm,代码行数:49,代码来源:actions.class.php

示例2: processForm

 protected function processForm(sfWebRequest $request, sfForm $form)
 {
     $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
     if ($form->isValid()) {
         if ($form->getObject()->isNew()) {
             $project = Doctrine_Core::getTable('Projects')->find($request->getParameter('projects_id'));
             if ($request->getParameter('projects_types_id') > 0) {
                 $project->setProjectsTypesId($request->getParameter('projects_types_id'));
             }
             if ($request->getParameter('projects_status_id') > 0) {
                 $project->setProjectsStatusId($request->getParameter('projects_status_id'));
             }
             $project->save();
         }
         if ($form->getObject()->isNew()) {
             $form->setFieldValue('created_at', date('Y-m-d H:i:s'));
         }
         $projects_comments = $form->save();
         Attachments::insertAttachments($request->getFiles(), 'projectsComments', $projects_comments->getId(), $request->getParameter('attachments_info'), $this->getUser());
         ProjectsComments::sendNotification($this, $projects_comments, $this->getUser());
         $this->redirect('projectsComments/index?projects_id=' . $projects_comments->getProjectsId());
     }
 }
开发者ID:noikiy,项目名称:qdpm,代码行数:23,代码来源:actions.class.php

示例3: processForm

 protected function processForm(sfWebRequest $request, sfForm $form)
 {
     $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
     if ($form->isValid()) {
         $form->setFieldValue('assigned_to', implode(',', $form['assigned_to']->getValue()));
         $send_to = $this->getSendTo($form);
         if ($form->getObject()->isNew()) {
             $previeous_status = false;
         } else {
             $previeous_status = $form->getObject()->getDiscussionsStatusId();
         }
         if ($form->getObject()->isNew()) {
             $form->setFieldValue('created_at', date('Y-m-d H:i:s'));
         }
         $discussions = $form->save();
         ExtraFieldsList::setValues($request->getParameter('extra_fields'), $discussions->getId(), 'discussions', $this->getUser(), $request);
         Attachments::insertAttachments($request->getFiles(), 'discussions', $discussions->getId(), $request->getParameter('attachments_info'), $this->getUser());
         $discussions = $this->addCommentIfStatusChanged($previeous_status, $discussions);
         $discussions = $this->checkIfAssignedToChanged($send_to, $discussions);
         $this->addRelatedItems($discussions, $request);
         Discussions::sendNotification($this, $discussions, $send_to, $this->getUser());
         $this->redirect_to($request->getParameter('redirect_to'), $discussions->getProjectsId(), $discussions->getId(), $request);
     }
 }
开发者ID:noikiy,项目名称:qdpm,代码行数:24,代码来源:actions.class.php

示例4: processForm

 protected function processForm(sfWebRequest $request, sfForm $form)
 {
     $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
     if ($form->isValid()) {
         if ($form->getObject()->isNew()) {
             $previeous_status = false;
         } else {
             $previeous_status = $form->getObject()->getTicketsStatusId();
         }
         if ($form->getObject()->isNew()) {
             $previeous_departmnet = false;
         } else {
             $previeous_departmnet = $form->getObject()->getDepartmentsId();
         }
         $send_to = $this->getSendTo($form);
         if ($form->getObject()->isNew()) {
             $form->setFieldValue('created_at', date('Y-m-d H:i:s'));
         }
         $tickets = $form->save();
         ExtraFieldsList::setValues($request->getParameter('extra_fields'), $tickets->getId(), 'tickets', $this->getUser(), $request);
         Attachments::insertAttachments($request->getFiles(), 'tickets', $tickets->getId(), $request->getParameter('attachments_info'), $this->getUser());
         $tickets = $this->addCommentIfStatusChanged($previeous_status, $previeous_departmnet, $tickets);
         $this->addRelatedItems($tickets, $request);
         if ($tickets->getUsersId() > 0) {
             Tickets::sendNotification($this, $tickets, $send_to, $this->getUser(), $request->getParameter('extra_notification', array()));
         }
         $this->redirect_to($request->getParameter('redirect_to'), $tickets->getProjectsId(), $tickets->getId(), $request);
     }
 }
开发者ID:noikiy,项目名称:qdpm,代码行数:29,代码来源:actions.class.php

示例5: processForm

 protected function processForm(sfWebRequest $request, sfForm $form)
 {
     $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
     if ($form->isValid()) {
         $events = $form->save();
         ExtraFieldsList::setValues($request->getParameter('extra_fields'), $events->getEventId(), 'events', $this->getUser());
         Attachments::insertAttachments($request->getFiles(), 'events', $events->getEventId(), $request->getParameter('attachments_info'), $this->getUser());
         if ($events->getUsersId() > 0) {
             $this->redirect('scheduler/personal');
         } else {
             $this->redirect('scheduler/index');
         }
     }
 }
开发者ID:noikiy,项目名称:qdpm,代码行数:14,代码来源:actions.class.php


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