public function __construct($actionurl, $companyid, $departmentid)
 {
     global $CFG, $USER;
     $this->selectedcompany = $companyid;
     $this->departmentid = $departmentid;
     $company = new company($this->selectedcompany);
     $parentlevel = company::get_company_parentnode($company->id);
     $this->companydepartment = $parentlevel->id;
     if (iomad::has_capability('block/iomad_company_admin:edit_all_departments', context_system::instance())) {
         $userhierarchylevel = $parentlevel->id;
     } else {
         $userlevel = company::get_userlevel($USER);
         $userhierarchylevel = $userlevel->id;
     }
     $this->subhierarchieslist = company::get_all_subdepartments($userhierarchylevel);
     if ($this->departmentid == 0) {
         $departmentid = $userhierarchylevel;
     } else {
         $departmentid = $this->departmentid;
     }
     $this->userdepartment = $userhierarchylevel;
     $options = array('context' => $this->context, 'multiselect' => true, 'companyid' => $this->selectedcompany, 'departmentid' => $departmentid, 'subdepartments' => $this->subhierarchieslist, 'parentdepartmentid' => $parentlevel, 'showopenshared' => true, 'license' => false);
     $this->currentcourses = new potential_subdepartment_course_selector('currentcourses', $options);
     $this->currentcourses->set_rows(20);
     $this->context = context_coursecat::instance($CFG->defaultrequestcategory);
     parent::moodleform($actionurl);
 }
 public function __construct($actionurl, $isadding, $companyid, $companyrecord, $returnurl)
 {
     $this->isadding = $isadding;
     $this->companyid = $companyid;
     $this->companyrecord = $companyrecord;
     //GWL
     $this->returnurl = $returnurl;
     parent::moodleform($actionurl);
 }
 public function __construct($actionurl, $companyid, $departmentid, $chosenid = 0, $regionid = 0, $action = 0)
 {
     global $CFG;
     $this->selectedcompany = $companyid;
     $this->context = context_coursecat::instance($CFG->defaultrequestcategory);
     $this->departmentid = $departmentid;
     $this->chosenid = $chosenid;
     $this->action = $action;
     $this->regionid = $regionid;
     parent::moodleform($actionurl);
 }
Ejemplo n.º 4
0
 public function __construct($actionurl, $companyid, $submitlabelstring)
 {
     $this->selectedcompany = $companyid;
     $this->submitlabel = get_string($submitlabelstring, 'block_iomad_company_admin');
     parent::moodleform($actionurl);
 }