/** * Metoda zapobiega nadpisywaniu wartości dla kolumny created_by jeżeli została przekazana * @return type */ protected function fillCreatedBy() { if (null === $this->created_by) { return parent::fillCreatedBy(); } return; }
public function __get($columnName) { $value = parent::__get($columnName); if ($columnName === 'ip') { $value = $this->_cidrIpToArray($value); } return $value; }
/** * Mapowanie słownikowe wartości * Przystosowane do mapowania na wierszu i paginatorze * * @param Base_Db_Table_Row $row * @param string $key * @param Base_Paginator $paginator * @return string */ public function DictMap($row, $key, $paginator = null) { if ($row instanceof Base_Db_Table_Row) { $ret = $row->getDictMapping($key, $row); } elseif ($row instanceof Base_Paginator_Adapter_Array_Row) { $ret = $row->getDictMapping($key, $row); } else { $ret = $paginator->getDictMapping($key); } if ($ret instanceof Base_Dictionary_Dictionary) { $ret = $ret->toArray(); } if (isset($ret[$row[$key]])) { return $ret[$row[$key]]; } return $row[$key]; }
public function getActions() { foreach ($this->_rowActions as $key => $action) { if (!empty($this->send_at)) { if ($action['action'] == 'send') { unset($this->_rowActions[$key]); } } } return parent::getActions(); }
public function getActions() { foreach ($this->_rowActions as $key => $action) { if ($action['action'] == 'publishset' && ($this->status == Logic_Ws_ServiceSet_ServiceSet::STATE_ACTIVE || $this->status == Logic_Ws_ServiceSet_ServiceSet::STATE_INACTIVE)) { unset($this->_rowActions[$key]); } if (($action['action'] == 'deleteset' || $action['action'] == 'editset') && $this->ghost) { unset($this->_rowActions[$key]); } } return parent::getActions(); }
public function getActions() { foreach ($this->_rowActions as $key => $action) { if (($action['controller'] == 'smswhitelist' || $action['controller'] == 'mailwhitelist') && $this->white_list == 'tak') { unset($this->_rowActions[$key]); } if (($action['controller'] == 'smsblacklist' || $action['controller'] == 'mailblacklist') && $this->black_list == 'tak') { unset($this->_rowActions[$key]); } } return parent::getActions(); }
public function getHeaderMappings() { if (isset($this->repeat_message) && $this->repeat_message == 0) { unset($this->headerMappings['repeat_interval'], $this->headerMappings['repeat_day_interval'], $this->headerMappings['repeat_days'], $this->headerMappings['repeat_count'], $this->headerMappings['repeat_end']); } elseif (isset($this->repeat_message) && $this->repeat_message == 1) { $dict = new Base_Dictionary(); $dayDict = $dict->setSource('day_of_week')->getDictionary(); if ($this->repeat_interval == 5) { $days = ''; $daysJson = Zend_Json_Decoder::decode($this->repeat_days); foreach ($daysJson as $day) { $days .= $dayDict[$day] . ' '; } $this->repeat_days = $days; } } return parent::getHeaderMappings(); }
/** * Nadpisana metoda update'u wiersza tabeli z uwzględnieniem mailera * @param array $data * @return type */ public function setFromArray(array $data) { $headerMappings = $this->getHeaderMappings(); if (isset($data['send_mail'])) { $this->send_mail = $data['send_mail']; unset($data['send_mail']); } foreach ($data as $key => $value) { if (isset($headerMappings[$key]['format'])) { switch ($headerMappings[$key]['format']) { case 'currency': $data[$key] = Zend_Locale_Format::getFloat($value); break; } } if ($value == null) { $data[$key] = null; } } parent::setFromArray($data); if (isset($data['id_state']) && $this->send_mail) { $mailer = new Logic_Mailer(Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('view'), $translate); $userModel = new User(); //receiver data if (get_called_class() === 'Row_DelegationSettlement') { if ($data['id_state'] == Logic_Settlements::STATE_APPROVED_2) { $receiverRow = $userModel->findOne($this->settlement_by); } elseif (!is_null($this->created_by)) { $receiverRow = $userModel->findOne($this->created_by); } else { $receiverRow = $userModel->findOne($this->settlement_by); } $delegation = $this->findParentRow('Delegation'); } else { if (get_called_class() === 'Row_Delegation') { if ($data['id_state'] == Logic_Settlements::STATE_APPROVED) { $receiverRow = $userModel->findOne($this->acceptance_by); } else { $receiverRow = $userModel->findOne($this->created_by); } $params['deleg_no'] = $this->deleg_no; } else { return $this; } } $params['email'] = $receiverRow->email; //diee($params['email']); //sender data $senderRow = Zend_Auth::getInstance()->getIdentity(); $params['user_full_name'] = $senderRow->first_name . ' ' . $senderRow->surname; $params['departament'] = $senderRow->department; $params['KOD_MPK'] = $senderRow->jednostka['symbol']; //email body data $params['id'] = $this->id; if (isset($data['deleg_no'])) { $params['deleg_no'] = $data['deleg_no']; } elseif (isset($this->deleg_no)) { $params['deleg_no'] = $this->deleg_no; } elseif (isset($delegation->deleg_no)) { $params['deleg_no'] = $delegation->deleg_no; } try { switch ($data['id_state']) { case Logic_Settlements::STATE_ACCEPTED: $mailer->acceptedByDelegation($params); break; case Logic_Settlements::STATE_APPROVED: $mailer->acceptDelegation($params); break; case Logic_Settlements::STATE_APPROVED_2: $mailer->settleDelegation($params); break; case Logic_Settlements::STATE_CORRECTION: $mailer->correctDelegation($params); break; case Logic_Settlements::STATE_SETTLED: $mailer->settledDelegation($params); break; case Logic_Settlements::STATE_APPROVED_ACCOUNTING: $mailer->approvedDelegation($params); break; // case Logic_Settlements::STATE_SETTLED } } catch (Exception $e) { $messenger = new Base_View_Helper_Messenger(); $messenger->error($e->getMessage()); } } return $this; }
public function softDelete() { $logicCert = new Logic_Ws_Cert(); $logicCert->deleteCertificateFiles($this->ws_service_id); parent::softDelete(); }
/** * * @param array $actions * @param type $ignore * @return type */ public function getActions($actions = null, $ignore = false) { $this->_rowActions = array_merge($this->_rowActions, $this->_extendRowActions); return parent::getActions($actions, $ignore); }