Ejemplo n.º 1
0
	public function find($id,Pment_Models_Mplan $mplan)
	{
		$result = $this->getDbTable()->find($id);

		if (0 == count($result)) {
			return;
		}
		$row = $result->current();
		$mplan->setPlanId($row->planId)
				->setProjectId($row->projectId)
				->setPlanName($row->planName)
				->setTypeId($row->typeId)
				->setYearNum($row->yearNum)
				->setMonNum($row->monNum)
				->setPDate($row->pDate)
				->setContactId($row->contactId)
				->setTotal($row->total)
				->setApprovcId($row->approvcId)
				->setApprovcDate($row->approvcDate)
				->setApprovcRemark($row->approvcRemark)
				->setApprovfId($row->approvfId)
				->setApprovfDate($row->approvfDate)
				->setApprovfRemark($row->approvfRemark)
				->setStatus($row->status)
				->setRemark($row->remark)
				->setCTime($row->cTime);
		$contacts = new Employee_Models_ContactMapper();
		$contactName = $contacts->findContactName($mplan->getContactId());
		$status = $mplan->getStatus();
		$mstatus = new General_Models_MstatusMapper();
		$statusName = $mstatus->getStatusName($status);
		$mplan->setStatusName($statusName);
		if($status >= 3)
		{
			$approvcName = $contacts->findContactName($mplan->getApprovcId());
			$mplan->setApprovcName($approvcName);
			}
		if($status == 4 || $status ==6)
		{
			$approvfName = $contacts->findContactName($mplan->getApprovfId());
			$mplan->setApprovfName($approvfName);
			}
		$mplan->setContactName($contactName);
		$ptypes = new General_Models_PtypeMapper();
		$typeName = $ptypes->findPtypeName($mplan->getTypeId());
		$mplan->setTypeName($typeName);
	}