Esempio n. 1
0
 /**
  * Display form to edit a registration type.
  * @param $args array
  * @param $request PKPRequest
  */
 function editRegistrationType($args, &$request)
 {
     $this->validate();
     $this->setupTemplate($request, true);
     $schedConf =& $request->getSchedConf();
     $registrationTypeId = !isset($args) || empty($args) ? null : (int) $args[0];
     $registrationTypeDao = DAORegistry::getDAO('RegistrationTypeDAO');
     // Ensure registration type is valid and for this scheduled conference.
     if ($registrationTypeId != null && $registrationTypeDao->getRegistrationTypeSchedConfId($registrationTypeId) == $schedConf->getId() || $registrationTypeId == null) {
         import('classes.registration.form.RegistrationTypeForm');
         $templateMgr =& TemplateManager::getManager($request);
         $templateMgr->append('pageHierarchy', array($request->url(null, null, 'manager', 'registrationTypes'), 'manager.registrationTypes'));
         if ($registrationTypeId == null) {
             $templateMgr->assign('registrationTypeTitle', 'manager.registrationTypes.createTitle');
         } else {
             $templateMgr->assign('registrationTypeTitle', 'manager.registrationTypes.editTitle');
         }
         $registrationTypeForm = new RegistrationTypeForm($registrationTypeId);
         if ($registrationTypeForm->isLocaleResubmit()) {
             $registrationTypeForm->readInputData();
         } else {
             $registrationTypeForm->initData();
         }
         $registrationTypeForm->display();
     } else {
         $request->redirect(null, null, null, 'registrationTypes');
     }
 }