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); }
private function buildSpecialActionLabel(C3op_Projects_Action $action) { $isSpecialAction = false; $separator = ""; if ($action->GetMilestone()) { $milestone = "*"; $separator = " "; $isSpecialAction = true; } else { $milestone = ""; } if ($action->GetRequirementForReceiving()) { $isSpecialAction = true; $requirementForReceiving = $separator . '$'; } else { $requirementForReceiving = ""; } if ($isSpecialAction) { $specialAction = "({$milestone}{$requirementForReceiving})"; } else { $specialAction = ""; } return $specialAction; }