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


PHP UsersHelper::getRole方法代码示例

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


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

示例1: Copyright

<?php

/*------------------------------------------------------------------------
# Cobalt
# ------------------------------------------------------------------------
# @author Cobalt
# @copyright Copyright (C) 2012 cobaltcrm.org All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Website: http://www.cobaltcrm.org
-------------------------------------------------------------------------*/
// no direct access
defined('_CEXEC') or die('Restricted access');
$convo = $this->conversation;
echo '<div class="media" id="convo_entry_' . $convo['id'] . '">';
if (UsersHelper::getRole() == "exec" || $convo['author'] == UsersHelper::getUserId()) {
    echo '<div class="btn-group pull-right"><a class="btn" href="javascript:void(0);" onclick="editConvoEntry(' . $convo['id'] . ')"><i class="glyphicon glyphicon-pencil"></i></a><a class="btn" href="javascript:void(0);" onclick="trashConvoEntry(' . $convo['id'] . ')"><i class="glyphicon glyphicon-trash"></i></a></div>';
}
echo '<div class="pull-left"><img class="media-object widget" src="' . $convo['owner_avatar'] . '" /></div>';
echo '<div class="media-body">';
echo '<h4 class="media-heading">' . $convo['owner_first_name'] . ' ' . $convo['owner_last_name'] . '</h4>';
echo nl2br($convo['conversation']);
echo '</div>';
echo '<hr /></div>';
开发者ID:houzhenggang,项目名称:cobalt,代码行数:23,代码来源:conversation_entry.php

示例2: array

    ?>
                         <optgroup label="<?php 
    echo TextHelper::_('COBALT_MEMBERS');
    ?>
" class="member" id="member" >
                            <?php 
    $member = array();
    $member[] = JHTML::_('select.option', UsersHelper::getUserId(), TextHelper::_('COBALT_ME'));
    echo JHtml::_('select.options', $member, 'value', 'text', $user_filter, true);
    ?>
                            <?php 
    echo JHtml::_('select.options', $this->user_names, 'value', 'text', $user_filter, true);
    ?>
                        </optgroup>
                        <?php 
    if (UsersHelper::getRole() == 'exec') {
        ?>
                        <optgroup label="<?php 
        echo TextHelper::_('COBALT_TEAM');
        ?>
" class="team" id="team" >
                            <?php 
        echo JHtml::_('select.options', $this->team_names, 'value', 'text', $user_filter, true);
        ?>
                        </optgroup>
                        <?php 
    }
    ?>
                    </select>
                </th>
                <th></th>
开发者ID:houzhenggang,项目名称:cobalt,代码行数:31,代码来源:sales_pipeline_header.php

示例3:

        <?php 
