From: <lph...@us...> - 2011-07-28 14:21:42
|
Revision: 35713 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=35713&view=rev Author: lphuberdeau Date: 2011-07-28 14:21:36 +0000 (Thu, 28 Jul 2011) Log Message: ----------- [MOD]?\194?\160Add a field to keep track of the source itemId and fill it on sync Modified Paths: -------------- trunk/lib/core/Services/Tracker/Controller.php Modified: trunk/lib/core/Services/Tracker/Controller.php =================================================================== --- trunk/lib/core/Services/Tracker/Controller.php 2011-07-28 14:11:52 UTC (rev 35712) +++ trunk/lib/core/Services/Tracker/Controller.php 2011-07-28 14:21:36 UTC (rev 35713) @@ -345,6 +345,16 @@ 'trackerId' => $trackerId, 'raw' => $export, ))); + $this->createField(array( + 'trackerId' => $trackerId, + 'type' => 't', + 'name' => tr('Remote Source'), + 'permName' => 'syncSource', + 'description' => tr('Automatically generated field for synchronized trackers. Contains the itemId of the remote item.'), + 'options' => $this->buildOptions(array( + 'prepend' => $url . '/item', + ), 't'), + )); $this->registerSynchronization($trackerId, $url, $remoteTracker); @@ -392,6 +402,7 @@ $this->clearTracker($trackerId); foreach ($this->getRemoteItems($syncInfo) as $item) { + $item['fields']['syncSource'] = $item['itemId']; $this->insertItem($definition, $item); } @@ -511,6 +522,15 @@ private function buildOptions($input, $typeInfo) { + if (is_string($typeInfo)) { + $types = $this->getFieldTypes($description); + $typeInfo = $types[$typeInfo]; + } + + if (is_array($input)) { + $input = new JitFilter($input); + } + $parts = array(); foreach ($typeInfo['params'] as $key => $info) { @@ -584,7 +604,7 @@ 'n', 'y', $trklib->get_last_position($data['trackerId']) + 10, - '', + isset($data['options']) ? $data['options'] : '', $data['description'], '', null, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |