本文整理汇总了PHP中company::get_recursive_departments_licenses方法的典型用法代码示例。如果您正苦于以下问题:PHP company::get_recursive_departments_licenses方法的具体用法?PHP company::get_recursive_departments_licenses怎么用?PHP company::get_recursive_departments_licenses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类company
的用法示例。
在下文中一共展示了company::get_recursive_departments_licenses方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
$licensecourses = $DB->get_records('companylicense_courses', array('licenseid' => $license->id));
$coursestring = "";
foreach ($licensecourses as $licensecourse) {
$coursename = $DB->get_record('course', array('id' => $licensecourse->courseid));
if (empty($coursestring)) {
$coursestring = "<a href='" . new moodle_url('/course/view.php', array('id' => $licensecourse->courseid)) . "'>" . $coursename->fullname . "</a>";
} else {
$coursestring .= ",</br><a href='" . new moodle_url('/course/view.php', array('id' => $licensecourse->courseid)) . "'>" . $coursename->fullname . "</a>";
}
}
// Create the table data.
$table->data[] = array("{$license->name}", $coursestring, date('d M Y', $license->expirydate), "{$license->validlength}", "{$license->allocation}", "{$license->used}", $editbutton, $deletebutton);
}
} else {
if ($licenses = company::get_recursive_departments_licenses($companydepartment->id)) {
foreach ($licenses as $licenseid) {
// Get the license record.
$license = $DB->get_record('companylicense', array('id' => $licenseid->licenseid));
// Set up the edit buttons.
if (iomad::has_capability('block/iomad_company_admin:edit_licenses', $context)) {
$deletebutton = "<a href=\"company_license_list.php?delete={$license->id}&sesskey=" . sesskey() . "\">{$strdelete}</a>";
$editbutton = "<a href='" . new moodle_url('company_license_edit_form.php', array("licenseid" => $license->id, 'departmentid' => $departmentid)) . "'>{$stredit}</a>";
} else {
$deletebutton = "";
$editbutton = "";
}
$table->data[] = array("{$license->name}", "{$license->expirydate}", "{$license->validlength}", "{$license->allocation}", "{$license->used}", $editbutton, $deletebutton);
}
}
}
示例2: array
$licenselist = array();
if (iomad::has_capability('block/iomad_company_admin:unallocate_licenses', context_system::instance())) {
$userhierarchylevel = $parentlevel->id;
// Get all the licenses.
$licenses = $DB->get_records('companylicense', array('companyid' => $companyid), null, 'id,name,expirydate');
foreach ($licenses as $license) {
if ($license->expirydate > time()) {
$licenselist[$license->id] = $license->name;
} else {
$licenselist[$license->id] = $license->name . " (expired)";
}
}
} else {
$userlevel = company::get_userlevel($USER);
$userhierarchylevel = $userlevel->id;
$licenses = company::get_recursive_departments_licenses($userhierarchylevel);
if (!empty($licenses)) {
foreach ($licenses as $deptlicenseid) {
// Get the license record.
if ($license = $DB->get_records('companylicense', array('id' => $deptlicenseid->licenseid, 'companyid' => $companyid), null, 'id,name')) {
$licenselist[$license[$deptlicenseid->licenseid]->id] = $license[$deptlicenseid->licenseid]->name;
}
}
}
}
$usersform = new company_license_users_form($PAGE->url, $context, $companyid, $licenseid, $userhierarchylevel);
$blockpage->display_header();
// GWL : Check the department is valid.
if (!empty($departmentid) && !company::check_valid_department($companyid, $departmentid)) {
print_error('invaliddepartment', 'block_iomad_company_admin');
}