Minor - format code

1.10.x
Julio 10 years ago
parent 82dce71bf5
commit b3b5ac409b
  1. 2
      plugin/ticket/config.install.php
  2. 1
      plugin/ticket/config.php
  3. 11
      plugin/ticket/database.php
  4. 2
      plugin/ticket/install.php
  5. 2
      plugin/ticket/plugin.php
  6. 4
      plugin/ticket/src/assign_tickets.php
  7. 3
      plugin/ticket/src/course_user_list.php
  8. 3
      plugin/ticket/src/myticket.php
  9. 8
      plugin/ticket/src/report.php
  10. 29
      plugin/ticket/src/ticket.class.php
  11. 14
      plugin/ticket/src/ticket_assign_log.php
  12. 2
      plugin/ticket/src/ticket_plugin.class.php
  13. 7
      plugin/ticket/src/tutor_report.lib.php
  14. 2
      plugin/ticket/start.php
  15. 2
      plugin/ticket/uninstall.php

@ -8,7 +8,5 @@
*/
require_once '../../main/inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'plugin.class.php';
require_once 'src/ticket.class.php';
require_once 'src/ticket_plugin.class.php';

@ -4,6 +4,7 @@
/**
* @package chamilo.plugin.ticket
*/
/* Tables names constants */
define('PLUGIN_NAME', 'ticket');
define('TABLE_TICKET_ASSIGNED_LOG', 'plugin_ticket_assigned_log');

