本文整理汇总了PHP中Company::getLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP Company::getLanguage方法的具体用法?PHP Company::getLanguage怎么用?PHP Company::getLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Company
的用法示例。
在下文中一共展示了Company::getLanguage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run($args)
{
$companies = Company::model()->findAll('frozen=:p AND telfin_id<>:t', array(':p' => '0', ':t' => ''));
foreach ($companies as $company) {
Company::setActive($company);
Yii::app()->language = Company::getLanguage();
//User::model()->refreshMetaData();
/*AuthAssignment::model()->refreshMetaData();
ProfileField::model()->refreshMetaData();
Profile::model()->refreshMetaData();
Zakaz::model()->refreshMetaData();
ZakazParts::model()->refreshMetaData();
Events::model()->refreshMetaData();*/
//self::executor();
//self::manager();
//echo '=)';
Yii::app()->cdr->init('cron');
CrmCdr::model()->refreshMetaData();
// Проверим нет ли сохраненного токена в сессии
// Работу с сессией вынес в прикладной код, потому что врапер может вызываться из командной строки
//Yii::app()->cdr->cookie2token();
// Обновим данные из Телфина
Yii::app()->cdr->refresh();
// Сохраним токен в сессии есть есть что сохранять
//Yii::app()->cdr->token2cookie();
}
}
示例2: run
public function run($args)
{
$companies = Company::model()->findAll('frozen=:p', array(':p' => '0'));
foreach ($companies as $company) {
Company::setActive($company);
Yii::app()->language = Company::getLanguage();
User::model()->refreshMetaData();
AuthAssignment::model()->refreshMetaData();
ProfileField::model()->refreshMetaData();
Profile::model()->refreshMetaData();
Zakaz::model()->refreshMetaData();
ZakazParts::model()->refreshMetaData();
Events::model()->refreshMetaData();
Templates::model()->refreshMetaData();
Emails::model()->refreshMetaData();
self::executor();
self::manager();
self::send_deffered_emails();
}
}
示例3: init
public function init()
{
// --- Организации
$c_id = Company::getId();
if ($c_id) {
if (Company::getCompany()->frozen) {
echo 'Where is my money, dude ?!?!?!';
die;
}
ProjectChanges::$file_path = 'uploads/c' . $c_id . '/changes_documents';
Zakaz::$files_folder = '/uploads/c' . $c_id . '/';
Yii::app()->language = Company::getLanguage();
} else {
$tmp = explode('.', $_SERVER['SERVER_NAME']);
if (array_shift($tmp) == 'www') {
$this->redirect('http://' . implode('.', $tmp));
} else {
echo 'Requested company not found.';
}
Yii::app()->end();
}
// ---
if (!Yii::app()->user->isGuest) {
switch (User::model()->getUserRole()) {
case 'Manager':
case 'Admin':
case 'root':
Yii::app()->theme = 'admin';
break;
case 'Author':
$menu[] = array('label' => Yii::t('site', 'My orders'), 'url' => array('/project/zakaz/ownList'));
$menu[] = array('label' => Yii::t('site', 'New projects'), 'url' => array('/project/zakaz/list'));
if (User::model()->isCorrector()) {
$menu[] = array('label' => Yii::t('site', 'New projects for technical'), 'url' => array('/project/zakaz/listtech'));
//if (Company::getCompany()->module_tree) $menu[] = array('label'=>Yii::t('site','Tree structure'), 'url'=>array('/project/zakaz/tree'));
}
if (Company::getCompany()->agreement4executors && Company::getCompany()->agreement4executors != '') {
$menu[] = array('label' => Yii::t('site', 'User Agreement'), 'url' => array('/site/agreement'));
}
//$menu[] = array('label'=>Yii::t('site','Personal account'), 'url'=>array('/user/profile/account'));
$menu[] = array('label' => Yii::t('site', 'Logout'), 'url' => array('/user/logout'));
// Далее выводится в обратном порядке
$menu[] = array('label' => Yii::t('site', 'Profile'), 'url' => array('/user/profile/edit'));
$this->menu = $menu;
Yii::app()->theme = 'client';
break;
case 'Customer':
$menu[] = array('label' => Yii::t('site', 'My orders'), 'url' => array('/project/zakaz/customerOrderList'));
if (Company::getCompany()->module_tree) {
$menu[] = array('label' => Yii::t('site', 'Tree structure'), 'url' => array('/project/zakaz/tree'));
}
$menu[] = array('label' => Yii::t('site', 'Create order'), 'url' => array('/project/zakaz/create'));
//$menu[] = array('label'=>Yii::t('site','Personal account'), 'url'=>array('/user/profile/account'));
if (Company::getCompany()->agreement4customers && Company::getCompany()->agreement4customers != '') {
$menu[] = array('label' => Yii::t('site', 'User Agreement'), 'url' => array('/site/agreement'));
}
$menu[] = array('label' => Yii::t('site', 'Logout'), 'url' => array('/user/logout'));
// Даллее выводится в обратном порядке
$menu[] = array('label' => Yii::t('site', 'Profile'), 'url' => array('/user/profile/edit'));
$this->menu = $menu;
/*$this->authMenu = array(
array('label'=>Yii::t('site','Logout'), 'url'=>array('/user/logout')),
);*/
Yii::app()->theme = 'client';
break;
case 'Webmaster':
$this->menu = array(array('label' => Yii::t('site', 'Stats'), 'url' => array('/partner/stats')), array('label' => Yii::t('site', 'Promo materials'), 'url' => array('/partner/materials')), array('label' => Yii::t('site', 'Logout'), 'url' => array('/user/logout')), array('label' => Yii::t('site', 'Profile'), 'url' => array('/user/profile/edit')));
$this->authMenu = array(array('label' => Yii::t('site', 'Logout'), 'url' => array('/user/logout')));
Yii::app()->theme = 'client';
if (Yii::app()->getRequest()->getRequestUri() == '/project/zakaz/list') {
$this->redirect('/');
}
break;
}
}
// var_dump(Yii::app()->controller->module->id ,Yii::app()->controller->id, Yii::app()->controller->action->id);
// die();
}