diff --git a/include/class.upgrader.php b/include/class.upgrader.php index b71a3ff6bc4c121c52acef36ed2bc4a229e0c7b0..927f4660db8c9a0a7124f19d68408f4a956df144 100644 --- a/include/class.upgrader.php +++ b/include/class.upgrader.php @@ -79,28 +79,13 @@ class Upgrader { function createUpgradedTicket() { global $cfg; + $i18n = new Internationalization(); + $vars = $i18n->getTemplate('templates/ticket/upgraded.yaml')->getData(); + $vars['deptId'] = $cfg->getDefaultDeptId(); + //Create a ticket to make the system warm and happy. - $dept_id = $cfg->getDefaultDeptId(); - $prio_id = $cfg->getDefaultPriorityId(); - $sql='INSERT INTO '.TICKET_TABLE.' SET created=NOW(), status="open", source="Web" ' - ." ,priority_id=$prio_id, dept_id=$dept_id, topic_id=0 " - .' ,ticketID='.db_input(Misc::randNumber(6)) - .' ,email="support@osticket.com" ' - .' ,name="osTicket Support" ' - .' ,subject="osTicket Upgraded!"'; - - if(db_query($sql, false) && ($tid=db_insert_id())) { - if(!($msg=file_get_contents(UPGRADE_DIR.'msg/upgraded.txt'))) - $msg='Congratulations and Thank you for choosing osTicket!'; - - $sql='INSERT INTO '.TICKET_THREAD_TABLE.' SET created=NOW()' - .', source="Web" ' - .', thread_type="M" ' - .', ticket_id='.db_input($tid) - .', title='.db_input('osTicket Upgraded') - .', body='.db_input($msg); - db_query($sql, false); - } + $errors = array(); + Ticket::create($vars, $errors, 'api', false, false); } function getMode() { diff --git a/include/i18n/en_US/templates/ticket/installed.yaml b/include/i18n/en_US/templates/ticket/installed.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9dab69f2d7db265622955fcaa6f9cfe00f2eec18 --- /dev/null +++ b/include/i18n/en_US/templates/ticket/installed.yaml @@ -0,0 +1,50 @@ +# +# Welcome ticket template +# +# When the system if first installed and the installer finishes setting up +# the database, it creates a first ticket with a welcome message to the +# administrator +# +--- +deptId: 1 # support +topicId: 1 # support +name: osTicket Support +email: support@osticket.com +source: Web # notrans +subject: osTicket Installed! +message: | + <p> + Thank you for choosing osTicket. + </p><p> + Please make sure you join the <a + href="http://osticket.com/forums">osTicket forums</a> and our <a + href="http://osticket.com/updates">mailing list</a> to stay up to date + on the latest news, security alerts and updates. The osTicket forums are + also a great place to get assistance, guidance, tips, and help from + other osTicket users. In addition to the forums, the osTicket wiki + provides a useful collection of educational materials, documentation, + and notes from the community. We welcome your contributions to the + osTicket community. + </p><p> + If you are looking for a greater level of support, we provide + professional services and commercial support with guaranteed response + times, and access to the core development team. We can also help + customize osTicket or even add new features to the system to meet your + unique needs. + </p><p> + If the idea of managing and upgrading this osTicket installation is + daunting, you can try osTicket as a hosted service at <a + href="http://www.supportsystem.com">http://www.supportsystem.com/</a> -- + no installation required and we can import your data! With + SupportSystem's turnkey infrastructure, you get osTicket at its best, + leaving you free to focus on your customers without the burden of making + sure the application is stable, maintained, and secure. + </p><p> + Cheers, + </p><p> + -<br/> + osTicket Team http://osticket.com/ + </p><p> + <strong>PS.</strong> Don't just make customers happy, make happy + customers! + </p> diff --git a/include/i18n/en_US/templates/ticket/upgraded.yaml b/include/i18n/en_US/templates/ticket/upgraded.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b46a44d854c3849262da9b024b4af64baaee78c8 --- /dev/null +++ b/include/i18n/en_US/templates/ticket/upgraded.yaml @@ -0,0 +1,40 @@ +# +# Upgrade completed ticket +# +# This ticket is added to the system after the completion of an upgrade. It +# might include information specific to the release, perhaps with some new +# feature highlights, etc. +# +--- +source: Web # notrans +name: osTicket Support +email: support@osticket.com +subject: osTicket Upgraded! +message: | + <p> + osTicket upgraded successfully! Please refer to the Release Notes + (http://osticket.com/wiki/Release_Notes) for more information about + changes and new features. + </p><p> + Be sure to join the <a href="http://osticket.com/forums">osTicket + forums</a> and our <a href="http://osticket.com/updates">mailing + list</a> to stay up to date on announcements, security updates and + alerts! Your contribution to osTicket community will be appreciated! + </p><p> + The osTicket team is committed to providing support to all users through + our free online resources and a full range of commercial support + packages and services. For more information, or to discuss your needs, + please contact us today at http://osticket.com/support/. Any feedback + will be appreciated! + </p><p> + If managing and upgrading this osTicket installation is daunting, you + can try osTicket as a hosted service at http://www.supportsystem.com/ -- + no upgrading ever, and we can import your data! With SupportSystem's + turnkey infrastructure, you get osTicket at its best, leaving you free + to focus on your customers without the burden of making sure the + application is stable, maintained, and secure. + </p><p> + -<br/> + osTicket Team<br/> + http://osticket.com/ + </p> diff --git a/include/upgrader/msg/upgraded.txt b/include/upgrader/msg/upgraded.txt deleted file mode 100644 index 84554ec313eaad08b45fd64e7e7bfd781263bc50..0000000000000000000000000000000000000000 --- a/include/upgrader/msg/upgraded.txt +++ /dev/null @@ -1,11 +0,0 @@ -osTicket upgraded successfully! Please refer to the Release Notes (http://osticket.com/wiki/Release_Notes) for more information about changes and new features. - -Be sure to join osTicket forum (http://osticket.com/forums) and our mailing list (http://osticket.com/updates) , if you haven't done so already, to stay up to date on announcements, security updates and alerts! Your contribution to osTicket community will be appreciated! - -The osTicket team is committed to providing support to all users through our free online resources and a full range of commercial support packages and services. For more information, or to discuss your needs, please contact us today at http://osticket.com/support/. Any feedback will be appreciated! - -If managing and upgrading this osTicket installation is daunting, you can try osTicket as a hosted service at http://www.supportsystem.com/ -- no upgrading ever, and we can import your data! With SupportSystem's turnkey infrastructure, you get osTicket at its best, leaving you free to focus on your customers without the burden of making sure the application is stable, maintained, and secure. - -- -osTicket Team -http://osticket.com/ diff --git a/setup/inc/class.installer.php b/setup/inc/class.installer.php index aeec06d2e0f8d728779ba08d9b2fd8ebedd5249d..23dbac500c71209d4a826821fbbf2e31b2d30e66 100644 --- a/setup/inc/class.installer.php +++ b/setup/inc/class.installer.php @@ -245,18 +245,11 @@ class Installer extends SetupWizard { $cfg = new OsticketConfig(); //Create a ticket to make the system warm and happy. - if(!($msg=file_get_contents(INC_DIR.'msg/installed.txt'))) - $msg='Congratulations and Thank you for choosing osTicket!'; $errors = array(); - $tid = Ticket::create(array( - 'email' => 'support@osticket.com', - 'name' => 'osTicket Support', - 'subject' => 'osTicket Installed!', - 'message' => $msg, - 'source' => 'email', - 'deptId' => $dept_id_1), - $errors, - 'api', false, false); + $ticket_vars = $i18n->getTemplate('templates/ticket/installed.yaml') + ->getData(); + $tid = Ticket::create($ticket_vars, $errors, 'api', false, false); + //TODO: create another personalized ticket and assign to admin?? //Log a message. diff --git a/setup/inc/msg/installed.txt b/setup/inc/msg/installed.txt deleted file mode 100644 index 5b598afdaec399b23c751177967dfc689814b201..0000000000000000000000000000000000000000 --- a/setup/inc/msg/installed.txt +++ /dev/null @@ -1,15 +0,0 @@ -Thank you for choosing osTicket. - -Please make sure you join the osTicket forums (http://osticket.com/forums) and our mailing list (http://osticket.com/updates) to stay up to date on the latest news, security alerts and updates. The osTicket forums are also a great place to get assistance, guidance, tips, and help from other osTicket users. In addition to the forums, the osTicket wiki provides a useful collection of educational materials, documentation, and notes from the community. We welcome your contributions to the osTicket community. - -If you are looking for a greater level of support, we provide professional services and commercial support with guaranteed response times, and access to the core development team. We can also help customize osTicket or even add new features to the system to meet your unique needs. - -If the idea of managing and upgrading this osTicket installation is daunting, you can try osTicket as a hosted service at http://www.supportsystem.com/ -- no installation required and we can import your data! With SupportSystem's turnkey infrastructure, you get osTicket at its best, leaving you free to focus on your customers without the burden of making sure the application is stable, maintained, and secure. - -Cheers, - -- -osTicket Team -http://osticket.com/ - -PS. Don't just make customers happy, make happy customers!