|
|
|
@ -128,8 +128,10 @@ if (empty($projectId)) { |
|
|
|
|
$currentUrl = api_get_self().'?project_id='.$projectId; |
|
|
|
|
$user_id = api_get_user_id(); |
|
|
|
|
$isAdmin = api_is_platform_admin(); |
|
|
|
|
$actionRight = ''; |
|
|
|
|
|
|
|
|
|
Display::display_header(get_lang('MyTickets')); |
|
|
|
|
|
|
|
|
|
if (!empty($projectId)) { |
|
|
|
|
$getParameters = []; |
|
|
|
|
if ($isAdmin) { |
|
|
|
@ -177,7 +179,11 @@ if (!empty($projectId)) { |
|
|
|
|
$selectTypes[$type['category_id']] = $type['name']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$admins = UserManager::get_user_list_like(array('status' => '1'), array('username'), true); |
|
|
|
|
$admins = UserManager::get_user_list_like( |
|
|
|
|
array('status' => '1'), |
|
|
|
|
array('username'), |
|
|
|
|
true |
|
|
|
|
); |
|
|
|
|
$selectAdmins = [ |
|
|
|
|
0 => get_lang('Unassigned') |
|
|
|
|
]; |
|
|
|
@ -191,14 +197,6 @@ if (!empty($projectId)) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$selectPriority = TicketManager::getPriorityList(); |
|
|
|
|
/*var_dump($priorities); |
|
|
|
|
$selectPriority = [ |
|
|
|
|
'' => get_lang('All'), |
|
|
|
|
TicketManager::PRIORITY_NORMAL => get_lang('PriorityNormal'), |
|
|
|
|
TicketManager::PRIORITY_HIGH => get_lang('PriorityHigh'), |
|
|
|
|
TicketManager::PRIORITY_LOW => get_lang('PriorityLow') |
|
|
|
|
];*/ |
|
|
|
|
|
|
|
|
|
$selectStatusUnread = [ |
|
|
|
|
'' => get_lang('StatusAll'), |
|
|
|
|
'yes' => get_lang('StatusUnread'), |
|
|
|
@ -217,52 +215,60 @@ if (!empty($projectId)) { |
|
|
|
|
$form->addText('keyword', get_lang('Keyword'), false); |
|
|
|
|
$form->addButtonSearch(get_lang('Search'), 'submit_simple'); |
|
|
|
|
$form->addHidden('project_id', $projectId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$advancedSearch = Display::url( |
|
|
|
|
'<span id="img_plus_and_minus"> '.Display::returnFontAwesomeIcon('arrow-right').' '.get_lang('AdvancedSearch'), |
|
|
|
|
'<span id="img_plus_and_minus"> '. |
|
|
|
|
Display::returnFontAwesomeIcon('arrow-right').' '.get_lang('AdvancedSearch'), |
|
|
|
|
'javascript://', |
|
|
|
|
array( |
|
|
|
|
'class' => 'btn btn-default advanced-parameters', |
|
|
|
|
'onclick'=>'display_advanced_search_form();') |
|
|
|
|
); |
|
|
|
|
'onclick' => 'display_advanced_search_form();' |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (api_is_platform_admin()) { |
|
|
|
|
|
|
|
|
|
$actionRight = Display::url( |
|
|
|
|
Display::return_icon( |
|
|
|
|
'add.png', |
|
|
|
|
get_lang('Add'), |
|
|
|
|
null, |
|
|
|
|
ICON_SIZE_MEDIUM |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
api_get_path(WEB_CODE_PATH).'ticket/new_ticket.php?project_id='.$projectId, |
|
|
|
|
['title' => get_lang('Add')] |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$actionRight .= Display::url( |
|
|
|
|
Display::return_icon( |
|
|
|
|
'export_excel.png', |
|
|
|
|
get_lang('Export'), |
|
|
|
|
null, |
|
|
|
|
ICON_SIZE_MEDIUM |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
api_get_self().'?action=export'.$get_parameter.$get_parameter2.'&project_id='.$projectId, |
|
|
|
|
['title' => get_lang('Export')] |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$actionRight .= Display::url( |
|
|
|
|
Display::return_icon( |
|
|
|
|
'settings.png', |
|
|
|
|
get_lang('Categories'), |
|
|
|
|
null, |
|
|
|
|
ICON_SIZE_MEDIUM |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
api_get_path(WEB_CODE_PATH).'ticket/settings.php', |
|
|
|
|
['title' => get_lang('Settings')] |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
echo Display::toolbarAction('toolbar-tickets', array(0 => $form->return_form(), 1 => $advancedSearch, 2 => $actionRight)); |
|
|
|
|
|
|
|
|
|
echo Display::toolbarAction( |
|
|
|
|
'toolbar-tickets', |
|
|
|
|
array( |
|
|
|
|
$form->returnForm(), |
|
|
|
|
$advancedSearch, |
|
|
|
|
$actionRight |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$advancedSearchForm = new FormValidator( |
|
|
|
|
'advanced_search', |
|
|
|
@ -280,7 +286,6 @@ if (!empty($projectId)) { |
|
|
|
|
$selectTypes, |
|
|
|
|
['placeholder' => get_lang('Select')] |
|
|
|
|
); |
|
|
|
|
//$advancedSearchForm->addText('keyword_request_user', get_lang('User'), false); |
|
|
|
|
$advancedSearchForm->addDateTimePicker('keyword_start_date_start', get_lang('Created')); |
|
|
|
|
$advancedSearchForm->addDateTimePicker('keyword_start_date_end', get_lang('Until')); |
|
|
|
|
$advancedSearchForm->addSelect( |
|
|
|
@ -301,18 +306,12 @@ if (!empty($projectId)) { |
|
|
|
|
$selectPriority, |
|
|
|
|
['placeholder' => get_lang('All')] |
|
|
|
|
); |
|
|
|
|
/*$advancedSearchForm->addSelect( |
|
|
|
|
'keyword_unread', |
|
|
|
|
get_lang('Status'), |
|
|
|
|
$selectStatusUnread, |
|
|
|
|
['placeholder' => get_lang('All')] |
|
|
|
|
);*/ |
|
|
|
|
$advancedSearchForm->addText('keyword_course', get_lang('Course'), false); |
|
|
|
|
$advancedSearchForm->addButtonSearch(get_lang('AdvancedSearch'), 'submit_advanced'); |
|
|
|
|
$advancedSearchForm->display(); |
|
|
|
|
} else { |
|
|
|
|
if (api_get_setting('ticket_allow_student_add') === 'true') { |
|
|
|
|
echo '<div class="actions" >'; |
|
|
|
|
echo '<div class="actions">'; |
|
|
|
|
echo '<a href="'.api_get_path(WEB_CODE_PATH).'ticket/new_ticket.php?project_id='.$projectId.'">'. |
|
|
|
|
Display::return_icon('add.png', get_lang('Add'), '', '32'). |
|
|
|
|
'</a>'; |
|
|
|
@ -330,8 +329,8 @@ if ($isAdmin) { |
|
|
|
|
$table->set_header(6, get_lang('AssignedTo'), true); |
|
|
|
|
$table->set_header(7, get_lang('Message'), true); |
|
|
|
|
} else { |
|
|
|
|
echo '<center><h1>'.get_lang('MyTickets').'</h1></center>'; |
|
|
|
|
echo '<center><p>'.get_lang('TicketMsgWelcome').'</p></center>'; |
|
|
|
|
echo Display::page_subheader(get_lang('MyTickets')); |
|
|
|
|
echo Display::return_message(get_lang('TicketMsgWelcome')); |
|
|
|
|
$table->set_header(0, '#', true); |
|
|
|
|
$table->set_header(1, get_lang('Status'), false); |
|
|
|
|
$table->set_header(2, get_lang('Date'), true); |
|
|
|
|