"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ajax/timeline.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).

timeline.php  (glpi-9.3.3.tgz):timeline.php  (glpi-9.4.0.tgz)
skipping to change at line 47 skipping to change at line 47
if (!isset($_REQUEST['action'])) { if (!isset($_REQUEST['action'])) {
exit; exit;
} }
if ($_REQUEST['action'] == 'change_task_state') { if ($_REQUEST['action'] == 'change_task_state') {
header("Content-Type: application/json; charset=UTF-8"); header("Content-Type: application/json; charset=UTF-8");
} else { } else {
header("Content-Type: text/html; charset=UTF-8"); header("Content-Type: text/html; charset=UTF-8");
} }
$objType = $_REQUEST['parenttype']::getType();
$foreignKey = $_REQUEST['parenttype']::getForeignKeyField();
switch ($_REQUEST['action']) { switch ($_REQUEST['action']) {
case "change_task_state": case "change_task_state":
if (!isset($_REQUEST['tasks_id'])) { if (!isset($_REQUEST['tasks_id'])) {
exit(); exit();
} }
$task = new TicketTask;
$taskClass = $objType."Task";
$task = new $taskClass;
$task->getFromDB(intval($_REQUEST['tasks_id'])); $task->getFromDB(intval($_REQUEST['tasks_id']));
if (!in_array($task->fields['state'], [0, Planning::INFO])) { if (!in_array($task->fields['state'], [0, Planning::INFO])) {
$new_state = ($task->fields['state'] == Planning::DONE) $new_state = ($task->fields['state'] == Planning::DONE)
? Planning::TODO ? Planning::TODO
: Planning::DONE; : Planning::DONE;
$new_label = Planning::getState($new_state); $new_label = Planning::getState($new_state);
echo json_encode([ echo json_encode([
'state' => $new_state, 'state' => $new_state,
'label' => $new_label 'label' => $new_label
]); ]);
$task->update([ $task->update([
'id' => intval($_REQUEST['tasks_id']), 'id' => intval($_REQUEST['tasks_id']),
'tickets_id' => intval($_REQUEST['tickets_id']), $foreignKey => intval($_REQUEST[$foreignKey]),
'state' => $new_state 'state' => $new_state
]); ]);
} }
break; break;
case "viewsubitem": case "viewsubitem":
Html::header_nocache(); Html::header_nocache();
if (!isset($_REQUEST['type'])) { if (!isset($_REQUEST['type'])) {
exit(); exit();
} }
if (!isset($_REQUEST['parenttype'])) { if (!isset($_REQUEST['parenttype'])) {
skipping to change at line 100 skipping to change at line 105
$sol_params = [ $sol_params = [
'item' => $parent, 'item' => $parent,
'kb_id_toload' => $_REQUEST['load_kb_sol'] 'kb_id_toload' => $_REQUEST['load_kb_sol']
]; ];
$solution = new ITILSolution(); $solution = new ITILSolution();
if (isset($_REQUEST['id']) && (int)$_REQUEST['id'] > 0) { if (isset($_REQUEST['id']) && (int)$_REQUEST['id'] > 0) {
$solution->getFromDB($_REQUEST['id']); $solution->getFromDB($_REQUEST['id']);
} }
$solution->showForm(null, $sol_params); $solution->showForm(null, $sol_params);
} else if ($_REQUEST['type'] == "ITILFollowup") {
$parent->getFromDB($_REQUEST[$parent->getForeignKeyField()]);
$fup_params = [
'item' => $parent
];
$fup = new ITILFollowup();
if (isset($_REQUEST['id']) && (int)$_REQUEST['id'] > 0) {
$fup->getFromDB($_REQUEST['id']);
}
$fup->showForm(null, $fup_params);
} else if (isset($_REQUEST[$parent->getForeignKeyField()]) } else if (isset($_REQUEST[$parent->getForeignKeyField()])
&& isset($_REQUEST["id"]) && isset($_REQUEST["id"])
&& $parent->getFromDB($_REQUEST[$parent->getForeignKeyField()])) { && $parent->getFromDB($_REQUEST[$parent->getForeignKeyField()])) {
$ol = ObjectLock::isLocked( $_REQUEST['parenttype'], $parent->getID() ) ; $ol = ObjectLock::isLocked( $_REQUEST['parenttype'], $parent->getID() ) ;
if ($ol && (Session::getLoginUserID() != $ol->fields['users_id'])) { if ($ol && (Session::getLoginUserID() != $ol->fields['users_id'])) {
ObjectLock::setReadOnlyProfile( ); ObjectLock::setReadOnlyProfile( );
} }
Ticket::showSubForm($item, $_REQUEST["id"], ['parent' => $parent, $parent::showSubForm($item, $_REQUEST["id"], ['parent' => $parent,
'tickets_id' => $_REQUEST[ $foreignKey => $_REQUEST[$
"tickets_id"]]); foreignKey]]);
} else { } else {
echo __('Access denied'); echo __('Access denied');
} }
Html::ajaxFooter(); Html::ajaxFooter();
break; break;
} }
 End of changes. 5 change blocks. 
5 lines changed or deleted 22 lines changed or added

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