示例#1
0
 /**
  * actionFetchComponents
  * @access public
  * @return void
  */
 public function actionFetchComponents()
 {
     Yii::log("actionFetchComponents DesignController called", "trace", self::LOG_CAT);
     $postData = $_POST;
     $data = GoalData::model()->findAll(['select' => 'pageId, pageName', 'condition' => 'parentId=:parentId', 'params' => [':parentId' => $postData['FrameworkContext']['goalId']]]);
     $data = CHtml::listData($data, 'pageId', 'pageName');
     //print_r($data);
     foreach ($data as $value => $name) {
         echo CHtml::tag('option', ['value' => $value], CHtml::encode($name), true);
     }
 }
示例#2
0
 /**
  * actionDeleteGoal 
  * 
  * @access public
  * @return void
  */
 public function actionDeleteGoal()
 {
     Yii::log("actionDeleteGoal called", "trace", self::LOG_CAT);
     if (isset($_POST["delId"])) {
         $record = GoalData::model()->findByPk($_POST['delId']);
         if (!$record->delete()) {
             Yii::log("Error deleting goal: " . $_POST['delId'], "warning", self::LOG_CAT);
             //echo $errorMessage;
             echo Yii::t("translation", "A problem occured when deleting the goal ") . $_POST['delId'];
         } else {
             echo Yii::t("translation", "The goal ") . Yii::t("translation", " has been successfully deleted");
         }
     }
 }