move ticket code

pull/2487/head
jmontoyaa 10 years ago
parent 20cce24918
commit 4e8be5ba5c
  1. 0
      main/inc/lib/TicketManager.php
  2. 10
      main/inc/lib/database.constants.inc.php
  3. 1
      plugin/ticket/README.md
  4. 23
      plugin/ticket/config.php
  5. 1
      plugin/ticket/index.php
  6. 11
      plugin/ticket/install.php
  7. 8
      plugin/ticket/plugin.php
  8. 98
      plugin/ticket/src/ticket_plugin.class.php
  9. 14
      plugin/ticket/start.php
  10. 11
      plugin/ticket/uninstall.php
  11. 1
      src/Chamilo/CoreBundle/Composer/ScriptHandler.php

@ -332,3 +332,13 @@ define('TABLE_GRADE_MODEL_COMPONENTS', 'grade_components');
define('TABLE_HOOK_OBSERVER', 'hook_observer');
define('TABLE_HOOK_CALL', 'hook_call');
define('TABLE_HOOK_EVENT', 'hook_event');
define('TABLE_TICKET_ASSIGNED_LOG', 'ticket_assigned_log');
define('TABLE_TICKET_CATEGORY', 'ticket_category');
define('TABLE_TICKET_MESSAGE', 'ticket_message');
define('TABLE_TICKET_PRIORITY', 'ticket_priority');
define('TABLE_TICKET_PROJECT', 'ticket_project');
define('TABLE_TICKET_STATUS', 'ticket_status');
define('TABLE_TICKET_TICKET', 'ticket_ticket');
define('TABLE_TICKET_CATEGORY_REL_USER', 'ticket_category_rel_user');
define('TABLE_TICKET_MESSAGE_ATTACHMENTS', 'ticket_message_attachments');

@ -1 +0,0 @@
Ticket management system features for Chamilo.

@ -1,23 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.plugin.ticket
*/
/* Tables names constants */
define('PLUGIN_NAME', 'ticket');
define('TABLE_TICKET_ASSIGNED_LOG', 'plugin_ticket_assigned_log');
define('TABLE_TICKET_CATEGORY', 'plugin_ticket_category');
define('TABLE_TICKET_MESSAGE', 'plugin_ticket_message');
define('TABLE_TICKET_PRIORITY', 'plugin_ticket_priority');
define('TABLE_TICKET_PROJECT', 'plugin_ticket_project');
define('TABLE_TICKET_STATUS', 'plugin_ticket_status');
define('TABLE_TICKET_TICKET', 'plugin_ticket_ticket');
define('TABLE_TICKET_CATEGORY_REL_USER', 'plugin_ticket_category_rel_user');
define('TABLE_TICKET_MESSAGE_ATTACHMENTS', 'plugin_ticket_message_attachments');
require_once __DIR__ . '/../../main/inc/global.inc.php';
require_once api_get_path(SYS_PLUGIN_PATH) . PLUGIN_NAME . '/src/ticket_plugin.class.php';
require_once api_get_path(SYS_PLUGIN_PATH) . PLUGIN_NAME . '/src/ticket.class.php';

@ -1,11 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script is included by main/admin/settings.lib.php and generally
* includes things to execute in the main database (settings_current table)
* @package chamilo.plugin.ticket
*/
require_once __DIR__.'/config.php';
TicketPlugin::create()->install();

@ -1,8 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.plugin.ticket
*/
require_once __DIR__.'/config.php';
$plugin_info = TicketPlugin::create()->get_info();

