本文整理汇总了PHP中company::get_shortname方法的典型用法代码示例。如果您正苦于以下问题:PHP company::get_shortname方法的具体用法?PHP company::get_shortname怎么用?PHP company::get_shortname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类company
的用法示例。
在下文中一共展示了company::get_shortname方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process()
{
global $DB;
if ($this->selectedcompany) {
$company = new company($this->selectedcompany);
$companyshortname = $company->get_shortname();
$companydefaultdepartment = company::get_company_parentnode($company->id);
// Process incoming assignments.
if (optional_param('add', false, PARAM_BOOL) && confirm_sesskey()) {
$userstoassign = $this->potentialusers->get_selected_users();
if (!empty($userstoassign)) {
foreach ($userstoassign as $adduser) {
$allow = true;
if ($allow) {
$user = $DB->get_record('user', array('id' => $adduser->id));
// Add user to default company department.
$company->assign_user_to_company($adduser->id);
}
}
$this->potentialusers->invalidate_selected_users();
$this->currentusers->invalidate_selected_users();
}
}
// Process incoming unassignments.
if (optional_param('remove', false, PARAM_BOOL) && confirm_sesskey()) {
$userstounassign = $this->currentusers->get_selected_users();
if (!empty($userstounassign)) {
foreach ($userstounassign as $removeuser) {
// Check if the user was a company manager.
if ($DB->get_records('company_users', array('userid' => $removeuser->id, 'managertype' => 1))) {
$companymanagerrole = $DB->get_record('role', array('shortname' => 'companymanager'));
role_unassign($companymanagerrole->id, $removeuser->id, $this->context->id);
}
if ($DB->get_records('company_users', array('userid' => $removeuser->id, 'managertype' => 2))) {
$departmentmanagerrole = $DB->get_record('role', array('shortname' => 'departmentmanager'));
role_unassign($departmentmanagerrole->id, $removeuser->id, $this->context->id);
}
$DB->delete_records('company_users', array('userid' => $removeuser->id));
// Deal with the company theme.
$DB->set_field('user', 'theme', '', array('id' => $removeuser->id));
}
$this->potentialusers->invalidate_selected_users();
$this->currentusers->invalidate_selected_users();
}
}
}
}
示例2: blockpage
iomad::require_capability('block/iomad_company_admin:user_upload', context_system::instance());
// Correct the navbar .
// Set the name for the page.
$linktext = get_string('user_upload_title', 'block_iomad_company_admin');
// Set the url.
$linkurl = new moodle_url('/blocks/iomad_company_admin/uploaduser.php');
// Build the nav bar.
company_admin_fix_breadcrumb($PAGE, $linktext, $linkurl);
$blockpage = new blockpage($PAGE, $OUTPUT, 'iomad_company_admin', 'block', 'user_upload_title');
$blockpage->setup();
// Set the companyid
$companyid = iomad::get_my_companyid($context);
$companyshortname = '';
if ($companyid) {
$company = new company($companyid);
$companyshortname = $company->get_shortname();
}
require_login(null, false);
// Adds to $PAGE, creates $OUTPUT.
$systemcontext = context_system::instance();
$struserrenamed = get_string('userrenamed', 'tool_uploaduser');
$strusernotrenamedexists = get_string('usernotrenamedexists', 'error');
$strusernotrenamedmissing = get_string('usernotrenamedmissing', 'error');
$strusernotrenamedoff = get_string('usernotrenamedoff', 'error');
$strusernotrenamedadmin = get_string('usernotrenamedadmin', 'error');
$struserupdated = get_string('useraccountupdated', 'tool_uploaduser');
$strusernotupdated = get_string('usernotupdatederror', 'error');
$strusernotupdatednotexists = get_string('usernotupdatednotexists', 'error');
$strusernotupdatedadmin = get_string('usernotupdatedadmin', 'error');
$struseradded = get_string('newuser');
$strusernotadded = get_string('usernotaddedregistered', 'error');