{"action":"created","issue":{"url":"https://api.github.com/repos/osTicket/osTicket-1.8/issues/1419","repository_url":"https://api.github.com/repos/osTicket/osTicket-1.8","labels_url":"https://api.github.com/repos/osTicket/osTicket-1.8/issues/1419/labels{/name}","comments_url":"https://api.github.com/repos/osTicket/osTicket-1.8/issues/1419/comments","events_url":"https://api.github.com/repos/osTicket/osTicket-1.8/issues/1419/events","html_url":"https://github.com/osTicket/osTicket-1.8/pull/1419","id":46488895,"number":1419,"title":"Tickets: Time tracking","user":{"login":"robintoy","id":8893903,"avatar_url":"https://avatars.githubusercontent.com/u/8893903?v=3","gravatar_id":"","url":"https://api.github.com/users/robintoy","html_url":"https://github.com/robintoy","followers_url":"https://api.github.com/users/robintoy/followers","following_url":"https://api.github.com/users/robintoy/following{/other_user}","gists_url":"https://api.github.com/users/robintoy/gists{/gist_id}","starred_url":"https://api.github.com/users/robintoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robintoy/subscriptions","organizations_url":"https://api.github.com/users/robintoy/orgs","repos_url":"https://api.github.com/users/robintoy/repos","events_url":"https://api.github.com/users/robintoy/events{/privacy}","received_events_url":"https://api.github.com/users/robintoy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":224,"created_at":"2014-10-22T09:21:37Z","updated_at":"2016-02-03T16:00:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/osTicket/osTicket-1.8/pulls/1419","html_url":"https://github.com/osTicket/osTicket-1.8/pull/1419","diff_url":"https://github.com/osTicket/osTicket-1.8/pull/1419.diff","patch_url":"https://github.com/osTicket/osTicket-1.8/pull/1419.patch"},"body":"# Time Tracking Mod / Change\r\n**Updated: 21/08/2015**\r\n\r\nRe-written and complete Time Tracking enhancement.\r\n**Requires Version v1.9.12**\r\n\r\nThis enhancement allows you to enable functions for adding just time to a ticket or enable functions to allow adding time to the thread of the ticket along with the type of time spent.\r\n\r\nThe time types are a custom list that can be modified to your business requirements giving your full billing and reporting abilities.\r\n\r\n\r\n### Pictures\r\nAdmin screen displaying available options\r\n![adminoptions](https://cloud.githubusercontent.com/assets/8893903/8396187/76da6660-1d93-11e5-918e-5c53ea81faf9.jpg)\r\n\r\nTicket Header providing a time overview\r\n![ticket-header](https://cloud.githubusercontent.com/assets/8893903/4733792/8b1905ae-59cc-11e4-842f-3fde56b86b3b.jpg)\r\n\r\nTicket Thread with time added\r\n![ticket-thread](https://cloud.githubusercontent.com/assets/8893903/4733799/99ad8d24-59cc-11e4-91a8-12795b3f0006.jpg)\r\n\r\n\r\nPost a Reply and Internal Note options when you enable thread time\r\n![postreply](https://cloud.githubusercontent.com/assets/8893903/8396229/69dc54f8-1d95-11e5-9c25-bf9b7b3d8392.jpg)\r\n![postinternal](https://cloud.githubusercontent.com/assets/8893903/8396231/707e0f04-1d95-11e5-9ce7-9d556b2d186f.jpg)\r\n\r\n\r\nTime adding form when you enable Total Time adding\r\n![ticket-time](https://cloud.githubusercontent.com/assets/8893903/4733810/b5c0af64-59cc-11e4-92a3-04dcfc516d08.jpg)\r\n\r\n\r\nTime Billing Report / Menu\r\n![billmenu](https://cloud.githubusercontent.com/assets/8893903/8396235/85b4a5c2-1d95-11e5-9f15-e53e41a9891d.jpg)\r\n![billreport](https://cloud.githubusercontent.com/assets/8893903/8396236/8c21b80a-1d95-11e5-8f0f-ded30c3f5f42.jpg)\r\n\r\n\r\n\r\n## MOD Install Instructions\r\n### Base file install\r\n1. Download the following files: -\r\n\r\nhttps://raw.githubusercontent.com/StrobeTechnologiesLtd/osTicket-1.8/TimeTracking/include/class.config.php\r\nhttps://raw.githubusercontent.com/StrobeTechnologiesLtd/osTicket-1.8/TimeTracking/include/class.list.php\r\nhttps://raw.githubusercontent.com/StrobeTechnologiesLtd/osTicket-1.8/TimeTracking/include/class.nav.php\r\nhttps://raw.githubusercontent.com/StrobeTechnologiesLtd/osTicket-1.8/TimeTracking/include/class.thread.php\r\nhttps://raw.githubusercontent.com/StrobeTechnologiesLtd/osTicket-1.8/TimeTracking/include/class.ticket.php\r\nhttps://raw.githubusercontent.com/StrobeTechnologiesLtd/osTicket-1.8/TimeTracking/include/client/view.inc.php\r\nhttps://raw.githubusercontent.com/StrobeTechnologiesLtd/osTicket-1.8/TimeTracking/include/staff/settings-tickettime.inc.php\r\nhttps://raw.githubusercontent.com/StrobeTechnologiesLtd/osTicket-1.8/TimeTracking/include/staff/ticket-view.inc.php\r\nhttps://raw.githubusercontent.com/StrobeTechnologiesLtd/osTicket-1.8/TimeTracking/scp/settings.php\r\nhttps://raw.githubusercontent.com/StrobeTechnologiesLtd/osTicket-1.8/TimeTracking/scp/tickets.php\r\nhttps://raw.githubusercontent.com/StrobeTechnologiesLtd/osTicket-1.8/TimeTracking/scp/tickets_cost.php\r\nhttps://raw.githubusercontent.com/StrobeTechnologiesLtd/osTicket-1.8/TimeTracking/scp/tickets_hardware.php\r\nhttps://raw.githubusercontent.com/StrobeTechnologiesLtd/osTicket-1.8/TimeTracking/scp/tickets_bill.php\r\nhttps://raw.githubusercontent.com/StrobeTechnologiesLtd/osTicket-1.8/TimeTracking/include/i18n/en_US/help/tips/settings.tickettime.yaml\r\n\r\n2. Copy class.config.php to /include/\r\n3. Copy class.list.php to /include/\r\n4. Copy class.nav.php to /include/\r\n5. Copy class.thread.php to /include/\r\n6. Copy class.ticket.php to /include/\r\n7. Copy view.inc.php to /include/client/\r\n8. Copy settings-tickettime.inc.php to /include/staff/\r\n9. Copy ticket-view.inc.php to /include/staff/\r\n10. copy settings.tickettime.yaml to /include/i18n/en_US/help/tips/\r\n11. Copy settings.php to /scp/\r\n12. Copy tickets.php to /scp/\r\n13. Copy tickets_cost.php to /scp/\r\n14. Copy tickets_hardware.php to /scp/\r\n15. Copy tickets_bill.php to /scp/\r\n\r\n\r\n### Database upgrade (SQL commends)\r\nRun the following commands in something like PHPMyAdmin or MySQL CLI\r\n```SQL\r\nINSERT INTO  ost_list  ( name ,  name_plural ,  sort_mode ,  masks ,  type ,  notes ,  created ,  updated ) VALUES ('Time Type', 'Time Types', 'SortCol', '13', 'time-type', 'Time Spent plugin list, do not modify', NOW(), NOW());\r\n```\r\n```SQL\r\nINSERT INTO `ost_list_items` (`list_id`, `status`, `value`, `sort`)\r\nSELECT ost_list.id, 1, 'Telephone', 1\r\nFROM ost_list\r\nWHERE `name`='Time Type';\r\n\r\nINSERT INTO `ost_list_items` (`list_id`, `status`, `value`, `sort`)\r\nSELECT ost_list.id, 1, 'Email', 2\r\nFROM ost_list\r\nWHERE `name`='Time Type';\r\n\r\nINSERT INTO `ost_list_items` (`list_id`, `status`, `value`, `sort`)\r\nSELECT ost_list.id, 1, 'Remote', 3\r\nFROM ost_list\r\nWHERE `name`='Time Type';\r\n\r\nINSERT INTO `ost_list_items` (`list_id`, `status`, `value`, `sort`)\r\nSELECT ost_list.id, 1, 'Workshop', 4\r\nFROM ost_list\r\nWHERE `name`='Time Type';\r\n\r\nINSERT INTO `ost_list_items` (`list_id`, `status`, `value`, `sort`)\r\nSELECT ost_list.id, 1, 'Onsite', 5\r\nFROM ost_list\r\nWHERE `name`='Time Type';\r\n```\r\n```SQL\r\nINSERT INTO  ost_config  (`namespace`, `key`, `value`, `updated`) VALUES\r\n ('core', 'isclienttime', 0, now()),\r\n ('core', 'istickettime', 0, now()),\r\n ('core', 'isthreadtime', 0, now()),\r\n ('core', 'isthreadtimer', 0, now()),\r\n ('core', 'isthreadbill', 0, now()),\r\n ('core', 'isthreadbilldefault', 0, now()),\r\n ('core', 'istickethardware', 0, now());\r\n```\r\n```SQL\r\nALTER TABLE  ost_ticket  ADD COLUMN  time_spent  INT( 11 ) UNSIGNED NOT NULL DEFAULT '0' AFTER  closed;\r\n```\r\n```SQL\r\nALTER TABLE  ost_ticket_thread  ADD COLUMN  time_spent  INT( 11 ) UNSIGNED NOT NULL DEFAULT '0' AFTER  thread_type;\r\n```\r\n```SQL\r\nALTER TABLE  ost_ticket_thread  ADD COLUMN  time_type  INT( 11 ) UNSIGNED NOT NULL DEFAULT '0' AFTER  time_spent;\r\n```\r\n```SQL\r\nALTER TABLE  ost_ticket_thread  ADD COLUMN  time_bill  INT( 11 ) UNSIGNED NOT NULL DEFAULT '0' AFTER  time_type;\r\n```\r\n```SQL\r\nCREATE TABLE IF NOT EXISTS `ost_ticket_hardware` (\r\n  `id` bigint(20) unsigned NOT NULL auto_increment,\r\n  `ticket_id` int(11) default NULL,\r\n  `description` varchar(255) default NULL,\r\n  `qty` int(11) NOT NULL default '0',\r\n  `unit_cost` DECIMAL(15,2) NOT NULL default '0',\r\n  `total_cost` DECIMAL(15,2) NOT NULL default '0',\r\n  PRIMARY KEY  (`id`)\r\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\r\n```\r\n\r\n\r\n\r\n## News\r\n### 13/03/2015\r\nCode modified to change hours to minutes for storage as suggested by @joshbmarshall \r\n\r\n### 14/03/2015\r\nUpdated all code to support new features added in version v1.9.6\r\n\r\n### 16/03/2015\r\nAdded Thread Timer as suggested by @joshbmarshall but modified to use buttons to start and stop the timer. Also you can disable this feature by the admin panel.\r\n\r\n### 19/03/2015\r\nCode and installer changed to support minute time storage in INT format instead of hours in decimal via FLOAT\r\n\r\n### 26/03/2015\r\nUpdated / modified installer SQL statement for dropdown list after help from @ReidarBeck & @vipitadmin\r\n\r\n### 28/03/2015\r\nFirst example report created that you can access via the print menu.\r\n\r\n### 17/04/2015\r\nWe have updated the fork and MOD to version v1.9.7\r\n\r\n### 28/06/2015\r\nUpdated the osTicket core to version 1.9.9 and checked all mod working after upgrade.\r\nDocumentation on this forum / post updated\r\nNew images showing changes and new billing report\r\n\r\n### 11/08/2015\r\nUpdated the osTicket core to version 1.9.11\r\n\r\n### 17/08/2015\r\nFix - Error with the ability to fail to add comment still resulting in time being added. This was fixed with the help of @derekjohnsonzethcon \r\n\r\n### 18/08/2015\r\nFix - Error with action time not adding up after post. This was fixed with help of @derekjohnsonzethcon \r\ni18n en_US - added help text / pop-ups for time in settings menu.\r\nAdded billable option. This update requires additional SQL changes, please follow all install instructions carefully\r\n\r\n### 19/08/2015\r\nNEW - New Hardware option located under \"More\", this displays a hardware page allowing you to add used hardware and costs to ticket\r\nUPDATED - Billing report to display hardware used on ticket\r\n\r\n### 20/08/2015\r\nCORE - Updated to osTicket v1.9.12 Core\r\nUPDATED - Added settings menu to enable or disable hardware billing\r\nUPDATED - Time Settings Menu\r\nNEW - Being able to set billable as default as requested by @freshW\r\n\r\n### 21/08/2015\r\nNEW - Invoice report found under the print menu\r\nUPDATED - Billing Information to show full information about billing and non-billing. Also now does not show hardware if disabled."},"comment":{"url":"https://api.github.com/repos/osTicket/osTicket-1.8/issues/comments/179311542","html_url":"https://github.com/osTicket/osTicket-1.8/pull/1419#issuecomment-179311542","issue_url":"https://api.github.com/repos/osTicket/osTicket-1.8/issues/1419","id":179311542,"user":{"login":"dirkbez","id":17048972,"avatar_url":"https://avatars.githubusercontent.com/u/17048972?v=3","gravatar_id":"","url":"https://api.github.com/users/dirkbez","html_url":"https://github.com/dirkbez","followers_url":"https://api.github.com/users/dirkbez/followers","following_url":"https://api.github.com/users/dirkbez/following{/other_user}","gists_url":"https://api.github.com/users/dirkbez/gists{/gist_id}","starred_url":"https://api.github.com/users/dirkbez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dirkbez/subscriptions","organizations_url":"https://api.github.com/users/dirkbez/orgs","repos_url":"https://api.github.com/users/dirkbez/repos","events_url":"https://api.github.com/users/dirkbez/events{/privacy}","received_events_url":"https://api.github.com/users/dirkbez/received_events","type":"User","site_admin":false},"created_at":"2016-02-03T16:00:50Z","updated_at":"2016-02-03T16:00:50Z","body":"Hi Robin\r\nSame as Derek, any progress on the time tracking for 1.10.  Thanks for all the work that you have done on this thus far.  It really is a big help.\r\n\r\nThanks"}}