*/ /** * Klasa stPointsBackendActions. * * @package stPointsPlugin * @subpackage actions */ class stPointsBackendActions extends autoStPointsBackendActions { public function executeAddPointsForOrder() { $i18n = $this -> getContext() -> getI18N(); $this -> config = stConfig::getInstance('stPointsBackend'); $this -> config -> setCulture($this -> getRequestParameter('culture', stLanguage::getOptLanguage())); $c = new Criteria(); $c -> add(OrderPeer::ID, $this -> getRequestParameter('id')); $order = OrderPeer::doSelectOne($c); if (stPoints::isPointsAssigned($order) == false) { stPoints::addPointForOrder($order,true); } $flash_text = $i18n -> __('Punkty zostały przydzielone'); $this -> setFlash('notice', $flash_text); return $this -> redirect('stOrder/edit?id=' . $this -> getRequestParameter('id')); } public function executeConfirmMessage() { $config_points = stConfig::getInstance(sfContext::getInstance(), 'stPointsBackend'); $config_points->set('points_system_install_update', 0); $config_points->save(); return $this -> redirect('stPointsBackend/config'); } }