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


PHP Utils_RecordBrowserCommon::create_record_href方法代码示例

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


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

示例1: watchdog_label

 public static function watchdog_label($tab, $cat, $rid, $events = array(), $label = null, $details = true)
 {
     $ret = array('category' => $cat);
     if ($rid !== null) {
         $r = self::get_record($tab, $rid);
         if ($r === null) {
             return null;
         }
         if (!self::get_access($tab, 'view', $r)) {
             return null;
         }
         if (is_array($label)) {
             $label = Utils_RecordBrowserCommon::record_link_open_tag_r($tab, $r) . call_user_func($label, $r, true) . Utils_RecordBrowserCommon::record_link_close_tag();
             $label = self::create_default_record_tooltip_ajax($label, $tab, $rid);
         } elseif ($label) {
             $label = Utils_RecordBrowserCommon::create_linked_label_r($tab, $label, $r);
             $label = self::create_default_record_tooltip_ajax($label, $tab, $rid);
         } else {
             $label = Utils_RecordBrowserCommon::create_default_linked_label($tab, $rid, false, false);
         }
         $ret['title'] = $label;
         $ret['view_href'] = Utils_RecordBrowserCommon::create_record_href($tab, $rid);
         $events_display = array();
         $events = array_reverse($events);
         $other_events = array();
         $header = false;
         foreach ($events as $v) {
             if (count($events_display) > 20) {
                 $other_events[__('And more...')] = 1;
                 break;
             }
             $param = explode('_', $v);
             switch ($param[0]) {
                 case 'C':
                     $what = 'Created';
                     $event_display = array('who' => Base_UserCommon::get_user_label($r['created_by'], true), 'when' => Base_RegionalSettingsCommon::time2reg($r['created_on']), 'what' => _V($what));
                     break;
                 case 'D':
                     if (!isset($what)) {
                         $what = 'Deleted';
                     }
                 case 'R':
                     if (!isset($what)) {
                         $what = 'Restored';
                     }
                     if (!isset($param[1])) {
                         $event_display = array('who' => '', 'when' => '', 'what' => _V($what));
                         break;
                     }
                 case 'E':
                     $event_display = self::get_edit_details_modify_record($tab, $r['id'], $param[1], $details);
                     if (isset($event_display['what']) && !empty($event_display['what'])) {
                         $header = true;
                     }
                     break;
                 case 'N':
                     $event_display = false;
                     switch ($param[1]) {
                         case '+':
                             $action = __('Note linked');
                             break;
                         case '-':
                             $action = __('Note unlinked');
                             break;
                         default:
                             if (!isset($other_events[$param[1]])) {
                                 $other_events[$param[1]] = 0;
                             }
                             $other_events[$param[1]]++;
                             $event_display = null;
                             break;
                     }
                     if ($event_display === false) {
                         $date = isset($param[3]) ? Base_RegionalSettingsCommon::time2reg($param[3]) : '';
                         $who = isset($param[4]) ? Base_UserCommon::get_user_label($param[4], true) : '';
                         $action .= ' - ' . self::create_default_linked_label('utils_attachment', $param[2]);
                         $event_display = array('what' => $action, 'who' => $who, 'when' => $date);
                     }
                     break;
                 default:
                     $event_display = array('what' => _V($v));
             }
             if ($event_display) {
                 $events_display[] = $event_display;
             }
         }
         foreach ($other_events as $k => $v) {
             $events_display[] = array('what' => _V($k) . ($v > 1 ? ' [' . $v . ']' : ''));
         }
         if ($events_display) {
             $theme = Base_ThemeCommon::init_smarty();
             if ($header) {
                 $theme->assign('header', array(__('Field'), __('Old value'), __('New value')));
             }
             $theme->assign('events', $events_display);
             $tpl = 'changes_list';
             if (Utils_WatchdogCommon::email_mode()) {
                 $record_data = self::get_record_tooltip_data($tab, $rid);
                 $theme->assign('record', $record_data);
                 $tpl = 'changes_list_email';
//.........这里部分代码省略.........
开发者ID:cretzu89,项目名称:EPESI,代码行数:101,代码来源:RecordBrowserCommon_0.php

示例2: crm_event_get

 public static function crm_event_get($id)
 {
     if (!is_array($id)) {
         $r = Utils_RecordBrowserCommon::get_record('task', $id);
     } else {
         $r = $id;
         $id = $r['id'];
     }
     $r = Utils_RecordBrowserCommon::filter_record_by_access('task', $r);
     if (!$r) {
         return null;
     }
     $next = array('type' => __('Task'));
     $day = $r['deadline'];
     $iday = strtotime($day);
     $next['id'] = $r['id'];
     $base_unix_time = strtotime(date('1970-01-01 00:00:00'));
     $next['start'] = $iday;
     $next['timeless'] = $day;
     $next['duration'] = -1;
     $next['title'] = (string) $r['title'];
     $next['description'] = (string) $r['description'];
     $next['color'] = 'gray';
     if ($r['status'] == 0 || $r['status'] == 1) {
         switch ($r['priority']) {
             case 0:
                 $next['color'] = 'green';
                 break;
             case 1:
                 $next['color'] = 'yellow';
                 break;
             case 2:
                 $next['color'] = 'red';
                 break;
         }
     }
     if ($r['status'] == 2) {
         $next['color'] = 'blue';
     }
     if ($r['status'] == 3) {
         $next['color'] = 'gray';
     }
     $next['view_action'] = Utils_RecordBrowserCommon::create_record_href('task', $r['id'], 'view');
     if (Utils_RecordBrowserCommon::get_access('task', 'edit', $r) !== false) {
         $next['edit_action'] = Utils_RecordBrowserCommon::create_record_href('task', $r['id'], 'edit');
     } else {
         $next['edit_action'] = false;
         $next['move_action'] = false;
     }
     if (Utils_RecordBrowserCommon::get_access('task', 'delete', $r) == false) {
         $next['delete_action'] = false;
     }
     /*		$r_new = $r;
     		if ($r['status']==0) $r_new['status'] = 1;
     		if ($r['status']<=1) $next['actions'] = array(
     			array('icon'=>Base_ThemeCommon::get_template_file('CRM/Meeting', 'close_event.png'), 'href'=>self::get_status_change_leightbox_href($r_new, false, array('id'=>'status')))
     		);*/
     $start_time = Base_RegionalSettingsCommon::time2reg($next['start'], 2, false, false);
     $event_date = Base_RegionalSettingsCommon::time2reg($next['start'], false, 3, false);
     $inf2 = array(__('Date') => '<b>' . $event_date . '</b>');
     $emps = array();
     foreach ($r['employees'] as $e) {
         $e = CRM_ContactsCommon::contact_format_no_company($e, true);
         $e = str_replace('&nbsp;', ' ', $e);
         if (mb_strlen($e, 'UTF-8') > 33) {
             $e = mb_substr($e, 0, 30, 'UTF-8') . '...';
         }
         $emps[] = $e;
     }
     $next['busy_label'] = $r['employees'];
     $cuss = array();
     foreach ($r['customers'] as $c) {
         $c = CRM_ContactsCommon::display_company_contact(array('customers' => $c), true, array('id' => 'customers'));
         $cuss[] = str_replace('&nbsp;', ' ', $c);
     }
     $inf2 += array(__('Task') => '<b>' . $next['title'] . '</b>', __('Description') => $next['description'], __('Assigned to') => implode('<br>', $emps), __('Contacts') => implode('<br>', $cuss), __('Status') => Utils_CommonDataCommon::get_value('CRM/Status/' . $r['status'], true), __('Access') => Utils_CommonDataCommon::get_value('CRM/Access/' . $r['permission'], true), __('Priority') => Utils_CommonDataCommon::get_value('CRM/Priority/' . $r['priority'], true), __('Notes') => Utils_AttachmentCommon::count('task/' . $r['id']));
     $next['employees'] = $r['employees'];
     $next['customers'] = $r['customers'];
     $next['status'] = $r['status'] <= 2 ? 'active' : 'closed';
     $next['custom_tooltip'] = '<center><b>' . __('Task') . '</b></center><br>' . Utils_TooltipCommon::format_info_tooltip($inf2) . '<hr>' . CRM_ContactsCommon::get_html_record_info($r['created_by'], $r['created_on'], null, null);
     return $next;
 }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:82,代码来源:TasksCommon_0.php

示例3: crm_event_get


//.........这里部分代码省略.........
                 return null;
             }
             $numdays = date('t', $iday);
             $cday = date('d', $iday);
             $tday = date('d', strtotime($r['date']));
             if ($cday != $tday && ($tday <= $numdays || $numdays != $cday)) {
                 return null;
             }
         }
         $next['id'] = $r['id'];
     }
     if ($r['recurrence_type'] > 0) {
         $next['id'] = $r['id'] . '_' . $day;
     }
     $base_unix_time = strtotime(date('1970-01-01 00:00:00'));
     //		$next['start'] = Base_RegionalSettingsCommon::reg2time(Base_RegionalSettingsCommon::time2reg(date('Y-m-d',$iday).' '.date('H:i:s',strtotime($r['time'])), true, false, true, false));
     //		$next['end'] = Base_RegionalSettingsCommon::reg2time(date('Y-m-d',$iday).' '.Base_RegionalSettingsCommon::time2reg(date('Y-m-d',$iday).' '.date('H:i:s',strtotime($r['time'])+$r['duration']), true, false, true, false));
     $next['start'] = date('Y-m-d', $iday) . ' ' . date('H:i:s', strtotime($r['time']));
     $next['end'] = date('Y-m-d', $iday) . ' ' . date('H:i:s', strtotime($r['time']) + $r['duration']);
     $next['start'] = strtotime($next['start']);
     $next['end'] = strtotime($next['end']);
     if ($r['duration'] == -1) {
         $next['timeless'] = $day;
     }
     $next['duration'] = intval($r['duration']);
     $next['title'] = (string) $r['title'];
     $next['description'] = (string) $r['description'];
     $next['color'] = 'gray';
     if ($r['status'] == 0 || $r['status'] == 1) {
         switch ($r['priority']) {
             case 0:
                 $next['color'] = 'green';
                 break;
             case 1:
                 $next['color'] = 'yellow';
                 break;
             case 2:
                 $next['color'] = 'red';
                 break;
         }
     }
     if ($r['status'] == 2) {
         $next['color'] = 'blue';
     }
     if ($r['status'] == 3) {
         $next['color'] = 'gray';
     }
     if ($r['recurrence_type']) {
         $next['title'] = '<img src="' . Base_ThemeCommon::get_template_file('CRM_Calendar_Event', 'recurrence.png') . '" border=0 hspace=0 vspace=0 align=left>' . $next['title'];
     }
     $next['view_action'] = Utils_RecordBrowserCommon::create_record_href('crm_meeting', $r['id'], 'view', array('day' => $day));
     if (Utils_RecordBrowserCommon::get_access('crm_meeting', 'edit', $r) !== false) {
         $next['edit_action'] = Utils_RecordBrowserCommon::create_record_href('crm_meeting', $r['id'], 'edit');
         if ($r['status'] <= 1) {
             $r_new = $r;
             if ($r['status'] == 0) {
                 $r_new['status'] = 1;
             }
             $next['actions'] = array(array('icon' => Base_ThemeCommon::get_template_file('CRM/Meeting', 'close_event.png'), 'href' => self::get_status_change_leightbox_href($r_new, false, array('id' => 'status'))));
         }
     } else {
         $next['edit_action'] = false;
         $next['move_action'] = false;
     }
     if (Utils_RecordBrowserCommon::get_access('crm_meeting', 'delete', $r) == false) {
         $next['delete_action'] = false;
     }
     $start_time = Base_RegionalSettingsCommon::time2reg($next['start'], 2, false, $r['duration'] != -1);
     $event_date = Base_RegionalSettingsCommon::time2reg($next['start'], false, 3, $r['duration'] != -1);
     $end_time = Base_RegionalSettingsCommon::time2reg($next['end'], 2, false, $r['duration'] != -1);
     $inf2 = array(__('Date') => '<b>' . $event_date . '</b>');
     if ($r['duration'] == -1) {
         $inf2 += array(__('Time') => __('Timeless event'));
     } else {
         $inf2 += array(__('Time') => $start_time . ' - ' . $end_time, __('Duration') => Base_RegionalSettingsCommon::seconds_to_words($r['duration']));
     }
     $emps = array();
     foreach ($r['employees'] as $e) {
         $e = CRM_ContactsCommon::contact_format_no_company($e, true);
         $e = str_replace('&nbsp;', ' ', $e);
         if (mb_strlen($e, 'UTF-8') > 33) {
             $e = mb_substr($e, 0, 30, 'UTF-8') . '...';
         }
         $emps[] = $e;
     }
     $next['busy_label'] = $r['employees'];
     $cuss = array();
     foreach ($r['customers'] as $c) {
         $c = CRM_ContactsCommon::display_company_contact(array('customers' => $c), true, array('id' => 'customers'));
         $cuss[] = str_replace('&nbsp;', ' ', $c);
     }
     $inf2 += array(__('Event') => '<b>' . $next['title'] . '</b>', __('Description') => $next['description'], __('Assigned to') => implode('<br>', $emps), __('Contacts') => implode('<br>', $cuss), __('Status') => Utils_CommonDataCommon::get_value('CRM/Status/' . $r['status'], true), __('Access') => Utils_CommonDataCommon::get_value('CRM/Access/' . $r['permission'], true), __('Priority') => Utils_CommonDataCommon::get_value('CRM/Priority/' . $r['priority'], true), __('Notes') => Utils_AttachmentCommon::count('crm_meeting/' . $r['id']));
     //		$next['employees'] = implode('<br>',$emps);
     //		$next['customers'] = implode('<br>',$cuss);
     $next['employees'] = $r['employees'];
     $next['customers'] = $r['customers'];
     $next['status'] = $r['status'] <= 2 ? 'active' : 'closed';
     $next['custom_tooltip'] = '<center><b>' . __('Meeting') . '</b></center><br>' . Utils_TooltipCommon::format_info_tooltip($inf2) . '<hr>' . CRM_ContactsCommon::get_html_record_info($r['created_by'], $r['created_on'], null, null);
     return $next;
 }
开发者ID:62BRAINS,项目名称:EPESI,代码行数:101,代码来源:MeetingCommon_0.php


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