Beispiel #1
0
 public function fieldFormatter($value, $item = null, array $format = [])
 {
     if ($format['original_field_name'] == 'parentCategory.name' && $value == '0_ROOT') {
         $value = '';
     }
     return parent::fieldFormatter($value, $item, $format);
 }
Beispiel #2
0
 public function action_edit()
 {
     parent::action_edit();
     if (!$this->execute) {
         return;
     }
 }
Beispiel #3
0
 public function action_edit()
 {
     parent::action_edit();
     if (!$this->execute) {
         return;
     }
     $this->view->pageHeader = 'Страница «' . htmlspecialchars(trim($this->view->item->title)) . '»';
 }
 public function action_index()
 {
     parent::action_index();
     if (!$this->execute) {
         return;
     }
     $this->view->tableHeader = 'Список подписок';
 }
Beispiel #5
0
 /**
  * @param $value
  * @param null|\App\Model\Role $item
  * @param array $format
  * @return string|void
  */
 public function fieldFormatter($value, $item = null, array $format = [])
 {
     if ($format['extra'] && in_array($format['original_field_name'], ['delete']) && !$item->removable) {
         return '';
     } else {
         return parent::fieldFormatter($value, $item, $format);
     }
 }
 public function action_edit()
 {
     parent::action_edit();
     if (!$this->execute) {
         return;
     }
     $this->view->pageHeader = 'Шаблон №' . $this->view->item->id();
 }
Beispiel #7
0
 public function action_edit()
 {
     parent::action_edit();
     /** @var \App\Model\Enquiry $enquiry */
     $enquiry = $this->view->item;
     if ($enquiry->id()) {
         $this->view->enquiryMessages = $enquiry->messages->with('author')->find_all()->as_array();
         $this->view->subview = 'enquiry/edit';
     }
 }
Beispiel #8
0
 public function action_edit()
 {
     parent::action_edit();
     /** @var \App\Model\Order $order */
     $order = $this->view->item;
     $this->view->order = $order;
     $this->view->orderItems = $order->orderItems->find_all()->as_array();
     if ($order->id()) {
         $this->view->subview = 'order/edit';
     }
 }
Beispiel #9
0
 public function action_edit()
 {
     parent::action_edit();
     if (!$this->execute) {
         return;
     }
     /** @var \App\Model\Option $option */
     $option = $this->view->item;
     if ($option->id()) {
         //$this->view->enquiryMessages = $option->messages->with('author')->find_all()->as_array();
         $this->view->subview = 'option/edit';
         $this->view->pageHeader = "Product Option «" . $option->name . "»";
     }
 }
Beispiel #10
0
 public function action_edit()
 {
     $oldStatus = null;
     $id = $this->request->param('id');
     if ($this->request->method == 'POST') {
         $item = null;
         if ($id) {
             /** @var \App\Model\Order $item */
             $item = $this->pixie->orm->get($this->model->model_name, $id);
         }
         if (!$item || !$item->loaded()) {
             throw new NotFoundException();
         }
         $oldStatus = $item->status;
     }
     parent::action_edit();
     /** @var \App\Model\Order $order */
     $order = $this->pixie->orm->get($this->model->model_name, $id);
     if ($this->request->method == 'POST') {
         if ($oldStatus != $order->status) {
             $this->pixie->dispatcher->dispatch(Events::ORDER_STATUS_CHANGED, new OrderStatusChangedEvent($order, $order->status));
         }
     }
     if (!$this->execute) {
         return;
     }
     $this->view->order = $order;
     $this->view->orderItems = $order->orderItems->find_all()->as_array();
     if ($order->id()) {
         $paymentConfig = $this->pixie->config->get('payment');
         $isTesting = !!$paymentConfig['testing'];
         $this->view->isTesting = $isTesting;
         if ($order->isRefundable() || $isTesting) {
             $payment = $order->payment;
             $canRefundOrder = !(!$order->isRefundable() && !$isTesting || !$payment || !$payment->loaded());
             if ($canRefundOrder) {
                 $canRefundPayment = $payment->isRefundable() || $isTesting;
                 if ($canRefundPayment) {
                     $operation = $payment->refund_operation;
                     $this->pixie->payments->getRefundParameters($this->request, $this->view, $operation, $payment, $isTesting);
                 }
             }
         }
         $this->view->subview = 'order/edit';
         $this->view->pageTitle = $this->modelNameSingle . ' №' . $order->uid;
         $this->view->pageHeader = $this->view->pageTitle;
     }
 }