BaseEventTypeController::processJsVars PHP Method

processJsVars() public method

set base js vars for use in the standard scripts for the controller.
public processJsVars ( )
    public function processJsVars()
    {
        if ($this->patient) {
            $this->jsVars['OE_patient_id'] = $this->patient->id;
        }
        if ($this->event) {
            $this->jsVars['OE_event_id'] = $this->event->id;
            if (Yii::app()->params['event_print_method'] == 'pdf') {
                $this->jsVars['OE_print_url'] = Yii::app()->createUrl($this->getModule()->name . '/default/PDFprint/' . $this->event->id);
            } else {
                $this->jsVars['OE_print_url'] = Yii::app()->createUrl($this->getModule()->name . '/default/print/' . $this->event->id);
            }
        }
        $this->jsVars['OE_asset_path'] = $this->assetPath;
        $firm = Firm::model()->findByPk(Yii::app()->session['selected_firm_id']);
        $subspecialty_id = $firm->serviceSubspecialtyAssignment ? $firm->serviceSubspecialtyAssignment->subspecialty_id : null;
        $this->jsVars['OE_subspecialty_id'] = $subspecialty_id;
        parent::processJsVars();
    }

Usage Example

Esempio n. 1
0
 public function processJsVars()
 {
     $lens_types = array();
     foreach (OphInBiometry_LensType_Lens::model()->findAll() as $lens) {
         $lens_types[$lens->name] = array('model' => $lens->name, 'description' => $lens->description, 'acon' => (double) $lens->acon);
     }
     $this->jsVars['OphInBioemtry_lens_types'] = $lens_types;
     parent::processJsVars();
 }
BaseEventTypeController