GPI_Translation_Services_Connector - Version 1.0.0.2

Version Notes

Always install the latest, stable version of the GPI Translation Services Connector for Magento.

Download this release

Release Info

Developer Kevin Blake-Thomas
Extension GPI_Translation_Services_Connector
Version 1.0.0.2
Comparing to
See all releases


Code changes from version 1.0.0.1 to 1.0.0.2

Files changed (29) hide show
  1. app/code/community/Gpi/Tsc/Helper/webclient/AbstractTscClientPlugin.php +78 -137
  2. app/code/community/Gpi/Tsc/Helper/webclient/BackgroundJob.php +23 -24
  3. app/code/community/Gpi/Tsc/Helper/webclient/ClientConfigurationServiceImpl.php +2 -2
  4. app/code/community/Gpi/Tsc/Helper/webclient/Constants.php +4 -4
  5. app/code/community/Gpi/Tsc/Helper/webclient/ExportBackgroundJob.php +110 -74
  6. app/code/community/Gpi/Tsc/Helper/webclient/ImportBackgroundJob.php +50 -62
  7. app/code/community/Gpi/Tsc/Helper/webclient/RemoteConnection.php +23 -19
  8. app/code/community/Gpi/Tsc/Helper/webclient/WorkerContext.php +0 -63
  9. app/code/community/Gpi/Tsc/Helper/webclient/XLIFFConstruct.php +68 -0
  10. app/code/community/Gpi/Tsc/Helper/webclient/XliffReader.php +42 -0
  11. app/code/community/Gpi/Tsc/Helper/webclient/XliffWriter.php +87 -0
  12. app/code/community/Gpi/Tsc/Model/Cron.php +142 -0
  13. app/code/community/Gpi/Tsc/Model/Lock.php +142 -0
  14. app/code/community/Gpi/Tsc/Model/MagentoGpiClient.php +129 -21
  15. app/code/community/Gpi/Tsc/Model/Quotes.php +27 -0
  16. app/code/community/Gpi/Tsc/Model/Resource/Quotes.php +28 -0
  17. app/code/community/Gpi/Tsc/Model/Resource/Quotes/Collection.php +10 -0
  18. app/code/community/Gpi/Tsc/Model/Utilities.php +208 -67
  19. app/code/community/Gpi/Tsc/etc/config.xml +15 -1
  20. app/code/community/Gpi/Tsc/sql/gpi_tsc_setup/install-1.0.0.1.php +17 -3
  21. app/locale/de_DE/Gpi_Tsc.csv +44 -0
  22. app/locale/es_ES/Gpi_Tsc.csv +44 -0
  23. app/locale/fr_FR/Gpi_Tsc.csv +44 -0
  24. app/locale/nl_NL/Gpi_Tsc.csv +43 -0
  25. app/locale/pt_BR/Gpi_Tsc.csv +44 -0
  26. app/locale/zh_CN/Gpi_Tsc.csv +43 -0
  27. js/gpi_tsc/tsc.js +30 -2
  28. package.xml +6 -6
  29. skin/adminhtml/base/default/css/gpiconnector_tsc.css +2 -2
app/code/community/Gpi/Tsc/Helper/webclient/AbstractTscClientPlugin.php CHANGED
@@ -1,22 +1,39 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  $helperPath = Mage::getModuleDir('helpers', 'Gpi_Tsc') . DS . 'Helper';
3
 
4
 
5
  $webclientPath = $helperPath . DS . 'webclient';
6
  $sharedDataPath = $helperPath . DS . 'shareddata';
7
 
8
- require($webclientPath . DS . 'ITscClientPlugin.php');
9
- require($webclientPath . DS . 'RemoteConnection.php');
10
- //require($webclientPath . DS . 'ImportArguments.php');
11
- //require($webclientPath . DS . 'ImportBackgroundJob.php');
12
- require($webclientPath . DS . 'ExportArguments.php');
13
- //require($webclientPath . DS . 'ExportBackgroundJob.php');
14
- require($webclientPath . DS . 'WorkerList.php');
15
 
16
- require($sharedDataPath . DS . 'popo' . DS. 'PojoFactory.php');
17
- require($sharedDataPath . DS . 'popo' . DS. 'WorkStatus.php');
18
- require($sharedDataPath . DS . 'popo' . DS. 'TreeNode.php');
19
- require($sharedDataPath . DS . 'popo' . DS. 'RemoteQuote.php');
20
 
21
  /**
22
  *
@@ -36,13 +53,11 @@ abstract class AbstractTscClientPlugin implements ITscClientPlugin {
36
  }
37
 
38
  public function GetStatuses() {
39
- //List<WorkStatus> statuses = new ArrayList<WorkStatus>();
40
  $statuses = array();
41
 
42
  foreach (WorkerList::$ExportWorkers as $thread) {
43
  $status = new WorkStatus();
44
  $status->setPercentaje($thread->getExportProgress());
45
- //$status->setMessage(String->format("Exported %d documents", thread->getExportedDocuments()));
46
  $status->setMessage(sprintf("Exported %d documents", $thread->getExportedDocuments()));
47
 
48
  $statuses[] = $status;
@@ -62,33 +77,18 @@ abstract class AbstractTscClientPlugin implements ITscClientPlugin {
62
  public abstract function GetChildren($parentNodeID, $sourceLanguage, $paneID);
63
 
64
  public function Import($quoteID, $userName) {
65
- $args = new ImportArguments();
66
- $args->Quote = GetQuoteByID($quoteID);
67
- $args->Plugin = $this;
68
- $args->UserName = $userName;
69
-
70
- $importJob = new ImportBackgroundJob($clientConfiguration);
71
- $importJob->run($args);
72
- WorkerList::$ImportWorkers[] = $importJob;
73
-
74
- /* New Thread Functionality */
75
- //
76
- // try
77
- // {
78
- // $thread = new ImportWorkerThread();
79
- // $thread->RunWorkerAsync(new ImportWorkerThreadArguments
80
- // {
81
- // $Quote = GetQuoteByID($quoteID),
82
- // $Plugin = $this,
83
- // $UserName = $userName
84
- // });
85
- // WorkerList::$ImportWorkers[] = $thread;
86
- // }
87
- // catch (Exception $e)
88
- // {
89
- // throw new RemotingException($e->Message);
90
- // }
91
-
92
  }
93
 
94
  public function GetConfiguration() {
@@ -173,84 +173,7 @@ abstract class AbstractTscClientPlugin implements ITscClientPlugin {
173
  $quote->TargetLanguages = array_values($quote->TargetLanguages->string);
174
  }
175
  }
176
-
177
-
178
- /*
179
- /* CMS Pages
180
- /*
181
- $pages = Mage::getModel('cms/page')->getCollection();
182
- $page = Mage::getModel('cms/page')->load('home','identifier');
183
- $title = $page->getTitle();
184
- $content = $page->getContent();
185
- $keywords = $page->getMetaKeywords();
186
- $descriptions = $page->getMetaDescription();
187
- /*
188
- /* Create new CMS Page
189
- $cmsPage = array(
190
- 'title' => 'Test Page',
191
- 'identifier' => 'test-page',
192
- 'content' => 'Sample Test Page',
193
- 'is_active' => 1,
194
- 'sort_order' => 0,
195
- 'stores' => array(0),
196
- 'root_template' => 'three_columns'
197
- );
198
- Mage::getModel('cms/page')->setData($cmsPage)->save();
199
- */
200
- /*
201
- /* CMS Blocks
202
- /*
203
- $blocks = Mage::getModel('cms/block')->getCollection();
204
- $page = Mage::getModel('cms/block')->load('footer_links','identifier');
205
- $title = $page->getTitle();
206
- $content = $page->getContent();
207
-
208
- /* Save New Block
209
- $staticBlock = array(
210
- 'title' => 'Test Block',
211
- 'identifier' => 'test-block',
212
- 'content' => 'Sample Test Block',
213
- 'is_active' => 1,
214
- 'stores' => array(o)
215
- );
216
-
217
- Mage::getModel('cms/block')->setData($staticBlock)->save();
218
- */
219
- /*
220
- /* Products */
221
- /* http://gauss-development.com/blog/e-commerce-blog/magento-mass-export-xml-format/
222
- /*
223
- /* $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*');
224
- // select all attributes
225
-
226
- foreach($collection as $product){
227
- $i++;
228
- // something
229
- }
230
- */
231
- /*
232
- /* Products */
233
- /* http://gauss-development.com/blog/e-commerce-blog/magento-mass-export-xml-format/
234
- /*
235
- $category = Mage::getModel ( 'catalog/category' );
236
- $tree = $category->getTreeModel ();
237
- $tree->load ();
238
-
239
- $ids = $tree->getCollection ()->getAllIds ();
240
-
241
- if ($ids) {
242
- foreach ( $ids as $id ) {
243
- $string = $id . ', ' .$category->load($id)->getName() . "\n";
244
- Mage::log(print_r($string,true));
245
- }
246
- }
247
- */
248
-
249
- /*
250
- /* https://github.com/bippo/magento-bulk
251
- /*
252
- Mage::log(print_r(Mage::getModel('eav/entity_attribute')->getCollection(),true));
253
- */
254
  return json_encode($quotes);
255
  }
256
 
@@ -262,25 +185,25 @@ abstract class AbstractTscClientPlugin implements ITscClientPlugin {
262
 
263
  foreach ($languages as $language) {
264
  $strings[] = $language;
265
- }
266
 
 
267
  $params = array(
268
  'projectId' => $projectId,
269
  'quoteName' => $quoteName,
270
  'quoteComments' => $quoteComments,
271
  'sourceLanguage' => $sourceLanguage,
272
- 'languages'=> $strings,
273
  'userName' => $userName
274
  );
275
 
276
- $remoteQuote = $this->remoteConnection->create()
 
277
  ->CreateQuote($params)
278
  ->CreateQuoteResult;
279
 
280
- return json_encode($remoteQuote);
281
  }
282
 
283
  public function DeleteQuote($quoteID, $userName) {
284
- //$uLong = new Math_BigInteger($quoteID);
285
  $params = array('quoteId' => $quoteID, 'userName' => $userName);
286
  $this->remoteConnection->create()->deleteQuote($params);
287
  }
