public function assignAction() { $this->session->step = 2; $form = $this->getForm(self::FORM_ASSIGN); $submited = $form->isSubmitted(); if ($submited) { $this->session->importOptions['skip'] = $this->getParam('skip', 0); $this->session->importOptions['add_subscription'] = $this->getParam('add_subscription', 0); $this->session->importOptions['add_encrypted_pass'] = $this->getParam('add_encrypted_pass', 0); $this->session->importOptions['encrypted_pass_format'] = $this->getParam('encrypted_pass_format'); $this->session->importOptions['delim'] = $this->getParam('delim'); if ($delimCode = $this->session->importOptions['delim']) { $this->dataSource->setDelim($delimCode); } $this->session->fieldsMap = $this->getFieldsMapFromRequest(); //some import fields can be not applicable with new configuration $this->clearImportFields(); $this->addImportFields(); //recreate form with new configuration $form = $this->getForm(self::FORM_ASSIGN, $recreate = true, $force_submited = true); } if ($this->isAjax()) { echo $this->renderAssignTable(); exit; } if ($submited && !($error = $this->validateAssign())) { $this->defineAction(); } else { $table = $this->renderAssignTable(); if (isset($error) && $error) { $this->view->error = $error; } $this->view->title = 'Import: step 2 of 4'; $this->view->table = $table; $this->view->display('admin/import/assign.phtml'); } }
public function assignAction() { $this->session->step = 2; $form = $this->getForm(self::FORM_ASSIGN); if ($form->isSubmitted()) { $this->session->importOptions['skip'] = $this->_request->get('skip', 0); $this->session->importOptions['add_subscription'] = $this->_request->get('add_subscription', 0); $this->session->importOptions['delim'] = $this->_request->get('delim'); if ($delimCode = $this->session->importOptions['delim']) { $this->dataSource->setDelim($delimCode); } $this->session->fieldsMap = $this->getFieldsMapFromRequest(); //recreate form with new configuration $form = $this->getForm(self::FORM_ASSIGN, $recreate = true); } if ($this->isAjax()) { echo $this->renderAssignTable(); exit; } if ($form->isSubmitted() && !($error = $this->validateAssign())) { $this->defineAction(); } else { $table = $this->renderAssignTable(); if (isset($error) && $error) { $this->view->error = $error; } $this->view->title = 'Import: step 2 of 4'; $this->view->table = $table; $this->view->display('admin/import/assign.phtml'); } }