예제 #1
0
 /**
  * 
  * @return InterviewSlot
  */
 public function getSlot()
 {
     if ($this->_slot) {
         return $this->_slot;
     }
     return $this->_slot = InterviewSlot::model()->create();
 }
 public function getSlot()
 {
     if ($this->_slot) {
         return $this->_slot;
     } else {
         return $this->_slot = InterviewSlot::model()->findById($this->_slotId);
     }
 }
예제 #3
0
 public function actionSort()
 {
     if (isset($_POST['SlotList']) && isset($_POST['SlotList']['items'])) {
         $this->checkAccess('slot.sort');
         try {
             InterviewSlot::model()->sortOrDelete($this->rec->id, $_POST['SlotList']['items']);
             $error = NULL;
         } catch (CException $e) {
             $error = $e->getMessage();
         }
         if (O::app()->getRequest()->isAjaxRequest) {
             echo CJSON::encode(array('status' => $error == NULL ? 'OK' : 'ERROR', 'error' => $error));
         } else {
             $url = array('index');
             if ($error) {
                 $url['error'] = $error;
             }
             $this->redirect($url);
         }
     } else {
         throw new CHttpException(403);
     }
 }