DELETE FROM `#__js_ticket_config` WHERE configname = 'staff_can_lock_ticket';
DELETE FROM `#__js_ticket_config` WHERE configname = 'staff_identity';
DELETE FROM `#__js_ticket_config` WHERE configname = 'view_tickets';
DELETE FROM `#__js_ticket_config` WHERE configname = 'default_system_email';
DELETE FROM `#__js_ticket_config` WHERE configname = 'articles_per_row';
DELETE FROM `#__js_ticket_config` WHERE configname = 'knowledge_base_enable';
DELETE FROM `#__js_ticket_config` WHERE configname = 'staff_create_categories';
DELETE FROM `#__js_ticket_config` WHERE configname = 'staff_create_articles';
ALTER TABLE `#__js_ticket_departments` ADD COLUMN `ordering` int(11) NOT NULL AFTER status;
UPDATE `#__js_ticket_departments` SET ordering = id;
ALTER TABLE `#__js_ticket_priorities` ADD COLUMN `ordering` int(11) NOT NULL AFTER status;
UPDATE `#__js_ticket_priorities` SET ordering = id;
INSERT INTO `#__js_ticket_emailtemplates` (`templatefor`, `title`, `subject`, `body`, `created`, `status`) VALUES ('lock-tk', '', 'JS Tickets :  Ticket {TRACKINGID} has been locked', 'Dear {USERNAME} ,\r\n\r\nYour Ticket {TRACKINGID} has been locked.\r\n\r\nUsername : {USERNAME}\r\nSubject : {SUBJECT}\r\nTicket ID : {TRACKINGID}\r\nEmail : {EMAIL}\r\n\r\nYou can manage ticket here {TICKETURL}\r\n\r\n<span style=\"color: red;\"><strong>*DO NOT REPLY TO THIS E-MAIL*</strong></span>\r\nThis is an automated e-mail message sent from our support system. Do not reply to this e-mail as we wonot receive your reply!', NULL, 0),('unlock-tk', '', 'JS Tickets :  Ticket {TRACKINGID} has been unlocked', 'Dear {USERNAME} ,\r\n\r\nYour Ticket {TRACKINGID} has been unlocked.\r\n\r\nUsername : {USERNAME}\r\nSubject : {SUBJECT}\r\nTicket ID : {TRACKINGID}\r\nEmail : {EMAIL}\r\n\r\nYou can manage ticket here {TICKETURL}\r\n\r\n<span style=\"color: red;\"><strong>*DO NOT REPLY TO THIS E-MAIL*</strong></span>\r\nThis is an automated e-mail message sent from our support system. Do not reply to this e-mail as we wonot receive your reply!', NULL, 0),('minprogress-tk', '', 'JS Tickets:  Mark in progress Ticket ', 'Ticket Mark in progress\r\n\r\nTicket Subject : {SUBJECT}\r\n\r\nTicket ID:{TRACKINGID} is Mark in progress.\r\n\r\nYou can manage this ticket here\r\n\r\n{TICKETURL}\r\n\r\n<span style=\"color: red;\"><strong>*DO NOT REPLY TO THIS E-MAIL*</strong></span>\r\nThis is an automated e-mail message sent from our support system. Do not reply to this e-mail as we wonot receive your reply!', NULL, 0),('prtrans-tk', '', 'JS Tickets:  Ticket transfer to Priority{PRIORITY_TITLE} ', 'Ticket transfer to priority\r\n\r\nTicket Subject : {SUBJECT}\r\n\r\nTicket ID: {TRACKINGID} is transfer to department{PRIORITY_TITLE}.\r\n\r\nYou can manage this ticket here\r\n\r\n{TICKETURL}\r\n\r\n<span style=\"color: red;\"><strong>*DO NOT REPLY TO THIS E-MAIL*</strong></span>\r\nThis is an automated e-mail message sent from our support system. Do not reply to this e-mail as we wonot receive your reply!', NULL, 0),('mail-new', '', 'JS Tickets:  New Mail has been sent by {STAFF_MEMBER_NAME}', '<p>New mail has been sent by the {STAFF_MEMBER_NAME}</p>\n<p>Mail Subject : {SUBJECT}</p>\n<p>Message : {MESSAGE}</p>\n<p><span style=\"color: red;\"><strong>*DO NOT REPLY TO THIS E-MAIL*</strong></span><br />\nThis is an automated e-mail message sent from our support system. Do not reply to this e-mail as we wonot receive your reply!</p>\n', NULL, 0),('mail-rpy', '', 'JS Tickets:  New reply has been sent by {STAFF_MEMBER_NAME}', '<p>New reply has been sent by the {STAFF_MEMBER_NAME}</p>\n<p>Mail Subject : {SUBJECT}</p>\n<p>Message : {MESSAGE}</p>\n<p><span style=\"color: red;\"><strong>*DO NOT REPLY TO THIS E-MAIL*</strong></span><br />\nThis is an automated e-mail message sent from our support system. Do not reply to this e-mail as we wonot receive your reply!</p>\n', NULL, 0);
INSERT INTO `#__js_ticket_config` (`configname`, `configvalue`, `configfor`) VALUES ('maximum_tickets', '100', 'default'),('maximum_open_tickets', '25', 'deafult'),('pagination_default_page_size', '10', 'deafult'),('recaptcha_publickey', '', 'default'),('recaptcha_privatekey', '', 'default'),('captcha_selection', '2', 'default'),('owncaptcha_calculationtype', '1', 'default'),('owncaptcha_totaloperand', '2', 'default'),('owncaptcha_subtractionans', '1', 'default'),('ticket_lock_staff', '1', 'email'),('ticket_lock_admin', '1', 'email'),('ticket_lock_user', '1', 'email'),('ticket_unlock_staff', '1', 'email'),('ticket_unlock_admin', '1', 'email'),('ticket_unlock_user', '1', 'email'),('ticket_mark_progress_staff', '1', 'email'),('ticket_mark_progress_admin', '0', 'email'),('ticket_mark_progress_user', '1', 'email'),('ticket_priority_staff', '1', 'email'),('ticket_priority_admin', '0', 'email'),('ticket_priority_user', '1', 'email'),('new_ticket_message', '', 'default'),('cplink_openticket_staff', '1', 'cplink'),('cplink_myticket_staff', '1', 'cplink'),('cplink_addrole_staff', '2', 'cplink'),('cplink_roles_staff', '1', 'cplink'),('cplink_addstaff_staff', '2', 'cplink'),('cplink_staff_staff', '1', 'cplink'),('cplink_adddepartment_staff', '2', 'cplink'),('cplink_department_staff', '1', 'cplink'),('cplink_addcategory_staff', '2', 'cplink'),('cplink_category_staff', '1', 'cplink'),('cplink_addkbarticle_staff', '2', 'cplink'),('cplink_kbarticle_staff', '1', 'cplink'),('cplink_adddownload_staff', '2', 'cplink'),('cplink_download_staff', '1', 'cplink'),('cplink_addannouncement_staff', '2', 'cplink'),('cplink_announcement_staff', '1', 'cplink'),('cplink_addfaq_staff', '2', 'cplink'),('cplink_faq_staff', '1', 'cplink'),('cplink_mail_staff', '1', 'cplink'),('cplink_myprofile_staff', '1', 'cplink'),('cplink_openticket_user', '1', 'cplink'),('cplink_myticket_user', '1', 'cplink'),('cplink_checkticketstatus_user', '1', 'cplink'),('cplink_downloads_user', '1', 'cplink'),('cplink_announcements_user', '1', 'cplink'),('cplink_faqs_user', '1', 'cplink'),('cplink_knowledgebase_user', '1', 'cplink'),('tplink_home_staff', '1', 'tplink'),('tplink_tickets_staff', '1', 'tplink'),('tplink_knowledgebase_staff', '1', 'tplink'),('tplink_announcements_staff', '1', 'tplink'),('tplink_downloads_staff', '1', 'tplink'),('tplink_faqs_staff', '1', 'tplink'),('tplink_home_user', '1', 'tplink'),('tplink_tickets_user', '1', 'tplink'),('tplink_knowledgebase_user', '1', 'tplink'),('tplink_announcements_user', '1', 'tplink'),('tplink_downloads_user', '1', 'tplink'),('tplink_faqs_user', '1', 'tplink'),('show_breadcrumbs', '1', 'default'),('tve_enabled', '2', 'default'),('tve_mailreadtype', '3', 'default'),('tve_attachment', '1', 'default'),('tve_emailreadingdelay', '300', 'default'),('tve_hosttype', '4', 'default'),('tve_hostname', '', 'default'),('tve_emailaddress', '', 'default'),('tve_emailpassword', '', 'default'),('lastEmailReadingTime', '', 'default');
INSERT INTO `#__js_ticket_config` (`configname`, `configvalue`, `configfor`) VALUES ('versioncode','1.0.3','default') ON DUPLICATE KEY UPDATE configvalue = '1.0.3';
INSERT INTO `#__js_ticket_config` (`configname`, `configvalue`, `configfor`) VALUES ('productcode','jsticket','default') ON DUPLICATE KEY UPDATE configvalue = 'jsticket';