if ($app->input->get('view') != "print") {
    ?>
        <div class='alert alert-info'>
            <?php 
    echo TextHelper::_('COBALT_SHOW_TASKS_FOR');
    ?>
:
            <span class="dropdown">
                <a class="dropdown-toggle" href="#" data-toggle="dropdown" role="button" href="javascript:void(0);" id="event_user_link" ><?php 
    echo TextHelper::_('COBALT_ME');
    ?>
</a>
                <ul class="dropdown-menu" role="menu" aria-labelledby="event_user_link">
                    <?php 
    $user_role = UsersHelper::getRole();
    $user_id = UsersHelper::getUserId();
    ?>
                    <li><a class="filter_user_<?php 
    echo $user_id;
    ?>
" onclick="Task.updateEventList(<?php 
    echo $user_id;
    ?>
,0)" ><?php 
    echo TextHelper::_('COBALT_ME');
    ?>
</a></li>
                    <?php 
    if ($user_role != 'basic') {
        ?>
开发者ID:houzhenggang,项目名称:cobalt,代码行数:31,代码来源:event_dock.php

示例4: isset

?>
"
                                        name="address_country"
                                        value="<?php 
echo isset($this->company->address_country) ? $this->company->address_country : "";
?>
"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="tab-pane fade in" id="Assignment">
            <?php 
if (UsersHelper::getRole() == 'exec' || UsersHelper::getRole() == "manager" || !($this->company->id > 0) || array_key_exists('owner_id', $this->company) && UsersHelper::getUserId() == $this->company->owner_id || UsersHelper::isAdmin()) {
    ?>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="control-label" for="">
                            <?php 
    echo ucwords(TextHelper::_('COBALT_COMPANY_OWNER'));
    ?>
                        </label>
                        <div class="controls">
                            <?php 
    echo DropdownHelper::generateDropdown('owner', $ownerId, 'company');
    ?>
                        </div>
                    </div>
开发者ID:houzhenggang,项目名称:cobalt,代码行数:31,代码来源:edit.php

示例5:

?>
"></td>
            <td>
                <select class="form-control filter_input" name="owner_id">
                    <?php 
if (UsersHelper::getRole() != "basic") {
    ?>
                        <option value=""><?php 
    echo TextHelper::_('COBALT_ALL');
    ?>
</option>
                    <?php 
}
?>
                    <?php 
if (UsersHelper::getRole() != "basic") {
    ?>
                        <?php 
    $user_filter = $this->state->get('Deal.' . str_replace('_filter', '', $app->input->get('layout')) . '_owner_id');
    ?>
                        <?php 
    $team_filter = $this->state->get('Deal.' . str_replace('_filter', '', $app->input->get('layout')) . '_owner_id');
    ?>
                        <optgroup label="<?php 
    echo TextHelper::_('COBALT_TEAM');
    ?>
" class="team">
                            <?php 
    echo JHtml::_('select.options', $this->team_names, 'value', 'text', $user_filter, true);
    ?>
                        </optgroup>
开发者ID:houzhenggang,项目名称:cobalt,代码行数:31,代码来源:deal_milestones.php

示例6: getActivity

    public static function getActivity()
    {
        $db = \Cobalt\Container::fetch('db');
        $query = $db->getQuery(true);
        $query->select('h.*, CONCAT(u.first_name," ", u.last_name) AS owner_name, c.name as company_name, CONCAT(p.first_name," ", p.last_name) AS person_name,
                        d.name as deal_name, e.name as event_name, note_cat.name as notes_category_name,
                        event_cat.name as events_category_name, old_event_cat.name as events_category_name_old, old_note_cat.name AS notes_category_name_old,
                        doc.name AS document_name,status.name AS deal_status_name_old, status2.name AS deal_status_name,deal_source.name AS deal_source_name_old,deal_source_2.name AS deal_source_name,
                        deal_stage.name AS deal_stage_name_old,deal_stage_2.name AS deal_stage_name,CONCAT(deal_owner.first_name," ",deal_owner.last_name) AS deal_owner_name_old,
                        CONCAT(deal_owner_2.first_name," ",deal_owner_2.last_name) AS deal_owner_name

                        ');
        $query->from('#__history AS h');
        $query->leftJoin('#__users AS u ON u.id = h.user_id');
        $query->leftJoin('#__companies AS c ON c.id = h.type_id AND h.type="company"');
        $query->leftJoin('#__notes AS n ON n.id = h.type_id AND h.type="note"');
        $query->leftJoin('#__deals AS d on d.id = h.type_id AND h.type="deal"');
        $query->leftJoin('#__people AS p on p.id = h.type_id AND h.type="person"');
        $query->leftJoin('#__goals AS g on g.id = h.type_id AND h.type="goal"');
        $query->leftJoin('#__events AS e on e.id = h.type_id AND h.type="event"');
        $query->leftJoin('#__reports AS r on r.id = h.type_id AND h.type="report"');
        $query->leftJoin('#__documents AS doc ON doc.id = h.type_id AND h.type="document"');
        $query->leftJoin('#__notes_categories as note_cat ON note_cat.id = h.new_value AND h.field="category_id" AND h.type="notes"');
        $query->leftJoin('#__events_categories as event_cat ON event_cat.id = h.new_value AND h.field="category_id" AND h.type="events"');
        $query->leftJoin('#__notes_categories as old_note_cat ON old_note_cat.id = h.old_value AND h.field="category_id" AND h.type="notes"');
        $query->leftJoin('#__events_categories as old_event_cat ON old_event_cat.id = h.old_value AND h.field="category_id" AND h.type="events"');
        $query->leftJoin("#__deal_status AS status ON status.id = h.old_value AND h.type='deal'");
        $query->leftJoin("#__deal_status AS status2 ON status2.id = h.new_value AND h.type='deal'");
        $query->leftJoin("#__sources AS deal_source ON deal_source.id = h.old_value AND h.type='deal'");
        $query->leftJoin("#__sources AS deal_source_2 ON deal_source_2.id = h.new_value AND h.type='deal'");
        $query->leftJoin("#__stages AS deal_stage ON deal_stage.id = h.old_value AND h.type='deal'");
        $query->leftJoin("#__stages AS deal_stage_2 ON deal_stage_2.id = h.new_value AND h.type='deal'");
        $query->leftJoin("#__users AS deal_owner ON deal_owner.id = h.old_value AND h.type='deal'");
        $query->leftJoin("#__users AS deal_owner_2 ON deal_owner_2.id = h.new_value AND h.type='deal'");
        $member_id = UsersHelper::getUserId();
        $member_role = UsersHelper::getRole();
        $team_id = UsersHelper::getTeamId();
        if ($member_role != 'exec') {
            //manager filter
            if ($member_role == 'manager') {
                $query->where('u.team_id = ' . $team_id);
            } else {
                //basic user filter
                $query->where(array('h.user_id = ' . $member_id));
            }
        }
        //TODO: Add assignees to the display (massive left join)
        $query->where('h.field!="assignee_id" AND h.field!="repeats"');
        $query->order('h.date DESC');
        if (self::$limit != null) {
            $query .= " LIMIT " . self::$limit;
        } else {
            $query .= " LIMIT 10";
        }
        $db->setQuery($query);
        $activity = $db->loadObjectList();
        return $activity;
    }
开发者ID:houzhenggang,项目名称:cobalt,代码行数:58,代码来源:ActivityHelper.php

示例7:

 if ($event['type'] == 'task') {
     $due_date = $event['due_date'] != '0000-00-00 00:00:00' ? DateHelper::formatDate($event['due_date']) : TextHelper::_('COBALT_NA');
     $time = $event['due_date_hour'];
 } else {
     $due_date = DateHelper::formatDate($event['start_time']);
     $time = $event['start_time_hour'];
 }
 $id = (array_key_exists('parent_id', $event) && $event['parent_id']) != 0 ? $event['parent_id'] : $event['id'];
 echo '<tr id="list_row_' . $id . '" class="cobalt_row_' . $k . '">';
 if ($event['completed'] == 1) {
     $completed = "line-through";
 } else {
     $completed = "";
 }
 echo '<td>';
 if (UsersHelper::getLoggedInUser()->id == $event['owner_id'] || UsersHelper::getLoggedInUser()->id == $event['assignee_id'] || UsersHelper::isAdmin() || UsersHelper::getRole() == "exec") {
     echo '<input type="checkbox" name="ids[]" value="' . $id . '" />';
 }
 echo '</td>';
 echo '<td><div class="dropdown"><a data-toggle="dropdown" role="button" class="dropdown-toggle ' . $completed . '" id="event_menu_' . $event['id'] . '_link" >';
 echo $event['name'];
 echo '</a>';
 echo '<ul class="dropdown-menu" role="menu" aria-labelledby="event_menu_' . $event['id'] . '_link">';
 if ($event['completed'] == 1) {
     echo '<li><a href="javascript:void(0);" onclick="Calendar.markEventIncomplete(this)" >' . TextHelper::_('COBALT_MARK_INCOMPLETE') . '</a></li>';
 } else {
     echo '<li><a href="javascript:void(0);" onclick="Calendar.markEventComplete(this)" >' . TextHelper::_('COBALT_MARK_COMPLETE') . '</a></li>';
     echo '<li><a href="javascript:void(0);" onclick="Calendar.postponeEvent(this,1)" >' . TextHelper::_('COBALT_POSTPONE_1_DAY') . '</a></li>';
     echo '<li><a href="javascript:void(0);" onclick="Calendar.postponeEvent(this,7)" >' . TextHelper::_('COBALT_POSTPONE_7_DAYS') . '</a></li>';
 }
 $id = (array_key_exists('parent_id', $event) && $event['parent_id']) != 0 ? $event['parent_id'] : $event['id'];
开发者ID:houzhenggang,项目名称:cobalt,代码行数:31,代码来源:list.php


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