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


PHP Utils_RecordBrowserCommon::get_id方法代码示例

本文整理汇总了PHP中Utils_RecordBrowserCommon::get_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils_RecordBrowserCommon::get_id方法的具体用法?PHP Utils_RecordBrowserCommon::get_id怎么用?PHP Utils_RecordBrowserCommon::get_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utils_RecordBrowserCommon的用法示例。


在下文中一共展示了Utils_RecordBrowserCommon::get_id方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: user_label

 public static function user_label($id)
 {
     $label = Base_UserCommon::get_user_login($id);
     $c = Utils_RecordBrowserCommon::get_id('contact', 'login', $id);
     if ($c) {
         $label = CRM_ContactsCommon::contact_format_no_company($c, true) . ' [' . $label . ']';
     }
     return $label;
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:9,代码来源:LoginAuditCommon_0.php

示例2: QFfield_login

 public static function QFfield_login(&$form, $field, $label, $mode, $default, $desc, $rb = null)
 {
     $label = __('EPESI User');
     if (!Base_AclCommon::i_am_admin()) {
         return;
     }
     if ($mode == 'view') {
         if (!$default) {
             return;
         }
         if (Base_AclCommon::i_am_sa()) {
             Base_ActionBarCommon::add('settings', __('Log as user'), Module::create_href(array('log_as_user' => $default)));
             if (isset($_REQUEST['log_as_user']) && $_REQUEST['log_as_user'] == $default) {
                 Acl::set_user($default, true);
                 //tag who is logged
                 Epesi::redirect();
                 return;
             }
         }
         $form->addElement('static', $field, $label);
         $form->setDefaults(array($field => self::display_login(array('login' => $default), true, array('id' => 'login'))));
         return;
     }
     $ret = DB::Execute('SELECT id, login FROM user_login ORDER BY login');
     $users = array('' => '---', 'new' => '[' . __('Create new user') . ']');
     while ($row = $ret->FetchRow()) {
         $contact_id = Utils_RecordBrowserCommon::get_id('contact', 'login', $row['id']);
         if ($contact_id === false || $contact_id === null || $row['id'] === $default && $mode != 'add') {
             if (Base_AclCommon::i_am_admin() || $row['id'] == Acl::get_user()) {
                 $users[$row['id']] = $row['login'];
             }
         }
     }
     $form->addElement('select', $field, $label, $users, array('id' => 'crm_contacts_select_user'));
     $form->setDefaults(array($field => $default));
     if ($default !== '') {
         $form->freeze($field);
     } else {
         eval_js('new_user_textfield = function(){' . '($("crm_contacts_select_user").value=="new"?"":"none");' . '$("username").up("tr").style.display = $("set_password").up("tr").style.display = $("confirm_password").up("tr").style.display = $("_access__data").up("tr").style.display = ($("crm_contacts_select_user").value==""?"none":"");' . 'if ($("contact_admin")) $("contact_admin").up("tr").style.display = ($("crm_contacts_select_user").value==""?"none":"");' . '}');
         eval_js('new_user_textfield();');
         eval_js('Event.observe("crm_contacts_select_user","change",function(){new_user_textfield();});');
     }
     if ($default) {
         eval_js('$("_login__data").up("tr").style.display = "none";');
     }
 }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:46,代码来源:ContactsCommon_0.php

示例3: send_email_notifications

 public static function send_email_notifications($event_id)
 {
     $event = DB::GetRow('SELECT * FROM utils_watchdog_event WHERE id=%d', array($event_id));
     if (!$event) {
         return;
     }
     $category_id = $event['category_id'];
     $id = $event['internal_id'];
     $message = $event['message'];
     $subscribers = self::get_subscribers($category_id, $id);
     $c_user = Acl::get_user();
     self::email_mode(true);
     foreach ($subscribers as $user_id) {
         $wants_email = Base_User_SettingsCommon::get('Utils_Watchdog', 'email', $user_id);
         if (!$wants_email) {
             continue;
         }
         Acl::set_user($user_id);
         Base_LangCommon::load();
         $email_data = self::display_events($category_id, array($event_id => $message), $id, true);
         if (!$email_data) {
             continue;
         }
         $contact = Utils_RecordBrowserCommon::get_id('contact', 'login', $user_id);
         if (!$contact) {
             continue;
         }
         $email = Utils_RecordBrowserCommon::get_value('contact', $contact, 'email');
         if (!$email) {
             continue;
         }
         $title = __('%s notification - %s - %s', array(EPESI, $email_data['category'], strip_tags($email_data['title'])));
         Base_MailCommon::send($email, $title, $email_data['events'], null, null, true);
     }
     Acl::set_user($c_user);
     Base_LangCommon::load();
     self::email_mode(false);
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:38,代码来源:WatchdogCommon_0.php

示例4: new_event

	public static function new_event($category_name, $id, $message) {
		if(self::$disabled) return;
		$category_id = self::get_category_id($category_name, false);
		if (!$category_id) return;
		DB::Execute('INSERT INTO utils_watchdog_event (category_id, internal_id, message, event_time) VALUES (%d,%d,%s,%T)',array($category_id,$id,$message,time()));
		$event_id = DB::Insert_ID('utils_watchdog_event', 'id');
		Utils_WatchdogCommon::notified($category_name,$id);
		$count = DB::GetOne('SELECT COUNT(*) FROM utils_watchdog_event WHERE category_id=%d AND internal_id=%d', array($category_id,$id));
		if ($count==1) {
			$subscribers = self::get_subscribers($category_id);
			foreach ($subscribers as $s)
				self::user_subscribe($s, $category_name, $id);
		}
        $subscribers = self::get_subscribers($category_name, $id);

		$c_user = Acl::get_user();
        self::email_mode(true);
		foreach ($subscribers as $user_id) {
            if ($user_id==$c_user) continue;
            $wants_email = Base_User_SettingsCommon::get('Utils_Watchdog', 'email', $user_id);
            if (!$wants_email) continue;
            Acl::set_user($user_id);
            Base_LangCommon::load();
            $email_data = self::display_events($category_id, array($event_id => $message), $id, true);
            if (!$email_data) continue;
            $contact = Utils_RecordBrowserCommon::get_id('contact', 'login', $user_id);
            if (!$contact) continue;
            $email = Utils_RecordBrowserCommon::get_value('contact', $contact, 'email');
            if (!$email) continue;
            $title = __('%s notification - %s - %s', array(EPESI, $email_data['category'], strip_tags($email_data['title'])));
            Base_MailCommon::send($email, $title, $email_data['events'], null, null, true);
        }
		Acl::set_user($c_user);
        Base_LangCommon::load();
        self::email_mode(false);
    }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:36,代码来源:WatchdogCommon_0.php


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