Add show_link_ticket_notification

pull/2487/head
Julio 9 years ago
parent 51b2673771
commit f0e92b32f1
  1. 2
      app/Migrations/Schema/V111/Version111.php
  2. 12
      main/inc/lib/TicketManager.php
  3. 28
      main/inc/lib/template.lib.php
  4. 3
      main/install/data.sql
  5. 16
      main/ticket/new_ticket.php
  6. 15
      main/ticket/ticket_details.php
  7. 6
      main/ticket/tickets.php

@ -265,6 +265,7 @@ class Version111 extends AbstractMigrationChamilo
$this->addSql("INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('ticket_warn_admin_no_user_in_category', NULL, 'radio','Ticket', 'false','TicketWarnAdminNoUserInCategoryTitle','TicketWarnAdminNoUserInCategoryComment',NULL,NULL, 0)");
$this->addSql("INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('load_term_conditions_section', NULL, 'radio','Platform', 'login','LoadTermConditionsSectionTitle','LoadTermConditionsSectionDescription',NULL,NULL, 0)");
$this->addSql("INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('show_terms_if_profile_completed', NULL, 'radio','Ticket', 'false','ShowTermsIfProfileCompletedTitle','ShowTermsIfProfileCompletedComment',NULL,NULL, 0)");
$this->addSql("INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('show_link_ticket_notification', NULL, 'radio', 'Platform', 'false', 'ShowLinkTicketNotificationTitle', 'ShowLinkTicketNotificationComment', NULL, NULL, 0)");
$this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('ticket_allow_student_add', 'true', 'Yes'), ('ticket_allow_student_add', 'false', 'No')");
$this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('ticket_allow_category_edition', 'true', 'Yes'), ('ticket_allow_category_edition', 'false', 'No')");
@ -272,6 +273,7 @@ class Version111 extends AbstractMigrationChamilo
$this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('ticket_warn_admin_no_user_in_category', 'true', 'Yes'), ('ticket_warn_admin_no_user_in_category', 'false', 'No')");
$this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('load_term_conditions_section', 'login', 'Login'), ('load_term_conditions_section', 'course', 'Course')");
$this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('show_terms_if_profile_completed', 'true', 'Yes'), ('show_terms_if_profile_completed', 'false', 'No')");
$this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('show_link_ticket_notification', 'true', 'Yes'), ('show_link_ticket_notification', 'false', 'No')");
$this->addSql("ALTER TABLE c_quiz_question_rel_category ADD INDEX idx_qqrc_qid (question_id)");
$this->addSql("ALTER TABLE c_quiz_answer ADD INDEX idx_cqa_q (question_id)");

