Delicious      Technorati      Blinklist      Furl      Reddit

TimeTrex Time and Attendance

TimeTrex Time and Attendance


* FAQ    * Search
* Login   * Register

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu May 07, 2015 11:54 pm 
Offline

Joined: Wed Oct 17, 2012 4:48 pm
Posts: 108
I've tried using the API class CompanyGenericTag function called deleteCompanyGenericTag(), but this only removes the tag from the database. Opening the employee in TimeTrex shows the tag is still there but orphaned.
Code:
// this code leaves an orphaned tag still associated with the user record
$ttAPI = new TimeTrexClientAPI( 'CompanyGenericTag' );
$ttAPI->deleteCompanyGenericTag($tag['id'])

I've tried modifying the ['tag'] element of the array of data obtained from the getUserfunction in the API class User, but the tag still remains orphaned.
Code:
// this code does not remove a tag on the user record
$ttAPI = new TimeTrexClientAPI( 'User' );
$ttData = $ttAPI->getUser(null, true)->getResult();
$tagged_entry = $ttData[0];
$tagged_entry['tag'] = str_replace($tag_string,'',$tagged_entry['tag']);
$ttAPI->setUser($tagged_entry);


Top
 Profile  
 
PostPosted: Fri May 08, 2015 10:57 am 
Offline

Joined: Tue Sep 19, 2006 2:22 pm
Posts: 7278
Send the 'tag' array element like this:

Code:
'tag' => 'keepthistag, -removethistag'


So basically just add a "-" infront of the tag you want to remove, while keeping any other tags there.


Top
 Profile  
 
PostPosted: Fri May 15, 2015 12:39 am 
Offline

Joined: Wed Oct 17, 2012 4:48 pm
Posts: 108
Thanks! That worked.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron


Time and Attendance




Powered by phpBB® Forum Software © phpBB Group