public function getActions() { foreach ($this->_rowActions as $key => $action) { if ($this->counter_import <= 0) { if ($action['action'] == 'showsms' || $action['action'] == 'loadedsms') { unset($this->_rowActions[$key]); } } switch ($this->status) { case 0: if ($action['action'] == 'continueshipment' || $action['action'] == 'stopshipment') { unset($this->_rowActions[$key]); } break; case 1: if ($action['action'] == 'continueshipment' || $action['action'] == 'smstosend' || $action['action'] == 'deletesms') { unset($this->_rowActions[$key]); } break; case 2: if ($action['action'] == 'stopshipment' || $action['action'] == 'smstosend') { unset($this->_rowActions[$key]); } break; } } return parent::getActions(); }
public function getActions() { $dictionaryModel = new Dictionary(); $dictionary = $dictionaryModel->findOne($this->id_dictionary); if ($dictionary->is_system) { return array(); } else { return parent::getActions(); } }
public function getActions() { foreach ($this->_rowActions as $key => $action) { if ($this->ghost === true) { if ($action['action'] == 'edit' || $action['action'] == 'delete') { unset($this->_rowActions[$key]); } } } return parent::getActions(); }
/** * Ustawienie odpowiednich akcji na wiadomościach w tabeli * * @return array */ public function getActions() { foreach ($this->_rowActions as $key => $action) { if ($action['action'] == 'delete' && $this->ghost) { unset($this->_rowActions[$key]); } if ($action['action'] == 'undelete' && !$this->ghost) { unset($this->_rowActions[$key]); } } return parent::getActions(); }
public function getActions() { $config = Zend_Registry::get('config'); $sameUserAccept = $config['acceptance']['same_user_accept']; if ($sameUserAccept === 'false') { $userId = $_SESSION['Zend_Auth']['storage']->id; foreach ($this->_rowActions as $key => $action) { if ($this->created_by === $userId) { unset($this->_rowActions[$key]); unset($this->_rowActions[$key]); } } } return parent::getActions(); }
/** * Ustawienie odpowiednych akcji na filtrach w tabeli * * @return array */ public function getActions() { foreach ($this->_rowActions as $key => $action) { //print_r($this->is_public); if ($this->is_public) { if ($action['action'] == 'publish') { unset($this->_rowActions[$key]); } } else { if ($action['action'] == 'unpublish') { unset($this->_rowActions[$key]); } if ($action['action'] == 'share') { unset($this->_rowActions[$key]); } } /* if($action['action']=='publish' && $this->is_public == 1) unset($this->_rowActions[$key]); if($action['action']=='unpublish' && !$this->is_public) unset($this->_rowActions[$key]); if($action['action']=='share' && !$this->is_public) unset($this->_rowActions[$key]); */ } return parent::getActions(); }
public function getActions() { foreach ($this->_rowActions as $key => $action) { if ($this->ghost === true) { $existingButtons = array('show', 'showuserhistory'); if (!in_array($action['action'], $existingButtons)) { unset($this->_rowActions[$key]); } } else { if ($action['action'] == 'changepassword' && $this->id != Zend_Auth::getInstance()->getIdentity()->id) { unset($this->_rowActions[$key]); } if ($action['action'] === 'unlock') { if ($this->timelock_start !== null && $this->timelock_end !== null) { if (substr($this->timelock_start, 0, 10) < date('Y-m-d')) { if (substr($this->timelock_end, 0, 10) < date('Y-m-d') && $this->unsuccessful_logins_number < 3) { unset($this->_rowActions[$key]); } } else { if (substr($this->timelock_start, 0, 10) > date('Y-m-d')) { if (substr($this->timelock_end, 0, 10) > date('Y-m-d') && $this->unsuccessful_logins_number < 3) { unset($this->_rowActions[$key]); } } } } else { if ($this->timelock_start !== null && $this->timelock_end === null) { if (substr($this->timelock_start, 0, 10) > date('Y-m-d') && $this->unsuccessful_logins_number < 3) { unset($this->_rowActions[$key]); } } else { if ($this->timelock_start === null && $this->timelock_end === null) { if ($this->unsuccessful_logins_number < 3) { unset($this->_rowActions[$key]); } } } } } if ($action['action'] === 'lock') { if ($this->timelock_start !== null && $this->timelock_end !== null) { if (substr($this->timelock_start, 0, 10) < date('Y-m-d')) { if (substr($this->timelock_end, 0, 10) < date('Y-m-d') && $this->unsuccessful_logins_number >= 3) { unset($this->_rowActions[$key]); } if (substr($this->timelock_end, 0, 10) >= date('Y-m-d')) { unset($this->_rowActions[$key]); } } else { if (substr($this->timelock_start, 0, 10) == date('Y-m-d')) { if (substr($this->timelock_end, 0, 10) >= date('Y-m-d')) { unset($this->_rowActions[$key]); } } else { if (substr($this->timelock_start, 0, 10) > date('Y-m-d')) { if (substr($this->timelock_end, 0, 10) > date('Y-m-d') && $this->unsuccessful_logins_number >= 3) { unset($this->_rowActions[$key]); } } } } } else { if ($this->timelock_start !== null && $this->timelock_end === null) { if (substr($this->timelock_start, 0, 10) < date('Y-m-d')) { if (substr($this->timelock_end, 0, 10) < date('Y-m-d') && $this->unsuccessful_logins_number < 3) { unset($this->_rowActions[$key]); } if (substr($this->timelock_end, 0, 10) > date('Y-m-d') && $this->unsuccessful_logins_number >= 3) { unset($this->_rowActions[$key]); } } else { if (substr($this->timelock_start, 0, 10) == date('Y-m-d')) { if (substr($this->timelock_end, 0, 10) < date('Y-m-d') && $this->unsuccessful_logins_number < 3) { unset($this->_rowActions[$key]); } if (substr($this->timelock_end, 0, 10) > date('Y-m-d') && $this->unsuccessful_logins_number >= 3) { unset($this->_rowActions[$key]); } } else { if (substr($this->timelock_start, 0, 10) > date('Y-m-d')) { if (substr($this->timelock_end, 0, 10) > date('Y-m-d') && $this->unsuccessful_logins_number >= 3) { unset($this->_rowActions[$key]); } } } } } else { if ($this->timelock_start === null && $this->timelock_end === null) { if ($this->unsuccessful_logins_number >= 3) { unset($this->_rowActions[$key]); } } } } } } } return parent::getActions(); }