本文整理汇总了PHP中Tracker::getContributorField方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracker::getContributorField方法的具体用法?PHP Tracker::getContributorField怎么用?PHP Tracker::getContributorField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracker
的用法示例。
在下文中一共展示了Tracker::getContributorField方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkPermissionValidity
private function checkPermissionValidity(Tracker_Permission_PermissionRequest $request, Tracker $tracker)
{
if ($request->containsPermissionType(Tracker_Permission_Command::PERMISSION_ASSIGNEE) != null && $tracker->getContributorField() === null) {
$GLOBALS['Response']->addFeedback(Feedback::ERROR, $GLOBALS['Language']->getText('plugin_tracker_admin_permissions', 'no_assignee_semantic', array(TRACKER_BASE_URL . '/?' . http_build_query(array('func' => 'admin-semantic', 'tracker' => $tracker->getId())), $GLOBALS['Language']->getText('plugin_tracker_admin_semantic', 'contributor_label'))), CODENDI_PURIFIER_DISABLED);
return false;
}
if ($request->getPermissionType(ProjectUGroup::PROJECT_ADMIN)) {
return false;
}
return true;
}
示例2: getMatchingIdsInDb
protected function getMatchingIdsInDb(DataAccessObject $dao, PermissionsManager $permissionManager, Tracker $tracker, PFUser $user, array $criteria)
{
$dump_criteria = array();
foreach ($criteria as $c) {
$dump_criteria[$c->field->getName()] = $c->field->getCriteriaValue($c);
}
$dao->logStart(__METHOD__, json_encode(array('user' => $user->getUserName(), 'project' => $tracker->getGroupId(), 'query' => $dump_criteria, 'trackers' => array($tracker->getId()))));
$matching_ids = array();
$group_id = $tracker->getGroupId();
$permissions = $permissionManager->getPermissionsAndUgroupsByObjectid($tracker->getId());
$contributor_field = $tracker->getContributorField();
$contributor_field_id = $contributor_field ? $contributor_field->getId() : null;
$additional_from = array();
$additional_where = array();
foreach ($criteria as $c) {
if ($f = $c->getFrom()) {
$additional_from[] = $f;
}
if ($w = $c->getWhere()) {
$additional_where[] = $w;
}
}
$matching_ids['id'] = '';
$matching_ids['last_changeset_id'] = '';
$matching_ids_result = $dao->searchMatchingIds($group_id, $tracker->getId(), $additional_from, $additional_where, $user, $permissions, $contributor_field_id);
if ($matching_ids_result) {
$matching_ids = $matching_ids_result->getRow();
if ($matching_ids) {
if (substr($matching_ids['id'], -1) === ',') {
$matching_ids['id'] = substr($matching_ids['id'], 0, -1);
}
if (substr($matching_ids['last_changeset_id'], -1) === ',') {
$matching_ids['last_changeset_id'] = substr($matching_ids['last_changeset_id'], 0, -1);
}
}
}
$nb_matching = $matching_ids['id'] ? substr_count($matching_ids['id'], ',') + 1 : 0;
$dao->logEnd(__METHOD__, $nb_matching);
return $matching_ids;
}