本文整理汇总了PHP中Planning类的典型用法代码示例。如果您正苦于以下问题:PHP Planning类的具体用法?PHP Planning怎么用?PHP Planning使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Planning类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build
public function build()
{
$planning = new Planning($this->id, $this->name, $this->group_id, $this->backlog_title, $this->plan_title, $this->backlog_tracker_id, $this->planning_tracker_id);
if ($this->planning_tracker) {
$planning->setPlanningTracker($this->planning_tracker);
}
return $planning;
}
示例2: getMappingCollection
private function getMappingCollection(Planning $planning, Cardwall_OnTop_Config_ColumnCollection $columns, Cardwall_FieldProviders_IProvideFieldGivenAnArtifact $field_provider, Cardwall_OnTop_Config $config)
{
$trackers_used_on_cardwall = array();
foreach ($planning->getBacklogTrackers() as $backlog_tracker) {
$trackers_used_on_cardwall[] = $backlog_tracker->getChildren();
}
return $config->getCardwallMappings($this->getIndexedStatusFieldsOf($trackers_used_on_cardwall, $field_provider), $columns);
}
示例3: getOnTopConfigByPlanning
/**
* Returns the cardwall configuration of the given planning
*
* @param Planning $planning
*
* @return Cardwall_OnTop_Config | null
*/
public function getOnTopConfigByPlanning(Planning $planning)
{
$tracker = $planning->getPlanningTracker();
if ($this->getOnTopDao()->isEnabled($tracker->getId())) {
return $this->getOnTopConfig($tracker);
}
return null;
}
示例4: thereIsAtLeastOneBacklogTrackerNotDeleted
private function thereIsAtLeastOneBacklogTrackerNotDeleted(Planning $planning)
{
$there_is_an_active_tracker = false;
foreach ($planning->getBacklogTrackers() as $backlog_tracker) {
$there_is_an_active_tracker = $there_is_an_active_tracker || !$backlog_tracker->isDeleted();
}
return $there_is_an_active_tracker;
}
示例5: __construct
/**
* @param Cardwall_Board $board The board
* @param Cardwall_QrCode $qrcode QrCode to display. false if no qrcode (thus no typehinting)
* @param string $redirect_parameter the redirect paramter to add to various url
* @param Planning $planning The concerned planning
* @param Planning_Milestone $milestone The milestone
*/
public function __construct(Cardwall_Board $board, $qrcode, $redirect_parameter, $switch_display_username_url, $is_display_avatar_selected, Planning $planning, Planning_Milestone $milestone, Cardwall_EffortProgressPresenter $progress_presenter)
{
parent::__construct($board, $qrcode, $redirect_parameter);
$this->nifty = '';
$this->swimline_title = $GLOBALS['Language']->getText('plugin_cardwall', 'swimline_title');
$this->has_swimline_header = true;
$this->switch_display_username_url = $switch_display_username_url;
$this->is_display_avatar_selected = $is_display_avatar_selected;
$this->display_avatar_label = $GLOBALS['Language']->getText('plugin_cardwall', 'display_avatar_label');
$this->display_avatar_title = $GLOBALS['Language']->getText('plugin_cardwall', 'display_avatar_title');
$this->search_cardwall_placeholder = $GLOBALS['Language']->getText('plugin_cardwall', 'search_cardwall_placeholder');
$this->planning_id = $planning->getId();
$this->milestone = $milestone;
$this->progress_presenter = $progress_presenter;
}
示例6: displayTabContentForItem
static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
{
if ($item->getType() == __CLASS__) {
switch ($tabnum) {
case 1:
// all
Planning::showSelectionForm($_POST['type'], $_POST['date'], 'my', 0, $_POST["limititemtype"]);
Planning::showPlanning($_SESSION['glpiID'], $_POST["gID"], $_POST["date"], $_POST["type"], $_POST["limititemtype"]);
break;
case 2:
Planning::showSelectionForm($_POST['type'], $_POST['date'], 'mygroups', 0, $_POST["limititemtype"]);
Planning::showPlanning($_SESSION['glpiID'], 'mine', $_POST["date"], $_POST["type"], $_POST["limititemtype"]);
break;
case 3:
Planning::showSelectionForm($_POST['type'], $_POST['date'], 'users', $_POST["uID"], $_POST["limititemtype"]);
Planning::showPlanning($_POST['uID'], 0, $_POST["date"], $_POST["type"], $_POST["limititemtype"]);
break;
case 4:
Planning::showSelectionForm($_POST['type'], $_POST['date'], 'groups', $_POST["gID"], $_POST["limititemtype"]);
Planning::showPlanning(0, $_POST['gID'], $_POST["date"], $_POST["type"], $_POST["limititemtype"]);
break;
}
}
return true;
}
示例7: exportPermissions
private function exportPermissions(SimpleXMLElement $planning_node, Planning $planning)
{
$ugroups = $this->planning_permissions_manager->getGroupIdsWhoHasPermissionOnPlanning($planning->getId(), $planning->getGroupId(), PlanningPermissionsManager::PERM_PRIORITY_CHANGE);
if (!empty($ugroups)) {
foreach ($ugroups as $ugroup_id) {
if (($ugroup = array_search($ugroup_id, $GLOBALS['UGROUPS'])) !== false && $ugroup_id < 100) {
if (!isset($planning_node->permissions)) {
$permission_nodes = $planning_node->addChild(self::NODE_PERMISSIONS);
}
$permission_node = $permission_nodes->addChild(self::NODE_PERMISSION);
$permission_node->addAttribute('ugroup', $ugroup);
$permission_node->addAttribute('type', PlanningPermissionsManager::PERM_PRIORITY_CHANGE);
unset($permission_node);
}
}
}
}
示例8: build
public function build(User $user, Project $project, Tracker_CrossSearch_Query $cross_search_query, array $already_planned_artifact_ids, $backlog_tracker_id, Planning $planning, $planning_redirect_parameter)
{
$backlog_hierarchy = $this->hierarchy_factory->getHierarchy(array($backlog_tracker_id));
$report = $this->getReport($user);
$criteria = $this->getCriteria($user, $project, $report, $cross_search_query);
$tracker_ids = $backlog_hierarchy->flatten();
$artifacts = $this->getHierarchicallySortedArtifacts($user, $project, $tracker_ids, $cross_search_query, $already_planned_artifact_ids);
// The following lines allows to tailor/rebuild the result before display
// As of today (aug-12), we decided to display everything and to wait for
// user feedback to see if we need to enable one of them.
//$visitor = new Planning_BacklogItemFilterVisitor($backlog_tracker_id, $this->hierarchy_factory, $already_planned_artifact_ids);
//$artifacts = $artifacts->accept($visitor);
//$visitor = new Planning_GroupByParentsVisitor($user);
//$artifacts->accept($visitor);
$backlog_actions_presenter = new Planning_BacklogActionsPresenter($planning->getBacklogTracker(), $planning_redirect_parameter);
return new Planning_SearchContentView($report, $criteria, $artifacts, Tracker_ArtifactFactory::instance(), $this->form_element_factory, $user, $backlog_actions_presenter, $planning, $planning_redirect_parameter);
}
示例9: getAllowedChildrenTypes
/**
* @see Tracker_Artifact::getAllowedChildrenTypes()
*/
public function getAllowedChildrenTypes()
{
$trackers = $this->artifact->getAllowedChildrenTypes();
if ($this->getTracker() == $this->planning->getPlanningTracker()) {
$trackers[] = $this->planning->getBacklogTracker();
}
return $trackers;
}
示例10: pdfForTicket
static function pdfForTicket(PluginPdfSimplePDF $pdf, Ticket $job, $private)
{
global $CFG_GLPI, $DB;
$ID = $job->getField('id');
//////////////Tasks///////////
$RESTRICT = "";
if (!$private) {
// Don't show private'
$RESTRICT = " AND `is_private` = '0' ";
} else {
if (!Session::haveRight("show_full_ticket", "1")) {
// No right, only show connected user private one
$RESTRICT = " AND (`is_private` = '0'\n OR `users_id` ='" . Session::getLoginUserID() . "' ) ";
}
}
$query = "SELECT *\n FROM `glpi_tickettasks`\n WHERE `tickets_id` = '{$ID}'\n {$RESTRICT}\n ORDER BY `date` DESC";
$result = $DB->query($query);
if (!$DB->numrows($result)) {
$pdf->setColumnsSize(100);
$pdf->displayLine(__('No task found.'));
} else {
$pdf->displayTitle("<b>" . TicketTask::getTypeName($DB->numrows($result) . "</b>"));
$pdf->setColumnsSize(20, 20, 20, 20, 20);
$pdf->displayTitle("<b><i>" . __('Type') . "</i></b>", "<b><i>" . __('Date') . "</i></b>", "<b><i>" . __('Duration') . "</i></b>", "<b><i>" . __('Writer') . "</i></b>", "<b><i>" . __('Planning') . "</i></b>");
while ($data = $DB->fetch_array($result)) {
$actiontime = Html::timestampToString($data['actiontime'], false);
$planification = '';
if (empty($data['begin'])) {
if (isset($data["state"])) {
$planification = Planning::getState($data["state"]) . "<br>";
}
$planification .= _e('None');
} else {
if (isset($data["state"])) {
$planification = sprintf(__('%1$s: %2$s'), _x('item', 'State'), Planning::getState($data["state"]));
}
$planificiation = sprintf(__('%1$s - %2$s'), $planification, Html::convDateTime($data["begin"]) . " -> " . Html::convDateTime($data["end"]));
$planificiation = sprintf(__('%1$s - %2$s'), $planification, sprintf(__('%1$s %2$s'), __('By'), getUserName($data["users_id_tech"])));
}
if ($data['taskcategories_id']) {
$lib = Dropdown::getDropdownName('glpi_taskcategories', $data['taskcategories_id']);
} else {
$lib = '';
}
if ($data['is_private']) {
$lib = sprintf(__('%1$s (%2$s)'), $lib, __('Private'));
}
toolbox::logdebug("lib", $data);
$pdf->displayLine(Html::clean($lib), Html::convDateTime($data["date"]), Html::timestampToString($data["actiontime"], 0), Html::clean(getUserName($data["users_id"])), Html::clean($planification), 1);
$pdf->displayText("<b><i>" . sprintf(__('%1$s: %2$s'), __('Description') . "</i></b>", Html::clean($data["content"]), 1));
}
}
$pdf->displaySpace();
}
示例11: appendBacklogTrackerIfRoot
/**
* Allow to create artifacts when the item comes from the planning tracker and if
* the backlog tracker is at the root of the hierarchy.
*
* Example:
* Given I have a planning Epic -> Release
* And Epic has not parent (root of hierarchy)
* Then I can create an Epic right in the release
*
* Counter example:
* Given I have a planning Story -> Sprint
* And I have a hierarchy Epic -> Story
* Then I cannot create Story directly below Sprint
*
* @param array $allowed_trackers
* @return type
*/
private function appendBacklogTrackerIfRoot(array $allowed_trackers)
{
$backlog_tracker = array();
if ($this->getTracker() == $this->planning->getPlanningTracker()) {
$backlog_hierarchy = $this->planning->getBacklogTracker()->getHierarchy();
if ($backlog_hierarchy->isRoot($this->planning->getBacklogTrackerId())) {
$backlog_tracker = array($this->planning->getBacklogTracker());
}
}
return array_merge($allowed_trackers, $backlog_tracker);
}
示例12: getSpecificValueToSelect
/**
* @param $field
* @param $name (default '')
* @param $values (default '')
* @param $options array
**/
static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'refresh_rate':
return Planning::dropdownState($name, $values[$field], false);
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例13: redirectToPlanning
private function redirectToPlanning(Tracker_Artifact $artifact, $requested_planning, Planning $planning, Tracker_Artifact_Redirect $redirect)
{
$redirect_to_artifact = $requested_planning[AgileDashboard_PaneRedirectionExtractor::ARTIFACT_ID];
if ($redirect_to_artifact == -1) {
$redirect_to_artifact = $artifact->getId();
}
$redirect->base_url = '/plugins/agiledashboard/';
$redirect->query_parameters = array('group_id' => $planning->getGroupId(), 'planning_id' => $planning->getId(), 'action' => 'show', 'aid' => $redirect_to_artifact, 'pane' => $requested_planning[AgileDashboard_PaneRedirectionExtractor::PANE]);
}
示例14: showFormUserPrefs
//.........这里部分代码省略.........
$selected = "selected='selected'";
}
echo "<option value='{$key}' {$selected}>" . ucfirst($name) . "</option>";
}
echo Html::scriptBlock("\n function formatLayout(layout) {\n return \" <img src='../pics/layout_\" + layout.id.toLowerCase() + \".png'/>\"\n + \" \" + layout.text;\n }\n \$(\"#layout-selector\").select2({\n formatResult: formatLayout,\n formatSelection: formatLayout,\n escapeMarkup: function(m) { return m; }\n });\n ");
echo "</select>";
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_2'><td>" . __('Enable ticket timeline') . "</td>";
echo "<td>";
Dropdown::showYesNo('ticket_timeline', $data['ticket_timeline']);
echo "</td>";
echo "<td>" . __('Keep tabs replaced by the ticket timeline') . "</td><td>";
Dropdown::showYesNo('ticket_timeline_keep_replaced_tabs', $data['ticket_timeline_keep_replaced_tabs']);
echo "</td></tr>";
if ($oncentral) {
echo "<tr class='tab_bg_1'><th colspan='4'>" . __('Assistance') . "</th></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Private followups by default') . "</td><td>";
Dropdown::showYesNo("followup_private", $data["followup_private"]);
echo "</td><td>" . __('Show new tickets on the home page') . "</td><td>";
if (Session::haveRightsOr("ticket", array(Ticket::READMY, Ticket::READALL, Ticket::READASSIGN))) {
Dropdown::showYesNo("show_jobs_at_login", $data["show_jobs_at_login"]);
} else {
echo Dropdown::getYesNo(0);
}
echo " </td></tr>";
echo "<tr class='tab_bg_2'><td>" . __('Private tasks by default') . "</td><td>";
Dropdown::showYesNo("task_private", $data["task_private"]);
echo "</td><td> " . __('Request sources by default') . "</td><td>";
RequestType::dropdown(array('value' => $data["default_requesttypes_id"], 'name' => "default_requesttypes_id"));
echo "</td></tr>";
echo "<tr class='tab_bg_2'><td>" . __('Tasks state by default') . "</td><td>";
Planning::dropdownState("task_state", $data["task_state"]);
echo "</td><td colspan='2'> </td></tr>";
echo "<tr class='tab_bg_2'><td>" . __('Pre-select me as a technician when creating a ticket') . "</td><td>";
if (!$userpref || Session::haveRight('ticket', Ticket::OWN)) {
Dropdown::showYesNo("set_default_tech", $data["set_default_tech"]);
} else {
echo Dropdown::getYesNo(0);
}
echo "</td><td>" . __('Automatically refresh the list of tickets (minutes)') . "</td><td>";
Dropdown::showNumber('refresh_ticket_list', array('value' => $data["refresh_ticket_list"], 'min' => 1, 'max' => 30, 'step' => 1, 'toadd' => array(0 => __('Never'))));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Priority colors') . "</td>";
echo "<td colspan='3'>";
echo "<table><tr>";
echo "<td>1 ";
Html::showColorField('priority_1', array('value' => $data["priority_1"]));
echo "</td>";
echo "<td>2 ";
Html::showColorField('priority_2', array('value' => $data["priority_2"]));
echo "</td>";
echo "<td>3 ";
Html::showColorField('priority_3', array('value' => $data["priority_3"]));
echo "</td>";
echo "<td>4 ";
Html::showColorField('priority_4', array('value' => $data["priority_4"]));
echo "</td>";
echo "<td>5 ";
Html::showColorField('priority_5', array('value' => $data["priority_5"]));
echo "</td>";
echo "<td>6 ";
Html::showColorField('priority_6', array('value' => $data["priority_6"]));
示例15: getSpecificValueToSelect
/**
* @since version 0.84
*
* @param $field
* @param $name (default '')
* @param $values (default '')
* @param $options array
*
* @return string
**/
static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'priority':
$options['name'] = $name;
$options['value'] = $values[$field];
$options['withmajor'] = 1;
return CommonITILObject::dropdownPriority($options);
case 'visibility':
$options['name'] = $name;
$options['value'] = $values[$field];
return self::dropdownVisibility($options);
case 'state':
return Planning::dropdownState($name, $values[$field], false);
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}