Format Tickets Plugin Code

1.9.x
Francis Gonzales 12 years ago
parent c2221eb86a
commit 48a008cdb4
  1. 7
      plugin/ticket/lang/spanish.php
  2. 2
      plugin/ticket/lib/ticket_plugin.class.php
  3. 4
      plugin/ticket/src/report.php
  4. 92
      plugin/ticket/src/ticket.class.php
  5. 86
      plugin/ticket/src/ticket_details.php
  6. 4
      plugin/ticket/src/tutor.php
  7. 16
      plugin/ticket/src/tutor_report.lib.php

@ -67,3 +67,10 @@ $strings['SrcPresential'] = "Presencial";
//
$strings['TicketAssignedMsg'] = "<p>Estimado(a) %s </p><p>Se le ha sido asignado el <a href=\"%s\">ticket %s</a></p><p>Mensaje enviado desde el sistema de ticket.</p>";
$strings['TicketAssignX'] = "[TICKETS] Asignacion de Ticket #%s ";
$strings['AreYouSureYouWantToCloseTheTicket'] = "¿Esta seguro que quiere cerrar el ticket?";
$strings['AreYouSureYouWantToUnassignTheTicket'] = "¿Esta seguro que quiere desasignarse el ticket?";
$strings['YouMustWriteAMessage'] = "Debe escribir un mensaje";
$strings['LastResponse'] = "Ultima Respuesta";
$strings['AssignTicket'] = "Asignar Ticket";
$strings['AttendedBy'] = "Atendido por";

@ -23,7 +23,7 @@ class TicketPlugin extends Plugin
public function install()
{
// Create database tables
require_once api_get_path(SYS_PLUGIN_PATH).PLUGIN_NAME.'/database.php';
require_once api_get_path(SYS_PLUGIN_PATH) . PLUGIN_NAME . '/database.php';
// Create link tab
// $homep = api_get_path(SYS_PATH).'home/'; //homep for Home Path

@ -20,7 +20,7 @@ if (!api_is_allowed_to_edit()) {
api_not_allowed();
}
//$nameTools = api_xml_http_response_encode(get_lang('Soporte Virtual'));
$this_section = 'Reportes';
$this_section = 'Reports';
unset($_SESSION['this_section']);
$htmlHeadXtra[] = '
@ -246,7 +246,7 @@ function get_user_data($from, $number_of_items, $column, $direction)
return $users;
}
Display::display_header('Reportes');
Display::display_header('Reports');
echo '<div class="actions">
<form action="' . api_get_self() . '" method="get" name="search_simple" id="search_simple">
<input name="user_id_request" id="user_id_request" type="hidden" value="">

