"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "inc/projecttask_ticket.class.php" between
glpi-9.3.3.tgz and glpi-9.4.0.tgz

About: GLPI is an IT and asset management software (Information Resource Manager).

projecttask_ticket.class.php  (glpi-9.3.3.tgz):projecttask_ticket.class.php  (glpi-9.4.0.tgz)
skipping to change at line 166 skipping to change at line 166
if ($canedit) { if ($canedit) {
echo "<div class='firstbloc'>"; echo "<div class='firstbloc'>";
echo "<form name='projecttaskticket_form$rand' id='projecttaskticket_fo rm$rand' echo "<form name='projecttaskticket_form$rand' id='projecttaskticket_fo rm$rand'
method='post' action='".Toolbox::getItemTypeFormURL(__CLASS__)." '>"; method='post' action='".Toolbox::getItemTypeFormURL(__CLASS__)." '>";
echo "<table class='tab_cadre_fixe'>"; echo "<table class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_2'><th colspan='3'>".__('Add a ticket')."</th>< /tr>"; echo "<tr class='tab_bg_2'><th colspan='3'>".__('Add a ticket')."</th>< /tr>";
echo "<tr class='tab_bg_2'><td class='right'>"; echo "<tr class='tab_bg_2'><td class='right'>";
echo "<input type='hidden' name='projecttasks_id' value='$ID'>"; echo "<input type='hidden' name='projecttasks_id' value='$ID'>";
$condition = "`glpi_tickets`.`status` $condition = [
NOT IN ('".implode("', '", 'NOT' => [
array_merge(Ticket::getSolvedStatusAr 'glpi_tickets.status' => array_merge(
ray(), Ticket::getSolvedStatusArray(),
Ticket::getClosedStatusAr Ticket::getClosedStatusArray()
ray()))."')"; )
Ticket::dropdown(['used' => $used, ]
'entity' => $projecttask->getEntityID(), ];
'entity_sons' => $projecttask->isRecursive(), Ticket::dropdown([
'condition' => $condition, 'used' => $used,
'displaywith' => ['id']]); 'entity' => $projecttask->getEntityID(),
'entity_sons' => $projecttask->isRecursive(),
'condition' => $condition,
'displaywith' => ['id']
]);
echo "</td><td width='20%'>"; echo "</td><td width='20%'>";
echo "<a href='".Toolbox::getItemTypeFormURL('Ticket')."?_projecttasks_ id=$ID'>"; echo "<a href='".Toolbox::getItemTypeFormURL('Ticket')."?_projecttasks_ id=$ID'>";
echo __('Create a ticket from this task'); echo __('Create a ticket from this task');
echo "</a>"; echo "</a>";
echo "</td><td class='center'>"; echo "</td><td class='center'>";
echo "<input type='submit' name='add' value=\""._sx('button', 'Add')."\ " class='submit'>"; echo "<input type='submit' name='add' value=\""._sx('button', 'Add')."\ " class='submit'>";
echo "</td></tr>"; echo "</td></tr>";
echo "</table>"; echo "</table>";
skipping to change at line 279 skipping to change at line 285
], ],
] ]
); );
$finished_states_ids = []; $finished_states_ids = [];
foreach ($finished_states_it as $finished_state) { foreach ($finished_states_it as $finished_state) {
$finished_states_ids[] = $finished_state['id']; $finished_states_ids[] = $finished_state['id'];
} }
echo "<tr class='tab_bg_2'><td class='right'>"; echo "<tr class='tab_bg_2'><td class='right'>";
echo Html::hidden('tickets_id', ['value' => $ID]); echo Html::hidden('tickets_id', ['value' => $ID]);
Project::dropdown(['entity' => $ticket->getEntityID(), Project::dropdown([
'entity_sons' => $ticket->isRecursive(), 'entity' => $ticket->getEntityID(),
'condition' => '`glpi_projects`.`projectstates_id` 'entity_sons' => $ticket->isRecursive(),
NOT IN(' . implode($finished_st 'condition' => ['NOT' => ['glpi_projects.projectstates_id' => $fin
ates_ids, ", ") . ')', ished_states_ids]],
'rand' => $rand]); 'rand' => $rand
]);
$p = ['projects_id' => '__VALUE__', $p = ['projects_id' => '__VALUE__',
'entity_restrict' => $ticket->getEntityID(), 'entity_restrict' => $ticket->getEntityID(),
'used' => $used, 'used' => $used,
'rand' => $rand, 'rand' => $rand,
'myname' => "projects"]; 'myname' => "projects"];
Ajax::updateItemOnSelectEvent("dropdown_projects_id$rand", "results_pro jects$rand", Ajax::updateItemOnSelectEvent("dropdown_projects_id$rand", "results_pro jects$rand",
$CFG_GLPI["root_doc"]. $CFG_GLPI["root_doc"].
"/ajax/dropdownProjectTaskTicket.php", "/ajax/dropdownProjectTaskTicket.php",
skipping to change at line 310 skipping to change at line 317
'SELECT' => ['id'], 'SELECT' => ['id'],
'FROM' => Project::getTable(), 'FROM' => Project::getTable(),
'WHERE' => [ 'WHERE' => [
'OR' => [ 'OR' => [
'projectstates_id' => $finished_states_ids, 'projectstates_id' => $finished_states_ids,
'is_template' => 1 'is_template' => 1
] ]
], ],
] ]
); );
$ecluded_projects_ids = []; $excluded_projects_ids = [];
foreach ($excluded_projects_it as $ecluded_project) { foreach ($excluded_projects_it as $excluded_project) {
$ecluded_projects_ids[] = $ecluded_project['id']; $excluded_projects_ids[] = $excluded_project['id'];
} }
echo "<td class='right'>"; echo "<td class='right'>";
echo "<span id='results_projects$rand'>"; echo "<span id='results_projects$rand'>";
ProjectTask::dropdown(['used' => $used, ProjectTask::dropdown([
'entity' => $ticket->getEntityID(), 'used' => $used,
'entity_sons' => $ticket->isRecursive(), 'entity' => $ticket->getEntityID(),
'condition' => '`glpi_projecttasks`.`projectst 'entity_sons' => $ticket->isRecursive(),
ates_id` 'condition' => [
NOT IN(' . implode($finishe 'NOT' => [
d_states_ids, ", ") . ') 'glpi_projecttasks.projectstates_id' => $finished_states_ids
AND `glpi_projecttasks`.`proje ,
cts_id` 'glpi_projecttasks.projects_id' => $excluded_projects_i
NOT IN(' . implode($ecluded ds
_projects_ids, ", ") . ')', ]
'displaywith' => ['id']]); ],
'displaywith' => ['id']
]);
echo "</span>"; echo "</span>";
echo "</td><td width='20%'>"; echo "</td><td width='20%'>";
echo "</td><td class='center'>"; echo "</td><td class='center'>";
echo Html::submit(_sx('button', 'Add'), ['name' => 'add']); echo Html::submit(_sx('button', 'Add'), ['name' => 'add']);
echo "</td></tr>"; echo "</td></tr>";
echo "</table>"; echo "</table>";
Html::closeForm(); Html::closeForm();
echo "</div>"; echo "</div>";
skipping to change at line 365 skipping to change at line 376
if (!isset($_GET["sort"]) || empty($_GET["sort"])) { if (!isset($_GET["sort"]) || empty($_GET["sort"])) {
$_GET["sort"] = "plan_start_date"; $_GET["sort"] = "plan_start_date";
} }
if (isset($_GET["sort"]) && !empty($_GET["sort"]) && isset($columns[$_G ET["sort"]])) { if (isset($_GET["sort"]) && !empty($_GET["sort"]) && isset($columns[$_G ET["sort"]])) {
$sort = "`".$_GET["sort"]."`"; $sort = "`".$_GET["sort"]."`";
} else { } else {
$sort = "`plan_start_date` $order, `name`"; $sort = "`plan_start_date` $order, `name`";
} }
$query = "SELECT `glpi_projecttasks`.*, $iterator = $DB->request([
`glpi_projecttasktypes`.`name` AS tname, 'SELECT' => [
`glpi_projectstates`.`name` AS sname, 'glpi_projecttasks.*',
`glpi_projectstates`.`color`, 'glpi_projecttasktypes.name AS tname',
`father`.`name` AS fname, 'glpi_projectstates.name AS sname',
`father`.`id` AS fID, 'glpi_projectstates.color',
`glpi_projects`.`name` AS projectname, 'father.name AS fname',
`glpi_projects`.`content` AS projectcontent 'father.id AS fID',
FROM `glpi_projecttasks` 'glpi_projects.name AS projectname',
LEFT JOIN `glpi_projecttasktypes` 'glpi_projects.content AS projectcontent'
ON (`glpi_projecttasktypes`.`id` = `glpi_projecttasks`.`pr ],
ojecttasktypes_id`) 'FROM' => 'glpi_projecttasks',
LEFT JOIN `glpi_projectstates` 'LEFT JOIN' => [
ON (`glpi_projectstates`.`id` = `glpi_projecttasks`.`proje 'glpi_projecttasktypes' => [
ctstates_id`) 'ON' => [
LEFT JOIN `glpi_projecttasks` as father 'glpi_projecttasktypes' => 'id',
ON (`father`.`id` = `glpi_projecttasks`.`projecttasks_id`) 'glpi_projecttasks' => 'projecttasktypes_id'
LEFT JOIN `glpi_projecttasks_tickets` ]
ON (`glpi_projecttasks_tickets`.`projecttasks_id` = `glpi_ ],
projecttasks`.`id`) 'glpi_projectstates' => [
LEFT JOIN `glpi_projects` 'ON' => [
ON (`glpi_projecttasks`.`projects_id` = `glpi_projects`.`i 'glpi_projectstates' => 'id',
d`) 'glpi_projecttasks' => 'projectstates_id'
WHERE `glpi_projecttasks_tickets`.`tickets_id` = '$ID' ]
ORDER BY $sort $order"; ],
'glpi_projecttasks AS father' => [
'ON' => [
'father' => 'id',
'glpi_projecttasks' => 'projecttasks_id'
]
],
'glpi_projecttasks_tickets' => [
'ON' => [
'glpi_projecttasks_tickets' => 'projecttasks_id',
'glpi_projecttasks' => 'id'
]
],
'glpi_projects' => [
'ON' => [
'glpi_projecttasks' => 'projects_id',
'glpi_projects' => 'id'
]
]
],
'WHERE' => [
'glpi_projecttasks_tickets.tickets_id' => $ID
],
'ORDERBY' => [
"$sort $order"
]
]);
Session::initNavigateListItems('ProjectTask', Session::initNavigateListItems('ProjectTask',
//TRANS : %1$s is the itemtype name, //TRANS : %1$s is the itemtype name,
// %2$s is the name of the item (u sed for headings of a list) // %2$s is the name of the item (u sed for headings of a list)
sprintf(__('%1$s = %2$s'), $ticket::getT ypeName(1), sprintf(__('%1$s = %2$s'), $ticket::getT ypeName(1),
$ticket->getName())); $ticket->getName()));
if ($result = $DB->query($query)) { if (count($iterator)) {
if ($DB->numrows($result)) { echo "<table class='tab_cadre_fixehov'>";
echo "<table class='tab_cadre_fixehov'>"; echo "<tr><th colspan='10'>".ProjectTask::getTypeName($numrows)."</t
echo "<tr><th colspan='10'>".ProjectTask::getTypeName($numrows)." h>";
</th>"; echo "</tr>";
echo "</tr>";
$header = '<tr>';
$header = '<tr>'; foreach ($columns as $key => $val) {
foreach ($columns as $key => $val) { // Non order column
// Non order column if ($key[0] == '_') {
if ($key[0] == '_') { $header .= "<th>$val</th>";
$header .= "<th>$val</th>"; } else {
} else { $header .= "<th".($sort == "`$key`" ? " class='order_$order'"
$header .= "<th".($sort == "`$key`" ? " class='order_$order : '').">".
'" : '').">". "<a href='javascript:reloadTab(\"sort=$key&amp;ord
"<a href='javascript:reloadTab(\"sort=$key&amp;o er=".
rder=". (($order == "ASC") ?"DESC":"ASC")."&amp;start=0
(($order == "ASC") ?"DESC":"ASC")."&amp;start= \");'>$val</a></th>";
0\");'>$val</a></th>";
}
} }
$header .= "</tr>\n"; }
echo $header; $header .= "</tr>\n";
echo $header;
while ($data=$DB->fetch_assoc($result)) { while ($data = $iterator->next()) {
Session::addToNavigateListItems('ProjectTask', $data['id']); Session::addToNavigateListItems('ProjectTask', $data['id']);
$rand = mt_rand(); $rand = mt_rand();
echo "<tr class='tab_bg_2'>"; echo "<tr class='tab_bg_2'>";
echo "<td>"; echo "<td>";
$link = "<a id='Project".$data["projects_id"].$rand."' href='" $link = "<a id='Project".$data["projects_id"].$rand."' href='".
. Project::getFormURLWithID($data['projects_id'])."'>".
Project::getFormURLWithID($data['projects_id'])."'>" $data['projectname'].
.$data['projectname']. (empty($data['projectname'])?"(".$data['projects_id']
(empty($data['projectname'])?"(".$data['projects_id' .")":"")."</a>";
].")":"")."</a>"; echo sprintf(__('%1$s %2$s'), $link,
echo sprintf(__('%1$s %2$s'), $link, Html::showToolTip($data['projectcontent'],
Html::showToolTip($data['projectcontent'], ['display' => false,
['display' => false, 'applyto' => "Project".$da
'applyto' => "Project".$d ta["projects_id"].$rand]));
ata["projects_id"].$rand])); echo "</td>";
echo "</td>"; echo "<td>";
echo "<td>"; $link = "<a id='ProjectTask".$data["id"].$rand."' href='".
$link = "<a id='ProjectTask".$data["id"].$rand."' href='". ProjectTask::getFormURLWithID($data['id'])."'>".$data
ProjectTask::getFormURLWithID($data['id'])."'>".$dat ['name'].
a['name']. (empty($data['name'])?"(".$data['id'].")":"")."</a>";
(empty($data['name'])?"(".$data['id'].")":"")."</a>" echo sprintf(__('%1$s %2$s'), $link,
; Html::showToolTip($data['content'],
echo sprintf(__('%1$s %2$s'), $link, ['display' => false,
Html::showToolTip($data['content'], 'applyto' => "ProjectTask"
['display' => false, .$data["id"].$rand]));
'applyto' => "ProjectTask echo "</td>";
".$data["id"].$rand])); echo "<td>".$data['tname']."</td>";
echo "</td>"; echo "<td";
echo "<td>".$data['tname']."</td>"; echo " style=\"background-color:".$data['color']."\"";
echo "<td"; echo ">".$data['sname']."</td>";
echo " style=\"background-color:".$data['color']."\""; echo "<td>";
echo ">".$data['sname']."</td>"; echo Dropdown::getValueWithUnit($data["percent_done"], "%");
echo "<td>"; echo "</td>";
echo Dropdown::getValueWithUnit($data["percent_done"], "%"); echo "<td>".Html::convDateTime($data['plan_start_date'])."</td>";
echo "</td>"; echo "<td>".Html::convDateTime($data['plan_end_date'])."</td>";
echo "<td>".Html::convDateTime($data['plan_start_date'])."</td echo "<td>".Html::timestampToString($data['planned_duration'], fa
>"; lse)."</td>";
echo "<td>".Html::convDateTime($data['plan_end_date'])."</td>" echo "<td>".Html::timestampToString(ProjectTask::getTotalEffectiv
; eDuration($data['id']),
echo "<td>".Html::timestampToString($data['planned_duration'], false)."</td>";
false)."</td>"; echo "<td>";
echo "<td>".Html::timestampToString(ProjectTask::getTotalEffec if ($data['projecttasks_id']>0) {
tiveDuration($data['id']), $father = Dropdown::getDropdownName('glpi_projecttasks', $data
false)."</td>"; ['projecttasks_id']);
echo "<td>"; echo "<a id='ProjectTask".$data["projecttasks_id"].$rand."' hr
if ($data['projecttasks_id']>0) { ef='".
$father = Dropdown::getDropdownName('glpi_projecttasks', $d ProjectTask::getFormURLWithID($data['projecttasks_id']).
ata['projecttasks_id']); "'>".$father.
echo "<a id='ProjectTask".$data["projecttasks_id"].$rand."' (empty($father)?"(".$data['projecttasks_id'].")":"")."</
href='". a>";
ProjectTask::getFormURLWithID($data['projecttasks_id'
])."'>".$father.
(empty($father)?"(".$data['projecttasks_id'].")":"").
"</a>";
}
echo "</td></tr>";
} }
echo $header; echo "</td></tr>";
echo "</table>\n";
} else {
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th>".__('No item found')."</th></tr>";
echo "</table>\n";
} }
echo $header;
echo "</table>\n";
} else {
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th>".__('No item found')."</th></tr>";
echo "</table>\n";
} }
echo "</div>"; echo "</div>";
} }
} }
} }
 End of changes. 10 change blocks. 
143 lines changed or deleted 169 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)