示例#1
0
 public function AcknowledgeReceipt(C3op_Projects_Action $action, C3op_Projects_ActionMapper $mapper)
 {
     if (!$action->GetDone()) {
         $action->SetStatus(C3op_Projects_ActionStatusConstants::STATUS_RECEIVED);
         $mapper->update($action);
     }
     $this->LogAcknowledgment($action);
 }
示例#2
0
 public function update(C3op_Projects_Action $a)
 {
     if (!isset($this->identityMap[$a])) {
         throw new C3op_Projects_ActionMapperException('Object has no ID, cannot update.');
     }
     $sql = sprintf('UPDATE projects_actions SET title = \'%s\', project = %d, done = %d, status = %d, description = \'%s\', subordinated_to = %d, responsible = %d, milestone = %d, requirement_for_receiving = %d WHERE id = %d;', $a->GetTitle(), $a->GetProject(), $a->GetDone(), $a->GetStatus(), $a->GetDescription(), $a->GetSubordinatedTo(), $a->GetResponsible(), $a->GetMilestone(), $a->GetRequirementForReceiving(), $this->identityMap[$a]);
     try {
         $this->db->exec($sql);
     } catch (Exception $e) {
         throw new C3op_Projects_ActionException("{$sql} failed");
     }
     $this->UpdateDates($a);
 }