@ -65,7 +65,7 @@ class TicketManager
return $types;
}
/**
/**
* @param $from
* @param $numberItems
* @param $column
@ -269,6 +269,7 @@ class TicketManager
public static function add(
$category_id,
$course_id,
$sessionId,
$project_id,
$other_area,
$email,
@ -355,6 +356,9 @@ class TicketManager
$params['course_id'] = $course_id;
}
if (!empty($sessionId)) {
$params['session_id'] = $sessionId;
}
$ticket_id = Database::insert($table_support_tickets, $params);
if ($ticket_id) {
@ -1321,8 +1325,12 @@ class TicketManager
$row['course_url'] = null;
if ($row['course_id'] != 0) {
$course = api_get_course_info_by_id($row['course_id']);
$sessionId = 0;
if ($row['session_id']) {
$sessionId = $row['session_id'];
}
if ($course) {
$row['course_url'] = '<a href="'.$course['course_public_url'].'">'.$course['name'].'</a>';
$row['course_url'] = '<a href="'.$course['course_public_url'].'?id_session='.$sessionId.'">'.$course['name'].'</a>';
}
}

@ -883,17 +883,33 @@ class Template
$this->setHelp();
//@todo move this in the template
$bugLink = '';
$rightFloatMenu = '';
$iconBug = Display::return_icon('bug.png', get_lang('ReportABug'), null, ICON_SIZE_LARGE);
if (api_get_setting('show_link_bug_notification') == 'true' && $this->user_is_logged_in) {
$bugLink = '<div class="report">
$rightFloatMenu = '<div class="report">
<a href="http://support.chamilo.org/projects/chamilo-18/wiki/How_to_report_bugs" target="_blank">
'. $iconBug . '
</a>
</div>';
}
$this->assign('bug_notification', $bugLink);
if (api_get_setting('show_link_ticket_notification') == 'true' && $this->user_is_logged_in) {
// by default is project_id = 1
$iconTicket = Display::return_icon('bug.png', get_lang('Ticket'), null, ICON_SIZE_LARGE);
$courseInfo = api_get_course_info();
$courseParams = '';
if (!empty($courseInfo)) {
$courseParams = api_get_cidreq();
}
$url = api_get_path(WEB_CODE_PATH).'ticket/new_ticket.php?project_id=1&'.$courseParams;
$rightFloatMenu .= '<div class="report">
<a href="'.$url.'" target="_blank">
'. $iconTicket . '
</a>
</div>';
}
$this->assign('bug_notification', $rightFloatMenu);
$notification = returnNotificationMenu();
$this->assign('notification_menu', $notification);
@ -923,12 +939,12 @@ class Template
//Profile link
if (api_get_setting('allow_social_tool') == 'true') {
$profile_url = api_get_path(WEB_CODE_PATH).'social/home.php';
} else {
$profile_url = api_get_path(WEB_CODE_PATH).'auth/profile.php';
}
$this->assign('profile_url', $profile_url);
//Message link

@ -182,6 +182,7 @@ VALUES
('timezone_value', 'timezones', 'select', 'Timezones', '', 'TimezoneValueTitle','TimezoneValueComment',NULL,'Timezones', 1),
('allow_user_course_subscription_by_course_admin', NULL, 'radio', 'Security', 'true', 'AllowUserCourseSubscriptionByCourseAdminTitle', 'AllowUserCourseSubscriptionByCourseAdminComment', NULL, NULL, 1),
('show_link_bug_notification', NULL, 'radio', 'Platform', 'false', 'ShowLinkBugNotificationTitle', 'ShowLinkBugNotificationComment', NULL, NULL, 0),
('show_link_ticket_notification', NULL, 'radio', 'Platform', 'false', 'ShowLinkTicketNotificationTitle', 'ShowLinkTicketNotificationComment', NULL, NULL, 0),
('course_validation', NULL, 'radio', 'Platform', 'false', 'EnableCourseValidation', 'EnableCourseValidationComment', NULL, NULL, 1),
('course_validation_terms_and_conditions_url', NULL, 'textfield', 'Platform', '', 'CourseValidationTermsAndConditionsLink', 'CourseValidationTermsAndConditionsLinkComment', NULL, NULL, 1),
('sso_authentication',NULL,'radio','Security','false','EnableSSOTitle','EnableSSOComment',NULL,NULL,1),
@ -497,6 +498,8 @@ VALUES
('allow_user_course_subscription_by_course_admin', 'false', 'No'),
('show_link_bug_notification', 'true', 'Yes'),
('show_link_bug_notification', 'false', 'No'),
('show_link_ticket_notification', 'true', 'Yes'),
('show_link_ticket_notification', 'false', 'No'),
('course_validation', 'true', 'Yes'),
('course_validation', 'false', 'No'),
('sso_authentication', 'true', 'Yes'),

@ -363,6 +363,19 @@ function show_form_send_ticket()
)
);
$courseInfo = api_get_course_info();
if (!empty($courseInfo)) {
$form->addLabel(get_lang('Course'), $courseInfo['title']);
$form->addHidden('course_id', $courseInfo['real_id']);
$sessionInfo = api_get_session_info(api_get_session_id());
if (!empty($sessionInfo)) {
$form->addLabel(get_lang('Session'), $sessionInfo['name']);
$form->addHidden('session_id', $sessionInfo['id']);
}
}
$form->addElement('file', 'attach_1', get_lang('FilesAttachment'));
$form->addLabel('', '<span id="filepaths"><div id="filepath_1"></div></span>');
@ -405,6 +418,8 @@ function save_ticket()
$content .= '<p style="color:red">&nbsp;' . get_lang('Phone') . ': ' . Security::remove_XSS($_POST['phone']). '</p>';
}
$course_id = isset($_POST['course_id']) ? $_POST['course_id'] : '';
$sessionId = isset($_POST['session_id']) ? $_POST['session_id'] : '';
$project_id = $_POST['project_id'];
$subject = $_POST['subject'];
$other_area = (int) $_POST['other_area'];
@ -419,6 +434,7 @@ function save_ticket()
if (TicketManager::add(
$category_id,
$course_id,
$sessionId,
$project_id,
$other_area,
$email,

@ -319,11 +319,18 @@ if (!isset($_POST['compose'])) {
}
if ($ticket['ticket']['course_url'] != null) {
echo '<tr>
<td><p>' . get_lang('Course') . ':</p></td>
<td></td>
<td>' . $ticket['ticket']['course_url'] . '</td>
<td><b>' . get_lang('Course') . ':</b> ' . $ticket['ticket']['course_url'] . ' </td>
<td></td>
<td colspan="2"></td>
</tr>';
if (!empty($ticket['ticket']['session_id'])) {
$sessionInfo = api_get_session_info($ticket['ticket']['session_id']);
echo '<tr>
<td><b>' . get_lang('Session') . ':</b> ' . $sessionInfo['name'] . ' </td>
<td></td>
<td colspan="2"></td>
</tr>';
}
}
echo '<tr>
<td>
@ -350,7 +357,7 @@ if (!isset($_POST['compose'])) {
$admin['complete_name'] . "</option>";
}
$select_admins .= "</select>";
echo '<div id="dialog-form" title="' . get_lang('AssignTicket') . '" >';
echo '<div id="dialog-form" title="' . get_lang('Assign') . '" >';
echo '<form id="frmResponsable" method="POST" action="ticket_details.php?ticket_id=' . $ticket['ticket']['id'] . '">
<input type="hidden" name ="action" id="action" value="assign"/>
<div>

@ -246,15 +246,15 @@ if ($isAdmin ) {
$advancedSearchForm = new FormValidator(
'advanced_search',
'get',
api_get_self().'&project_id='.$projectId,
api_get_self().'?project_id='.$projectId,
null,
['style' => 'display:"none"', 'id' => 'advanced_search_form']
);
$advancedSearchForm->addHeader(get_lang('AdvancedSearch'));
$advancedSearchForm->addSelect('keyword_category', get_lang('Category'), $selectTypes, ['placeholder' => get_lang('Select')]);
//$advancedSearchForm->addText('keyword_request_user', get_lang('User'), false);
$advancedSearchForm->addDateTimePicker('keyword_start_date_start', get_lang('RegisterDate'));
$advancedSearchForm->addDateTimePicker('keyword_start_date_end', get_lang('Untill'));
$advancedSearchForm->addDateTimePicker('keyword_start_date_start', get_lang('Created'));
$advancedSearchForm->addDateTimePicker('keyword_start_date_end', get_lang('Until'));
$advancedSearchForm->addSelect('keyword_admin', get_lang('AssignedTo') , $selectAdmins, ['placeholder' => get_lang('All')]);
$advancedSearchForm->addSelect('keyword_status', get_lang('Status'), $selectStatus, ['placeholder' => get_lang('Select')]);
$advancedSearchForm->addSelect('keyword_priority', get_lang('Priority'), $selectPriority, ['placeholder' => get_lang('All')]);

Loading…
Cancel
Save