|
@@ -10,7 +10,7 @@ require_once __DIR__.'/../inc/global.inc.php';
|
|
|
|
|
|
api_protect_admin_script(true);
|
|
api_protect_admin_script(true);
|
|
|
|
|
|
-$toolName = get_lang('Project');
|
|
|
|
|
|
+//$toolName = get_lang('Project');
|
|
|
|
|
|
$libPath = api_get_path(LIBRARY_PATH);
|
|
$libPath = api_get_path(LIBRARY_PATH);
|
|
$webLibPath = api_get_path(WEB_LIBRARY_PATH);
|
|
$webLibPath = api_get_path(WEB_LIBRARY_PATH);
|
|
@@ -43,6 +43,11 @@ $interbreadcrumb[] = array(
|
|
'name' => get_lang('Settings')
|
|
'name' => get_lang('Settings')
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+$interbreadcrumb[] = array(
|
|
|
|
+ 'url' => api_get_path(WEB_CODE_PATH).'ticket/projects.php',
|
|
|
|
+ 'name' => get_lang('Projects')
|
|
|
|
+);
|
|
|
|
+
|
|
switch ($action) {
|
|
switch ($action) {
|
|
case 'delete':
|
|
case 'delete':
|
|
TicketManager::deleteProject($id);
|
|
TicketManager::deleteProject($id);
|
|
@@ -51,10 +56,7 @@ switch ($action) {
|
|
break;
|
|
break;
|
|
case 'add':
|
|
case 'add':
|
|
$toolName = get_lang('Add');
|
|
$toolName = get_lang('Add');
|
|
- $interbreadcrumb[] = array(
|
|
|
|
- 'url' => api_get_path(WEB_CODE_PATH).'ticket/categories.php',
|
|
|
|
- 'name' => get_lang('Categories')
|
|
|
|
- );
|
|
|
|
|
|
+
|
|
$url = api_get_self().'?action=add';
|
|
$url = api_get_self().'?action=add';
|
|
$form = TicketManager::getProjectForm($url);
|
|
$form = TicketManager::getProjectForm($url);
|
|
$formToString = $form->returnForm();
|
|
$formToString = $form->returnForm();
|
|
@@ -74,15 +76,14 @@ switch ($action) {
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 'edit':
|
|
case 'edit':
|
|
|
|
+ $item = TicketManager::getProject($_GET['id']);
|
|
|
|
+ if (empty($item)) {
|
|
|
|
+ api_not_allowed(true);
|
|
|
|
+ }
|
|
$toolName = get_lang('Edit');
|
|
$toolName = get_lang('Edit');
|
|
- $interbreadcrumb[] = array(
|
|
|
|
- 'url' => api_get_path(WEB_CODE_PATH).'ticket/categories.php',
|
|
|
|
- 'name' => get_lang('Categories')
|
|
|
|
- );
|
|
|
|
$url = api_get_self().'?action=edit&id='.$id;
|
|
$url = api_get_self().'?action=edit&id='.$id;
|
|
$form = TicketManager::getProjectForm($url);
|
|
$form = TicketManager::getProjectForm($url);
|
|
|
|
|
|
- $item = TicketManager::getProject($_GET['id']);
|
|
|
|
$form->setDefaults([
|
|
$form->setDefaults([
|
|
'name' => $item->getName(),
|
|
'name' => $item->getName(),
|
|
'description' => $item->getDescription()]
|
|
'description' => $item->getDescription()]
|
|
@@ -120,6 +121,18 @@ $isAdmin = api_is_platform_admin();
|
|
function modify_filter($id, $params, $row)
|
|
function modify_filter($id, $params, $row)
|
|
{
|
|
{
|
|
$result = Display::url(
|
|
$result = Display::url(
|
|
|
|
+ get_lang('Tickets'),
|
|
|
|
+ "tickets.php?project_id={$row['id']}",
|
|
|
|
+ ['class' => 'btn btn-small btn-default']
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ $result .= Display::url(
|
|
|
|
+ get_lang('Categories'),
|
|
|
|
+ "categories.php?project_id={$row['id']}",
|
|
|
|
+ ['class' => 'btn btn-default']
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ $result .= Display::url(
|
|
Display::return_icon('edit.png', get_lang('Edit')),
|
|
Display::return_icon('edit.png', get_lang('Edit')),
|
|
"projects.php?action=edit&id={$row['id']}"
|
|
"projects.php?action=edit&id={$row['id']}"
|
|
);
|
|
);
|
|
@@ -129,7 +142,7 @@ function modify_filter($id, $params, $row)
|
|
"projects.php?action=delete&id={$row['id']}"
|
|
"projects.php?action=delete&id={$row['id']}"
|
|
);
|
|
);
|
|
|
|
|
|
- return $result;
|
|
|
|
|
|
+ return $result;
|
|
}
|
|
}
|
|
|
|
|
|
$table->set_header(0, '', false);
|
|
$table->set_header(0, '', false);
|
|
@@ -138,7 +151,7 @@ $table->set_header(2, get_lang('Description'), true, array("style" => "width:200
|
|
$table->set_header(3, get_lang('Actions'), true);
|
|
$table->set_header(3, get_lang('Actions'), true);
|
|
$table->set_column_filter('3', 'modify_filter');
|
|
$table->set_column_filter('3', 'modify_filter');
|
|
|
|
|
|
-Display::display_header($toolName);
|
|
|
|
|
|
+Display::display_header('');
|
|
|
|
|
|
$items = [
|
|
$items = [
|
|
[
|
|
[
|