@ -1141,8 +1141,13 @@ class TicketManager
{
$table_support_tickets = Database::get_main_table(TABLE_TICKET_TICKET);
$now = api_get_utc_datetime();
$sql = "UPDATE " . $table_support_tickets . " SET status_id = 'CLS' , sys_lastedit_user_id ='" . api_get_user_id(
) . "' ,sys_lastedit_datetime ='" . $now . "',end_date ='" . $now . "' WHERE DATEDIFF('$now',sys_lastedit_datetime) > 7 AND status_id != 'CLS' AND status_id != 'NAT' AND status_id != 'REE'";
$userId = api_get_user_id();
$sql = "UPDATE $table_support_tickets
SET status_id = 'CLS', sys_lastedit_user_id ='$userId',
sys_lastedit_datetime ='$now', end_date ='$now'
WHERE DATEDIFF('$now',sys_lastedit_datetime) > 7
AND status_id != 'CLS' AND status_id != 'NAT'
AND status_id != 'REE'";
Database::query($sql);
}
@ -1152,12 +1157,13 @@ class TicketManager
*/
public static function get_assign_log($ticket_id)
{
$table_support_assigned_log = Database::get_main_table(
TABLE_TICKET_ASSIGNED_LOG
);
$sql = "SELECT log.* FROM " . TABLE_TICKET_ASSIGNED_LOG . " log WHERE log.ticket_id = '$ticket_id' ORDER BY log.assigned_date";
$table_support_assigned_log = Database::get_main_table(TABLE_TICKET_ASSIGNED_LOG);
$sql = "SELECT log.* FROM $table_support_assigned_log log
WHERE log.ticket_id = '$ticket_id'
ORDER BY log.assigned_date";
$result = Database::query($sql);
$history = array();
$webpath = api_get_path(WEB_PATH);
while ($row = Database::fetch_assoc($result)) {
if ($row['user_id'] != 0) {
$assignuser = api_get_user_info(
@ -1168,14 +1174,10 @@ class TicketManager
$row['assigned_date'] = api_convert_and_format_date(
api_get_local_time($row['assigned_date']), '%d/%m/%y-%H:%M:%S', _api_get_timezone()
);
$row['assignuser'] = ($row['user_id'] != 0) ? ('<a href="' . api_get_path(
WEB_PATH
) . 'main/admin/user_information.php?user_id=' . $row['user_id'] . '" target="_blank">' . $assignuser['username'] . '</a>') : get_lang(
$row['assignuser'] = ($row['user_id'] != 0) ? ('<a href="' . $webpath . 'main/admin/user_information.php?user_id=' . $row['user_id'] . '" target="_blank">' . $assignuser['username'] . '</a>') : get_lang(
'Unassign'
);
$row['insertuser'] = '<a href="' . api_get_path(
WEB_PATH
) . 'main/admin/user_information.php?user_id=' . $row['sys_insert_user_id'] . '" target="_blank">' . $insertuser['username'] . '</a>';
$row['insertuser'] = '<a href="' . $webpath . 'main/admin/user_information.php?user_id=' . $row['sys_insert_user_id'] . '" target="_blank">' . $insertuser['username'] . '</a>';
$history[] = $row;
}
return $history;
@ -1212,16 +1214,30 @@ class TicketManager
$user_id = api_get_user_id();
}
$sql = "SELECT ticket.ticket_code, ticket.sys_insert_datetime , ticket.sys_lastedit_datetime , cat.name as category , CONCAT(user.lastname,' ', user.firstname) AS fullname , status.name as status , ticket.total_messages as messages , ticket.assigned_last_user as responsable
FROM " . $table_support_tickets . " ticket ," . $table_support_category . " cat , " . $table_support_priority . " priority, " . $table_support_status . " status , " . Database::get_main_table(
TABLE_MAIN_USER
) . " user
WHERE cat.category_id = ticket.category_id AND ticket.priority_id = priority.priority_id AND ticket.status_id = status.status_id AND user.user_id = ticket.request_user ";
$sql = "SELECT ticket.ticket_code, ticket.sys_insert_datetime ,
ticket.sys_lastedit_datetime , cat.name as category ,
CONCAT(user.lastname,' ', user.firstname) AS fullname ,
status.name as status , ticket.total_messages as messages ,
ticket.assigned_last_user as responsable
FROM $table_support_tickets ticket,
$table_support_category cat ,
$table_support_priority priority,
$table_support_status status ,
$table_main_user user
WHERE cat.category_id = ticket.category_id
AND ticket.priority_id = priority.priority_id
AND ticket.status_id = status.status_id
AND user.user_id = ticket.request_user ";
//Search simple
if (isset($_GET['submit_simple'])) {
if ($_GET['keyword'] != '') {
$keyword = Database::escape_string(trim($_GET['keyword']));
$sql .= " AND (ticket.ticket_code = '" . $keyword . "' OR user.firstname LIKE '%" . $keyword . "%' OR user.lastname LIKE '%" . $keyword . "%' OR concat(user.firstname,' ',user.lastname) LIKE '%" . $keyword . "%' OR concat(user.lastname,' ',user.firstname) LIKE '%" . $keyword . "%' OR user.username LIKE '%" . $keyword . "%') ";
$sql .= " AND (ticket.ticket_code = '$keyword'
OR user.firstname LIKE '%$keyword%'
OR user.lastname LIKE '%$keyword%'
OR concat(user.firstname,' ',user.lastname) LIKE '%$keyword%'
OR concat(user.lastname,' ',user.firstname) LIKE '%$keyword%'
OR user.username LIKE '%$keyword%') ";
}
}
//Search advanced
@ -1264,7 +1280,13 @@ class TicketManager
$sql .= " AND ticket.category_id = '$keyword_category' ";
}
if ($keyword_request_user != '') {
$sql .= " AND (ticket.request_user = '$keyword_request_user' OR user.firstname LIKE '%" . $keyword_request_user . "%' OR user.official_code LIKE '%" . $keyword_request_user . "%' OR user.lastname LIKE '%" . $keyword_request_user . "%' OR concat(user.firstname,' ',user.lastname) LIKE '%" . $keyword_request_user . "%' OR concat(user.lastname,' ',user.firstname) LIKE '%" . $keyword_request_user . "%' OR user.username LIKE '%" . $keyword_request_user . "%') ";
$sql .= " AND (ticket.request_user = '$keyword_request_user'
OR user.firstname LIKE '%$keyword_request_user%'
OR user.official_code LIKE '%$keyword_request_user%'
OR user.lastname LIKE '%$keyword_request_user%'
OR concat(user.firstname,' ',user.lastname) LIKE '%$keyword_request_user%'
OR concat(user.lastname,' ',user.firstname) LIKE '%$keyword_request_user%'
OR user.username LIKE '%$keyword_request_user%') ";
}
if ($keyword_admin != '') {
$sql .= " AND ticket.assigned_last_user = '$keyword_admin' ";
@ -1276,7 +1298,8 @@ class TicketManager
$sql .= " AND DATE_FORMAT( ticket.start_date,'%d/%m/%Y') = '$keyword_start_date_start' ";
}
if ($keyword_range == '1' && $keyword_start_date_start != '' && $keyword_start_date_end != '') {
$sql .= " AND DATE_FORMAT( ticket.start_date,'%d/%m/%Y') >= '$keyword_start_date_start' AND DATE_FORMAT( ticket.start_date,'%d/%m/%Y') <= '$keyword_start_date_end'";
$sql .= " AND DATE_FORMAT( ticket.start_date,'%d/%m/%Y') >= '$keyword_start_date_start'
AND DATE_FORMAT( ticket.start_date,'%d/%m/%Y') <= '$keyword_start_date_end'";
}
if ($keyword_priority != '') {
$sql .= " AND ticket.priority_id = '$keyword_priority' ";
@ -1290,13 +1313,36 @@ class TicketManager
if ($keyword_course != '') {
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$sql .= " AND ticket.course_id IN ( ";
$sql .= "SELECT id FROM $course_table WHERE (title LIKE '%" . $keyword_course . "%' OR code LIKE '%" . $keyword_course . "%' OR visual_code LIKE '%" . $keyword_course . "%' )) ";
$sql .= "SELECT id
FROM $course_table
WHERE (title LIKE '%$keyword_course%'
OR code LIKE '%$keyword_course%'
OR visual_code LIKE '%$keyword_course%' )) ";
}
if ($keyword_unread == 'yes') {
$sql .= " AND ticket.ticket_id IN (SELECT ticket.ticket_id FROM $table_support_tickets ticket, $table_support_messages message, $table_main_user user WHERE ticket.ticket_id = message.ticket_id AND message.status = 'NOL' AND message.sys_insert_user_id = user.user_id AND user.status != 1 AND ticket.status_id != 'REE' GROUP BY ticket.ticket_id)";
$sql .= " AND ticket.ticket_id IN (
SELECT ticket.ticket_id
FROM $table_support_tickets ticket,
$table_support_messages message,
$table_main_user user
WHERE ticket.ticket_id = message.ticket_id
AND message.status = 'NOL'
AND message.sys_insert_user_id = user.user_id
AND user.status != 1 AND ticket.status_id != 'REE'
GROUP BY ticket.ticket_id)";
} else {
if ($keyword_unread == 'no') {
$sql .= " AND ticket.ticket_id NOT IN (SELECT ticket.ticket_id FROM $table_support_tickets ticket, $table_support_messages message, $table_main_user user WHERE ticket.ticket_id = message.ticket_id AND message.status = 'NOL' AND message.sys_insert_user_id = user.user_id AND user.status != 1 AND ticket.status_id != 'REE' GROUP BY ticket.ticket_id)";
$sql .= " AND ticket.ticket_id NOT IN (
SELECT ticket.ticket_id
FROM $table_support_tickets ticket,
$table_support_messages message,
$table_main_user user
WHERE ticket.ticket_id = message.ticket_id
AND message.status = 'NOL'
AND message.sys_insert_user_id = user.user_id
AND user.status != 1
AND ticket.status_id != 'REE'
GROUP BY ticket.ticket_id)";
}
}
}

