Speedinfo_Opensi - Version 0.3.5

Version Notes

Mise à jour du module vers la version 0.3.5
Pour plus d'informations, se référer à la documentation.

Download this release

Release Info

Developer Magento Core Team
Extension Speedinfo_Opensi
Version 0.3.5
Comparing to
See all releases


Code changes from version 0.3.4 to 0.3.5

app/code/community/Speedinfo/Opensi/Model/Webservices.php CHANGED
@@ -109,8 +109,11 @@ class Speedinfo_Opensi_Model_Webservices extends Mage_Core_Model_Abstract {
109
  $this->createArticle($startedAt, $client, $storeId);
110
  $this->createClientWeb($startedAt, $client, $storeId);
111
  }
112
-
113
  foreach ($orderCollection as $order) {
 
 
 
114
  $docXml = $this->createXml();
115
  $request = $docXml->createElement("request");
116
 
@@ -129,7 +132,7 @@ class Speedinfo_Opensi_Model_Webservices extends Mage_Core_Model_Abstract {
129
  $commandeWeb->setAttribute('Login', "Invité");
130
  }
131
  $commandeWeb->setAttribute('Date_Commande', $orderDate->format('d-m-Y H:i:s'));
132
- $shippingDesc = $order->getShippingDescription();
133
  if (strlen($shippingDesc) > 30) {
134
  $shippingDesc = explode(' - ', $shippingDesc);
135
  if (strlen($shippingDesc[1]) > 30){
@@ -219,10 +222,10 @@ class Speedinfo_Opensi_Model_Webservices extends Mage_Core_Model_Abstract {
219
 
220
  if($item->getProductType() == "configurable"){
221
  $ligneCommandeClient->setAttribute('Reference', substr($item->getProductOptionByCode('simple_sku'),0,39));
222
- $ligneCommandeClient->setAttribute('Designation', substr($item->getProductOptionByCode('simple_name'),0,99));
223
  }else{
224
  $ligneCommandeClient->setAttribute('Reference', substr($item->getSku(),0,39));
225
- $ligneCommandeClient->setAttribute('Designation', substr($item->getName(),0,99));
226
  }
227
  $ligneCommandeClient->setAttribute('Quantite', round($item->getQtyOrdered(),3));
228
 
@@ -363,33 +366,33 @@ class Speedinfo_Opensi_Model_Webservices extends Mage_Core_Model_Abstract {
363
  try{
364
  // Informations du produit
365
  $article->setAttribute('Reference', $product->getSku());
366
- $article->setAttribute('Designation', substr($product->getName(), 0, 99));
367
- $article->setAttribute('Description_1', $product->getDescription());
368
  $shortDescription = $product->getShortDescription();
369
  if (!empty($shortDescription))
370
- $article->setattribute('Description_2', $shortDescription);
371
  $brand = $product->getAttributeText('manufacturer');
372
  if (!empty($brand))
373
- $article->setAttribute('Marque', substr($brand, 0, 39));
374
 
375
  // Gestion des familles
376
  $fam1 = $this->getSimpleAttributes($product, $client->famille1);
377
  if (!empty($client->famille1) && !empty($fam1)) {
378
- $article->setAttribute('Famille_1', substr($this->getSimpleAttributes($product, $client->famille1), 0, 39));
379
  } else {
380
  $article->setAttribute('Famille_1', 'NC');
381
  }
382
- !empty($client->famille2) && $this->getSimpleAttributes($product, $client->famille2) ? $article->setAttribute('Famille_2', substr($this->getSimpleAttributes($product, $client->famille2), 0, 39)) : false;
383
  !empty($client->famille3) && $this->getSimpleAttributes($product, $client->famille3) ? $article->setAttribute('Famille_3', substr($this->getSimpleAttributes($product, $client->famille3), 0, 39)) : false;
384
 
385
  // Gestion des attributs
386
- !empty($client->attribut1) && $this->getSimpleAttributes($product, $client->attribut1) ? $article->setAttribute('Attribut_1', substr($this->getSimpleAttributes($product, $client->attribut1), 0, 39)) : false;
387
- !empty($client->attribut2) && $this->getSimpleAttributes($product, $client->attribut2) ? $article->setAttribute('Attribut_2', substr($this->getSimpleAttributes($product, $client->attribut2), 0, 39)) : false;
388
- !empty($client->attribut3) && $this->getSimpleAttributes($product, $client->attribut3) ? $article->setAttribute('Attribut_3', substr($this->getSimpleAttributes($product, $client->attribut3), 0, 39)) : false;
389
- !empty($client->attribut4) && $this->getSimpleAttributes($product, $client->attribut4) ? $article->setAttribute('Attribut_4', substr($this->getSimpleAttributes($product, $client->attribut4), 0, 39)) : false;
390
- !empty($client->attribut5) && $this->getSimpleAttributes($product, $client->attribut5) ? $article->setAttribute('Attribut_5', substr($this->getSimpleAttributes($product, $client->attribut5), 0, 39)) : false;
391
- !empty($client->attribut6) && $this->getSimpleAttributes($product, $client->attribut6) ? $article->setAttribute('Attribut_6', substr($this->getSimpleAttributes($product, $client->attribut6), 0, 39)) : false;
392
- !empty($client->code_barre) && $this->getSimpleAttributes($product, $client->code_barre) ? $article->setAttribute('Code_Barre', substr($this->getSimpleAttributes($product, $client->code_barre), 0, 14)) : false;
393
  !empty($client->volume) && is_numeric($this->getSimpleAttributes($product, $client->volume)) && $this->getSimpleAttributes($product, round($client->volume,2)) ? $article->setAttribute('Volume',$this->getSimpleAttributes($product, round($client->volume,2) )) : false;
394
  !empty($client->hauteur) && is_numeric($this->getSimpleAttributes($product, $client->hauteur)) && $this->getSimpleAttributes($product, round($client->hauteur,2)) ? $article->setAttribute('Hauteur',$this->getSimpleAttributes($product, round($client->hauteur,2))) : false;
395
  !empty($client->longueur) && is_numeric($this->getSimpleAttributes($product, $client->longueur)) && $this->getSimpleAttributes($product, round($client->longueur,2)) ? $article->setAttribute('Longueur',$this->getSimpleAttributes($product, round($client->longueur,2))) : false;
@@ -643,7 +646,7 @@ class Speedinfo_Opensi_Model_Webservices extends Mage_Core_Model_Abstract {
643
  $transactionComWeb->setAttribute('Code_Site_Web', $client->web_site_code);
644
  $transactionComWeb->setAttribute('Num_Com_Web', $numOrder);
645
  $transactionComWeb->setAttribute('Num_Transaction', $numeroTransaction);
646
- $transactionComWeb->setAttribute('Mode_Reglement', $methodPayment);
647
  $transactionComWeb->setAttribute('Date_Transaction', $dateTransaction->format('d-m-Y'));
648
  $transactionComWeb->setAttribute('Montant', $montant);
649
 
@@ -742,7 +745,7 @@ class Speedinfo_Opensi_Model_Webservices extends Mage_Core_Model_Abstract {
742
  //passer derniere valeur a true pour envoyer mail au client
743
  switch ($etatCommande->getAttribute('Etat')) {
744
  case 'N': //Non validée
745
- if ($status != 'pending' && $status != 'processing' && $status != 'holded')
746
  $order->setState('pending', true, 'changement de statut OpenSI (Pending)', true);
747
  break;
748
 
@@ -952,4 +955,4 @@ class Speedinfo_Opensi_Model_Webservices extends Mage_Core_Model_Abstract {
952
  return true;
953
  }
954
 
955
- }
109
  $this->createArticle($startedAt, $client, $storeId);
110
  $this->createClientWeb($startedAt, $client, $storeId);
111
  }
112
+ ini_set('max_execution_time', 50 );
113
  foreach ($orderCollection as $order) {
114
+ ini_set('max_execution_time', ini_get('max_execution_time')+1 );
115
+ if (ini_get('max_execution_time') == 100)
116
+ ini_set('max_execution_time', 50 );
117
  $docXml = $this->createXml();
118
  $request = $docXml->createElement("request");
119
 
132
  $commandeWeb->setAttribute('Login', "Invité");
133
  }
134
  $commandeWeb->setAttribute('Date_Commande', $orderDate->format('d-m-Y H:i:s'));
135
+ $shippingDesc = strip_tags($order->getShippingDescription());
136
  if (strlen($shippingDesc) > 30) {
137
  $shippingDesc = explode(' - ', $shippingDesc);
138
  if (strlen($shippingDesc[1]) > 30){
222
 
223
  if($item->getProductType() == "configurable"){
224
  $ligneCommandeClient->setAttribute('Reference', substr($item->getProductOptionByCode('simple_sku'),0,39));
225
+ $ligneCommandeClient->setAttribute('Designation', substr(strip_tags($item->getProductOptionByCode('simple_name')),0,99));
226
  }else{
227
  $ligneCommandeClient->setAttribute('Reference', substr($item->getSku(),0,39));
228
+ $ligneCommandeClient->setAttribute('Designation', substr(strip_tags($item->getName()),0,99));
229
  }
230
  $ligneCommandeClient->setAttribute('Quantite', round($item->getQtyOrdered(),3));
231
 
366
  try{
367
  // Informations du produit
368
  $article->setAttribute('Reference', $product->getSku());
369
+ $article->setAttribute('Designation', substr(strip_tags($product->getName()), 0, 99));
370
+ $article->setAttribute('Description_1', strip_tags($product->getDescription()));
371
  $shortDescription = $product->getShortDescription();
372
  if (!empty($shortDescription))
373
+ $article->setattribute('Description_2', strip_tags($shortDescription));
374
  $brand = $product->getAttributeText('manufacturer');
375
  if (!empty($brand))
376
+ $article->setAttribute('Marque', substr(strip_tags($brand), 0, 39));
377
 
378
  // Gestion des familles
379
  $fam1 = $this->getSimpleAttributes($product, $client->famille1);
380
  if (!empty($client->famille1) && !empty($fam1)) {
381
+ $article->setAttribute('Famille_1', substr(strip_tags($this->getSimpleAttributes($product, $client->famille1)), 0, 39));
382
  } else {
383
  $article->setAttribute('Famille_1', 'NC');
384
  }
385
+ !empty($client->famille2) && $this->getSimpleAttributes($product, $client->famille2) ? $article->setAttribute('Famille_2', substr(strip_tags($this->getSimpleAttributes($product, $client->famille2)), 0, 39)) : false;
386
  !empty($client->famille3) && $this->getSimpleAttributes($product, $client->famille3) ? $article->setAttribute('Famille_3', substr($this->getSimpleAttributes($product, $client->famille3), 0, 39)) : false;
387
 
388
  // Gestion des attributs
389
+ !empty($client->attribut1) && $this->getSimpleAttributes($product, $client->attribut1) ? $article->setAttribute('Attribut_1', substr(strip_tags($this->getSimpleAttributes($product, $client->attribut1)), 0, 39)) : false;
390
+ !empty($client->attribut2) && $this->getSimpleAttributes($product, $client->attribut2) ? $article->setAttribute('Attribut_2', substr(strip_tags($this->getSimpleAttributes($product, $client->attribut2)), 0, 39)) : false;
391
+ !empty($client->attribut3) && $this->getSimpleAttributes($product, $client->attribut3) ? $article->setAttribute('Attribut_3', substr(strip_tags($this->getSimpleAttributes($product, $client->attribut3)), 0, 39)) : false;
392
+ !empty($client->attribut4) && $this->getSimpleAttributes($product, $client->attribut4) ? $article->setAttribute('Attribut_4', substr(strip_tags($this->getSimpleAttributes($product, $client->attribut4)), 0, 39)) : false;
393
+ !empty($client->attribut5) && $this->getSimpleAttributes($product, $client->attribut5) ? $article->setAttribute('Attribut_5', substr(strip_tags($this->getSimpleAttributes($product, $client->attribut5)), 0, 39)) : false;
394
+ !empty($client->attribut6) && $this->getSimpleAttributes($product, $client->attribut6) ? $article->setAttribute('Attribut_6', substr(strip_tags($this->getSimpleAttributes($product, $client->attribut6)), 0, 39)) : false;
395
+ !empty($client->code_barre) && $this->getSimpleAttributes($product, $client->code_barre) ? $article->setAttribute('Code_Barre', substr(strip_tags($this->getSimpleAttributes($product, $client->code_barre)), 0, 14)) : false;
396
  !empty($client->volume) && is_numeric($this->getSimpleAttributes($product, $client->volume)) && $this->getSimpleAttributes($product, round($client->volume,2)) ? $article->setAttribute('Volume',$this->getSimpleAttributes($product, round($client->volume,2) )) : false;
397
  !empty($client->hauteur) && is_numeric($this->getSimpleAttributes($product, $client->hauteur)) && $this->getSimpleAttributes($product, round($client->hauteur,2)) ? $article->setAttribute('Hauteur',$this->getSimpleAttributes($product, round($client->hauteur,2))) : false;
398
  !empty($client->longueur) && is_numeric($this->getSimpleAttributes($product, $client->longueur)) && $this->getSimpleAttributes($product, round($client->longueur,2)) ? $article->setAttribute('Longueur',$this->getSimpleAttributes($product, round($client->longueur,2))) : false;
646
  $transactionComWeb->setAttribute('Code_Site_Web', $client->web_site_code);
647
  $transactionComWeb->setAttribute('Num_Com_Web', $numOrder);
648
  $transactionComWeb->setAttribute('Num_Transaction', $numeroTransaction);
649
+ $transactionComWeb->setAttribute('Mode_Reglement', strip_tags($methodPayment));
650
  $transactionComWeb->setAttribute('Date_Transaction', $dateTransaction->format('d-m-Y'));
651
  $transactionComWeb->setAttribute('Montant', $montant);
652
 
745
  //passer derniere valeur a true pour envoyer mail au client
746
  switch ($etatCommande->getAttribute('Etat')) {
747
  case 'N': //Non validée
748
+ if ($status != 'pending' && $status != 'processing' && $status != 'holded' && $status != 'canceled')
749
  $order->setState('pending', true, 'changement de statut OpenSI (Pending)', true);
750
  break;
751
 
955
  return true;
956
  }
957
 
958
+ }
app/code/community/Speedinfo/Opensi/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Speedinfo_Opensi>
5
- <version>0.3.4</version>
6
  </Speedinfo_Opensi>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Speedinfo_Opensi>
5
+ <version>0.3.5</version>
6
  </Speedinfo_Opensi>
7
  </modules>
8
  <global>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Speedinfo_Opensi</name>
4
- <version>0.3.4</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
@@ -10,12 +10,12 @@
10
  <description>Le module OpenSi Connect vous permet de coupler Magento au logiciel de gestion commerciale et de comptabilit&#xE9; OpenSi E-Commerce.
11
  Speedinfo a con&#xE7;u un connecteur pour OpenSi E-Commerce et Magento sous la forme du module OpenSi Connect
12
  OpenSi E-Commerce, est un logiciel de gestion commerciale et de comptabilit&#xE9; d&#xE9;di&#xE9; &#xE0; l'e-commerce.</description>
13
- <notes>Mise &#xE0; jour du module vers la version 0.3.4
14
  Pour plus d'informations, se r&#xE9;f&#xE9;rer &#xE0; la documentation.</notes>
15
  <authors><author><name>Dray</name><user>auto-converted</user><email>rony.dray@speedinfo.fr</email></author></authors>
16
- <date>2011-05-02</date>
17
- <time>09:43:26</time>
18
- <contents><target name="mage"><dir name="app"><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="opensi"><dir name="tab"><file name="webservices.phtml" hash="44197706123f54d5c2e17475cd64b9f1"/></dir></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Speedinfo_Opensi.xml" hash="16cc3fbf8e32ce7b8add016bfbc89c5f"/></dir></dir><dir name="locale"><dir name="fr_FR"><file name="Speedinfo_OpenSi.csv" hash="51f46b50056059d178766fa9111fe072"/></dir></dir></dir></target><target name="magecommunity"><dir name="Speedinfo"><dir name="Opensi"><dir name="Block"><dir name="Adminhtml"><dir name="Edit"><dir name="Tab"><file name="Attributs.php" hash="562e895af0d5f2a1cffa1be63d0b5fa4"/><file name="Familles.php" hash="317e2361f1dcb6c494ca9ab6bf0d5cae"/><file name="General.php" hash="485e888e215dde1762a42d147cced3e1"/><file name="Webservices.php" hash="09ccc564f6ba4e7cbb58e0357c43e035"/></dir><file name="Form.php" hash="3ce2dc7af0ec4c5a44178ac46d6178a8"/></dir><file name="Edit.php" hash="b91602dd06e9432d879db352fa2aaeaa"/><file name="Grid.php" hash="6ace416ae5264fed2bbc57aa5d152e6e"/><file name="Tabs.php" hash="4383dd11c3e1fffe43868e489f6b977f"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="9754ad25b294a0306d4e28090bf9e4cb"/></dir><dir name="etc"><file name="config.xml" hash="f52d1a4914d68a8a7f1e516a3c209366"/></dir><dir name="Helper"><file name="Data.php" hash="b5798cdae9319b34ada4c3de5964c0b4"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Errorlog"><file name="Collection.php" hash="ad19bb95ad5e56f0dcaeff4db10cf52f"/></dir><dir name="Webservice"><file name="Collection.php" hash="3a5e5d973ffb834d4eadec4f9335b36e"/></dir><file name="Client.php" hash="0b47754c6aace0dc54340dfd807eb17a"/><file name="Errorlog.php" hash="9a8c882377bbdeada65c7c5d8346af35"/><file name="Webservice.php" hash="781eb93e76ba8bffe881f091904d0f98"/></dir><file name="Client.php" hash="f89aeb3dda8d8a27bf6a05e5082a945e"/><file name="Cron.php" hash="c2dccdfb120a3d8639ff88523c1e655e"/><file name="Errorlog.php" hash="d269ec20ae481684a1daa2c515848252"/><file name="Webservice.php" hash="c77708c3507d79a83e64a1801ea255c2"/><file name="Webservices.php" hash="6a08249520fd94a62104b37f791c1bcb"/></dir><dir name="sql"><dir name="opensi_setup"><file name="mysql4-install-0.1.0.php" hash="ce8cef17aac76ccfadf09d7d84d23841"/><file name="mysql4-upgrade-0.2.0-0.2.1.php" hash="f207b0704a6cad542dced6b40ac25341"/><file name="mysql4-upgrade-0.2.4-0.2.5.php" hash="99fcd03734f514441005dd8af5c22809"/></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies/>
21
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Speedinfo_Opensi</name>
4
+ <version>0.3.5</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
10
  <description>Le module OpenSi Connect vous permet de coupler Magento au logiciel de gestion commerciale et de comptabilit&#xE9; OpenSi E-Commerce.
11
  Speedinfo a con&#xE7;u un connecteur pour OpenSi E-Commerce et Magento sous la forme du module OpenSi Connect
12
  OpenSi E-Commerce, est un logiciel de gestion commerciale et de comptabilit&#xE9; d&#xE9;di&#xE9; &#xE0; l'e-commerce.</description>
13
+ <notes>Mise &#xE0; jour du module vers la version 0.3.5
14
  Pour plus d'informations, se r&#xE9;f&#xE9;rer &#xE0; la documentation.</notes>
15
  <authors><author><name>Dray</name><user>auto-converted</user><email>rony.dray@speedinfo.fr</email></author></authors>
16
+ <date>2011-05-30</date>
17
+ <time>11:01:51</time>
18
+ <contents><target name="mage"><dir name="app"><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="opensi"><dir name="tab"><file name="webservices.phtml" hash="44197706123f54d5c2e17475cd64b9f1"/></dir></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Speedinfo_Opensi.xml" hash="16cc3fbf8e32ce7b8add016bfbc89c5f"/></dir></dir><dir name="locale"><dir name="fr_FR"><file name="Speedinfo_OpenSi.csv" hash="51f46b50056059d178766fa9111fe072"/></dir></dir></dir></target><target name="magecommunity"><dir name="Speedinfo"><dir name="Opensi"><dir name="Block"><dir name="Adminhtml"><dir name="Edit"><dir name="Tab"><file name="Attributs.php" hash="562e895af0d5f2a1cffa1be63d0b5fa4"/><file name="Familles.php" hash="317e2361f1dcb6c494ca9ab6bf0d5cae"/><file name="General.php" hash="485e888e215dde1762a42d147cced3e1"/><file name="Webservices.php" hash="09ccc564f6ba4e7cbb58e0357c43e035"/></dir><file name="Form.php" hash="3ce2dc7af0ec4c5a44178ac46d6178a8"/></dir><file name="Edit.php" hash="b91602dd06e9432d879db352fa2aaeaa"/><file name="Grid.php" hash="6ace416ae5264fed2bbc57aa5d152e6e"/><file name="Tabs.php" hash="4383dd11c3e1fffe43868e489f6b977f"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="9754ad25b294a0306d4e28090bf9e4cb"/></dir><dir name="etc"><file name="config.xml" hash="67924c0d50793cbd461d700326a365b0"/></dir><dir name="Helper"><file name="Data.php" hash="b5798cdae9319b34ada4c3de5964c0b4"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Errorlog"><file name="Collection.php" hash="ad19bb95ad5e56f0dcaeff4db10cf52f"/></dir><dir name="Webservice"><file name="Collection.php" hash="3a5e5d973ffb834d4eadec4f9335b36e"/></dir><file name="Client.php" hash="0b47754c6aace0dc54340dfd807eb17a"/><file name="Errorlog.php" hash="9a8c882377bbdeada65c7c5d8346af35"/><file name="Webservice.php" hash="781eb93e76ba8bffe881f091904d0f98"/></dir><file name="Client.php" hash="f89aeb3dda8d8a27bf6a05e5082a945e"/><file name="Cron.php" hash="c2dccdfb120a3d8639ff88523c1e655e"/><file name="Errorlog.php" hash="d269ec20ae481684a1daa2c515848252"/><file name="Webservice.php" hash="c77708c3507d79a83e64a1801ea255c2"/><file name="Webservices.php" hash="0f6f5fe5c2685b987da56b7303a65552"/></dir><dir name="sql"><dir name="opensi_setup"><file name="mysql4-install-0.1.0.php" hash="ce8cef17aac76ccfadf09d7d84d23841"/><file name="mysql4-upgrade-0.2.0-0.2.1.php" hash="f207b0704a6cad542dced6b40ac25341"/><file name="mysql4-upgrade-0.2.4-0.2.5.php" hash="99fcd03734f514441005dd8af5c22809"/></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies/>
21
  </package>