/** * Perform the main actions of the page. */ protected function action() { if (!parent::action()) { return false; } if (!$this->hasPermission("task(person_can_edit_child_form_person_scheduled_training_course)")) { $no_edit = "You do not have permission to edit students for this course instance."; I2CE::getConfig()->setIfIsSet($no_edit, "/modules/training-course/translatable-strings/no_edit_students"); $this->userMessage($no_edit); return false; } $this->template->addHeaderLink("view.js"); //$this->template->appendFileById( "menu_view.html", "li", "navBarUL", true ); $this->factory = I2CE_FormFactory::instance(); if (!$this->get_exists('id')) { $this->userMessage("Invalid Scheduled Training Course Requested"); return false; } if ($this->get_exists('id')) { $id = $this->get('id'); if (strpos($id, '|') === false) { I2CE::raiseError("Deprecated use of id variable"); $id = 'scheduled_training_course|' . $id; } } else { $id = 'scheduled_training_course|0'; } if (!($this->scheduled_training_course = $this->factory->createContainer($id)) instanceof I2CE_Form) { return false; } $this->scheduled_training_course->populate(); $this->template->setForm($this->scheduled_training_course); /*$job = $this->sh->getField('job'); // Note, this will fail if the request() method has been called on this page since that // caches all the get/post details and it can't be changed after that without changing core code. // lduncan@intrahealth.org // if ( !$this->post_exists('limits') && !$this->get_exists('limits') ) { if ( $job && $job instanceof I2CE_FormField_MAP_MULT ) { if ( $job->isValid() ) { $this->get['limits']['position+job']['in']['value'] = explode( ',', $job->getDBValue() ); } } else { I2CE::raiseError("Invalid job from provider instance to limit students."); } } */ $this->setupStudents(); $this->showStudents(); if (!$this->actionReport("id={$id}")) { return false; } $this->template->appendFileByID("edit_students_return.html", "div", "siteContent"); return true; }
/** * Perform the main actions of the page. */ protected function action() { if (!parent::action()) { return false; } if (!$this->hasPermission("role(admin)")) { $this->userMessage("You do not have permission to view this page."); return false; } $this->template->addHeaderLink("view.js"); //$this->template->appendFileById( "menu_view.html", "li", "navBarUL", true ); return $this->actionReport(); }
/** * Perform the main actions of the page. */ protected function action() { if (!parent::action()) { return false; } if (!$this->hasPermission("task(person_can_edit_child_form_person_instance)")) { $this->userMessage("You do not have permission to edit participants for this instance."); return false; } $this->template->addHeaderLink("view.js"); //$this->template->appendFileById( "menu_view.html", "li", "navBarUL", true ); $this->factory = I2CE_FormFactory::instance(); if (!$this->get_exists('id')) { $this->userMessage("Invalid Training Provider Requested"); return false; } if ($this->get_exists('id')) { $id = $this->get('id'); if (strpos($id, '|') === false) { I2CE::raiseError("Deprecated use of id variable"); $id = 'provider_instance|' . $id; } } else { $id = 'provider_instance|0'; } $this->instance = $this->factory->createContainer($id); $this->instance->populate(); $this->template->setForm($this->instance); $job = $this->instance->getField('job'); // Note, this will fail if the request() method has been called on this page since that // caches all the get/post details and it can't be changed after that without changing core code. // lduncan@intrahealth.org // if (!$this->post_exists('limits') && !$this->get_exists('limits')) { if ($job && $job instanceof I2CE_FormField_MAP_MULT) { if ($job->isValid()) { $this->get['limits']['position+job']['in']['value'] = explode(',', $job->getDBValue()); } } else { I2CE::raiseError("Invalid job from provider instance to limit participants."); } } $this->setupParticipants(); return $this->actionReport("id={$id}"); }