wbTeamPro Feature Request & Bug Tracker
wbTeamPro and wbTimeLog are actively being developed and supported.

We are working to update our tracker, changelogs, and documentation to convey this appropriately.
Thank you for your patience as we manage this period of growth.

View Issue Details Jump to Notes ]
1 Vote
 ]
Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010328wbTeamPro[All Projects] Featurespublic2017-01-30 09:312015-01-25 00:00
Reportertagteam 
Assigned Towebuddha 
PrioritynormalSeverityminorReproducibilityalways
StatusFeedbackResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionApplied to Version 
Summary0010328: Import time logs from excel
DescriptionIs there a way to create an import process to import the time logs from an excel spreadsheet. If it isnt something you want to add to the code can you just help me develop it on the side.
I have an excel spreadsheet attached. I can write the query to import into the database but I am not sure what fields I will need to add. Fields like projectid, etc.
I can do most of the work if you can just help me get started in the right direction I will google for the rest.
Thanks
TagsNo tags attached.
Attached Filesxls file icon Time report 2014-01-01 - 2014-01-30.xls [^] (41,472 bytes) 2014-01-29 20:26

- Relationships

-  Notes
(0010088)
webuddha (administrator)
2014-02-05 14:20
edited on: 2014-02-05 14:23

The import would be fairly simply if you are comfortable with SQL. You probably would want to read the CSV into a php script to parse each line and perform the formatted insert.

Parse CSV Line in PHP
http://php.net/manual/en/function.fgetcsv.php [^]

You could use the wbDatabase class provided with wbTeamPro for your database inserts.
http://billing.holodyn.com/knowledgebase/87/91-wbDatabase-Class-Reference.html [^]

You can alternatively create a plugin or use the API for manipulating the database.
http://billing.holodyn.com/knowledgebase/84/92-Plugins-Reference.html [^]
http://billing.holodyn.com/knowledgebase/85/93-Remote-API-Methods.html [^]

The timelog_elapsed is in seconds, dates are in a standard SQL format, the action_id and ticket_id should be set to ZERO '0' if not available.

INSERT INTO `tbladdon_wbteampro_timelog` (`timelog_id`, `project_id`, `action_id`, `ticket_id`, `owner_adminid`, `owner_userid`, `date_created`, `date_modified`, `timelog_note`, `timelog_start`, `timelog_stop`, `timelog_status`, `timelog_elapsed`, `timelog_billable`, `invoice_id`) VALUES
(NULL, {project_id}, 0, 0, {adminid}, NULL, '2014-02-05 00:00:00', '2014-02-05 00:00:00', 'Test', '2014-02-05 00:00:00', '2014-02-05 00:01:00', 'complete', 60, 1, 0),

CREATE TABLE IF NOT EXISTS `tbladdon_wbteampro_timelog` (
  `timelog_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `project_id` bigint(20) unsigned NOT NULL,
  `action_id` bigint(20) unsigned NOT NULL DEFAULT '0',
  `ticket_id` int(10) unsigned NOT NULL DEFAULT '0',
  `owner_adminid` int(10) unsigned DEFAULT NULL,
  `owner_userid` int(10) unsigned DEFAULT NULL,
  `date_created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `date_modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `timelog_note` text NOT NULL,
  `timelog_start` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `timelog_stop` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `timelog_status` enum('active','complete') NOT NULL DEFAULT 'active',
  `timelog_elapsed` int(10) unsigned NOT NULL DEFAULT '0',
  `timelog_billable` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `invoice_id` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`timelog_id`),
  KEY `project_id` (`project_id`),
  KEY `action_id` (`action_id`),
  KEY `owner_adminid` (`owner_adminid`),
  KEY `timelog_status` (`timelog_status`),
  KEY `owner_userid` (`owner_userid`),
  KEY `ticket_id` (`ticket_id`)
);


- Issue History
Date Modified Username Field Change
2014-01-29 20:26 tagteam New Issue
2014-01-29 20:26 tagteam
2014-01-29 20:26 tagteam File Added: Time report 2014-01-01 - 2014-01-30.xls
2014-02-05 14:20 webuddha Note Added: 0010088
2014-02-05 14:20 webuddha Assigned To => webuddha
2014-02-05 14:20 webuddha Status New => Feedback
2014-02-05 14:21 webuddha Note Edited: 0010088 View Revisions
2014-02-05 14:23 webuddha Note Edited: 0010088 View Revisions



Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker