当前位置: 首页>>代码示例>>PHP>>正文


PHP company::get_shortname方法代码示例

本文整理汇总了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();
             }
         }
     }
 }
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:47,代码来源:company_users_form.php

示例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');
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:31,代码来源:uploaduser.php


注:本文中的company::get_shortname方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。