@ -1,4 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Contains the SQL for the tickets management plugin database structure
*/
@ -42,6 +44,7 @@ $categoRow = array(
$objPlugin->get_lang('VirtualCampus') => $objPlugin->get_lang('TicketsAboutVirtualCampus'),
$objPlugin->get_lang('OnlineEvaluation') => $objPlugin->get_lang('TicketsAboutOnlineEvaluation')
);
$i = 1;
foreach ($categoRow as $category => $description) {
//Online evaluation requires a course
@ -67,7 +70,7 @@ foreach ($categoRow as $category => $description) {
Database::insert($table, $attributes);
$i++;
}
//END default categories
$table = Database::get_main_table(TABLE_TICKET_MESSAGE);
$sql = "CREATE TABLE IF NOT EXISTS ".$table." (
id int UNSIGNED NOT NULL AUTO_INCREMENT,
@ -117,6 +120,7 @@ $sql = "CREATE TABLE IF NOT EXISTS ".$table." (
sys_lastedit_datetime datetime DEFAULT NULL,
PRIMARY KEY (id))";
Database::query($sql);
//Default Priorities
$defaultPriorities = array(
'NRM' => $objPlugin->get_lang('PriorityNormal'),
@ -134,7 +138,6 @@ foreach ($defaultPriorities as $pId => $priority) {
Database::insert($table, $attributes);
$i++;
}
//End
$table = Database::get_main_table(TABLE_TICKET_PROJECT);
$sql = "CREATE TABLE IF NOT EXISTS ".$table." (
@ -150,6 +153,7 @@ $sql = "CREATE TABLE IF NOT EXISTS ".$table." (
sys_lastedit_datetime datetime DEFAULT NULL,
PRIMARY KEY (id))";
Database::query($sql);
//Default Project Table Ticket
$attributes = array(
'id' => 1,
@ -157,7 +161,6 @@ $attributes = array(
'name' => 'Ticket System'
);
Database::insert($table, $attributes);
//END
//STATUS
$table = Database::get_main_table(TABLE_TICKET_STATUS);
@ -168,6 +171,7 @@ $sql = "CREATE TABLE IF NOT EXISTS ".$table." (
description varchar(255) DEFAULT NULL,
PRIMARY KEY (id))";
Database::query($sql);
//Default status
$defaultStatus = array(
'NAT' => $objPlugin->get_lang('StatusNew'),
@ -187,7 +191,6 @@ foreach ($defaultStatus as $abr => $status) {
Database::insert($table, $attributes);
$i ++;
}
//END
$table = Database::get_main_table(TABLE_TICKET_TICKET);
$sql = "CREATE TABLE IF NOT EXISTS ".$table." (

@ -7,5 +7,5 @@
* @package chamilo.plugin.ticket
*/
require_once dirname(__FILE__).'/config.php';
require_once __DIR__.'/config.php';
TicketPlugin::create()->install();

@ -4,5 +4,5 @@
/**
* @package chamilo.plugin.ticket
*/
require_once dirname(__FILE__).'/config.php';
require_once __DIR__.'/config.php';
$plugin_info = TicketPlugin::create()->get_info();

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
*
* @package chamilo.plugin.ticket
@ -64,7 +65,8 @@ while ($row = Database::fetch_assoc($result_forum)) {
echo '</select></div><div>';
echo '<div class="row">
<div class="formw">
<button class="save" name="edit" type="button" value="' . get_lang('Edit') . '" onClick="save(' . "$id" . ');">' . get_lang('Edit') . '</button>
<button class="save" name="edit" type="button" value="' . get_lang('Edit') . '" onClick="save(' . "$id" . ');">' .
get_lang('Edit') . '</button>
</div>
</div>';
echo '</form>';

@ -18,8 +18,6 @@ foreach ($coursesList as $key => $course) {
$courseInfo = CourseManager::get_course_information($course['code']);
$arrCourseList[$courseInfo['code']] = $courseInfo['title'];
}
//End Course List
$userLabel = Display::tag('label', get_lang('User'), array('class' => 'control-label'));
$personName = api_get_person_name($userInfo['firstname'], $userInfo['lastname']);
@ -40,6 +38,7 @@ $courseControl = Display::div($courseSelect, array('class' => 'controls'));
$userDiv = Display::div($userLabel . " " . $userControl, array('class' => 'control-group'));
$courseDiv = Display::div($courseLabel . " " . $courseControl, array('class' => 'control-group'));
echo $userDiv;
echo $courseDiv;

@ -194,7 +194,8 @@ if (isset($_GET['action'])) {
break;
}
}
//$nameTools = api_xml_http_response_encode($plugin->get_lang('MyTickets'));
// $nameTools = api_xml_http_response_encode($plugin->get_lang('MyTickets'));
$user_id = api_get_user_id();
$isAdmin = api_is_platform_admin();

@ -4,6 +4,7 @@
/**
* @package chamilo.plugin.ticket
*/
$language_file = array('trad4all');
$cidReset = true;
require_once '../config.php';
@ -14,7 +15,7 @@ api_block_anonymous_users();
if (!api_is_allowed_to_edit()) {
api_not_allowed();
}
//$nameTools = api_xml_http_response_encode(get_lang('Soporte Virtual'));
$this_section = 'Reports';
unset($_SESSION['this_section']);
@ -24,7 +25,8 @@ $(document).ready(function(){
$( "#keyword_start_date_start" ).datepicker({ dateFormat: ' . "'yy-mm-dd'" . ' });
$( "#keyword_start_date_end" ).datepicker({ dateFormat: ' . "'yy-mm-dd'" . ' });
});
function validate(){
function validate() {
if( $("#keyword_start_date_start").val() != "" && $("#keyword_start_date_end").val() != ""){
datestart = $("#keyword_start_date_start").val();
dateend = $("#keyword_start_date_end").val();
@ -35,6 +37,7 @@ function validate(){
}
}
}
function load_course_list (div_course,my_user_id) {
$.ajax({
contentType: "application/x-www-form-urlencoded",
@ -84,6 +87,7 @@ $tools['quiz'] = array('id' => 'quiz', 'name' => get_lang('Quiz'));
$tools['student_publication'] = array('id' => 'student_publication', 'name' => get_lang('Student_publication'));
$tools['user'] = array('id' => 'user', 'name' => get_lang('User'));
$tools['forum'] = array('id' => 'forum', 'name' => get_lang('Forum'));
/**
* Returns the escaped string.
* @param string $s

@ -336,8 +336,8 @@ class TicketManager
$obj = Database::fetch_object($result);
$message_id = $obj->total_messages + 1;
$now = api_get_utc_datetime();
$sql_insert_message = "INSERT INTO $table_support_messages (
// insert msg
$sql = "INSERT INTO $table_support_messages (
ticket_id,
message_id,
subject,
@ -360,16 +360,19 @@ class TicketManager
'" . $now . "',
'$status'
)";
Database::query($sql_insert_message);
$sql_update_total_message = "UPDATE $table_support_tickets
SET sys_lastedit_user_id ='$user_id',
sys_lastedit_datetime ='$now',
total_messages = (
SELECT COUNT(*) as total_messages
FROM $table_support_messages
WHERE ticket_id ='$ticket_id'
) WHERE ticket_id ='$ticket_id' ";
Database::query($sql_update_total_message);
Database::query($sql);
// update_total_message
$sql = "UPDATE $table_support_tickets
SET sys_lastedit_user_id ='$user_id',
sys_lastedit_datetime ='$now',
total_messages = (
SELECT COUNT(*) as total_messages
FROM $table_support_messages
WHERE ticket_id ='$ticket_id'
)
WHERE ticket_id ='$ticket_id' ";
Database::query($sql);
$sql_message_att_id = "SELECT COUNT(*) as total_attach
FROM $table_support_message_attachments
@ -1239,6 +1242,7 @@ class TicketManager
$sql .= " AND ticket.project_id != '' ";
$res = Database::query($sql);
$obj = Database::fetch_object($res);
return $obj->unread;
}
@ -1512,7 +1516,6 @@ class TicketManager
}
}
//$sql .= " ORDER BY col$column $direction";
$sql .= " LIMIT $from,$number_of_items";
$result = Database::query($sql);

@ -4,7 +4,9 @@
/**
* @package chamilo.plugin.ticket
*/
require_once '../config.php';
$plugin = TicketPlugin::create();
$ticket_id = intval($_POST['ticket_id']);
@ -22,9 +24,15 @@ $history = TicketManager::get_assign_log($ticket_id);
?>
<?php for ($k = 0; $k < count($history); $k++) { ?>
<tr>
<td width="125px"><?php echo api_convert_encoding($history[$k]['assignuser'], 'UTF-8', $charset); ?></td>
<td width="100px"><?php echo api_convert_encoding($history[$k]['assigned_date'], 'UTF-8', $charset); ?></td>
<td width="125px"><?php echo api_convert_encoding($history[$k]['insertuser'], 'UTF-8', $charset); ?></td>
<td width="125px">
<?php echo api_convert_encoding($history[$k]['assignuser'], 'UTF-8', $charset); ?>
</td>
<td width="100px">
<?php echo api_convert_encoding($history[$k]['assigned_date'], 'UTF-8', $charset); ?>
</td>
<td width="125px">
<?php echo api_convert_encoding($history[$k]['insertuser'], 'UTF-8', $charset); ?>
</td>
</tr>
<?php } ?>
</table>

@ -58,7 +58,7 @@ class TicketPlugin extends Plugin
$settings = $this->get_settings();
$plugSetting = current($settings);
//Delete settings
// Delete settings
$sql = "DELETE FROM $tblSettings WHERE variable = 'ticket_tool_enable'";
Database::query($sql);

@ -32,8 +32,9 @@ function initializeReport($course_code)
if (intval($obj->cant) != $weeksCount) {
if (intval($obj->cant) > $weeksCount) {
$sql = "DELETE FROM $table_reporte_semanas WHERE week_id > $weeksCount AND course_code = '$course_code'";
Database::query("DELETE FROM $table_reporte_semanas WHERE week_id > $weeksCount AND course_code = '$course_code'");
$sql = "DELETE FROM $table_reporte_semanas
WHERE week_id > $weeksCount AND course_code = '$course_code'";
Database::query($sql);
} else {
for ($i = $obj->cant + 1; $i <= $weeksCount; $i++) {
if (!Database::query("INSERT INTO $table_reporte_semanas (week_id, course_code, forum_id, work_id, quiz_id, pc_id)
@ -139,7 +140,6 @@ function showResults($courseInfo, $weeksCount, $page)
<option value="14" ' . (($weeksCount == 14) ? 'selected="selected"' : "") . '>14 weeks</option>
</select>';
if ($weeksCount == 14) {
$html .= '<span style="float:right;"><a href="tutor.php?page=' . (($page == 1) ? 2 : 1) . '">' . (($page == 1) ? "Siguiente" : "Anterior") . '</a></span>';
}
@ -196,6 +196,7 @@ function showStudentResult($datos, $pagina)
$fila.= '<td align="center">' . (($dato['thread_ok'] == 1) ? Display::return_icon('check.png') : Display::return_icon('aspa.png')) . '</td>';
}
$fila.= '</tr>';
return $fila;
}

@ -6,7 +6,7 @@
* @package chamilo.plugin.ticket
*/
$course_plugin = 'ticket'; //needed in order to load the plugin lang variables
require_once dirname(__FILE__).'/config.php';
require_once __DIR__.'/config.php';
$tool_name = get_lang('Ticket');
$tpl = new Template($tool_name);

@ -7,5 +7,5 @@
* the global database and the courses tables
* @package chamilo.plugin.ticket
*/
require_once dirname(__FILE__).'/config.php';
require_once __DIR.'/config.php';
TicketPlugin::create()->uninstall();

Loading…
Cancel
Save