/** * Update order * @param bool $new * @throws CHttpException */ public function actionUpdate($new = false) { if (SLicenseChecker::check() === false && SLicenseChecker::isOnLocalhost() === false) { throw new CHttpException(404, 'В ознакомительной версии редактирование заказов недоступно.'); } if ($new === true) { $model = new Order(); $model->unsetAttributes(); } else { $model = $this->_loadModel($_GET['id']); } if (Yii::app()->request->isPostRequest) { $model->attributes = $_POST['Order']; if ($model->validate()) { $model->save(); // Update quantities if (sizeof(Yii::app()->request->getPost('quantity', array()))) { $model->setProductQuantities(Yii::app()->request->getPost('quantity')); } $model->updateDeliveryPrice(); $model->updateTotalPrice(); $this->setFlashMessage(Yii::t('OrdersModule.admin', 'Изменения успешно сохранены')); if (isset($_POST['REDIRECT'])) { $this->smartRedirect($model); } else { $this->redirect(array('index')); } } } $this->render('update', array('deliveryMethods' => StoreDeliveryMethod::model()->applyTranslateCriteria()->orderByName()->findAll(), 'statuses' => OrderStatus::model()->orderByPosition()->findAll(), 'model' => $model)); }
</form> </div> </div> --> </div><!-- /sidebar --> <?php } ?> </div> <!-- footer --> <div id="ft" style="height:50px;"> <?php Yii::import('application.modules.admin.components.SLicenseChecker'); if (SLicenseChecker::check() === false) { ?> <div style="text-align: center;color:maroon;"> Для покупки лицензии посетите <a href="http://eximuscommerce.com" target="_blank">eximuscommerce.com</a> </div> <?php } ?> <div class="small-footer-text"> <a href="http://eximuscommerce.com/" target="_blank">EximusCommerce</a> <?php echo VERSION; ?> </div> </div> </div>