parent
20cce24918
commit
4e8be5ba5c
@ -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 +0,0 @@ |
||||
<?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(); |
||||
Loading…
Reference in new issue