@ -1,98 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Class TicketPlugin
*
* @package chamilo.plugin.ticket
*
*/
class TicketPlugin extends Plugin
{
/**
* Set the result
* @staticvar null $result
* @return TicketPlugin
*/
public static function create()
{
static $result = null;
return $result ? $result : $result = new self();
}
/**
* TicketPlugin constructor.
*/
protected function __construct()
{
$settings = array(
'tool_enable' => 'boolean',
'allow_student_add' => 'boolean',
'allow_category_edition' => 'boolean',
'warn_admin_no_user_in_category' => 'boolean',
'send_warning_to_all_admins' => 'boolean'
);
parent::__construct(
'3.0',
'Kenny Rodas Chavez, Genesis Lopez, Francis Gonzales, Yannick Warnier, Julio Montoya',
$settings
);
}
/**
* Install the ticket plugin
*/
public function install()
{
// Create database tables and insert a Tab
require_once api_get_path(SYS_PLUGIN_PATH) . PLUGIN_NAME . '/database.php';
}
/**
* Uninstall the ticket plugin
*/
public function uninstall()
{
$tblSettings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$tblTicketTicket = Database::get_main_table(TABLE_TICKET_TICKET);
$tblTicketStatus = Database::get_main_table(TABLE_TICKET_STATUS);
$tblTicketProject = Database::get_main_table(TABLE_TICKET_PROJECT);
$tblTicketPriority = Database::get_main_table(TABLE_TICKET_PRIORITY);
$tblTicketMesAttch = Database::get_main_table(TABLE_TICKET_MESSAGE_ATTACHMENTS);
$tblTicketMessage = Database::get_main_table(TABLE_TICKET_MESSAGE);
$tblTicketCategory = Database::get_main_table(TABLE_TICKET_CATEGORY);
$tblTicketAssgLog = Database::get_main_table(TABLE_TICKET_ASSIGNED_LOG);
$settings = $this->get_settings();
$plugSetting = current($settings);
// Delete settings
$sql = "DELETE FROM $tblSettings WHERE variable = 'ticket_tool_enable'";
Database::query($sql);
$sql = "DROP TABLE IF EXISTS $tblTicketTicket";
Database::query($sql);
$sql = "DROP TABLE IF EXISTS $tblTicketStatus";
Database::query($sql);
$sql = "DROP TABLE IF EXISTS $tblTicketProject";
Database::query($sql);
$sql = "DROP TABLE IF EXISTS $tblTicketPriority";
Database::query($sql);
$sql = "DROP TABLE IF EXISTS $tblTicketMesAttch";
Database::query($sql);
$sql = "DROP TABLE IF EXISTS $tblTicketMessage";
Database::query($sql);
$sql = "DROP TABLE IF EXISTS $tblTicketCategory";
Database::query($sql);
$sql = "DROP TABLE IF EXISTS $tblTicketAssgLog";
Database::query($sql);
$sql = "DROP TABLE IF EXISTS $tblTicketTicket";
Database::query($sql);
$rsTab = $this->deleteTab($plugSetting['comment']);
if ($rsTab) {
echo "<script>location.href = '" . $_SERVER['REQUEST_URI'] . "';</script>";
}
}
}

@ -1,14 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script initiates a ticket management system session
* @package chamilo.plugin.ticket
*/
$course_plugin = 'ticket'; //needed in order to load the plugin lang variables
require_once __DIR__.'/config.php';
$tool_name = get_lang('Ticket');
$tpl = new Template($tool_name);
$tpl->assign('message', $message);
$tpl->display_one_col_template();

@ -1,11 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This script is included by main/admin/settings.lib.php when unselecting a plugin
* and is meant to remove things installed by the install.php script in both
* the global database and the courses tables
* @package chamilo.plugin.ticket
*/
require_once __DIR__.'/config.php';
TicketPlugin::create()->uninstall();

@ -57,6 +57,7 @@ class ScriptHandler
__DIR__.'/../../../../main/inc/lib/pchart/',
__DIR__.'/../../../../main/inc/lib/htmlpurifier',
__DIR__.'/../../../../main/announcements/resources',
__DIR__.'/../../../../main/plugin/ticket',
__DIR__.'/../../../../src/Chamilo/CoreBundle/Entity/GroupRelGroup.php',
__DIR__.'/../../../../src/Chamilo/CoreBundle/Entity/GroupRelTag.php',
__DIR__.'/../../../../src/Chamilo/CoreBundle/Entity/GroupRelUser.php',

Loading…
Cancel
Save