Exemplo n.º 1
0
 protected function handleRequest(array $request)
 {
     $version = $request[self::FIELD_PROTOCOL_VERSION];
     $projectTitle = $request[self::FIELD_TITLE];
     $projectDescription = $request[self::FIELD_DESCRIPTION];
     $projectId = Project::create(Project::getNextOrd(), $projectTitle, $projectDescription);
     $listsRep = $request[self::FIELD_LISTS];
     $listOrd = 0;
     foreach ($listsRep as $listRep) {
         $listTitle = $listRep[self::FIELD_TITLE];
         $listId = TasksList::create($projectId, ++$listOrd, $listTitle);
         $tasksRep = $listRep[self::FIELD_TASKS];
         $taskOrd = 0;
         foreach ($tasksRep as $taskRep) {
             $taskTitle = $taskRep[self::FIELD_TITLE];
             $taskDescription = $taskRep[self::FIELD_DESCRIPTION];
             $taskId = Task::create($listId, ++$taskOrd, $taskTitle, $taskDescription);
             if ($version > 1) {
                 $taskStatus = $taskRep[self::FIELD_TASK_STATUS];
                 Task::updateStatus($taskId, $taskStatus);
             }
         }
     }
     return array(self::FIELD_PROJECT_ID => $projectId);
 }
Exemplo n.º 2
0
 protected function handleRequest(array $request)
 {
     $taskId = $request[self::FIELD_TASK_ID];
     $status = $request[self::FIELD_TASK_STATUS];
     Task::updateStatus($taskId, $status);
 }
                                foreach ($archive->Lane->Cards as $card) {
                                    if (!in_array($card->ExternalCardID, $external_task_id)) {
                                        array_push($external_task_id, $card->ExternalCardID);
                                        if ($card->ExternalCardID) {
                                            //getting the idtask from project_task table by sending idproject_task(ExternalCardID)
                                            $do_project_task = new ProjectTask();
                                            $idtask = $do_project_task->getTaskId($card->ExternalCardID);
                                            $do_project_task->free();
                                            echo '<br>' . $card->ExternalCardID;
                                            //Close the task (update the status to 'closed')
                                            if ($idtask) {
                                                $do_task = new Task();
                                                $status = $do_task->getStatus($idtask);
                                                echo $status . ":";
                                                if ($status != 'closed') {
                                                    $do_task->updateStatus($idtask, "closed");
                                                }
                                                $do_task->free();
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    // }//added for testing
                }
            }
        }
    }
}
Exemplo n.º 4
0
 /**
  * Event Method to close multiple task
  */
 function eventCloseTaskMultiple(EventControler $evctl)
 {
     $task_ids = $evctl->ck;
     if (is_array($task_ids) && count($task_ids) > 0) {
         $do_task = new Task();
         foreach ($task_ids as $idtask) {
             $do_task->updateStatus($idtask, "closed");
         }
     }
 }