@@ -292,7 +215,6 @@ abstract class AbstractTscClientPlugin implements ITscClientPlugin {
292
 
293
  public function ListLogs(){
294
  $projectId = $clientConfiguration->getProjectID();
295
- //$uLong = new Math_BigInteger($projectId);
296
  $entries = $this->remoteConnection->create()->listLogs($projectId);
297
  return $entries->getLogEntry()->toArray(new LogEntry());
298
  }
@@ -312,27 +234,46 @@ abstract class AbstractTscClientPlugin implements ITscClientPlugin {
312
 
313
  public function SendQuoteToGpms($quoteID, $userName, $quickQuote) {
314
 
315
- $nodes = json_decode($this->ListPackageFiles($quoteID));
316
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  $arguments = new ExportArguments();
318
  $arguments->Quote = $this->GetQuoteByID($quoteID);
319
  $arguments->Nodes = $nodes;
320
  $arguments->UserName = $userName;
321
- $arguments->Plugin = $this;
322
- $arguments->TotalCount = count($nodes);
323
- $arguments->QuickQuote = $quickQuote;
 
 
 
 
 
 
 
 
324
 
325
  Mage::log("SendQuoteToGpms ended");
326
-
327
- //$exportJob = new ExportBackgroundJob($clientConfiguration);
328
- //$exportJob->run($arguments);
329
- //WorkerList::$ExportWorkers[] = $exportJob;
330
-
331
  }
332
 
333
- // array_walk_recursive pass-by-reference example
334
-
335
-
336
  public function ListPackageFiles($quoteID) {
337
 
338
  $createParams = array(
1
  <?php
2
+ /**
3
+ * Globalization Partners International
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@globalizationpartners.com so we can send you a copy immediately.
14
+ *
15
+ * @category Gpi
16
+ * @package Gpi_Tsc
17
+ * @copyright Copyright (c) 2015 Globalization Partners International, LLC. (http://www.globalizationpartners.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
  $helperPath = Mage::getModuleDir('helpers', 'Gpi_Tsc') . DS . 'Helper';
22
 
23
 
24
  $webclientPath = $helperPath . DS . 'webclient';
25
  $sharedDataPath = $helperPath . DS . 'shareddata';
26
 
27
+ include_once($webclientPath . DS . 'ITscClientPlugin.php');
28
+ include_once($webclientPath . DS . 'RemoteConnection.php');
29
+ include_once($webclientPath . DS . 'ImportArguments.php');
30
+ include_once($webclientPath . DS . 'ExportArguments.php');
31
+ include_once($webclientPath . DS . 'WorkerList.php');
 
 
32
 
33
+ include_once($sharedDataPath . DS . 'popo' . DS. 'PojoFactory.php');
34
+ include_once($sharedDataPath . DS . 'popo' . DS. 'WorkStatus.php');
35
+ include_once($sharedDataPath . DS . 'popo' . DS. 'TreeNode.php');
36
+ include_once($sharedDataPath . DS . 'popo' . DS. 'RemoteQuote.php');
37
 
38
  /**
39
  *
53
  }
54
 
55
  public function GetStatuses() {
 
56
  $statuses = array();
57
 
58
  foreach (WorkerList::$ExportWorkers as $thread) {
59
  $status = new WorkStatus();
60
  $status->setPercentaje($thread->getExportProgress());
 
61
  $status->setMessage(sprintf("Exported %d documents", $thread->getExportedDocuments()));
62
 
63
  $statuses[] = $status;
77
  public abstract function GetChildren($parentNodeID, $sourceLanguage, $paneID);
78
 
79
  public function Import($quoteID, $userName) {
80
+ $arguments = new ImportArguments();
81
+ $arguments->Quote = $this->GetQuoteByID($quoteID);
82
+ $arguments->UserName = $userName;
83
+ $arguments->Plugin = null;
84
+
85
+ $backgroundJob = array(
86
+ 'job_type' => 'Import',
87
+ 'job_params' => serialize($arguments)
88
+ );
89
+ Mage::getModel('gpi_tsc/backgroundjobs')
90
+ ->setData($backgroundJob)
91
+ ->save();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  }
93
 
94
  public function GetConfiguration() {
173
  $quote->TargetLanguages = array_values($quote->TargetLanguages->string);
174
  }
175
  }
176
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  return json_encode($quotes);
178
  }
179
 
185
 
186
  foreach ($languages as $language) {
187
  $strings[] = $language;
 
188
 
189
+ }
190
  $params = array(
191
  'projectId' => $projectId,
192
  'quoteName' => $quoteName,
193
  'quoteComments' => $quoteComments,
194
  'sourceLanguage' => $sourceLanguage,
195
+ 'languages' => $strings,
196
  'userName' => $userName
197
  );
198
 
199
+ $remoteQuote = $this->remoteConnection
200
+ ->create()
201
  ->CreateQuote($params)
202
  ->CreateQuoteResult;
203
 
204
+ return $remoteQuote;
205
  }
206
 
207
  public function DeleteQuote($quoteID, $userName) {
 
208
  $params = array('quoteId' => $quoteID, 'userName' => $userName);
209
  $this->remoteConnection->create()->deleteQuote($params);
210
  }
215
 
216
  public function ListLogs(){
217
  $projectId = $clientConfiguration->getProjectID();
 
218
  $entries = $this->remoteConnection->create()->listLogs($projectId);
219
  return $entries->getLogEntry()->toArray(new LogEntry());
220
  }
234
 
235
  public function SendQuoteToGpms($quoteID, $userName, $quickQuote) {
236
 
237
+ $trees = json_decode($this->ListPackageFiles($quoteID));
238
+
239
+ $nodes = array();
240
+ $totalCount = 0;
241
+ foreach ($trees as $root)
242
+ {
243
+ Mage::log("processing '$root->ID'...");
244
+ if (!array_key_exists($root->ID, $nodes))
245
+ {
246
+ Mage::log("adding '$root->ID' key to node array...");
247
+ $nodes[$root->ID] = array();
248
+ } else {
249
+ Mage::log("the key '$root->ID' already exists...");
250
+ }
251
+
252
+ $children = $this->ConvertTreeNodesToIds($root);
253
+ Mage::log("key:'$root->ID', children:'" . print_r($children, true) . "'");
254
+ $totalCount += sizeof($children);
255
+ $nodes[$root->ID][] = $children;
256
+ }
257
+
258
  $arguments = new ExportArguments();
259
  $arguments->Quote = $this->GetQuoteByID($quoteID);
260
  $arguments->Nodes = $nodes;
261
  $arguments->UserName = $userName;
262
+ $arguments->Plugin = null;
263
+ $arguments->TotalCount = $totalCount;
264
+ $arguments->QuickQuote = $quickQuote;
265
+
266
+ $backgroundJob = array(
267
+ 'job_type' => 'Export',
268
+ 'job_params' => serialize($arguments)
269
+ );
270
+ Mage::getModel('gpi_tsc/backgroundjobs')
271
+ ->setData($backgroundJob)
272
+ ->save();
273
 
274
  Mage::log("SendQuoteToGpms ended");
 
 
 
 
 
275
  }
276
 
 
 
 
277
  public function ListPackageFiles($quoteID) {
278
 
279
  $createParams = array(
app/code/community/Gpi/Tsc/Helper/webclient/BackgroundJob.php CHANGED
@@ -1,28 +1,28 @@
1
  <?php
2
-
3
-
4
- //import tsc.utils.ServiceLocator;
5
- /*use Zend\Loader\StandardAutoloader;
6
- use Zend\Feed\Reader\Reader;
7
- use Zend\Debug\Debug;
8
-
9
- //include_once(Mage::getBaseDir('lib').'\Zend\Loader\StandardAutoloader.php');
10
-
11
- $loader = new StandardAutoloader(array('autoregister_zf' => true));
12
- $loader->register();*/
13
-
14
  /**
15
- *
16
  *
17
- * @param <TJobArguments>
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  */
 
19
  abstract class BackgroundJob {
20
- //extends Thread {
21
-
22
  /**
23
  *
24
  */
25
- protected $arguments;
26
 
27
  /**
28
  *
@@ -32,26 +32,25 @@ abstract class BackgroundJob {
32
 
33
  /**
34
  *
35
- * @param resourceResolver
36
  * @param clientConfigurationService
37
  */
38
  protected function __construct($clientConfigurationService) {
39
- $remoteConnection = new RemoteConnection($clientConfigurationService);
40
  }
41
 
42
  /**
43
  *
44
- * @param args
45
  */
46
- protected abstract function run();
47
 
48
 
49
  /**
50
  *
51
  * @param args
52
  */
53
- public function execute($args) {
54
- $this->$arguments = $args;
55
- $this->start();
56
  }
57
  }
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
+ * Globalization Partners International
4
  *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@globalizationpartners.com so we can send you a copy immediately.
14
+ *
15
+ * @category Gpi
16
+ * @package Gpi_Tsc
17
+ * @copyright Copyright (c) 2015 Globalization Partners International, LLC. (http://www.globalizationpartners.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
+
21
  abstract class BackgroundJob {
 
 
22
  /**
23
  *
24
  */
25
+ protected $args;
26
 
27
  /**
28
  *
32
 
33
  /**
34
  *
 
35
  * @param clientConfigurationService
36
  */
37
  protected function __construct($clientConfigurationService) {
38
+ $this->remoteConnection = new RemoteConnection($clientConfigurationService);
39
  }
40
 
41
  /**
42
  *
43
+ *
44
  */
45
+ protected abstract function doWork();
46
 
47
 
48
  /**
49
  *
50
  * @param args
51
  */
52
+ public function run($args) {
53
+ $this->args = $args;
54
+ $this->doWork();
55
  }
56
  }
app/code/community/Gpi/Tsc/Helper/webclient/ClientConfigurationServiceImpl.php CHANGED
@@ -2,8 +2,8 @@
2
 
3
  $webclientPath = Mage::getModuleDir('helpers', 'Gpi_Tsc') . DS . 'Helper' . DS . 'webclient';
4
 
5
- include($webclientPath . DS . 'ClientConfigurationService.php');
6
- include($webclientPath . DS . 'Xxtea.php');
7
 
8
  class ClientConfigurationServiceImpl implements ClientConfigurationService {
9
 
2
 
3
  $webclientPath = Mage::getModuleDir('helpers', 'Gpi_Tsc') . DS . 'Helper' . DS . 'webclient';
4
 
5
+ include_once($webclientPath . DS . 'ClientConfigurationService.php');
6
+ include_once($webclientPath . DS . 'Xxtea.php');
7
 
8
  class ClientConfigurationServiceImpl implements ClientConfigurationService {
9
 
app/code/community/Gpi/Tsc/Helper/webclient/Constants.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
- public final class Constants {
4
- public static final $TRANSFER_SIZE_LIMIT = (4 * 1024 * 1024);//4mb
5
- public static final $MAX_TRANSFER_SIZE_LIMIT = (4 * 1024 * 1024) + (1 * 1024 * 1024);//5mb
6
- public static final $MAX_TRANSFER_COUNT_LIMIT = 96;
7
  }
1
  <?php
2
 
3
+ class Constants {
4
+ const TRANSFER_SIZE_LIMIT = 4194304;//4mb
5
+ const MAX_TRANSFER_SIZE_LIMIT = 5242880;//5mb
6
+ const MAX_TRANSFER_COUNT_LIMIT = 96;
7
  }
app/code/community/Gpi/Tsc/Helper/webclient/ExportBackgroundJob.php CHANGED
@@ -1,127 +1,163 @@
1
  <?php
2
  /**
3
- *
4
  *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  */
 
6
  class ExportBackgroundJob extends BackgroundJob {
7
 
8
- /**
9
- *
10
- * @param resourceResolver
11
- * @param clientConfigurationService
12
- */
13
  public function __construct($clientConfigurationService) {
14
  parent::__construct($clientConfigurationService);
15
  }
16
-
17
- private static final $_synLock = new Object(); //TODO: Ask behaviour
18
-
19
- private $_exportedDocuments;
20
- private $_exportProgress;
21
-
22
 
23
- /**
24
- *
25
- * @return
26
- */
27
- public function getExportedDocuments(){
28
- return $_exportedDocuments;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  }
30
 
31
- /**
32
- *
33
- * @return
34
- */
35
- public function getExportProgress(){
36
- return $_exportProgress;
 
 
 
 
 
37
  }
38
 
39
  /**
40
- * @param ExportArguments
41
  */
42
- protected function run() {
43
-
44
- $args = parent::$arguments;
45
 
46
- $context = WorkerContext->CreateContext();
47
- $context->SetValue("ExportNodes", $args->Nodes);
48
- $context->SetValue("CurrentQuote", $args->Quote);
 
 
49
 
50
  try{
51
- $args->Plugin->BeforeExport($context);
52
 
53
- //$factory = new ObjectFactory(); //TODO: Check this Object
54
- $documents = array(); //TODO: Check this Object
55
 
56
  $count = 0;
57
  $size = 0;
58
  $breakNow = false;
59
  $_exportedDocuments = 0;
60
 
61
- $userName = $args->UserName;
62
- $quoteId = $args->Quote->getID();
63
-
64
- foreach($args->Nodes as $node) {
65
- $nextDocument = null;
66
- for ($i = 0, $l = sizeof($node), $last = $l-1; $i < $l; ++$i ) {
67
- $documentID = $node[$i];
68
-
69
- //synchronized ($_synLock) { //TODO: to change to PHP
70
- $doc;
71
- if (nextDocument == null) {
72
- $doc = $args->Plugin->GetRemoteDocument($node->getKey(), $documentID, $context);
73
 
74
- } else {
75
- $doc = $nextDocument;
76
- $nextDocument = null;
77
- }
 
 
 
 
 
 
 
 
 
78
 
79
- ++$count;
80
- ++$_exportedDocuments;
81
 
82
- if ($doc != null) {
83
- $documents[] = $doc;
84
- $size += strlen($doc->getContents()->getValue());
85
- }
86
 
87
- $_exportProgress = (($_exportedDocuments / $args->TotalCount) * 100);
88
 
89
- if ($i < $last) {//check if next document size will grown up the total size by more than a mb...
90
- $nextDocument = $args->Plugin->GetRemoteDocument($node->getKey(), $node[$i+1], $context);
91
- $breakNow = (($size + sizeof($nextDocument->getContents()->getValue()) > $Constants->MAX_TRANSFER_SIZE_LIMIT);
92
- }
93
- //}
94
 
95
- if (!$breakNow && $count < $Constants->MAX_TRANSFER_COUNT_LIMIT && $size - $Constants->MAX_TRANSFER_SIZE_LIMIT < 0) {//96 files, 4mb limit or next accumulated bigger than 5mb
96
  continue;
97
  }
98
 
99
  //send accumulated documents
100
- $remoteConnection->create()->addDocuments($quoteId, $documents, $userName);
101
 
102
  $count = 0;
103
  $size = 0;
104
  $breakNow = false;
105
- unset($documents);
106
  }
107
  }
108
 
109
  if (count($documents) > 0) {
110
  //some documents left to send
111
  //send accumulated documents
112
- $remoteConnection->create()->addDocuments($quoteId, $documents, $userName);
113
  }
114
 
115
- $args->Plugin->BeforeSendQuoteToGpms($context);
116
 
117
- $remoteConnection->create()->sendQuoteToGpms($quoteId, $userName, $args->QuickQuote);
118
 
119
- $args->Plugin->AfterExport($context);
120
- } catch ($e) {
121
- $args->Plugin->ExportFailed($context, $e);
122
- } finally{
123
- WorkerList->ExportWorkers->remove($this);
124
- WorkerContext->DisposeContext($context);
125
  }
 
 
 
 
126
  }
127
  }
1
  <?php
2
  /**
3
+ * Globalization Partners International
4
  *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@globalizationpartners.com so we can send you a copy immediately.
14
+ *
15
+ * @category Gpi
16
+ * @package Gpi_Tsc
17
+ * @copyright Copyright (c) 2015 Globalization Partners International, LLC. (http://www.globalizationpartners.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
+
21
  class ExportBackgroundJob extends BackgroundJob {
22
 
 
 
 
 
 
23
  public function __construct($clientConfigurationService) {
24
  parent::__construct($clientConfigurationService);
25
  }
 
 
 
 
 
 
26
 
27
+ private function addDocuments($quoteId, $documents, $userName)
28
+ {
29
+ Mage::log("ExportBackgroundJob::addDocuments started");
30
+
31
+ $params = array(
32
+ 'quoteId' => $quoteId,
33
+ 'documents' => array_values($documents),
34
+ 'userName' => $userName
35
+ );
36
+ /*
37
+ for ($i = 0; $i < 5; $i++) {
38
+ try {
39
+
40
+ //plugin.Logger.Info("Successfully transferred {0} documents to quote# {1}", documents.Count, quoteID);
41
+ break;
42
+ } catch (Exception $e) {
43
+ //plugin.Logger.Error(ex, "Failed to add documents to quote# {0}, Attempt No: {1}. Will wait ten (10) seconds before re-trying..", quoteID, (i + 1));
44
+ if ($i == 4)
45
+ throw $e;
46
+ }
47
+ }*/
48
+
49
+
50
+ $client = $this->remoteConnection->create();
51
+ try {
52
+
53
+ $result = $client->AddDocuments($params);
54
+ var_dump($result);
55
+ }catch(Exception $ex){
56
+ var_dump($ex);
57
+ }
58
+
59
+ Mage::log($client->__getLastRequest());
60
+
61
+ Mage::log("ExportBackgroundJob::addDocuments exited");
62
  }
63
 
64
+ private function sendQuoteToGpms($quoteId, $userName, $quickQuote)
65
+ {
66
+ $params = array(
67
+ 'quoteId' => $quoteId,
68
+ 'userName' => $userName,
69
+ 'quickQuote' => $quickQuote,
70
+ );
71
+
72
+ $this->remoteConnection
73
+ ->create()
74
+ ->SendQuoteToGpms($params);
75
  }
76
 
77
  /**
78
+ *
79
  */
80
+ protected function doWork() {
 
 
81
 
82
+ Mage::log("ExportBackgroundJob::doWork started");
83
+
84
+ $context = array();
85
+ $context["nodes"] = $this->args->Nodes;
86
+ $context["quote"] = $this->args->Quote;
87
 
88
  try{
89
+ $this->args->Plugin->BeforeExport($context);
90
 
91
+ $documents = array();
 
92
 
93
  $count = 0;
94
  $size = 0;
95
  $breakNow = false;
96
  $_exportedDocuments = 0;
97
 
98
+ $userName = $this->args->UserName;
99
+ $quoteId = $this->args->Quote->ID;
 
 
 
 
 
 
 
 
 
 
100
 
101
+ $paneIds = array_keys($this->args->Nodes);
102
+ foreach($paneIds as $paneId)
103
+ {
104
+ $nextDocument = null;
105
+ for ($i = 0, $l = count($this->args->Nodes[$paneId][0]), $last = $l-1; $i < 1; ++$i ) {
106
+ $documentID = $this->args->Nodes[$paneId][0][$i];
107
+ $doc;
108
+ if ($nextDocument == null) {
109
+ $doc = $this->args->Plugin->GetRemoteDocument($paneId, $documentID, $context);
110
+ } else {
111
+ $doc = $nextDocument;
112
+ $nextDocument = null;
113
+ }
114
 
115
+ ++$count;
116
+ ++$_exportedDocuments;
117
 
118
+ if (!is_null($doc)) {
119
+ $documents[] = $doc;
120
+ $size += strlen($doc['Contents']);
121
+ }
122
 
123
+ $_exportProgress = (($_exportedDocuments / $this->args->TotalCount) * 100);
124
 
125
+ if ($i < $last) {//check if next document size will grown up the total size by more than a mb...
126
+ $nextDocument = $this->args->Plugin->GetRemoteDocument($paneId, $this->args->Nodes[$paneId][0][$i + 1], $context);
127
+ $breakNow = ($size + sizeof($nextDocument['Contents']) > Constants::MAX_TRANSFER_SIZE_LIMIT);
128
+ }
 
129
 
130
+ if (!$breakNow && $count < Constants::MAX_TRANSFER_COUNT_LIMIT && $size - Constants::MAX_TRANSFER_SIZE_LIMIT < 0) {//96 files, 4mb limit or next accumulated bigger than 5mb
131
  continue;
132
  }
133
 
134
  //send accumulated documents
135
+ $this->addDocuments($quoteId, $documents, $userName);
136
 
137
  $count = 0;
138
  $size = 0;
139
  $breakNow = false;
140
+ $documents = array();
141
  }
142
  }
143
 
144
  if (count($documents) > 0) {
145
  //some documents left to send
146
  //send accumulated documents
147
+ $this->addDocuments($quoteId, $documents, $userName);
148
  }
149
 
150
+ $this->args->Plugin->BeforeSendQuoteToGpms($context);
151
 
152
+ $this->sendQuoteToGpms($quoteId, $userName, $quickQuote);
153
 
154
+ $this->args->Plugin->AfterExport($context);
155
+ } catch (Exception $e) {
156
+ $this->args->Plugin->ExportFailed($context, $e);
 
 
 
157
  }
158
+ //WorkerList::ExportWorkers->remove($this);
159
+ unset($context);
160
+
161
+ Mage::log("ExportBackgroundJob::doWork exited");
162
  }
163
  }
app/code/community/Gpi/Tsc/Helper/webclient/ImportBackgroundJob.php CHANGED
@@ -1,88 +1,76 @@
1
  <?php
2
-
3
- include('WorkerList.php');
4
- include('WorkerContext.php');
5
- include('BackgroundJob.php');
6
-
7
  /**
8
- *
 
 
9
  *
 
 
 
 
 
 
 
 
 
 
 
 
10
  */
 
11
  class ImportBackgroundJob extends BackgroundJob {
12
 
13
  public function __construct($clientConfigurationService) {
14
- super($clientConfigurationService); //(call parent constructor
15
- }
16
-
17
- //private static final $_synLock = new Object();
18
- private static $_synLock;
19
-
20
- private $_importedDocuments;
21
- private $_importedProgress;
22
-
23
- /**
24
- *
25
- * @return
26
- */
27
- public function getImportedDocuments(){
28
- return $_importedDocuments;
29
- }
30
-
31
- /**
32
- *
33
- * @return
34
- */
35
- public function getImportedProgress(){
36
- return $_importedProgress;
37
  }
38
 
39
  /**
40
  *
41
  */
42
- protected function run($args) {
43
-
44
- $args = parent::$arguments;
45
-
46
- $context = $WorkerContext->CreateContext();
47
- $context->SetValue("CurrentQuote", $args->Quote); //check set value function
48
 
49
  try {
50
- $args->Plugin->BeforeImport($context);
 
 
 
 
 
 
 
 
51
 
52
- $count = 0;
53
- $_importedDocuments = 0;
54
-
55
  while(true) {
 
 
 
 
 
56
 
57
- $quoteId = $args->Quote->getID();
58
- $documents = $remoteConnection->create()->getDocuments(strval($context->getID()),
59
- $quoteId, $args->UserName);
60
-
61
- $bj = new BackgroundJob();
62
- $bj->start();
63
- $bj->synchronized(function ($_synLock) {
64
- $docs = $documents->getDocuments()->getValue()->getRemoteDocument();
65
- $count += count($docs);
66
- foreach ($docs as $document) {
67
- $args->Plugin->SetRemoteDocument($document, $context);
68
- ++$_importedDocuments;
69
- $_importedProgress = (($_importedDocuments / $count) * 100);
70
- }
71
- }, $bj);
72
 
73
- if ($documents->isLastBatch())
74
  break;
75
  }
76
 
77
- $args->Plugin->AfterImport($context);
78
 
79
  } catch (Exception $e) {
80
- $args->Plugin->ImportFailed($context, $e);
81
- } finally {
82
- //WorkerList->ImportWorkers->remove($this);
83
- $position = array_keys(WorkerList::$ImportWorkers, $this);
84
- unset(WorkerList::$ImportWorkers[$position]);
85
- WorkerContext::DisposeContext($context);
86
  }
 
 
 
 
87
  }
88
  }
1
  <?php
 
 
 
 
 
2
  /**
3
+ * Globalization Partners International
4
+ *
5
+ * NOTICE OF LICENSE
6
  *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@globalizationpartners.com so we can send you a copy immediately.
14
+ *
15
+ * @category Gpi
16
+ * @package Gpi_Tsc
17
+ * @copyright Copyright (c) 2015 Globalization Partners International, LLC. (http://www.globalizationpartners.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
+
21
  class ImportBackgroundJob extends BackgroundJob {
22
 
23
  public function __construct($clientConfigurationService) {
24
+ parent::__construct($clientConfigurationService);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  }
26
 
27
  /**
28
  *
29
  */
30
+ protected function doWork() {
31
+
32
+ Mage::log("ImportBackgroundJob::doWork started");
33
+
34
+ $context = array();
35
+ $context["quote"] = $this->args->Quote;
36
 
37
  try {
38
+ $this->args->Plugin->BeforeImport($context);
39
+
40
+ $requestId = com_create_guid();
41
+
42
+ $params = array(
43
+ "pQueryIdentifier" => $requestId,
44
+ "quoteId" => $this->args->Quote->ID,
45
+ "userName" => $this->args->UserName
46
+ );
47
 
 
 
 
48
  while(true) {
49
+
50
+ $response = $this->remoteConnection
51
+ ->create()
52
+ ->GetDocuments($params)
53
+ ->GetDocumentsResult;
54
 
55
+ $documents = $response->Documents->RemoteDocument;
56
+ foreach ($documents as $document) {
57
+ $this->args->Plugin->SetRemoteDocument($document, $context);
58
+ }
 
 
 
 
 
 
 
 
 
 
 
59
 
60
+ if ($response->LastBatch)
61
  break;
62
  }
63
 
64
+ $this->args->Plugin->AfterImport($context);
65
 
66
  } catch (Exception $e) {
67
+ Mage::log("ImportBackgroundJob::doWork exception");
68
+ $this->args->Plugin->ImportFailed($context, $e);
69
+ Mage::log($e->getMessage());
 
 
 
70
  }
71
+
72
+ unset($context);
73
+
74
+ Mage::log("ImportBackgroundJob::doWork exited");
75
  }
76
  }
app/code/community/Gpi/Tsc/Helper/webclient/RemoteConnection.php CHANGED
@@ -1,4 +1,23 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Class used to initiate connections with the remote server
4
  *
@@ -20,7 +39,6 @@ class RemoteConnection {
20
  * @return
21
  */
22
  public function create($params = null) {
23
- $service = null;
24
 
25
  $default = array(
26
  // We shall only enable TRACING & EXCEPTION for dev
@@ -29,28 +47,14 @@ class RemoteConnection {
29
  'cache_wsdl' => WSDL_CACHE_NONE,
30
  'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
31
  );
32
-
33
- /*
34
- * Mage::log(print_r($params, true));
35
- * Mage::log(print_r($default, true));
36
- */
37
-
38
  if(isset($params)) {
39
  $default = array_merge($params, $default);
40
- //Mage::log(print_r($default, true));
41
  }
42
 
43
- try{
44
- $tscServerEndPointUrl = "http://tsc.globalizationpartners.info/webservices/rpc.svc?wsdl";
45
- //$configuration->getTscServerEndPoint(); //pull from the database
46
 
47
- $service = new SoapClient(
48
- $tscServerEndPointUrl, $default
49
- );
50
- }catch(Exception $ex){
51
- //$ex.printStackTrace();
52
- }
53
-
54
- return $service;
55
  }
56
  }
1
  <?php
2
+ /**
3
+ * Globalization Partners International
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@globalizationpartners.com so we can send you a copy immediately.
14
+ *
15
+ * @category Gpi
16
+ * @package Gpi_Tsc
17
+ * @copyright Copyright (c) 2015 Globalization Partners International, LLC. (http://www.globalizationpartners.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
  /**
22
  * Class used to initiate connections with the remote server
23
  *
39
  * @return
40
  */
41
  public function create($params = null) {
 
42
 
43
  $default = array(
44
  // We shall only enable TRACING & EXCEPTION for dev
47
  'cache_wsdl' => WSDL_CACHE_NONE,
48
  'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
49
  );
50
+
 
 
 
 
 
51
  if(isset($params)) {
52
  $default = array_merge($params, $default);
 
53
  }
54
 
55
+ $tscServerEndPointUrl = $this->configuration->getTscServerEndPoint();
56
+ //"http://tsc.globalizationpartners.info/webservices/rpc.svc?wsdl";
 
57
 
58
+ return new SoapClient($tscServerEndPointUrl, $default);
 
 
 
 
 
 
 
59
  }
60
  }
app/code/community/Gpi/Tsc/Helper/webclient/WorkerContext.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
2
- //ASK FOR GUIDANCE
3
- /**
4
- * A worker context stores information for a specific import/export context
5
- */
6
- class WorkerContext {
7
- private static $_contexts = array();
8
- private $_values = array();
9
-
10
- private $_id;
11
-
12
- private function __construct() {
13
- $_id = uniqid();
14
- }
15
-
16
-
17
- /**
18
- *
19
- * @return
20
- */
21
- public function getID() { return $_id; }
22
-
23
-
24
- /**
25
- *
26
- * @param key
27
- * @param value
28
- */
29
- public function SetValue($key, $value) {
30
- //$_values[] = array($key, $value);
31
- $_values[$key] = $value;
32
- }
33
-
34
-
35
- /**
36
- *
37
- * @param key
38
- * @return
39
- */
40
- public function GetValue($key) {
41
- return $_values[$key];
42
- }
43
-
44
- /**
45
- *
46
- * @return
47
- */
48
- static function CreateContext() {
49
- $context = new WorkerContext();
50
- $position = $context->_id;
51
- $_context[$position] = $context;
52
- return $context;
53
- }
54
-
55
- /**
56
- *
57
- * @param context
58
- */
59
- static function DisposeContext($context) {
60
- $position = array_keys($_contexts, $context->_id);
61
- unset($_contexts[$position]);
62
- }
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Gpi/Tsc/Helper/webclient/XLIFFConstruct.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class XLIFFConstruct extends XMLWriter
3
+ {
4
+
5
+ /**
6
+ * Constructor.
7
+ * @param string $prm_rootElementName A root element's name of a current xml document
8
+ * @param string $prm_xsltFilePath Path of a XSLT file.
9
+ * @access public
10
+ * @param null
11
+ */
12
+ var $_phrase_id=1;
13
+ public function __construct(){
14
+ $this->openMemory();
15
+ $this->setIndent(true);
16
+ $this->setIndentString(' ');
17
+ $this->startDocument('1.0', 'UTF-8');
18
+
19
+ if($prm_xsltFilePath){
20
+ $this->writePi('xml-stylesheet', 'type="text/xsl" href="'.$prm_xsltFilePath.'"');
21
+ }
22
+ $this->startElement('xliff');
23
+ $this->writeAttribute('version', '1.0');
24
+ $this->startElement('file');
25
+ $this->writeAttribute('original', 'global');
26
+ $this->writeAttribute('source-language', 'es');
27
+ $this->writeAttribute('datatype', 'plaintext');
28
+ $this->writeAttribute('date', date('c'));
29
+ $this->startElement('body');
30
+ }
31
+ public function addPhrase($source, $target){
32
+ $this->startElement('trans-unit');
33
+ $this->writeAttribute('id', $this->_phrase_id++);
34
+ $this->startElement('source');
35
+ $this->text($source);
36
+ $this->endElement();
37
+ $this->startElement('target');
38
+ $this->text($target);
39
+ $this->endElement();
40
+ $this->endElement();
41
+ }
42
+
43
+ public function addTransUnit($fieldName, $content){
44
+ $this->startElement('trans-unit');
45
+ $this->writeAttribute('id', $this->_phrase_id++);
46
+ $this->writeAttribute('rel', $fieldName);
47
+ $this->startElement('source');
48
+ $this->text($content);
49
+ $this->endElement();
50
+ $this->startElement('target');
51
+ $this->text($content);
52
+ $this->endElement();
53
+ $this->endElement();
54
+ }
55
+
56
+ public function getDocument(){
57
+ $this->endElement();
58
+ $this->endElement();
59
+ $this->endElement();
60
+ $this->endDocument();
61
+ return $this->outputMemory();
62
+ }
63
+ public function output(){
64
+ header('Content-type: text/xml');
65
+ echo $this->getDocument();
66
+ }
67
+ }
68
+ ?>
app/code/community/Gpi/Tsc/Helper/webclient/XliffReader.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Globalization Partners International
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@globalizationpartners.com so we can send you a copy immediately.
14
+ *
15
+ * @category Gpi
16
+ * @package Gpi_Tsc
17
+ * @copyright Copyright (c) 2015 Globalization Partners International, LLC. (http://www.globalizationpartners.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class XliffReader {
22
+
23
+ public static function parseData($xml){
24
+ $dom = new DOMDocument();
25
+ $dom->loadXML($xml);
26
+ $transUnits = $dom->getElementsByTagName('trans-unit');
27
+
28
+ $data = array();
29
+ foreach($transUnits as $transUnit) {
30
+ if ($transUnit->childNodes->length < 2 || !$transUnit->hasAttribute('rel')) {
31
+ continue;
32
+ }
33
+
34
+ $key = $transUnit->getAttribute('rel');
35
+ $target = $transUnit->childNodes->item(1);
36
+ $data[$key] = $target->nodeValue;
37
+ }
38
+
39
+ return $data;
40
+ }
41
+ }
42
+ ?>
app/code/community/Gpi/Tsc/Helper/webclient/XliffWriter.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Globalization Partners International
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@globalizationpartners.com so we can send you a copy immediately.
14
+ *
15
+ * @category Gpi
16
+ * @package Gpi_Tsc
17
+ * @copyright Copyright (c) 2015 Globalization Partners International, LLC. (http://www.globalizationpartners.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class XliffWriter extends XMLWriter
22
+ {
23
+
24
+ /**
25
+ * Constructor.
26
+ * @param string $prm_rootElementName A root element's name of a current xml document
27
+ * @param string $prm_xsltFilePath Path of a XSLT file.
28
+ * @access public
29
+ * @param null
30
+ */
31
+ var $_phrase_id=1;
32
+ public function __construct(){
33
+ $this->openMemory();
34
+ $this->setIndent(true);
35
+ $this->setIndentString(' ');
36
+ $this->startDocument('1.0', 'UTF-8');
37
+
38
+ if($prm_xsltFilePath){
39
+ $this->writePi('xml-stylesheet', 'type="text/xsl" href="'.$prm_xsltFilePath.'"');
40
+ }
41
+ $this->startElement('xliff');
42
+ $this->writeAttribute('version', '1.0');
43
+ $this->startElement('file');
44
+ $this->writeAttribute('original', 'global');
45
+ $this->writeAttribute('source-language', 'es');
46
+ $this->writeAttribute('datatype', 'plaintext');
47
+ $this->writeAttribute('date', date('c'));
48
+ $this->startElement('body');
49
+ }
50
+ public function addPhrase($source, $target){
51
+ $this->startElement('trans-unit');
52
+ $this->writeAttribute('id', $this->_phrase_id++);
53
+ $this->startElement('source');
54
+ $this->text($source);
55
+ $this->endElement();
56
+ $this->startElement('target');
57
+ $this->text($target);
58
+ $this->endElement();
59
+ $this->endElement();
60
+ }
61
+
62
+ public function addTransUnit($fieldName, $content){
63
+ $this->startElement('trans-unit');
64
+ $this->writeAttribute('id', $this->_phrase_id++);
65
+ $this->writeAttribute('rel', $fieldName);
66
+ $this->startElement('source');
67
+ $this->text($content);
68
+ $this->endElement();
69
+ $this->startElement('target');
70
+ $this->text($content);
71
+ $this->endElement();
72
+ $this->endElement();
73
+ }
74
+
75
+ public function getDocument(){
76
+ $this->endElement();
77
+ $this->endElement();
78
+ $this->endElement();
79
+ $this->endDocument();
80
+ return $this->outputMemory();
81
+ }
82
+ public function output(){
83
+ header('Content-type: text/xml');
84
+ echo $this->getDocument();
85
+ }
86
+ }
87
+ ?>
app/code/community/Gpi/Tsc/Model/Cron.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Globalization Partners International
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@globalizationpartners.com so we can send you a copy immediately.
14
+ *
15
+ * @category Gpi
16
+ * @package Gpi_Tsc
17
+ * @copyright Copyright (c) 2015 Globalization Partners International, LLC. (http://www.globalizationpartners.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ $helperPath = Mage::getModuleDir('helpers', 'Gpi_Tsc') . DS . 'Helper';
22
+ $modelPath = Mage::getModuleDir('Model', 'Gpi_Tsc') . DS . 'Model';
23
+
24
+ $webclientPath = $helperPath . DS . 'webclient';
25
+ $sharedDataPath = $helperPath . DS . 'shareddata';
26
+
27
+
28
+ include_once($modelPath . DS . 'MagentoGpiClient.php');
29
+ include_once($webclientPath . DS . 'BackgroundJob.php');
30
+ include_once($webclientPath . DS . 'ClientConfigurationServiceImpl.php');
31
+ include_once($webclientPath . DS . 'Constants.php');
32
+ include_once($webclientPath . DS . 'ExportBackgroundJob.php');
33
+ include_once($webclientPath . DS . 'ImportBackgroundJob.php');
34
+ include_once($webclientPath . DS . 'RemoteConnection.php');
35
+ include_once($webclientPath . DS . 'XliffReader.php');
36
+ include_once($webclientPath . DS . 'XliffWriter.php');
37
+
38
+ /**
39
+ * Tsc Cron Model
40
+ *
41
+ * @category Gpi
42
+ * @package Gpi_Tsc
43
+ * @author GPI Development Team <magento@globalizationpartners.com>
44
+ */
45
+ class Gpi_Tsc_Model_Cron extends Mage_Core_Model_Abstract {
46
+ protected $clientConfigurationService = null;
47
+ protected $connector = null;
48
+
49
+
50
+ private function doExports() {
51
+ Mage::log("Cron::doExports starting");
52
+ $collection = Mage::getModel('gpi_tsc/backgroundjobs')->getCollection();
53
+ $exportJobs = $collection->addFieldToFilter('job_type', array('eq' => 'Export'))
54
+ ->load();
55
+
56
+ $exporter = new ExportBackgroundJob($this->clientConfigurationService);
57
+ foreach($exportJobs as $job) {
58
+ $params = unserialize($job->getJobParams());
59
+ $params->Plugin = $this->connector;
60
+ $exporter->run($params);
61
+ $job->delete();
62
+ }
63
+
64
+ Mage::log("Cron::doExports completed");
65
+ }
66
+
67
+ private function doImports() {
68
+ Mage::log("Cron::doImports starting");
69
+ $collection = Mage::getModel('gpi_tsc/backgroundjobs')->getCollection();
70
+ $importJobs = $collection->addFieldToFilter('job_type', array('eq' => 'Import'))
71
+ ->load();
72
+
73
+ $importer = new ImportBackgroundJob($this->clientConfigurationService);
74
+ foreach($importJobs as $job) {
75
+ $params = unserialize($job->getJobParams());
76
+ $params->Plugin = $this->connector;
77
+ $importer->run($params);
78
+ $job->delete();
79
+ }
80
+ Mage::log("Cron::doImports completed");
81
+ }
82
+
83
+ private function cleanUpQuotes() {
84
+ Mage::log("Cron::cleanUpQuotes starting");
85
+ $collection = Mage::getModel('gpi_tsc/quotes')->getCollection();
86
+ $quotes = $collection->load();
87
+
88
+ Mage::log("Cron::cleanUpQuotes completed");
89
+ }
90
+
91
+
92
+ /**
93
+ * Initiates any queued export/import operations
94
+ **/
95
+ public function run()
96
+ {
97
+
98
+ /*$page = Mage::getModel('cms/page')->setStoreId(2)->load('about-magento-demo-store', 'identifier');
99
+ var_dump($page);
100
+ */
101
+
102
+ $product = Mage::getModel('catalog/product')->setStoreId(1)->load(905);
103
+ var_dump($product);
104
+ /*
105
+ var_dump($product->getName());
106
+
107
+ $product = Mage::getModel('catalog/product')->setStoreId(2)->load(905);
108
+ var_dump($product->getName());
109
+
110
+ $product = Mage::getModel('catalog/product')->setStoreId(3)->load(905);
111
+ var_dump($product->getName());
112
+ */
113
+
114
+ return;
115
+
116
+
117
+
118
+ Mage::log("Cron::run entered");
119
+ $lock = Gpi_Tsc_Model_Lock::getInstance();
120
+ if ($lock->isLocked()) {
121
+ Mage::log("Cron::run lock in use, a previous CRON job is already running.");
122
+ } else {
123
+ Mage::log("Cron::run acquiring lock...");
124
+ $lock->lock();
125
+
126
+ try {
127
+ $this->clientConfigurationService = new ClientConfigurationServiceImpl();
128
+ $this->connector = new MagentoGpiClient();
129
+
130
+ $this->doExports();
131
+ $this->doImports();
132
+ $this->cleanUpQuotes();
133
+ } catch (Exception $e) {
134
+ Mage::log($e->getMessage());
135
+ }
136
+
137
+ Mage::log("Cron::run releasing lock...");
138
+ $lock->unlock();
139
+ }
140
+ Mage::log("Cron::run exited");
141
+ }
142
+ }
app/code/community/Gpi/Tsc/Model/Lock.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Lock manager to ensure our cron doesn't run twice at the same time.
5
+ *
6
+ * Inspired by the lock mechanism in Mage_Index_Model_Process
7
+ *
8
+ * Usage:
9
+ *
10
+ * $lock = Mage::getModel('gpi_tsc/cron_lock');
11
+ *
12
+ * if (!$lock->isLocked()) {
13
+ * $lock->lock();
14
+ * // Do your stuff
15
+ * $lock->unlock();
16
+ * }
17
+ */
18
+ class Gpi_Tsc_Model_Lock
19
+ {
20
+ /**
21
+ * Process lock properties
22
+ */
23
+ protected $_isLocked = null;
24
+ protected $_lockFile = null;
25
+
26
+ /**
27
+ * Singleton instance
28
+ *
29
+ * @var Gpi_Tsc_Model_Lock
30
+ */
31
+ protected static $_instance;
32
+
33
+
34
+ /**
35
+ * Constructor
36
+ */
37
+ protected function __construct()
38
+ {
39
+ }
40
+
41
+ /**
42
+ * Get lock singleton instance
43
+ *
44
+ * @return Gpi_Tsc_Model_Lock
45
+ */
46
+ public static function getInstance()
47
+ {
48
+ if (!self::$_instance instanceof self) {
49
+ self::$_instance = new self();
50
+ }
51
+ return self::$_instance;
52
+ }
53
+
54
+
55
+ /**
56
+ * Get lock file resource
57
+ *
58
+ * @return resource
59
+ */
60
+ protected function _getLockFile()
61
+ {
62
+ if ($this->_lockFile === null) {
63
+ $varDir = Mage::getConfig()->getVarDir('locks');
64
+ $file = $varDir . DS . 'gpi_tsc_cron.lock';
65
+ if (is_file($file)) {
66
+ $this->_lockFile = fopen($file, 'w');
67
+ } else {
68
+ $this->_lockFile = fopen($file, 'x');
69
+ }
70
+ fwrite($this->_lockFile, date('r'));
71
+ }
72
+ return $this->_lockFile;
73
+ }
74
+
75
+ /**
76
+ * Lock process without blocking.
77
+ * This method allow protect multiple process runing and fast lock validation.
78
+ *
79
+ * @return Mage_Index_Model_Process
80
+ */
81
+ public function lock()
82
+ {
83
+ $this->_isLocked = true;
84
+ flock($this->_getLockFile(), LOCK_EX | LOCK_NB);
85
+ return $this;
86
+ }
87
+
88
+ /**
89
+ * Lock and block process.
90
+ * If new instance of the process will try validate locking state
91
+ * script will wait until process will be unlocked
92
+ *
93
+ * @return Mage_Index_Model_Process
94
+ */
95
+ public function lockAndBlock()
96
+ {
97
+ $this->_isLocked = true;
98
+ flock($this->_getLockFile(), LOCK_EX);
99
+ return $this;
100
+ }
101
+
102
+ /**
103
+ * Unlock process
104
+ *
105
+ * @return Mage_Index_Model_Process
106
+ */
107
+ public function unlock()
108
+ {
109
+ $this->_isLocked = false;
110
+ flock($this->_getLockFile(), LOCK_UN);
111
+ return $this;
112
+ }
113
+
114
+ /**
115
+ * Check if process is locked
116
+ *
117
+ * @return bool
118
+ */
119
+ public function isLocked()
120
+ {
121
+ if ($this->_isLocked !== null) {
122
+ return $this->_isLocked;
123
+ } else {
124
+ $fp = $this->_getLockFile();
125
+ if (flock($fp, LOCK_EX | LOCK_NB)) {
126
+ flock($fp, LOCK_UN);
127
+ return false;
128
+ }
129
+ return true;
130
+ }
131
+ }
132
+
133
+ /**
134
+ * Close file resource if it was opened
135
+ */
136
+ public function __destruct()
137
+ {
138
+ if ($this->_lockFile) {
139
+ fclose($this->_lockFile);
140
+ }
141
+ }
142
+ }
app/code/community/Gpi/Tsc/Model/MagentoGpiClient.php CHANGED
@@ -1,22 +1,39 @@
1
  <?php
2
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  $helperPath = Mage::getModuleDir('helpers', 'Gpi_Tsc') . DS . 'Helper';
4
  $modelPath = Mage::getModuleDir('Model', 'Gpi_Tsc') . DS . 'Model';
5
 
6
  $webclientPath = $helperPath . DS . 'webclient';
7
  $sharedDataPath = $helperPath . DS . 'shareddata';
8
 
9
- include($modelPath . DS . 'Utilities.php');
10
 
11
- include($webclientPath . DS . 'AbstractTscClientPlugin.php');
12
- include($webclientPath . DS . 'ClientConfigurationServiceImpl.php');
13
- include($webclientPath . DS . 'ConnectorConfiguration.php');
14
 
15
  class MagentoGpiClient extends AbstractTscClientPlugin {
16
 
17
-
18
- const CONTENT_TYPE_CMS_PAGES = 'CMSpages';
19
- const CONTENT_TYPE_CMS_BLOCKS = 'CMSblocks';
20
  const CONTENT_TYPE_CATEGORIES = 'Categories';
21
  const CONTENT_TYPE_PRODUCTS = 'Products';
22
 
@@ -50,17 +67,30 @@ class MagentoGpiClient extends AbstractTscClientPlugin {
50
  protected function GetConfigurationInternal() {
51
 
52
  $config = new ConnectorConfiguration();
53
- /* We need to return a connector configuration
54
- */
55
 
56
- //GET CURRENT LANGUAGES IN MAGENTO
57
- $languages = Zend_Locale::getTranslationList("language");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
- $languagesList = array();
60
- foreach($languages as $id => $name) {
61
- $languagesList[] = array('ID'=>$id, 'Name'=>$name);
62
- }
63
- // Sort language list
64
  $config->SourceLanguages = $languagesList;
65
  $config->TargetLanguages = $languagesList;
66
 
@@ -77,15 +107,93 @@ class MagentoGpiClient extends AbstractTscClientPlugin {
77
  }
78
 
79
  protected function ConvertTreeNodesToIds($treeRoot) {
80
- //check only parents checked if threy are folders with children
 
 
 
 
 
 
 
 
81
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
 
83
  public function GetRemoteDocument($paneID, $nodeID, $context) {
84
- $remoteDocument = array();
85
- return $remoteDocument;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  }
87
 
88
  public function SetRemoteDocument($document, $context) {
89
-
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
91
  }
1
  <?php
2
+ /**
3
+ * Globalization Partners International
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@globalizationpartners.com so we can send you a copy immediately.
14
+ *
15
+ * @category Gpi
16
+ * @package Gpi_Tsc
17
+ * @copyright Copyright (c) 2015 Globalization Partners International, LLC. (http://www.globalizationpartners.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
  $helperPath = Mage::getModuleDir('helpers', 'Gpi_Tsc') . DS . 'Helper';
22
  $modelPath = Mage::getModuleDir('Model', 'Gpi_Tsc') . DS . 'Model';
23
 
24
  $webclientPath = $helperPath . DS . 'webclient';
25
  $sharedDataPath = $helperPath . DS . 'shareddata';
26
 
27
+ include_once($modelPath . DS . 'Utilities.php');
28
 
29
+ include_once($webclientPath . DS . 'AbstractTscClientPlugin.php');
30
+ include_once($webclientPath . DS . 'ClientConfigurationServiceImpl.php');
31
+ include_once($webclientPath . DS . 'ConnectorConfiguration.php');
32
 
33
  class MagentoGpiClient extends AbstractTscClientPlugin {
34
 
35
+ const CONTENT_TYPE_CMS_PAGES = 'CmsPages';
36
+ const CONTENT_TYPE_CMS_BLOCKS = 'CmsBlocks';
 
37
  const CONTENT_TYPE_CATEGORIES = 'Categories';
38
  const CONTENT_TYPE_PRODUCTS = 'Products';
39
 
67
  protected function GetConfigurationInternal() {
68
 
69
  $config = new ConnectorConfiguration();
 
 
70
 
71
+ //$locale = Mage::getModel('core/locale');
72
+ //$languages = $locale->getOptionLocales();
73
+
74
+ //$languagesList = array();
75
+ //foreach($languages as $language) {
76
+ // $languagesList[] = array('ID' => $language['value'], 'Name' => $language['label']);
77
+ //}
78
+
79
+
80
+ $stores = Mage::getModel('core/store')->getCollection();
81
+ $locale = Mage::getModel('core/locale');
82
+ $languages = $locale->getOptionLocales();
83
+ $storeLanguages = array_column($languages, 'label', 'value');
84
+
85
+ foreach($stores as $store)
86
+ {
87
+ $locale_code = Mage::getStoreConfig('general/locale/code', $store->getId());
88
+ $country_name = $storeLanguages[$locale_code];
89
+ $languagesList[] = array('ID' => $store->getId(), 'Name' => sprintf('%s [%s]', $store->getName(), $country_name));
90
+ }
91
+
92
 
93
+
 
 
 
 
94
  $config->SourceLanguages = $languagesList;
95
  $config->TargetLanguages = $languagesList;
96
 
107
  }
108
 
109
  protected function ConvertTreeNodesToIds($treeRoot) {
110
+ //check only parents checked if threy are folders with children
111
+
112
+ $ids = array();
113
+ foreach ($treeRoot->Children as $node)
114
+ {
115
+ $ids[] = $node->ID;
116
+ }
117
+
118
+ return $ids;
119
  }
120
+
121
+ private function getStoreLanguage($storeId) {
122
+ $storeLanguage = Mage::getStoreConfig('general/locale/code', $storeId);
123
+ $storeLanguage = str_replace("_", "-", $storeLanguage);
124
+ return $storeLanguage;
125
+ }
126
+
127
+ public function CreateQuote($quoteName, $quoteComments, $sourceStoreId, array $storeIds, $userName) {
128
+
129
+ $storeLanguages = array();
130
+ $target = array();
131
+ foreach ($storeIds as $storeId) {
132
+ $storeLanguage = $this->getStoreLanguage($storeId);
133
+ if (!in_array($storeLanguage, $storeLanguages)) {
134
+ $storeLanguages[] = $storeLanguage;
135
+ $target[$storeLanguage] = $storeId;
136
+ }
137
+ }
138
+
139
+ $sourceStoreLanguage = $this->getStoreLanguage($sourceStoreId);
140
+ $remoteQuote = parent::CreateQuote($quoteName, $quoteComments, $sourceStoreLanguage, $storeLanguages, $userName);
141
+
142
+ $source = array();
143
+ $source[$sourceStoreLanguage] = $sourceStoreId;
144
+
145
+ $quoteMeta = array(
146
+ 'source' => $source,
147
+ 'target' => $target
148
+ );
149
+
150
+ $quoteData = array(
151
+ 'quote_id' => $remoteQuote->ID,
152
+ 'quote_meta' => serialize($quoteMeta)
153
+ );
154
+
155
+ Mage::getModel('gpi_tsc/quotes')
156
+ ->setData($quoteData)
157
+ ->save();
158
+
159
+ return json_encode($remoteQuote);
160
+ }
161
 
162
  public function GetRemoteDocument($paneID, $nodeID, $context) {
163
+ $remoteDocument = array();
164
+
165
+ switch ($paneID) {
166
+ case self::CONTENT_TYPE_CMS_PAGES:
167
+ $remoteDocument = Utilities::ExportCMSPage($nodeID, $context);
168
+ break;
169
+ case self::CONTENT_TYPE_CMS_BLOCKS:
170
+ $remoteDocument = Utilities::ExportCMSBlock($nodeID, $context);
171
+ break;
172
+ case self::CONTENT_TYPE_CATEGORIES:
173
+ $remoteDocument = Utilities::ExportCategory($nodeID, $context);
174
+ break;
175
+ case self::CONTENT_TYPE_PRODUCTS:
176
+ $remoteDocument = Utilities::ExportProduct($nodeID, $context);
177
+ break;
178
+ }
179
+
180
+ return $remoteDocument;
181
  }
182
 
183
  public function SetRemoteDocument($document, $context) {
184
+ switch ($document->DocumentType) {
185
+ case self::CONTENT_TYPE_CMS_PAGES:
186
+ Utilities::ImportCMSPage($document, $context);
187
+ break;
188
+ case self::CONTENT_TYPE_CMS_BLOCKS:
189
+ Utilities::ImportCMSBlock($document, $context);
190
+ break;
191
+ case self::CONTENT_TYPE_CATEGORIES:
192
+ Utilities::ImportCategory($document, $context);
193
+ break;
194
+ case self::CONTENT_TYPE_PRODUCTS:
195
+ Utilities::ImportProduct($document, $context);
196
+ break;
197
+ }
198
  }
199
  }
app/code/community/Gpi/Tsc/Model/Quotes.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Globalization Partners International
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@globalizationpartners.com so we can send you a copy immediately.
14
+ *
15
+ * @category Gpi
16
+ * @package Gpi_Tsc
17
+ * @copyright Copyright (c) 2015 Globalization Partners International, LLC. (http://www.globalizationpartners.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class Gpi_Tsc_Model_Quotes extends Mage_Core_Model_Abstract
22
+ {
23
+ protected function _construct()
24
+ {
25
+ $this->_init('gpi_tsc/quotes');
26
+ }
27
+ }
app/code/community/Gpi/Tsc/Model/Resource/Quotes.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Globalization Partners International
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@globalizationpartners.com so we can send you a copy immediately.
14
+ *
15
+ * @category Gpi
16
+ * @package Gpi_Tsc
17
+ * @copyright Copyright (c) 2015 Globalization Partners International, LLC. (http://www.globalizationpartners.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+
21
+ class Gpi_Tsc_Model_Resource_Quotes extends Mage_Core_Model_Resource_Db_Abstract
22
+ {
23
+ protected function _construct()
24
+ {
25
+ $this->_init('gpi_tsc/quotes','quote_id');
26
+ $this->_isPkAutoIncrement = false;
27
+ }
28
+ }
app/code/community/Gpi/Tsc/Model/Resource/Quotes/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Gpi_Tsc_Model_Resource_Quotes_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ $this->_init('gpi_tsc/quotes');
8
+ }
9
+
10
+ }
app/code/community/Gpi/Tsc/Model/Utilities.php CHANGED
@@ -1,75 +1,64 @@
1
  <?php
2
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  class Utilities {
5
 
6
  public static function GetCMSPages () {
7
-
8
- /*
9
- /* CMS Pages
10
- /* */
11
- //$pages = Mage::getModel('cms/page')->getCollection();
12
- //$pages = Mage::getModel('cms/page')->load('home','identifier');
13
- $model = Mage::getModel('cms/page');
14
- $pages = $model->getCollection();
15
- $pages->load();
16
 
17
  $collection = array();
18
 
19
- foreach ($pages as $page) //loop for getting products
20
  {
21
- $pag = new TreeNode();
22
  $data = $page->getData();
23
- $pag->ID = $data['page_id'];
24
- $pag->Name = $data['title'];
25
- $pag->LastModificationDate = $data['update_time'];
26
- $collection[] = $pag;
 
 
27
  }
28
 
29
  return $collection;
30
-
31
- /*
32
- $content = $page->getContent();
33
- $keywords = $page->getMetaKeywords();
34
- $descriptions = $page->getMetaDescription();
35
- */
36
- /* $cmsPage = Mage::log(print_r($content,true));
37
- $cmsPage = Mage::log(print_r($keywords,true));
38
- $cmsPage = Mage::log(print_r($descriptions,true));
39
- /*
40
- /* Create new CMS Page
41
- $cmsPage = array(
42
- 'title' => 'Test Page',
43
- 'identifier' => 'test-page',
44
- 'content' => 'Sample Test Page',
45
- 'is_active' => 1,
46
- 'sort_order' => 0,
47
- 'stores' => array(0),
48
- 'root_template' => 'three_columns'
49
- );
50
- Mage::getModel('cms/page')->setData($cmsPage)->save();
51
- */
52
  }
53
 
54
  public static function GetCMSBlocks () {
55
 
56
- /*
57
- /* CMS Blocks
58
- /* */
59
- $model = Mage::getModel('cms/block');
60
- $pages = $model->getCollection();
61
- $pages->load();
62
 
63
  $collection = array();
64
 
65
- foreach ($pages as $page) //loop for getting products
66
  {
67
- $pag = new TreeNode();
68
- $data = $page->getData();
69
- $pag->ID = $data['identifier'];
70
- $pag->Name = $data['title'];
71
- $pag->LastModificationDate = $data['update_time'];
72
- $collection[] = $pag;
73
  }
74
 
75
  return $collection;
@@ -77,22 +66,18 @@ class Utilities {
77
 
78
  public static function GetProducts () {
79
 
80
- /*
81
- /* Products
82
- /* */
83
-
84
- $model = Mage::getModel('catalog/product'); //getting product model
85
- $products = $model->getCollection(); //products collection
86
 
87
  $collection = array();
88
 
89
- foreach ($products as $product) //loop for getting products
90
  {
91
- $prod = new TreeNode();
92
- $model->load($product->getId());
93
- $prod->Name = $model->getName();
94
- $prod->ID = $product->getId();
95
- $collection[] = $prod;
96
  }
97
 
98
  return $collection;
@@ -100,10 +85,6 @@ class Utilities {
100
 
101
  public static function GetCategories () {
102
 
103
- /*
104
- /* Categories
105
- /* */
106
-
107
  $model = Mage::getModel('catalog/category');
108
  $tree = $model->getTreeModel();
109
  $tree->load();
@@ -122,4 +103,164 @@ class Utilities {
122
  return $collection;
123
  }
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  }
1
  <?php
2
+ /**
3
+ * Globalization Partners International
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@globalizationpartners.com so we can send you a copy immediately.
14
+ *
15
+ * @category Gpi
16
+ * @package Gpi_Tsc
17
+ * @copyright Copyright (c) 2015 Globalization Partners International, LLC. (http://www.globalizationpartners.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
 
21
  class Utilities {
22
 
23
  public static function GetCMSPages () {
24
+
25
+ $pages = Mage::getModel('cms/page')
26
+ ->getCollection()
27
+ //->addFieldToFilter('is_active',1)
28
+ ->load();
 
 
 
 
29
 
30
  $collection = array();
31
 
32
+ foreach ($pages as $page)
33
  {
 
34
  $data = $page->getData();
35
+
36
+ $node = new TreeNode();
37
+ $node->ID = $data['page_id'];
38
+ $node->Name = $data['title'];
39
+ $node->LastModificationDate = $data['update_time'];
40
+ $collection[] = $node;
41
  }
42
 
43
  return $collection;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
45
 
46
  public static function GetCMSBlocks () {
47
 
48
+ $blocks = Mage::getModel('cms/block')
49
+ ->getCollection()
50
+ ->load();
 
 
 
51
 
52
  $collection = array();
53
 
54
+ foreach ($blocks as $block)
55
  {
56
+ $node = new TreeNode();
57
+ $data = $block->getData();
58
+ $node->ID = $data['identifier'];
59
+ $node->Name = $data['title'];
60
+ $node->LastModificationDate = $data['update_time'];
61
+ $collection[] = $node;
62
  }
63
 
64
  return $collection;
66
 
67
  public static function GetProducts () {
68
 
69
+ $products = Mage::getModel('catalog/product')
70
+ ->getCollection()
71
+ ->addAttributeToSelect('*');
 
 
 
72
 
73
  $collection = array();
74
 
75
+ foreach ($products as $product)
76
  {
77
+ $node = new TreeNode();
78
+ $node->Name = $product->getName();
79
+ $node->ID = $product->getId();
80
+ $collection[] = $node;
 
81
  }
82
 
83
  return $collection;
85
 
86
  public static function GetCategories () {
87
 
 
 
 
 
88
  $model = Mage::getModel('catalog/category');
89
  $tree = $model->getTreeModel();
90
  $tree->load();
103
  return $collection;
104
  }
105
 
106
+
107
+
108
+ public static function ExportCMSPage ($nodeID, $context) {
109
+ $page = Mage::getModel('cms/page')->load($nodeID);
110
+ $data = $page->getData();
111
+
112
+ $doc = array();
113
+ $doc['ID'] = $data['page_id'];
114
+ $doc['Title'] = $data['title'];
115
+ $doc['DocumentType'] = MagentoGpiClient::CONTENT_TYPE_CMS_PAGES;
116
+ $doc['LastModified'] = date("Y-m-d\Th:i:s\.u\Z");
117
+ $doc['FileName'] = sprintf("%s.xml", $data['page_id']);
118
+
119
+ $xliff = new XliffWriter();
120
+ foreach ($data as $key => $value) {
121
+ if (!is_array($value) && !is_null($value)) {
122
+ $xliff->addTransUnit($key, $value);
123
+ }
124
+ }
125
+ $doc['Contents'] = $xliff->getDocument();
126
+ return $doc;
127
+ }
128
+
129
+ public static function ExportCMSBlock ($nodeID, $context) {
130
+ $block = Mage::getModel('cms/block')->load($nodeID);
131
+ $data = $block->getData();
132
+
133
+ $doc = array();
134
+ $doc['ID'] = $data['block_id'];
135
+ $doc['Title'] = $data['title'];
136
+ $doc['DocumentType'] = MagentoGpiClient::CONTENT_TYPE_CMS_BLOCKS;
137
+ $doc['LastModified'] = date("Y-m-d\Th:i:s\.u\Z");
138
+ $doc['FileName'] = sprintf("%s.xml", $data['block_id']);
139
+
140
+ $xliff = new XliffWriter();
141
+ foreach ($data as $key => $value) {
142
+ if (!is_array($value) && !is_null($value)) {
143
+ $xliff->addTransUnit($key, $value);
144
+ }
145
+ }
146
+ $doc['Contents'] = $xliff->getDocument();
147
+ return $doc;
148
+ }
149
+
150
+ public static function ExportProduct ($nodeID, $context) {
151
+ $product = Mage::getModel('catalog/product')->load($nodeID);
152
+ $data = $product->getData();
153
+
154
+ $doc = array();
155
+ $doc['ID'] = $data['product_id'];
156
+ $doc['Title'] = $data['title'];
157
+ $doc['DocumentType'] = MagentoGpiClient::CONTENT_TYPE_CMS_PAGES;
158
+ $doc['LastModified'] = date("Y-m-d\Th:i:s\.u\Z");
159
+ $doc['FileName'] = sprintf("%s.xml", $data['page_id']);
160
+
161
+ $xliff = new XliffWriter();
162
+ foreach ($data as $key => $value) {
163
+ if (!is_array($value) && !is_null($value)) {
164
+ $xliff->addTransUnit($key, $value);
165
+ }
166
+ }
167
+ $doc['Contents'] = $xliff->getDocument();
168
+ return $doc;
169
+ }
170
+
171
+ public static function ExportCategory () {
172
+ }
173
+
174
+ public static function ImportCMSPage ($document, $context) {
175
+
176
+ //$data = XliffReader::parseData($document->Contents);
177
+ //var_dump($data);
178
+
179
+ /*
180
+ /* CMS Pages
181
+ /*
182
+ $pages = Mage::getModel('cms/page')->getCollection();
183
+ $page = Mage::getModel('cms/page')->load('home','identifier');
184
+ $title = $page->getTitle();
185
+ $content = $page->getContent();
186
+ $keywords = $page->getMetaKeywords();
187
+ $descriptions = $page->getMetaDescription();
188
+ /*
189
+ /* Create new CMS Page
190
+ $cmsPage = array(
191
+ 'title' => 'Test Page',
192
+ 'identifier' => 'test-page',
193
+ 'content' => 'Sample Test Page',
194
+ 'is_active' => 1,
195
+ 'sort_order' => 0,
196
+ 'stores' => array(0),
197
+ 'root_template' => 'three_columns'
198
+ );
199
+ Mage::getModel('cms/page')->setData($cmsPage)->save();
200
+ */
201
+ }
202
+
203
+ public static function ImportCMSBlock () {
204
+ /*
205
+ /* CMS Blocks
206
+ /*
207
+ $blocks = Mage::getModel('cms/block')->getCollection();
208
+ $page = Mage::getModel('cms/block')->load('footer_links','identifier');
209
+ $title = $page->getTitle();
210
+ $content = $page->getContent();
211
+
212
+ /* Save New Block
213
+ $staticBlock = array(
214
+ 'title' => 'Test Block',
215
+ 'identifier' => 'test-block',
216
+ 'content' => 'Sample Test Block',
217
+ 'is_active' => 1,
218
+ 'stores' => array(o)
219
+ );
220
+
221
+ Mage::getModel('cms/block')->setData($staticBlock)->save();
222
+ */
223
+ }
224
+
225
+ public static function ImportProduct () {
226
+ /*
227
+ /* Products */
228
+ /* http://gauss-development.com/blog/e-commerce-blog/magento-mass-export-xml-format/
229
+ /*
230
+ /* $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*');
231
+ // select all attributes
232
+
233
+ foreach($collection as $product){
234
+ $i++;
235
+ // something
236
+ }
237
+ */
238
+
239
+ /*
240
+ /* Products */
241
+ /* http://gauss-development.com/blog/e-commerce-blog/magento-mass-export-xml-format/
242
+ /*
243
+ $category = Mage::getModel ( 'catalog/category' );
244
+ $tree = $category->getTreeModel ();
245
+ $tree->load ();
246
+
247
+ $ids = $tree->getCollection ()->getAllIds ();
248
+
249
+ if ($ids) {
250
+ foreach ( $ids as $id ) {
251
+ $string = $id . ', ' .$category->load($id)->getName() . "\n";
252
+ Mage::log(print_r($string,true));
253
+ }
254
+ }
255
+ */
256
+
257
+ /*
258
+ /* https://github.com/bippo/magento-bulk
259
+ /*
260
+ Mage::log(print_r(Mage::getModel('eav/entity_attribute')->getCollection(),true));
261
+ */
262
+ }
263
+
264
+ public static function ImportCategory () {
265
+ }
266
  }
app/code/community/Gpi/Tsc/etc/config.xml CHANGED
@@ -32,7 +32,9 @@
32
  <configurations>
33
  <table>gpi_configurations</table>
34
  </configurations>
35
-
 
 
36
  </entities>
37
  </tsc_resource>
38
  </models>
@@ -66,6 +68,18 @@
66
  </before_tsc_items_display>
67
  </events>-->
68
  </global>
 
 
 
 
 
 
 
 
 
 
 
 
69
  <admin>
70
  <routers>
71
  <adminhtml>
32
  <configurations>
33
  <table>gpi_configurations</table>
34
  </configurations>
35
+ <quotes>
36
+ <table>gpi_quotes</table>
37
+ </quotes>
38
  </entities>
39
  </tsc_resource>
40
  </models>
68
  </before_tsc_items_display>
69
  </events>-->
70
  </global>
71
+ <crontab>
72
+ <jobs>
73
+ <gpi_tsc>
74
+ <schedule>
75
+ <cron_expr>*/1 * * * *</cron_expr>
76
+ </schedule>
77
+ <run>
78
+ <model>gpi_tsc/cron::run</model>
79
+ </run>
80
+ </gpi_tsc>
81
+ </jobs>
82
+ </crontab>
83
  <admin>
84
  <routers>
85
  <adminhtml>
app/code/community/Gpi/Tsc/sql/gpi_tsc_setup/install-1.0.0.1.php CHANGED
@@ -15,10 +15,10 @@ $table = $installer->getConnection()
15
  ), 'Id')
16
  ->addColumn('job_type', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
17
  'nullable' => false,
18
- ), 'Type')
19
- ->addColumn('project_id', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
20
  'nullable' => false,
21
- ), 'Project')
22
  ->addIndex($installer->getIdxName(
23
  $installer->getTable('gpi_tsc/backgroundjobs'),
24
  array('job_id'),
@@ -54,5 +54,19 @@ $table = $installer->getConnection()
54
  )
55
  ->setComment('GPI Configurations');
56
  $installer->getConnection()->createTable($table);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  $installer->endSetup();
15
  ), 'Id')
16
  ->addColumn('job_type', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array(
17
  'nullable' => false,
18
+ ), 'JobType')
19
+ ->addColumn('job_params', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
20
  'nullable' => false,
21
+ ), 'JobParams')
22
  ->addIndex($installer->getIdxName(
23
  $installer->getTable('gpi_tsc/backgroundjobs'),
24
  array('job_id'),
54
  )
55
  ->setComment('GPI Configurations');
56
  $installer->getConnection()->createTable($table);
57
+
58
+ $table = $installer->getConnection()
59
+ ->newTable($installer->getTable('gpi_tsc/quotes'))
60
+ ->addColumn('quote_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
61
+ 'identity' => false,
62
+ 'unsigned' => true,
63
+ 'nullable' => false,
64
+ 'primary' => true,
65
+ ), 'Id')
66
+ ->addColumn('quote_meta', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
67
+ 'nullable' => false,
68
+ ), 'JobParams')
69
+ ->setComment('GPI Quotes');
70
+ $installer->getConnection()->createTable($table);
71
 
72
  $installer->endSetup();
app/locale/de_DE/Gpi_Tsc.csv ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ exported, Exported {0} documents
2
+ imported, Imported {0} documents
3
+ invalid_authorization, An invalid authorization token was supplied
4
+ invalid_endpoint, An invalid server endpoint was supplied
5
+ InvalidQuoteID, Invalid quote ID
6
+ Additems, Add items
7
+ By, By
8
+ Cancel, Cancel
9
+ CloseProject, Close Project
10
+ Configure, Configure Translation Services Connector
11
+ CreatePackage, Create package
12
+ CreateQuote, Create quote
13
+ Delete, Delete
14
+ DeletePackage, You are about to delete the package [{{=package.Name}}].\\nAre you sure?
15
+ Endpoint, Endpoint URL
16
+ FormComments, Comments
17
+ FormPackageName, Package Name
18
+ FormQuoteName, Quote Name
19
+ FormSourceLanguage, Source Language
20
+ FormTargetLanguages, Target Languages
21
+ From, From:
22
+ <comment>As in "From: English" (language)</comment>
23
+ FullReport, Full Status Report
24
+ ImportTranslations, Import Translations
25
+ Languages, Languages
26
+ LastModified, Last Modified
27
+ ModifyPackage, Modify Package
28
+ NoPackages, There are no packages to list.
29
+ NoProjects, There are no projects to list.
30
+ NoQuotes, There are no quotes to list.
31
+ Package, Package
32
+ PackageName, Package '{{=quote.Name}}'
33
+ Project, Project
34
+ Projects, Projects
35
+ Quote, Quote
36
+ QuoteName, Quote '{{=quote.Name}}'
37
+ Quotes, Quotes
38
+ RequestAQuote, Request a quote
39
+ SaveConfiguration, Save configuration
40
+ Status, Status
41
+ To, To:
42
+ Token, Authorization Token
43
+ TranslationPackages, Translation packages
44
+ UpdatePackage, Update Package
app/locale/es_ES/Gpi_Tsc.csv ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ exported, Exported {0} documents
2
+ imported, Imported {0} documents
3
+ invalid_authorization, An invalid authorization token was supplied
4
+ invalid_endpoint, An invalid server endpoint was supplied
5
+ InvalidQuoteID, Invalid quote ID
6
+ Additems, Add items
7
+ By, By
8
+ Cancel, Cancel
9
+ CloseProject, Close Project
10
+ Configure, Configure Translation Services Connector
11
+ CreatePackage, Create package
12
+ CreateQuote, Create quote
13
+ Delete, Delete
14
+ DeletePackage, You are about to delete the package [{{=package.Name}}].\\nAre you sure?
15
+ Endpoint, Endpoint URL
16
+ FormComments, Comments
17
+ FormPackageName, Package Name
18
+ FormQuoteName, Quote Name
19
+ FormSourceLanguage, Source Language
20
+ FormTargetLanguages, Target Languages
21
+ From, From:
22
+ <comment>As in "From: English" (language)</comment>
23
+ FullReport, Full Status Report
24
+ ImportTranslations, Import Translations
25
+ Languages, Languages
26
+ LastModified, Last Modified
27
+ ModifyPackage, Modify Package
28
+ NoPackages, There are no packages to list.
29
+ NoProjects, There are no projects to list.
30
+ NoQuotes, There are no quotes to list.
31
+ Package, Package
32
+ PackageName, Package '{{=quote.Name}}'
33
+ Project, Project
34
+ Projects, Projects
35
+ Quote, Quote
36
+ QuoteName, Quote '{{=quote.Name}}'
37
+ Quotes, Quotes
38
+ RequestAQuote, Request a quote
39
+ SaveConfiguration, Save configuration
40
+ Status, Status
41
+ To, To:
42
+ Token, Authorization Token
43
+ TranslationPackages, Translation packages
44
+ UpdatePackage, Update Package
app/locale/fr_FR/Gpi_Tsc.csv ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ exported, Exported {0} documents
2
+ imported, Imported {0} documents
3
+ invalid_authorization, An invalid authorization token was supplied
4
+ invalid_endpoint, An invalid server endpoint was supplied
5
+ InvalidQuoteID, Invalid quote ID
6
+ Additems, Add items
7
+ By, By
8
+ Cancel, Cancel
9
+ CloseProject, Close Project
10
+ Configure, Configure Translation Services Connector
11
+ CreatePackage, Create package
12
+ CreateQuote, Create quote
13
+ Delete, Delete
14
+ DeletePackage, You are about to delete the package [{{=package.Name}}].\\nAre you sure?
15
+ Endpoint, Endpoint URL
16
+ FormComments, Comments
17
+ FormPackageName, Package Name
18
+ FormQuoteName, Quote Name
19
+ FormSourceLanguage, Source Language
20
+ FormTargetLanguages, Target Languages
21
+ From, From:
22
+ <comment>As in "From: English" (language)</comment>
23
+ FullReport, Full Status Report
24
+ ImportTranslations, Import Translations
25
+ Languages, Languages
26
+ LastModified, Last Modified
27
+ ModifyPackage, Modify Package
28
+ NoPackages, There are no packages to list.
29
+ NoProjects, There are no projects to list.
30
+ NoQuotes, There are no quotes to list.
31
+ Package, Package
32
+ PackageName, Package '{{=quote.Name}}'
33
+ Project, Project
34
+ Projects, Projects
35
+ Quote, Quote
36
+ QuoteName, Quote '{{=quote.Name}}'
37
+ Quotes, Quotes
38
+ RequestAQuote, Request a quote
39
+ SaveConfiguration, Save configuration
40
+ Status, Status
41
+ To, To:
42
+ Token, Authorization Token
43
+ TranslationPackages, Translation packages
44
+ UpdatePackage, Update Package
app/locale/nl_NL/Gpi_Tsc.csv ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "QuoteName","Quote Name"
2
+ "Additems", "Add items"
3
+ "PackageName","Package Name"
4
+ "ModifyPackage","Modify Package"
5
+ "RequestAQuote","Request A Quote"
6
+ "UpdatePackage","Update Package"
7
+ "Cancel","Cancel"
8
+ "CreateQuote","Create Quote"
9
+ "CreatePackage","Create Package"
10
+ "FormQuoteName","Form Quote Name"
11
+ "FormPackageName","Form Package Name"
12
+ "FormSourceLanguage", "FormSourceLanguage"
13
+ "FormComments","Form Comments"
14
+ "FormTargetLanguages","Form Target Languages"
15
+ "createQuote","create Quote"
16
+ "CreateQuote","Create Quote"
17
+ "TranslationPackages", "TranslationPackages"
18
+ "NoPackages","No Packages"
19
+ "Package","Package"
20
+ "LastModified","Last Modified"
21
+ "By","By"
22
+ "Languages","Languages"
23
+ "DeletePackage","Delete Package"
24
+ "Delete","Delete"
25
+ "RequestAQuote","Request A Quote"
26
+ "ModifyPackage","Modify Package"
27
+ "Quotes","Quotes"
28
+ "NoQuotes","NoQuotes"
29
+ "Quote","Quote"
30
+ "Status","Status"
31
+ "FullReport","Full Report"
32
+ "From","From"
33
+ "To","To"
34
+ "Projects","Projects"
35
+ "NoProjects","No Projects"
36
+ "Project","Project"
37
+ "ImportTranslations","Import Translations"
38
+ "CloseProject","Close Project"
39
+ "FullReport","FullReport"
40
+ "Configure","Configure"
41
+ "Token","Token"
42
+ "Endpoint","Endpoint"
43
+ "SaveConfiguration","Save Configuration"
app/locale/pt_BR/Gpi_Tsc.csv ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ exported, Exported {0} documents
2
+ imported, Imported {0} documents
3
+ invalid_authorization, An invalid authorization token was supplied
4
+ invalid_endpoint, An invalid server endpoint was supplied
5
+ InvalidQuoteID, Invalid quote ID
6
+ Additems, Add items
7
+ By, By
8
+ Cancel, Cancel
9
+ CloseProject, Close Project
10
+ Configure, Configure Translation Services Connector
11
+ CreatePackage, Create package
12
+ CreateQuote, Create quote
13
+ Delete, Delete
14
+ DeletePackage, You are about to delete the package [{{=package.Name}}].\\nAre you sure?
15
+ Endpoint, Endpoint URL
16
+ FormComments, Comments
17
+ FormPackageName, Package Name
18
+ FormQuoteName, Quote Name
19
+ FormSourceLanguage, Source Language
20
+ FormTargetLanguages, Target Languages
21
+ From, From:
22
+ <comment>As in "From: English" (language)</comment>
23
+ FullReport, Full Status Report
24
+ ImportTranslations, Import Translations
25
+ Languages, Languages
26
+ LastModified, Last Modified
27
+ ModifyPackage, Modify Package
28
+ NoPackages, There are no packages to list.
29
+ NoProjects, There are no projects to list.
30
+ NoQuotes, There are no quotes to list.
31
+ Package, Package
32
+ PackageName, Package '{{=quote.Name}}'
33
+ Project, Project
34
+ Projects, Projects
35
+ Quote, Quote
36
+ QuoteName, Quote '{{=quote.Name}}'
37
+ Quotes, Quotes
38
+ RequestAQuote, Request a quote
39
+ SaveConfiguration, Save configuration
40
+ Status, Status
41
+ To, To:
42
+ Token, Authorization Token
43
+ TranslationPackages, Translation packages
44
+ UpdatePackage, Update Package
app/locale/zh_CN/Gpi_Tsc.csv ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "QuoteName","Quote Name"
2
+ "Additems", "Add items"
3
+ "PackageName","Package Name"
4
+ "ModifyPackage","Modify Package"
5
+ "RequestAQuote","Request A Quote"
6
+ "UpdatePackage","Update Package"
7
+ "Cancel","Cancel"
8
+ "CreateQuote","Create Quote"
9
+ "CreatePackage","Create Package"
10
+ "FormQuoteName","Form Quote Name"
11
+ "FormPackageName","Form Package Name"
12
+ "FormSourceLanguage", "FormSourceLanguage"
13
+ "FormComments","Form Comments"
14
+ "FormTargetLanguages","Form Target Languages"
15
+ "createQuote","create Quote"
16
+ "CreateQuote","Create Quote"
17
+ "TranslationPackages", "TranslationPackages"
18
+ "NoPackages","No Packages"
19
+ "Package","Package"
20
+ "LastModified","Last Modified"
21
+ "By","By"
22
+ "Languages","Languages"
23
+ "DeletePackage","Delete Package"
24
+ "Delete","Delete"
25
+ "RequestAQuote","Request A Quote"
26
+ "ModifyPackage","Modify Package"
27
+ "Quotes","Quotes"
28
+ "NoQuotes","NoQuotes"
29
+ "Quote","Quote"
30
+ "Status","Status"
31
+ "FullReport","Full Report"
32
+ "From","From"
33
+ "To","To"
34
+ "Projects","Projects"
35
+ "NoProjects","No Projects"
36
+ "Project","Project"
37
+ "ImportTranslations","Import Translations"
38
+ "CloseProject","Close Project"
39
+ "FullReport","FullReport"
40
+ "Configure","Configure"
41
+ "Token","Token"
42
+ "Endpoint","Endpoint"
43
+ "SaveConfiguration","Save Configuration"
js/gpi_tsc/tsc.js CHANGED
@@ -1396,7 +1396,7 @@ var rpcUrl = "",
1396
  };
1397
 
1398
  efx.requestAQuote = function(packageID, quickQuote) {
1399
- new RPC(rpcUrl,
1400
  function() {
1401
  packages.forEach(function(item, index, arr) {
1402
  if (item.ID === packageID) {
@@ -1418,8 +1418,14 @@ var rpcUrl = "",
1418
  },
1419
  function(errorMessage) {
1420
  createMessage(String.format("Failed to request a quote. {0}", errorMessage), "error");
 
 
 
1421
  }
1422
- ).execute("SendQuoteToGpms", packageID, configuration.UserName, quickQuote || false);
 
 
 
1423
  };
1424
 
1425
  efx.addDocuments = function(quoteId, quickQuote) {
@@ -1448,6 +1454,28 @@ var rpcUrl = "",
1448
  paneID = pane.ID;
1449
  dl.className = "tsc_panel";
1450
  dt.appendChild(document.createTextNode(pane.Name));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1451
  dl.appendChild(dt);
1452
  dl.appendChild(dd);
1453
  container.appendChild(dl);
1396
  };
1397
 
1398
  efx.requestAQuote = function(packageID, quickQuote) {
1399
+ var e = new RPC(rpcUrl,
1400
  function() {
1401
  packages.forEach(function(item, index, arr) {
1402
  if (item.ID === packageID) {
1418
  },
1419
  function(errorMessage) {
1420
  createMessage(String.format("Failed to request a quote. {0}", errorMessage), "error");
1421
+ },
1422
+ function() {
1423
+ hideWaiting();
1424
  }
1425
+ );
1426
+
1427
+ showWaiting();
1428
+ e.execute("SendQuoteToGpms", packageID, configuration.UserName, quickQuote || false);
1429
  };
1430
 
1431
  efx.addDocuments = function(quoteId, quickQuote) {
1454
  paneID = pane.ID;
1455
  dl.className = "tsc_panel";
1456
  dt.appendChild(document.createTextNode(pane.Name));
1457
+
1458
+ var span = document.createElement('span');
1459
+ span.style.cssFloat = 'right'
1460
+ span.style.marginTop = '3px';
1461
+ span.style.fontSize = '75%';
1462
+
1463
+ var anchor = document.createElement('a');
1464
+ anchor.appendChild(document.createTextNode('Check All'));
1465
+ span.appendChild(anchor);
1466
+
1467
+ span.appendChild(document.createTextNode(' '));
1468
+
1469
+ anchor = document.createElement('a');
1470
+ anchor.appendChild(document.createTextNode('Uncheck All'));
1471
+ span.appendChild(anchor);
1472
+
1473
+ dt.appendChild(span);
1474
+ if (pane.IncludeCheckUncheckAll) {
1475
+ console.log('includeCheckUncheckAll');
1476
+ } else {
1477
+ console.log('do NOT includeCheckUncheckAll');
1478
+ }
1479
  dl.appendChild(dt);
1480
  dl.appendChild(dd);
1481
  container.appendChild(dl);
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>GPI_Translation_Services_Connector</name>
4
- <version>1.0.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
@@ -9,10 +9,10 @@
9
  <summary>GPI's Translation Services Connector simplfies translation workflows for multiple-language Magento websites. </summary>
10
  <description>GPI's Translation Services Connector for Magento enables users of Magento-based websites to launch and manage multi-language websites. The Translation Services Connector streamlines content exports and reimports allowing for the initiation of web content translation workflows with a single click. User will gain access to an array of reports to track and manage global translation web projects through GPI's Translation Portal</description>
11
  <notes>Always install the latest, stable version of the GPI Translation Services Connector for Magento.</notes>
12
- <authors><author><name>Globalization Partners International, LLC.</name><user>gpiconnector</user><email>kBlakeThomas@globalizationpartners.com</email></author></authors>
13
- <date>2015-02-27</date>
14
- <time>20:48:18</time>
15
- <contents><target name="magecommunity"><dir name="Gpi"><dir name="Tsc"><dir name="Block"><dir name="Adminhtml"><file name="ITscClientPlugin.php" hash="1a20dff985c97bd42647efb3e51557ab"/><dir name="Tsc"><file name="Grid.php" hash="56d842ea3dd2b34d13d6cab01f66cfc7"/></dir><file name="Tsc.php" hash="908839a3705e0802e3548937f5c6c5c2"/></dir></dir><dir name="Helper"><file name="Admin.php" hash="7160b2693a723d2369546cd08a5d829a"/><file name="Data.php" hash="2caf2ff9913bdc98455dcaa49ca9c598"/><dir name="shareddata"><dir name="popo"><file name="PojoFactory.php" hash="65e93b316e599234ef06fc33afabea8c"/><file name="RemoteConfig.php" hash="9c4f2bfcb24225b7561540da0fcc082f"/><file name="RemoteQuote.php" hash="f518c1f94fb5bc6911c039a83f6b38f9"/><file name="TreeNode.php" hash="ce51cce40023022784cb4d77b85099ca"/><file name="WorkStatus.php" hash="b72313bb1e4a3736d7854d2f8368b9c0"/></dir></dir><dir name="webclient"><file name="AbstractTscClientPlugin.php" hash="9c4488068b3bf36465e0f88292e83e0e"/><file name="BackgroundJob.php" hash="05f8ee1f573bb0b948d7ab17a0bced24"/><file name="ClientConfigurationService.php" hash="53c932080d9d42f90466ba1959d16619"/><file name="ClientConfigurationServiceImpl.php" hash="8bccf77aaf294fe7d908dfdeab0a0b3d"/><file name="ConnectorConfiguration.php" hash="bbbd1199c88f9052476ed82edd321bdf"/><file name="Constants.php" hash="7c39d682c5e6a06ed4683eea2c548229"/><file name="ExportArguments.php" hash="3f9d45c57de969af36d66fff5cb402e9"/><file name="ExportBackgroundJob.php" hash="8aa4f4240edcc68f25ef67c15948de54"/><file name="ITscClientPlugin.php" hash="e6895dc6cb63ad8055d7c737208eb9e6"/><file name="ImportArguments.php" hash="abd5920a2990b1d859c80b9f9f114003"/><file name="ImportBackgroundJob.php" hash="e1e927618288ed76ff79599a0b4501e1"/><file name="NameIDPair.php" hash="71b814fc256468d172896787079998f8"/><file name="RemoteConnection.php" hash="aff6f8e8f45244f824a9d8bc1160c1da"/><file name="Utils.php" hash="7e1497cacdb1360641d7c8805d52e343"/><file name="WorkerContext.php" hash="8e7be4331a8a54063dea93cbf25eeba2"/><file name="WorkerList.php" hash="a3eba6f5d525bc51bb74581f2e316c7e"/><file name="Xxtea.php" hash="db82c46cd2ed92658789c5597f224282"/></dir></dir><dir name="Model"><file name="Backgroundjobs.php" hash="94a35eb899f2c0026d2bf4ea31ae65f1"/><file name="Configurations.php" hash="c412c0d0c1a3d7d70b942376411b20f5"/><file name="MagentoGpiClient.php" hash="f38b69b8f8d712824a03241b2324099d"/><dir name="Resource"><dir name="Backgroundjobs"><file name="Collection.php" hash="9f26ec484e0380d10f0264a02ac6caac"/></dir><file name="Backgroundjobs.php" hash="eb4f828adb7ae0bc7f90634dbed71519"/><dir name="Configurations"><file name="Collection.php" hash="7309514526bd3712f199822fef838a95"/></dir><file name="Configurations.php" hash="ea118f6ee2a1c660a969129abfd34370"/></dir><file name="Tsc.php" hash="d8f24ea8886f84ef1ee0db906c597c7a"/><file name="Utilities.php" hash="10b13c8925350a8ec3d5b96ddcdd17f1"/></dir><dir name="controllers"><file name="IndexController.php" hash="c1a118eaefc965b8521021247327aca3"/><dir name="adminhtml"><file name="TscController.php" hash="5a72a45625224f45e490cdf8b4bbf311"/></dir></dir><dir name="data"><dir name="gpi_tsc_setup"><file name="data-install-1.0.0.1.php" hash="130d4463721de0d5aab9215a05325a72"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="dcf5d7880d722babb0f2b7eb3376e5af"/><file name="config.xml" hash="61fea351b6b53f4778a1f2ee070e4306"/></dir><dir name="sql"><dir name="gpi_tsc_setup"><file name="install-1.0.0.1.php" hash="278c02b3a65ba38decd6854b1c08e412"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="gpi_tsc.xml" hash="9e48b81a5d22698a163f365881035ff1"/></dir><dir name="template"><dir name="gpi"><file name="tsc.phtml" hash="b0b4f11929d18606733ff09f6f5d8601"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Gpi_Tsc.xml" hash="f26ab12182688362116ebc3c70e9b79f"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Gpi_Tsc.csv" hash="095cdabff2891e4e419ee372006307c4"/></dir></target><target name="mage"><dir name="js"><dir name="gpi_tsc"><file name="Crypto.js" hash="3861701ea9d2f881d80bb3707a930611"/><file name="Crypto.min.js" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="EcmaScript5.js" hash="61a75a6ea2475bb12d69b7d1f49648dc"/><file name="EcmaScript5.min.js" hash="507aa9c06a0d7e4a8b86954260b89fcf"/><file name="JSON.js" hash="626ef1f5cc397ec996c9008437379bb2"/><file name="JSON.min.js" hash="f9a4a32a6aaf1bede55c14fd9a72f211"/><file name="JSON.min.js.mine" hash="f9a4a32a6aaf1bede55c14fd9a72f211"/><file name="JSON.min.js.r118" hash="fd59f781fae50afcfc8f88e14d098259"/><file name="JSON.min.js.r175" hash="30e7aa2d1d98809514369109f9f08179"/><dir name="langs"><file name="en.js" hash="cf72c74c85ba30da0c14c171b4737677"/><file name="en.min.js" hash="9c3176f90a4f9348efd2b0d9ed249c04"/></dir><file name="tsc.js" hash="5609c80585482298d0b9ea8642e5c2fd"/><file name="tsc.min.js" hash="971d6c939b08da26a483e49d05338e2a"/><file name="tsc.min.js.mine" hash="fc53c843aa24dafd91a71c104e614f88"/><file name="tsc.min.js.r118" hash="e133e0c8aa7208ab1c43ddf29d0527e5"/><file name="tsc.min.js.r175" hash="9fed06c449dd0064d36b0da736c47e1a"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="css"><file name="gpiconnector_tsc.css" hash="818075a27cf6b6dd6ef46038bf03a195"/></dir><dir name="images"><dir name="gpi_tsc"><file name="YesNo.png" hash="6025ac2d2c98339e0f569ad9d749ab4c"/><file name="accept.png" hash="b5a898b96d3d6159097194867a4cfee0"/><file name="back.png" hash="c224e24db0e1a027fc755e07e4676d83"/><file name="box__arrow.png" hash="fbd869339052f79cfae46e1f7d3cd48e"/><file name="document__pencil.png" hash="8cb3d67573814b446c5025b19ff401c3"/><file name="envelope_arrow.png" hash="f982568ed75a4ae8af5dcffa7af5db31"/><file name="error.png" hash="3a9064713f2d4fa72b57c8085cdf5234"/><file name="expand__tree.png" hash="43ae5dd7266c772cd48fdc593b7292df"/><file name="icon_plus.png" hash="403929bd8fc029a8d8e168e3452e8104"/><file name="info.png" hash="5c7fe97d78e6e27ddfa6ba116fae2baf"/><file name="input-focus.png" hash="d20285eeef57c6746f0a5fb51c05f5ba"/><file name="input-normal.png" hash="a324de13591fcd42f5e0407900caf424"/><file name="loading.gif" hash="332841820de58396c9632e359731fef0"/><file name="lock.png" hash="1ec90e836676a761a93f9a8b573f567f"/><file name="logo.png" hash="9524b9a0cf195df1e6e6fbeeb7b05a0e"/><file name="magnifier__arrow.png" hash="6e5b5887bd35ab4cb0890b3b0a059f34"/><file name="minus_circle.png" hash="54975349ccea6124c4e7880b5ca84729"/><file name="progressBar.png" hash="75988d35574d74325ec869e35f5ee0d8"/><file name="required.png" hash="e1904cb7e749547bd5a48504ac253f3f"/><file name="settings.png" hash="7ec53f029df8c2cca7c9cf7951f7acb9"/><file name="success.png" hash="169c64bf6086a79d1344f7fa88c7da09"/><file name="transparency.png" hash="125cb55ab7051f989937f48a67d1e45d"/><dir name="tree"><file name="checkboxes.png" hash="299ad74f9ada13c59af63714806cfb24"/><file name="folderClosed.png" hash="c1832e87bd7309f538ff978be9baaba2"/><file name="folderOpen.png" hash="40d66d2f6e6dbacce6aa74a1bca830d5"/><file name="iconText.png" hash="ffd15319ef6a458160ed30faf78e693f"/><file name="iconTexts.png" hash="116533258d950954c990fbe83bdb28df"/><file name="leaf.png" hash="7bdc23897c9dae10ef126cf1940c48f1"/><file name="lines.png" hash="c8d18f5213baf1171430c68f7f132f1e"/><file name="minus.png" hash="62f0fb56f759699e7b2ba514a03257cc"/><file name="plus.png" hash="d5dc9ef7735dac152239b738bfd9ede0"/></dir><file name="tsc_styles.css" hash="aeae9ff88ff6caa9f132ecfd0efd135f"/><file name="tsc_styles.min.css" hash="af24b63370bb4c7b6e18e7c591641a61"/><file name="validation.png" hash="7c1a391c73d4559bae640e25992194ba"/><file name="warning.png" hash="32ff0ead65d861223a5198eca240ffed"/></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
- <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>GPI_Translation_Services_Connector</name>
4
+ <version>1.0.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
9
  <summary>GPI's Translation Services Connector simplfies translation workflows for multiple-language Magento websites. </summary>
10
  <description>GPI's Translation Services Connector for Magento enables users of Magento-based websites to launch and manage multi-language websites. The Translation Services Connector streamlines content exports and reimports allowing for the initiation of web content translation workflows with a single click. User will gain access to an array of reports to track and manage global translation web projects through GPI's Translation Portal</description>
11
  <notes>Always install the latest, stable version of the GPI Translation Services Connector for Magento.</notes>
12
+ <authors><author><name>Kevin Blake-Thomas</name><user>kBlakeThomas</user><email>kBlakeThomas@globalizationpartners.com</email></author><author><name>Globalization Partners International</name><user>gpiconnector</user><email>magento@globalizationpartners.com</email></author></authors>
13
+ <date>2015-03-28</date>
14
+ <time>15:42:09</time>
15
+ <contents><target name="magecommunity"><dir name="Gpi"><dir name="Tsc"><dir name="Block"><dir name="Adminhtml"><file name="ITscClientPlugin.php" hash="1a20dff985c97bd42647efb3e51557ab"/><dir name="Tsc"><file name="Grid.php" hash="56d842ea3dd2b34d13d6cab01f66cfc7"/></dir><file name="Tsc.php" hash="908839a3705e0802e3548937f5c6c5c2"/></dir></dir><dir name="Helper"><file name="Admin.php" hash="7160b2693a723d2369546cd08a5d829a"/><file name="Data.php" hash="2caf2ff9913bdc98455dcaa49ca9c598"/><dir name="shareddata"><dir name="popo"><file name="PojoFactory.php" hash="65e93b316e599234ef06fc33afabea8c"/><file name="RemoteConfig.php" hash="9c4f2bfcb24225b7561540da0fcc082f"/><file name="RemoteQuote.php" hash="f518c1f94fb5bc6911c039a83f6b38f9"/><file name="TreeNode.php" hash="ce51cce40023022784cb4d77b85099ca"/><file name="WorkStatus.php" hash="b72313bb1e4a3736d7854d2f8368b9c0"/></dir></dir><dir name="webclient"><file name="AbstractTscClientPlugin.php" hash="b609a1e983376d5cae6fba92f21845a4"/><file name="BackgroundJob.php" hash="d04fffcef07c617d6fb9a37f475c250c"/><file name="ClientConfigurationService.php" hash="53c932080d9d42f90466ba1959d16619"/><file name="ClientConfigurationServiceImpl.php" hash="a1b9cd2aa95dde0fe8830fd30b52c8ea"/><file name="ConnectorConfiguration.php" hash="bbbd1199c88f9052476ed82edd321bdf"/><file name="Constants.php" hash="d0ace62dc3b91a4c3da4ef51c9183a34"/><file name="ExportArguments.php" hash="3f9d45c57de969af36d66fff5cb402e9"/><file name="ExportBackgroundJob.php" hash="a9e90c38e611048401ee78636b0eae4e"/><file name="ITscClientPlugin.php" hash="e6895dc6cb63ad8055d7c737208eb9e6"/><file name="ImportArguments.php" hash="abd5920a2990b1d859c80b9f9f114003"/><file name="ImportBackgroundJob.php" hash="2e5addf70cbe8dec9eda8bcdf0f8bd17"/><file name="NameIDPair.php" hash="71b814fc256468d172896787079998f8"/><file name="RemoteConnection.php" hash="0433b648f79be34bd43e406be15a80c2"/><file name="Utils.php" hash="7e1497cacdb1360641d7c8805d52e343"/><file name="WorkerList.php" hash="a3eba6f5d525bc51bb74581f2e316c7e"/><file name="XLIFFConstruct.php" hash="4fa1cdcadf86b4614750c14dc5101ab3"/><file name="XliffReader.php" hash="80ce1a2352ddf405ef7ac2f15611016c"/><file name="XliffWriter.php" hash="fa7e162891db14419f02ac7eaab70ccb"/><file name="Xxtea.php" hash="db82c46cd2ed92658789c5597f224282"/></dir></dir><dir name="Model"><file name="Backgroundjobs.php" hash="94a35eb899f2c0026d2bf4ea31ae65f1"/><file name="Configurations.php" hash="c412c0d0c1a3d7d70b942376411b20f5"/><file name="Cron.php" hash="596c21dc3b9693263d75f465315061fb"/><file name="Lock.php" hash="5cc6b56c4c92d06da55bf56aa9959029"/><file name="MagentoGpiClient.php" hash="94b35e23ff9da0e6740493ccf4a0fc6a"/><file name="Quotes.php" hash="90abba913984ba0a142f6ab3eb0e2d64"/><dir name="Resource"><dir name="Backgroundjobs"><file name="Collection.php" hash="9f26ec484e0380d10f0264a02ac6caac"/></dir><file name="Backgroundjobs.php" hash="eb4f828adb7ae0bc7f90634dbed71519"/><dir name="Configurations"><file name="Collection.php" hash="7309514526bd3712f199822fef838a95"/></dir><file name="Configurations.php" hash="ea118f6ee2a1c660a969129abfd34370"/><dir name="Quotes"><file name="Collection.php" hash="fbd8bda82e1aba4b8fac3036e094831c"/></dir><file name="Quotes.php" hash="03544a96450579ae443276ce05fa1499"/></dir><file name="Tsc.php" hash="d8f24ea8886f84ef1ee0db906c597c7a"/><file name="Utilities.php" hash="f369cb7e74238b53560f8311f2c3084d"/></dir><dir name="controllers"><file name="IndexController.php" hash="c1a118eaefc965b8521021247327aca3"/><dir name="adminhtml"><file name="TscController.php" hash="5a72a45625224f45e490cdf8b4bbf311"/></dir></dir><dir name="data"><dir name="gpi_tsc_setup"><file name="data-install-1.0.0.1.php" hash="130d4463721de0d5aab9215a05325a72"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="dcf5d7880d722babb0f2b7eb3376e5af"/><file name="config.xml" hash="6009b616e21f3a183e27a04b919c4dc5"/></dir><dir name="sql"><dir name="gpi_tsc_setup"><file name="install-1.0.0.1.php" hash="d77568e6ad8da7337ab1cf3e1be7c778"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="gpi_tsc.xml" hash="9e48b81a5d22698a163f365881035ff1"/></dir><dir name="template"><dir name="gpi"><file name="tsc.phtml" hash="b0b4f11929d18606733ff09f6f5d8601"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Gpi_Tsc.xml" hash="f26ab12182688362116ebc3c70e9b79f"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Gpi_Tsc.csv" hash="095cdabff2891e4e419ee372006307c4"/></dir><dir name="en_US"><file name="Gpi_Tsc.csv" hash="095cdabff2891e4e419ee372006307c4"/></dir><dir name="es_ES"><file name="Gpi_Tsc.csv" hash="095cdabff2891e4e419ee372006307c4"/></dir><dir name="fr_FR"><file name="Gpi_Tsc.csv" hash="095cdabff2891e4e419ee372006307c4"/></dir><dir name="nl_NL"><file name="Gpi_Tsc.csv" hash="8ab5f4b16532bd62334742526c4af9f1"/></dir><dir name="pt_BR"><file name="Gpi_Tsc.csv" hash="095cdabff2891e4e419ee372006307c4"/></dir><dir name="zh_CN"><file name="Gpi_Tsc.csv" hash="8ab5f4b16532bd62334742526c4af9f1"/></dir></target><target name="mageweb"><dir name="js"><dir name="gpi_tsc"><file name="Crypto.js" hash="3861701ea9d2f881d80bb3707a930611"/><file name="Crypto.min.js" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="EcmaScript5.js" hash="61a75a6ea2475bb12d69b7d1f49648dc"/><file name="EcmaScript5.min.js" hash="507aa9c06a0d7e4a8b86954260b89fcf"/><file name="JSON.js" hash="626ef1f5cc397ec996c9008437379bb2"/><file name="JSON.min.js" hash="f9a4a32a6aaf1bede55c14fd9a72f211"/><file name="JSON.min.js.mine" hash="f9a4a32a6aaf1bede55c14fd9a72f211"/><file name="JSON.min.js.r118" hash="fd59f781fae50afcfc8f88e14d098259"/><file name="JSON.min.js.r175" hash="30e7aa2d1d98809514369109f9f08179"/><dir name="langs"><file name="en.js" hash="cf72c74c85ba30da0c14c171b4737677"/><file name="en.min.js" hash="9c3176f90a4f9348efd2b0d9ed249c04"/></dir><file name="tsc.js" hash="070bc8771a4dfdff8483b3190e85f18d"/><file name="tsc.min.js" hash="971d6c939b08da26a483e49d05338e2a"/><file name="tsc.min.js.mine" hash="fc53c843aa24dafd91a71c104e614f88"/><file name="tsc.min.js.r118" hash="e133e0c8aa7208ab1c43ddf29d0527e5"/><file name="tsc.min.js.r175" hash="9fed06c449dd0064d36b0da736c47e1a"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="css"><file name="gpiconnector_tsc.css" hash="e796cc8653c86210f428137533faa30b"/></dir><dir name="images"><dir name="gpi_tsc"><file name="YesNo.png" hash="6025ac2d2c98339e0f569ad9d749ab4c"/><file name="accept.png" hash="b5a898b96d3d6159097194867a4cfee0"/><file name="back.png" hash="c224e24db0e1a027fc755e07e4676d83"/><file name="box__arrow.png" hash="fbd869339052f79cfae46e1f7d3cd48e"/><file name="document__pencil.png" hash="8cb3d67573814b446c5025b19ff401c3"/><file name="envelope_arrow.png" hash="f982568ed75a4ae8af5dcffa7af5db31"/><file name="error.png" hash="3a9064713f2d4fa72b57c8085cdf5234"/><file name="expand__tree.png" hash="43ae5dd7266c772cd48fdc593b7292df"/><file name="icon_plus.png" hash="403929bd8fc029a8d8e168e3452e8104"/><file name="info.png" hash="5c7fe97d78e6e27ddfa6ba116fae2baf"/><file name="input-focus.png" hash="d20285eeef57c6746f0a5fb51c05f5ba"/><file name="input-normal.png" hash="a324de13591fcd42f5e0407900caf424"/><file name="loading.gif" hash="332841820de58396c9632e359731fef0"/><file name="lock.png" hash="1ec90e836676a761a93f9a8b573f567f"/><file name="logo.png" hash="9524b9a0cf195df1e6e6fbeeb7b05a0e"/><file name="magnifier__arrow.png" hash="6e5b5887bd35ab4cb0890b3b0a059f34"/><file name="minus_circle.png" hash="54975349ccea6124c4e7880b5ca84729"/><file name="progressBar.png" hash="75988d35574d74325ec869e35f5ee0d8"/><file name="required.png" hash="e1904cb7e749547bd5a48504ac253f3f"/><file name="settings.png" hash="7ec53f029df8c2cca7c9cf7951f7acb9"/><file name="success.png" hash="169c64bf6086a79d1344f7fa88c7da09"/><file name="transparency.png" hash="125cb55ab7051f989937f48a67d1e45d"/><dir name="tree"><file name="checkboxes.png" hash="299ad74f9ada13c59af63714806cfb24"/><file name="folderClosed.png" hash="c1832e87bd7309f538ff978be9baaba2"/><file name="folderOpen.png" hash="40d66d2f6e6dbacce6aa74a1bca830d5"/><file name="iconText.png" hash="ffd15319ef6a458160ed30faf78e693f"/><file name="iconTexts.png" hash="116533258d950954c990fbe83bdb28df"/><file name="leaf.png" hash="7bdc23897c9dae10ef126cf1940c48f1"/><file name="lines.png" hash="c8d18f5213baf1171430c68f7f132f1e"/><file name="minus.png" hash="62f0fb56f759699e7b2ba514a03257cc"/><file name="plus.png" hash="d5dc9ef7735dac152239b738bfd9ede0"/></dir><file name="tsc_styles.css" hash="aeae9ff88ff6caa9f132ecfd0efd135f"/><file name="tsc_styles.min.css" hash="af24b63370bb4c7b6e18e7c591641a61"/><file name="validation.png" hash="7c1a391c73d4559bae640e25992194ba"/><file name="warning.png" hash="32ff0ead65d861223a5198eca240ffed"/></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.5.0.1</min><max>1.9</max></package></required></dependencies>
18
  </package>
skin/adminhtml/base/default/css/gpiconnector_tsc.css CHANGED
@@ -12,7 +12,7 @@
12
  font-family: Candara, Calibri, tahoma, verdana, arial, helvetica, sans-serif;
13
  vertical-align: baseline;
14
  background: #f3f3f3 url('../images/gpi_tsc/back.png') repeat-x right top;
15
- margin: 0;
16
 
17
  -moz-border-radius: 8px;
18
  -webkit-border-radius: 8px;
@@ -262,7 +262,7 @@
262
  border-collapse: collapse;
263
  border-spacing: 0;
264
  table-layout: fixed;
265
- font-size: 75%;
266
  border-bottom: 2px solid #353a40;
267
  width: 100%;
268
  margin: 0 auto 1em;
12
  font-family: Candara, Calibri, tahoma, verdana, arial, helvetica, sans-serif;
13
  vertical-align: baseline;
14
  background: #f3f3f3 url('../images/gpi_tsc/back.png') repeat-x right top;
15
+ margin: 0 0 55px 0;
16
 
17
  -moz-border-radius: 8px;
18
  -webkit-border-radius: 8px;
262
  border-collapse: collapse;
263
  border-spacing: 0;
264
  table-layout: fixed;
265
+ font-size: 95%;
266
  border-bottom: 2px solid #353a40;
267
  width: 100%;
268
  margin: 0 auto 1em;