public function eventImport(&$event)
 {
     switch ($event->objectUsed['importobject']) {
         case 'Company':
             Template::importTemplates($event->objectUsed['root'], $event->id, $event->objectUsed['errors']);
             break;
     }
 }
 private function importTemplates($fileNameAndPath)
 {
     $allAccounts = array();
     $dom = new domDocument();
     if (!$dom->load($fileNameAndPath)) {
         throw new CException(Yii::t('lazy8', 'input file could not be xml parsed'));
     }
     $root = $dom->documentElement;
     if ($root->nodeName != "lazy8webtemplates") {
         $this->hasErrors = true;
         $this->errors = array(array(Yii::t('lazy8', 'Upload failed.  This is not a valid file.'), Yii::t('lazy8', 'Select a file and try again')));
         $this->render('showimport');
         return 0;
     }
     if ($root->getAttribute('version') > 1.0) {
         $this->errors = array(array(Yii::t('lazy8', 'There maybe problems because this is a file version greater then this programs version'), Yii::t('lazy8', 'Select a file and try again')));
     }
     Template::importTemplates($root, Yii::app()->user->getState('selectedCompanyId'), $this->errors);
 }