本文整理汇总了PHP中Planning类的典型用法代码示例。如果您正苦于以下问题:PHP Planning类的具体用法?PHP Planning怎么用?PHP Planning使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Planning类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:nickl-,项目名称:tuleap,代码行数:8,代码来源:aPlanning.php
示例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);
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:RawBoardBuilder.class.php
示例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;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:15,代码来源:ConfigFactory.class.php
示例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;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:ShortAccessFactory.class.php
示例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;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:22,代码来源:PaneContentPresenter.class.php
示例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;
}
开发者ID:geldarr,项目名称:hack-space,代码行数:25,代码来源:planning.class.php
示例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);
}
}
}
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:17,代码来源:XMLExporter.class.php
示例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);
}
开发者ID:nickl-,项目名称:tuleap,代码行数:17,代码来源:ViewBuilder.class.php
示例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;
}
开发者ID:nterray,项目名称:tuleap,代码行数:11,代码来源:Item.class.php
示例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();
}
开发者ID:geldarr,项目名称:hack-space,代码行数:54,代码来源:tickettask.class.php
示例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);
}
开发者ID:nickl-,项目名称:tuleap,代码行数:28,代码来源:Item.class.php
示例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);
}
开发者ID:stweil,项目名称:glpi,代码行数:18,代码来源:rssfeed.class.php
示例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]);
}
开发者ID:pkdevbox,项目名称:tuleap,代码行数:9,代码来源:agiledashboardPlugin.class.php
示例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"]));
开发者ID:UnidadInformaticaSERVIUVI,项目名称:Administrador-de-Inventario,代码行数:67,代码来源:config.class.php
示例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);
}
开发者ID:InfotelGLPI,项目名称:tasklists,代码行数:31,代码来源:task.class.php
示例16: showForm
/** form for Task
*
* @param $ID Integer : Id of the task
* @param $options array
* - parent Object : the object
**/
function showForm($ID, $options = array())
{
global $DB, $CFG_GLPI;
$rand_template = mt_rand();
$rand_text = mt_rand();
$rand_type = mt_rand();
$rand_time = mt_rand();
if (isset($options['parent']) && !empty($options['parent'])) {
$item = $options['parent'];
}
$fkfield = $item->getForeignKeyField();
if ($ID > 0) {
$this->check($ID, READ);
} else {
// Create item
$options[$fkfield] = $item->getField('id');
$this->check(-1, CREATE, $options);
}
$rand = mt_rand();
$this->showFormHeader($options);
$canplan = !$item->isStatusExists(CommonITILObject::PLANNED) || $item->isAllowedStatus($item->fields['status'], CommonITILObject::PLANNED);
$rowspan = 5;
if ($this->maybePrivate()) {
$rowspan++;
}
if (isset($this->fields["state"])) {
$rowspan++;
}
echo "<tr class='tab_bg_1'>";
echo "<td rowspan='{$rowspan}' style='width:100px'>" . __('Description') . "</td>";
echo "<td rowspan='{$rowspan}' style='width:50%' id='content{$rand_text}'>" . "<textarea name='content' style='width: 95%; height: 160px' id='task{$rand_text}'>" . $this->fields["content"] . "</textarea>";
echo Html::scriptBlock("\$(document).ready(function() { \$('#content{$rand}').autogrow(); });");
echo "</td>";
echo "<input type='hidden' name='{$fkfield}' value='" . $this->fields[$fkfield] . "'>";
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td style='width:100px'>" . _n('Task template', 'Task templates', 1) . "</td><td>";
TaskTemplate::dropdown(array('value' => 0, 'entity' => $this->getEntityID(), 'rand' => $rand_template, 'on_change' => 'tasktemplate_update(this.value)'));
echo "</td>";
echo "</tr>";
echo Html::scriptBlock('
function tasktemplate_update(value) {
jQuery.ajax({
url: "' . $CFG_GLPI["root_doc"] . '/ajax/task.php",
type: "POST",
data: {
tasktemplates_id: value
}
}).done(function(datas) {
datas.taskcategories_id = isNaN(parseInt(datas.taskcategories_id)) ? 0 : parseInt(datas.taskcategories_id);
datas.actiontime = isNaN(parseInt(datas.actiontime)) ? 0 : parseInt(datas.actiontime);
$("#task' . $rand_text . '").html(datas.content);
$("#dropdown_taskcategories_id' . $rand_type . '").select2("val", parseInt(datas.taskcategories_id));
$("#dropdown_actiontime' . $rand_time . '").select2("val", parseInt(datas.actiontime));
});
}
');
if ($ID > 0) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Date') . "</td>";
echo "<td>";
Html::showDateTimeField("date", array('value' => $this->fields["date"], 'timestep' => 1, 'maybeempty' => false));
echo "</tr>";
} else {
echo "<tr class='tab_bg_1'>";
echo "<td colspan='2'> ";
echo "</tr>";
}
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Category') . "</td><td>";
TaskCategory::dropdown(array('value' => $this->fields["taskcategories_id"], 'rand' => $rand_type, 'entity' => $item->fields["entities_id"], 'condition' => "`is_active` = '1'"));
echo "</td></tr>\n";
if (isset($this->fields["state"])) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Status') . "</td><td>";
Planning::dropdownState("state", $this->fields["state"]);
echo "</td></tr>\n";
}
if ($this->maybePrivate()) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Private') . "</td>";
echo "<td>";
Dropdown::showYesNo('is_private', $this->fields["is_private"]);
echo "</td>";
echo "</tr>";
}
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Duration') . "</td><td>";
$toadd = array();
for ($i = 9; $i <= 100; $i++) {
$toadd[] = $i * HOUR_TIMESTAMP;
}
Dropdown::showTimeStamp("actiontime", array('min' => 0, 'max' => 8 * HOUR_TIMESTAMP, 'value' => $this->fields["actiontime"], 'rand' => $rand_time, 'addfirstminutes' => true, 'inhours' => true, 'toadd' => $toadd));
//.........这里部分代码省略.........
开发者ID:glpi-project,项目名称:glpi,代码行数:101,代码来源:commonitiltask.class.php
示例17: getAvailablePlanningTrackers
/**
* Retrieve the project trackers that can be used as planning trackers.
*
* @param Planning $planning The planning for which we want to know the available trackers.
*
* @return Array of Tracker
*/
public function getAvailablePlanningTrackers(Planning $planning)
{
$planning_trackers = array($planning->getPlanningTracker());
foreach ($this->dao->searchNonPlanningTrackersByGroupId($planning->getGroupId()) as $row) {
$planning_trackers[] = $this->tracker_factory->getInstanceFromRow($row);
}
return $planning_trackers;
}
开发者ID:nterray,项目名称:tuleap,代码行数:15,代码来源:PlanningFactory.class.php
示例18: getPlanningId
public function getPlanningId()
{
return $this->planning->getId();
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:4,代码来源:VirtualTopMilestone.class.php
示例19: showTimeline
//.........这里部分代码省略.........
echo "<img src='{$pics_url}/" . $item_i['requesttypes_id'] . ".png' title='' class='h_requesttype' />";
}
if (isset($item_i['content'])) {
$content = $item_i['content'];
$content = linkUrlsInTrustedHtml($content);
//$content = nl2br($content);
$long_text = "";
if (substr_count($content, "<br") > 30 || strlen($content) > 2000) {
$long_text = "long_text";
}
echo "<div class='item_content {$long_text}'>";
echo "<p>{$content}</p>";
if (!empty($long_text)) {
echo "<p class='read_more'>";
echo "<a class='read_more_button'>.....</a>";
echo "</p>";
}
echo "</div>";
}
echo "<div class='b_right'>";
if (isset($item_i['solutiontypes_id']) && !empty($item_i['solutiontypes_id'])) {
echo Dropdown::getDropdownName("glpi_solutiontypes", $item_i['solutiontypes_id']) . "<br>";
}
if (isset($item_i['taskcategories_id']) && !empty($item_i['taskcategories_id'])) {
echo Dropdown::getDropdownName("glpi_taskcategories", $item_i['taskcategories_id']) . "<br>";
}
if (isset($item_i['actiontime']) && !empty($item_i['actiontime'])) {
echo "<span class='actiontime'>";
echo Html::timestampToString($item_i['actiontime'], false);
echo "</span>";
}
if (isset($item_i['state'])) {
echo "<span class='state state_" . $item_i['state'] . "'>";
echo Planning::getState($item_i['state']);
echo "</span>";
}
if (isset($item_i['begin'])) {
echo "<span class='planification'>";
echo Html::convDateTime($item_i["begin"]);
echo " ⇒ ";
echo Html::convDateTime($item_i["end"]);
echo "</span>";
}
if (isset($item_i['users_id_tech'])) {
echo "<div class='users_id_tech'>";
$user->getFromDB($item_i['users_id_tech']);
echo "<div class='tooltip_picture_border'>";
echo "<img class='user_picture' alt=\"" . __s('Picture') . "\" src='" . User::getThumbnailURLForPicture($user->fields['picture']) . "'>";
echo "</div>";
echo $user->getLink();
echo "</div>";
}
// show "is_private" icon
if (isset($item_i['is_private']) && $item_i['is_private']) {
echo "<div class='private'>" . __('Private') . "</div>";
}
echo "</div>";
// b_right
if ($item['type'] == 'Document_Item') {
$filename = $item_i['filename'];
$ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
echo "<img src='";
if (empty($filename)) {
$filename = $item_i['name'];
}
if (file_exists(GLPI_ROOT . "/pics/icones/{$ext}-dist.png")) {
开发者ID:jose-martins,项目名称:glpi,代码行数:67,代码来源:ticket.class.php
示例20: constructEventsArray
/**
* Prepare a set of events for jquery fullcalendar.
* Call populatePlanning functions for all $CFG_GLPI['planning_types'] types
*
* @since 9.1
*
* @param array $options: must contains this keys :
* - begin : planning start .
* (should be an ISO_8601 date, but could be anything wo can be parsed by strtotime)
* - end : planning end .
* (should be an ISO_8601 date, but could be anything wo can be parsed by strtotime)
* @return array $events : array with events in fullcalendar.io format
*/
static function constructEventsArray($options = array())
{
global $CFG_GLPI;
$param['start'] = '';
$param['end'] = '';
if (is_array($options) && count($options)) {
foreach ($options as $key => $val) {
$param[$key] = $val;
}
}
$param['begin'] = date("Y-m-d H:i:s", strtotime($param['start']));
$param['end'] = date("Y-m-d H:i:s", strtotime($param['end']));
$raw_events = array();
foreach ($CFG_GLPI['planning_types'] as $planning_type) {
if ($_SESSION['glpi_plannings']['filters'][$planning_type]['display']) {
$event_type_color = $_SESSION['glpi_plannings']['filters'][$planning_type]['color'];
foreach ($_SESSION['glpi_plannings']['plannings'] as $actor => $actor_params) {
$actor_params['event_type_color'] = $event_type_color;
$actor_params['planning_type'] = $planning_type;
self::constructEventsArraySingleLine($actor, array_merge($param, $actor_params), $raw_events);
}
}
}
// construct events (in fullcalendar format)
$events = array();
foreach ($raw_events as $event) {
$users_id = isset($event['users_id_tech']) && !empty($event['users_id_tech']) ? $event['users_id_tech'] : $event['users_id'];
$content = Planning::displayPlanningItem($event, $users_id, 'in', true);
$begin = date('c', strtotime($event['begin']));
$end = date('c', strtotime($event['end']));
// retreive all day events
if (strpos($event['begin'], "00:00:00") != false && (strtotime($event['end']) - strtotime($event['begin'])) % DAY_TIMESTAMP == 0) {
$begin = date('Y-m-d', strtotime($event['begin']));
$end = date('Y-m-d', strtotime($event['end']));
}
$index_color = array_search("user_{$users_id}", array_keys($_SESSION['glpi_plannings']));
$events[] = array('title' => $event['name'], 'content' => $content, 'start' => $begin, 'end' => $end, 'editable' => isset($event['editable']) ? $event['editable'] : false, 'color' => empty($event['color']) ? Planning::$palette_bg[$index_color] : $event['color'], 'borderColor' => empty($event['event_type_color']) ? self::$event_type_color[$event['itemtype']] : $event['event_type_color'], 'textColor' => Planning::$palette_fg[$index_color], 'typeColor' => empty($event['event_type_color']) ? self::$event_type_color[$event['itemtype']] : $event['event_type_color'], 'url' => isset($event['url']) ? $event['url'] : "", 'ajaxurl' => isset($event['ajaxurl']) ? $event['ajaxurl'] : "", 'itemtype' => $event['itemtype'], 'parentitemtype' => isset($event['parentitemtype']) ? $event['parentitemtype'] : "", 'items_id' => $event['id'], 'priority' => isset($event['priority']) ? $event['priority'] : "");
}
return $events;
}
开发者ID:korial29,项目名称:glpi,代码行数:53,代码来源:planning.class.php
注:本文中的Planning类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论