예제 #1
0
파일: index.php 프로젝트: nhuhtlb/linxbooks
/* @var $this DefaultController */
/* @var $entity_type tham so la các entity như task|issue|invocie...*/
/* @var $entity_id la id cua cac entity như task|issue|invocie...*/
$subscription_id = DefaultController::getSubscriptionId();
//require_once (YII::app()->modulePath.'/process_checklist/js/jquery-ui-1.11.1.js.php');
?>
<h2>Process Check List</h2>

<div id="container-process-checklist">
    <?php 
$this->renderPartial('process_checklist.views.default.form_process_checklist', array('entity_type' => $entity_type, 'entity_id' => $entity_id));
?>
</div>
<br>
<?php 
echo CHtml::dropDownList('process_checklist', '', CHtml::listData(ProcessChecklist::model()->getPchecklist($subscription_id)->data, 'pc_id', 'pc_name'));
//    $modelPCdefault = ProcessChecklistDefault::model()->getPCheckListDefaultByCheckList(2);
//    print_r($modelPCdefault->data);
?>
&nbsp;<a href="#" onclick="addPChecklistItem(); return false;" style="font-size: 2.5em; font-weight: bold; text-decoration: none;">+</a>

<script type="text/javascript">
    
    function addPChecklistItem()
    {
        var entity_type = '<?php 
echo $entity_type;
?>
';
        var entity_id = '<?php 
echo $entity_id;
 /**
  * Manages all models.
  */
 public function actionAdmin($pc_id)
 {
     $model = ProcessChecklistDefault::model()->getPCheckListDefaultByCheckList($pc_id);
     $modelChecklist = ProcessChecklist::model()->findByPk($pc_id);
     $this->render('admin', array('model' => $model, 'modelChecklist' => $modelChecklist));
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return ProcessChecklist the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = ProcessChecklist::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }