本文整理汇总了PHP中Project::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::getId方法的具体用法?PHP Project::getId怎么用?PHP Project::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Project
的用法示例。
在下文中一共展示了Project::getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: workspace_toxml
private function workspace_toxml(Project $ws, $activeProjects)
{
$parentIds = '';
$i = 1;
$pid = $ws->getPID($i);
while ($pid != $ws->getId() && $pid != 0 && $i <= 10) {
$coma = $parentIds == '' ? '' : ',';
if (in_array($pid, $activeProjects)) {
$parentIds .= $coma . $pid;
}
$i++;
$pid = $ws->getPID($i);
}
$this->instance->startElement('workspace');
$this->instance->startElement('id');
$this->instance->text($ws->getId());
$this->instance->endElement();
$this->instance->startElement('name');
$this->instance->text($ws->getName());
$this->instance->endElement();
$this->instance->startElement('description');
$this->instance->text($ws->getDescription());
$this->instance->endElement();
$this->instance->startElement('parentids');
$this->instance->text($parentIds);
$this->instance->endElement();
$this->instance->endElement();
}
示例2: render
/**
* Renders the chart
* @param IUser $logged_user
* @return string
*/
function render(IUser $logged_user)
{
$db_result = DB::execute("SELECT milestone_id, COUNT(*) as count FROM " . TABLE_PREFIX . "project_objects WHERE project_id = ? AND type='Task' AND state >= ? AND visibility >= ? GROUP BY milestone_id", $this->project->getId(), STATE_VISIBLE, $logged_user->getMinVisibility());
$array_result = $db_result instanceof DBResult ? $db_result->toArrayIndexedBy('milestone_id') : false;
if (is_foreachable($array_result)) {
$pie_chart = new PieChart('400px', '400px', 'milestone_eta_report_pie_chart_placeholder');
$this->serie_array = array();
$this->milestones = array();
// Set data for the rest
foreach ($array_result as $serie_data) {
$point = new ChartPoint('1', $serie_data['count']);
$serie = new ChartSerie($point);
if (intval($serie_data['milestone_id'])) {
$milestone = new RemediaMilestone(intval($serie_data['milestone_id']));
$label = PieChart::makeShortForPieChart($milestone->getName());
$this->milestones[] = $milestone;
} else {
$label = lang('No Milestone');
}
//if
$serie->setOption('label', $label);
$this->serie_array[] = $serie;
}
//foreach
$pie_chart->addSeries($this->serie_array);
return $pie_chart->render();
} else {
return '<p class="empty_slate">' . lang('There are no milestones in this project.') . '</p>';
}
//if
}
示例3: getAlreadyExistingTracker
private function getAlreadyExistingTracker()
{
foreach ($this->reserved_names as $itemname) {
if ($this->tracker_factory->isShortNameExists($itemname, $this->project->getId())) {
return $itemname;
}
}
}
示例4: getSearchConditions
/**
* Prepare search conditions string based on input params
*
* @param string $search_for Search string
* @param Project $project Search in this project
* @return array
*/
function getSearchConditions($search_for, Project $project, $include_private = false)
{
if ($include_private) {
return DB::prepareString('MATCH (`content`) AGAINST (? IN BOOLEAN MODE) AND `project_id` = ?', array($search_for, $project->getId()));
} else {
return DB::prepareString('MATCH (`content`) AGAINST (? IN BOOLEAN MODE) AND `project_id` = ? AND `is_private` = ?', array($search_for, $project->getId(), false));
}
// if
}
示例5: isProjectUser
/**
* Check if this user is part of specific project
*
* @param Project $project
* @return boolean
*/
function isProjectUser(Project $project)
{
if (!isset($this->is_project_user_cache[$project->getId()])) {
$project_user = ProjectUsers::findById(array('project_id' => $project->getId(), 'user_id' => $this->getId()));
// findById
$this->is_project_user_cache[$project->getId()] = $project_user instanceof ProjectUser;
}
// if
return $this->is_project_user_cache[$project->getId()];
}
示例6: getImportantProjectMessages
/**
* Return project messages that are marked as important for specific project
*
* @param Project $project
* @param boolean $include_private Include private messages
* @return array
*/
static function getImportantProjectMessages(Project $project, $include_private = false)
{
if ($include_private) {
$conditions = array('`project_id` = ? AND `is_important` = ?', $project->getId(), true);
} else {
$conditions = array('`project_id` = ? AND `is_important` = ? AND `is_private` = ?', $project->getId(), true, false);
}
// if
return self::findAll(array('conditions' => $conditions, 'order' => '`created_on` DESC'));
// findAll
}
示例7: getClosedProjectTickets
/**
* Return closed tickets for specific project
*
* @param Project $project
* @param boolean $include_private Include private tickets
* @return array
*/
static function getClosedProjectTickets(Project $project, $include_private = false)
{
if ($include_private) {
$conditions = array('`project_id` = ? AND `closed_on` > ?', $project->getId(), EMPTY_DATETIME);
} else {
$conditions = array('`project_id` = ? AND `closed_on` > ? AND `is_private` = ?', $project->getId(), EMPTY_DATETIME, false);
}
// if
return self::findAll(array('conditions' => $conditions, 'order' => '`created_on` DESC'));
// findAll
}
示例8: export
/**
*
* @param SimpleXMLElement $root
* Export in XML the list of tracker with a cardwall
*/
public function export(SimpleXMLElement $root)
{
$cardwall_node = $root->addChild(CardwallConfigXml::NODE_CARDWALL);
$trackers_node = $cardwall_node->addChild(CardwallConfigXml::NODE_TRACKERS);
$trackers = $this->tracker_factory->getTrackersByGroupId($this->project->getId());
foreach ($trackers as $tracker) {
$this->addTrackerChild($tracker, $trackers_node);
}
$rng_path = realpath(CARDWALL_BASE_DIR . '/../www/resources/xml_project_cardwall.rng');
$this->xml_validator->validate($cardwall_node, $rng_path);
}
示例9: toJSON
public function toJSON()
{
$json = array();
$json['fields'] = array();
$json['fields']['project'] = array("id" => $this->project->getId());
$json['fields']['summary'] = $this->summary;
$json['fields']['issuetype'] = array("id" => $this->issueType->getId());
$json['fields']['assignee'] = array("name" => $this->assignee->getName());
$json['fields']['reporter'] = array("name" => $this->reporter->getName());
$json['fields']['labels'] = $this->labels;
$json['fields']['description'] = $this->description;
return $json;
}
示例10: adminGitAdminsView
protected function adminGitAdminsView($is_admin_mass_change_allowed)
{
$params = $this->getData();
$presenter = new GitPresenters_AdminGitAdminsPresenter($this->groupId, $is_admin_mass_change_allowed, $this->ugroup_manager->getStaticUGroups($this->project), $this->git_permissions_manager->getCurrentGitAdminUgroups($this->project->getId()));
$renderer = TemplateRendererFactory::build()->getRenderer(dirname(GIT_BASE_DIR) . '/templates');
echo $renderer->renderToString('admin', $presenter);
}
示例11: addUserAsProjectAdmin
public function addUserAsProjectAdmin(Project $project, PFUser $user)
{
$project_id = $this->da->escapeInt($project->getId());
$user_id = $this->da->escapeInt($user->getId());
$sql = "UPDATE user_group\n SET admin_flags = 'A'\n WHERE group_id = {$project_id}\n AND user_id = {$user_id}";
return $this->update($sql);
}
示例12: dashboardSettings
/**
*
* @param SmartyHelper $smartyHelper
* @param Command $prj
* @param int $userid
*/
public static function dashboardSettings(SmartyHelper $smartyHelper, Project $prj, $userid, $teamid)
{
$pluginDataProvider = PluginDataProvider::getInstance();
$pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_ISSUE_SELECTION, $prj->getIssueSelection());
$pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_TEAM_ID, $teamid);
$pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_SESSION_USER_ID, $userid);
$team = TeamCache::getInstance()->getTeam($teamid);
$startT = $team->getDate();
$now = time();
$endT = mktime(23, 59, 59, date('m', $now), date('d', $now), date('Y', $now));
if ($startT > $endT) {
$startT = strtotime('today midnight');
}
//echo "start $startT end $endT<br>";
// Calculate a nice day interval
$nbWeeks = ($endT - $startT) / 60 / 60 / 24;
$interval = ceil($nbWeeks / 20);
$pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_START_TIMESTAMP, $startT);
$pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_END_TIMESTAMP, $endT);
$pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_INTERVAL, $interval);
// save the DataProvider for Ajax calls
$_SESSION[PluginDataProviderInterface::SESSION_ID] = serialize($pluginDataProvider);
// create the Dashboard
$dashboard = new Dashboard('Project' . $prj->getId());
$dashboard->setDomain(IndicatorPluginInterface::DOMAIN_PROJECT);
$dashboard->setCategories(array(IndicatorPluginInterface::CATEGORY_QUALITY, IndicatorPluginInterface::CATEGORY_ACTIVITY, IndicatorPluginInterface::CATEGORY_ROADMAP, IndicatorPluginInterface::CATEGORY_PLANNING, IndicatorPluginInterface::CATEGORY_RISK));
$dashboard->setTeamid($teamid);
$dashboard->setUserid($userid);
$data = $dashboard->getSmartyVariables($smartyHelper);
foreach ($data as $smartyKey => $smartyVariable) {
$smartyHelper->assign($smartyKey, $smartyVariable);
}
}
示例13: getMatchingArtifacts
public function getMatchingArtifacts(PFUser $user, Project $project, array $tracker_ids, Tracker_Hierarchy $hierarchy, Tracker_CrossSearch_Query $query, $excluded_artifact_ids = array())
{
$shared_fields = $this->shared_field_factory->getSharedFields($query->getSharedFields());
$semantic_fields = $query->getSemanticCriteria();
$artifacts_info = $this->dao->searchMatchingArtifacts($user, $project->getId(), $query, $tracker_ids, $shared_fields, $semantic_fields, $this->artifact_link_field_ids_for_column_display, $excluded_artifact_ids);
return $this->result_sorter->buildTreeWithMissingChildren($user, $artifacts_info, $excluded_artifact_ids);
}
示例14: resources_handle_on_project_user_removed
/**
* Handle on_project_user_removed event
*
* @param Project $project
* @param User $user
* @return null
*/
function resources_handle_on_project_user_removed($project, $user)
{
$rows = db_execute('SELECT id FROM ' . TABLE_PREFIX . 'project_objects WHERE project_id = ?', $project->getId());
if (is_foreachable($rows)) {
$object_ids = array();
foreach ($rows as $row) {
$object_ids[] = (int) $row['id'];
}
// foreach
$user_id = $user->getId();
// Assignments cleanup
db_execute('DELETE FROM ' . TABLE_PREFIX . 'assignments WHERE user_id = ? AND object_id IN (?)', $user_id, $object_ids);
cache_remove('object_starred_by_' . $user_id);
cache_remove('object_assignments_*');
cache_remove('object_assignments_*_rendered');
// Starred objects cleanup
db_execute('DELETE FROM ' . TABLE_PREFIX . 'starred_objects WHERE user_id = ? AND object_id IN (?)', $user_id, $object_ids);
cache_remove('object_starred_by_' . $user_id);
// Subscriptions cleanup
db_execute('DELETE FROM ' . TABLE_PREFIX . 'subscriptions WHERE user_id = ? AND parent_id IN (?)', $user_id, $object_ids);
cache_remove('user_subscriptions_' . $user_id);
// remove pinned project
PinnedProjects::unpinProject($project, $user);
}
// if
}
示例15: getAllProjectPages
/**
* Return array of all pages for project
*
* @param Project
* @return ProjectLinks
*/
static function getAllProjectPages(Project $project)
{
trace(__FILE__, 'getAllProjectPages():begin');
$conditions = array('`project_id` = ?', $project->getId());
return self::findAll(array('conditions' => $conditions, 'order' => '`id` ASC'));
// findAll
trace(__FILE__, 'getAllProjectPages():end');
}