@ -14,7 +14,7 @@ require_once '../config.php';
$plugin = TicketPlugin::create();
api_block_anonymous_users();
$interbreadcrumb[] = array('url' => 'myticket.php', 'name' => get_lang('MisTickets'));
$interbreadcrumb[] = array('url' => 'myticket.php', 'name' => $plugin->get_lang('MyTickets'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('TicketDetail'));
$htmlHeadXtra[] = '
<script src="/pie/PIE_IE678.js"></script>
@ -39,34 +39,32 @@ $(document).ready(function(){
$( "#dialog-form" ).dialog( "open" );
});
$("input#respuestasi").click(function () {
if(!confirm("Confirma que su respuesta es : SI ?. Si est\u00e1 seguro el ticket ser\u00e1 cerrado")){
return false;
}
$("input#responseyes").click(function () {
if(!confirm("' . get_lang('AreYouSure') . ' : ' . strtoupper(get_lang('Yes')) . '. Si est\u00e1 seguro el ticket ser\u00e1 cerrado")){
return false;
}
});
$("input#respuestano").click(function () {
if(!confirm("Confirma que su respuesta es : NO ?")){
return false;
}
$("input#responseno").click(function () {
if(!confirm("' . get_lang('AreYouSure') . ' : ' . strtoupper(get_lang('No')) . '")){
return false;
}
});
$("#unassign").click(function () {
if (!confirm("Estas seguro de Desasignarte")) {
if (!confirm("' . $plugin->get_lang('AreYouSureYouWantToUnassignTheTicket') . '")) {
return false
}
}
});
$("#close").click(function () {
if (!confirm("Estas seguro de Cerrar el Ticket")) {
if (!confirm("' . $plugin->get_lang('AreYouSureYouWantToCloseTheTicket') . '")) {
return false
}
}
});
});
function validate() {
fckEditor1val = FCKeditorAPI.__Instances["content"].GetHTML();
document.getElementById("content").value= fckEditor1val;
if(fckEditor1val ==""){
alert("Debe escribir un mensaje");
if(fckEditor1val == ""){
alert("' . $plugin->get_lang('YouMustWriteAMessage') . '");
return false;
}
}
@ -152,14 +150,14 @@ if (!isset($ticket['ticket'])) {
if (!isset($_GET['ticket_id'])) {
header('location:myticket.php');
}
if (isset($_POST['respuesta'])) {
if (isset($_POST['response'])) {
if ($user_id == $ticket['ticket']['request_user']) {
$respuesta = ($_POST['respuesta'] == 'si') ? true : (($_POST['respuesta'] == 'no' ? false : null));
if ($respuesta && $ticket['ticket']['status_id'] == 'XCF') {
$response = ($_POST['response'] == 'si') ? true : ($_POST['response'] == 'no' ? false : null);
if ($response && $ticket['ticket']['status_id'] == 'XCF') {
TicketManager::close_ticket($_GET['ticket_id'], $user_id);
$ticket['ticket']['status_id'] = 'CLS';
$ticket['ticket']['status'] = 'CERRADO';
} else if (!is_null($respuesta) && $ticket['ticket']['status_id'] == 'XCF') {
} else if (!is_null($response) && $ticket['ticket']['status_id'] == 'XCF') {
TicketManager::update_ticket_status('PND', $_GET['ticket_id'], $user_id);
$ticket['ticket']['status_id'] = 'PND';
$ticket['ticket']['status'] = 'PENDIENTE';
@ -196,12 +194,12 @@ if (!isset($_POST['compose'])) {
}
Display::display_header();
$form_close_ticket = "";
if ($ticket['ticket']['status_id'] != 'REE' AND $ticket['ticket']['status_id'] != 'CLS' AND $isAdmin) {
if ($ticket['ticket']['status_id'] != 'REE' && $ticket['ticket']['status_id'] != 'CLS' && $isAdmin) {
if (intval($ticket['ticket']['assigned_last_user']) == $user_id) {
if ($ticket['ticket']['status_id'] != 'CLS') {
$form_close_ticket.= '<form enctype="multipart/form-data" action="' . api_get_self() . '?ticket_id=' . $ticket['ticket']['ticket_id'] . '" method="post" name="close_ticket" id="close_ticket" >';
$form_close_ticket.= '<input type="hidden" name="ticket_id" value="' . $ticket['ticket']['ticket_id'] . '"/>
<button class="minus" name="close" type="submit" id="close" >Cerrar</button>';
<button class="minus" name="close" type="submit" id="close" >' . get_lang('Close') . '</button>';
$form_close_ticket.= '</form>';
}
}
@ -209,9 +207,11 @@ if (!isset($_POST['compose'])) {
$titulo = '<center><h1>Ticket #' . $ticket['ticket']['ticket_code'] . '</h1></center>';
if ($isAdmin && $ticket['ticket']['status_id'] != 'CLS' && $ticket['ticket']['status_id'] != 'REE') {
if ($ticket['ticket']['assigned_last_user'] != 0 && $ticket['ticket']['assigned_last_user'] == $user_id) {
$img_assing = '<a href="' . api_get_self() . '?ticket_id=' . $ticket['ticket']['ticket_id'] . '&amp;action=unassign" id="unassign"><img src="../../../main/img/admin_star.png" border="0" title="Desasignarme" align="center"/></a>';
$img_assing = '<a href="' . api_get_self() . '?ticket_id=' . $ticket['ticket']['ticket_id'] . '&amp;action=unassign" id="unassign">
<img src="../../../main/img/admin_star.png" border="0" title="Unassign" align="center"/>
</a>';
} else {
$img_assing .= '<a href="#" id="assign"><img src="../../../main/img/admin_star_na.png" border="0" title="Asignar" align="center"/></a>';
$img_assing .= '<a href="#" id="assign"><img src="../../../main/img/admin_star_na.png" border="0" title="Assign" align="center"/></a>';
}
}
$negrita = ($ticket['ticket']['status_id'] == 'CLS') ? 'style = "font-weight: bold;"' : '';
@ -224,26 +224,26 @@ if (!isset($_POST['compose'])) {
<td>' . $form_close_ticket . '</td>
</tr>
<tr>
<td style="width:45%;" ><p>Enviado : ' . $ticket['ticket']['start_date'] . '</p></td>
<td style="width:45%;" ><p>' . get_lang('Sent') . ': ' . $ticket['ticket']['start_date'] . '</p></td>
<td style="width:50px;"></td>
<td style="width:45%;" ><p>Ultima Respuesta : ' . $ticket['ticket']['sys_lastedit_datetime'] . '</p></td>
<td style="width:45%;" ><p>' . $plugin->get_lang('LastResponse') . ': ' . $ticket['ticket']['sys_lastedit_datetime'] . '</p></td>
<td colspan="2"></td>
</tr>
<tr>
<td><p>Asunto : ' . $ticket['messages'][0]['subject'] . '</p></td>
<td><p>' . get_lang('Subject') . ': ' . $ticket['messages'][0]['subject'] . '</p></td>
<td></td>
<td><p ' . $negrita . '>Estado : ' . $ticket['ticket']['status'] . '</p></td>
<td><p ' . $negrita . '>' . get_lang('Status') . ': ' . $ticket['ticket']['status'] . '</p></td>
<td colspan="2"></td>
</tr>
<tr>
<td><p>Categoria : ' . $ticket['ticket']['name'] . '</p></td>
<td><p>' . get_lang('Category') . ': ' . $ticket['ticket']['name'] . '</p></td>
<td></td>
<td ><p>Prioridad :' . $ticket['ticket']['priority'] . '<p></td>
<td ><p>' . get_lang('Priority') . ':' . $ticket['ticket']['priority'] . '<p></td>
<td colspan="2"></td>
</tr>';
if ($ticket['ticket']['course_url'] != null) {
echo '<tr>
<td><p>Curso:</p></td>
<td><p>' . get_lang('Course') . ':</p></td>
<td></td>
<td>' . $ticket['ticket']['course_url'] . '</td>
<td colspan="2"></td>
@ -251,7 +251,7 @@ if (!isset($_POST['compose'])) {
}
if ($isAdmin) {
echo '<tr>
<td><p>Usuario:</p></td>
<td><p>' . get_lang('User') . ':</p></td>
<td></td>
<td>' . $user_info = $ticket['ticket']['user_url'] . ' (' . $ticket['usuario']['username'] . ')</td>
<td colspan="2"></td>
@ -265,11 +265,11 @@ if (!isset($_POST['compose'])) {
$select_admins.= "<option value = '" . $admin['user_id'] . "' " . (($user_id == $admin['user_id']) ? ("selected='selected'") : "") . ">" . $admin['lastname'] . " ," . $admin['firstname'] . "</option>";
}
$select_admins .= "</select>";
echo '<div id="dialog-form" title="Asignar Ticket" >';
echo '<div id="dialog-form" title="' . get_lang('AssignTicket') . '" >';
echo '<form id="genesis" method="POST" action="ticket_details.php?ticket_id=' . $ticket['ticket']['ticket_id'] . '">
<input type="hidden" name ="action" id="action" value="assign"/>
<div class="row">
<div class="label">Responsable:</div>
<div class="label">' . get_lang('Responsable') . ':</div>
<div class="formw">' . $select_admins . '</div>
</div>
</form>';
@ -280,12 +280,13 @@ if (!isset($_POST['compose'])) {
$class = "messageuser";
if ($message['admin']) {
$class = "messagesupport";
if ($isAdmin)
$message['message'].="<br/><b>Atendido por: " . $message['user_created'] . " - " . api_convert_and_format_date(api_get_local_time($message['sys_insert_datetime']), DATE_TIME_FORMAT_LONG, _api_get_timezone()) . "</b>";
if ($isAdmin) {
$message['message'].='<br/><b>' . get_lang('AttendedBy') . ': ' . $message['user_created'] . " - " . api_convert_and_format_date(api_get_local_time($message['sys_insert_datetime']), DATE_TIME_FORMAT_LONG, _api_get_timezone()) . "</b>";
}
}else {
$message['message'].="<b>Enviado: " . api_convert_and_format_date(api_get_local_time($message['sys_insert_datetime']), DATE_TIME_FORMAT_LONG, _api_get_timezone()) . "</b>";
$message['message'].='<b>' . get_lang('Sent') . ': ' . api_convert_and_format_date(api_get_local_time($message['sys_insert_datetime']), DATE_TIME_FORMAT_LONG, _api_get_timezone()) . "</b>";
}
echo '<div class="' . $class . '" ><b>Asunto: </b> ' . $message['subject'] . '<br/> <b> Mensaje:</b>' . $message['message'] . '<br/>';
echo '<div class="' . $class . '" ><b>' . get_lang('Subject') . ': </b> ' . $message['subject'] . '<br/> <b>' . get_lang('Message') . ':</b>' . $message['message'] . '<br/>';
if (isset($message['atachments'])) {
foreach ($message['atachments'] as $attach) {
echo $attach['attachment_link'];
@ -327,7 +328,8 @@ function show_form_send_message()
<div class="formw"><input type = "text" id ="subject" name="subject" value="' . $asunto . '" required ="" style="width:60%"/></div>
</div>';
echo '<div class="row">
<div class="label2">mensaje
<div class="label2">
' . get_lang('Message') . '
</div>
<div class="formw2">
<input type="hidden" id="content" name="content" value="" style="display:none">
@ -356,7 +358,9 @@ function show_form_send_message()
</div>';
echo '<div class="row">
<div class="label"></div>
<div class="formw"> <button class="save" name="compose" type="submit">Enviar mensaje</button>' . ($isAdmin ? '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="confirmation"/>Solicitar confirmaci&oacute;n' : "") .
<div class="formw">
<button class="save" name="compose" type="submit">' . get_lang('SendMessage') . '</button>' .
($isAdmin ? '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="confirmation"/>Solicitar confirmaci&oacute;n' : "") .
'</div>
</div>';
echo '</form>';

@ -82,10 +82,10 @@ function save() {
.blackboard_hide {
display: none;
}
.reportes{
.reports{
border:1px ;
}
.reportes th {
.reports th {
border-bottom: 1px solid #DDDDDD;
line-height: normal;
text-align: center;

@ -24,7 +24,7 @@ function initializeReport($course_code)
$resWeeks = Database::query($sqlWeeks);
$weeks = Database::fetch_object($resWeeks);
$obj = Database::fetch_object($res);
$weeksCount = (!isset($_POST['numerosemanas'])) ? (($weeks->semanas == 0) ? 7 : $weeks->semanas) : $_POST['numerosemanas'];
$weeksCount = (!isset($_POST['weeksNumber'])) ? (($weeks->semanas == 0) ? 7 : $weeks->semanas) : $_POST['weeksNumber'];
Database::query("REPLACE INTO $table_semanas_curso (course_code , semanas) VALUES ('$course_code','$weeksCount')");
if (intval($obj->cant) != $weeksCount) {
@ -115,16 +115,6 @@ function showResults($courseInfo, $weeksCount, $page)
<div class="blackboard_hide" id="foro' . $rowe['week_id'] . '">' . $rowe['thread_title'] . '</div>
</a>
</th>';
/* $fila.= '<th>
<a href="#" onClick="showContent('."'eval".$rowe['week_id']."'".');">Eval'.$rowe['week_id'].'
<div class="blackboard_hide" id="eval'.$rowe['week_id'].'">'.$rowe['eval_title'].'</div>
</a>
</th>';
$fila.= '<th>
<a href="#" onClick="showContent('."'pc".$rowe['week_id']."'".');">PC'.$rowe['week_id'].'
<div class="blackboard_hide" id="pc'.$rowe['week_id'].'">'.$rowe['pc_title'].'</div>
</a>
</th>'; */
}
}
$tableExport[] = $lineHeaderExport;
@ -134,7 +124,7 @@ function showResults($courseInfo, $weeksCount, $page)
$html = '<form action="tutor.php" name="semanas" id="semanas" method="POST">
<div class="row">
' . get_lang('SelectWeeksSpan') . '
<select name="numerosemanas" id="numerosemanas" onChange="submit();">
<select name="weeksNumber" id="weeksNumber" onChange="submit();">
<option value="7" ' . (($weeksCount == 7) ? 'selected="selected"' : "") . '>7 weeks</option>
<option value="14" ' . (($weeksCount == 14) ? 'selected="selected"' : "") . '>14 weeks</option>
</select>';
@ -146,7 +136,7 @@ function showResults($courseInfo, $weeksCount, $page)
$html .= '<span style="float:right;"><a href="' . api_get_self() . '?action=export' . $get_parameter . $get_parameter2 . '">' . Display::return_icon('import_excel.png', get_lang('Export'), '', '32') . '</a></span>';
$html .= '</form>';
$html .= '<table class="reportes">';
$html .= '<table class="reports">';
$html .= '<tr>
<th ></th>';
for ($i = (7 * $page - 6); $i <= $page * 7; $i++) {

Loading…
Cancel
Save