packages: magento/magento-1.3.2.1-categories_id.patch (NEW), magento/magent...
glen
glen at pld-linux.org
Mon Jul 12 12:31:40 CEST 2010
Author: glen Date: Mon Jul 12 10:31:40 2010 GMT
Module: packages Tag: HEAD
---- Log message:
- new, based on http://openmamba.org/pub/openmamba/devel/SRPMS.i586/magento-1.4.0.0-1mamba.src.rpm
---- Files affected:
packages/magento:
magento-1.3.2.1-categories_id.patch (NONE -> 1.1) (NEW), magento-1.3.2.1-cron_export_fix_lang.patch (NONE -> 1.1) (NEW), magento-1.3.2.3-php43.patch (NONE -> 1.1) (NEW), magento-1.3.2.4-homelist_random.patch (NONE -> 1.1) (NEW), magento-cron_disabled.php (NONE -> 1.1) (NEW), magento-cron_export.php (NONE -> 1.1) (NEW), magento-cron_import.php (NONE -> 1.1) (NEW), magento-crontab (NONE -> 1.1) (NEW), magento.spec (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/magento/magento-1.3.2.1-categories_id.patch
diff -u /dev/null packages/magento/magento-1.3.2.1-categories_id.patch:1.1
--- /dev/null Mon Jul 12 12:31:40 2010
+++ packages/magento/magento-1.3.2.1-categories_id.patch Mon Jul 12 12:31:34 2010
@@ -0,0 +1,12 @@
+diff -ru magento/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php /var/www/shop.mambasoft.it/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php
+--- magento/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php 2009-06-01 15:18:04.000000000 +0200
++++ /var/www/shop.mambasoft.it/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php 2009-08-24 16:54:21.000000000 +0200
+@@ -277,7 +277,7 @@
+ */
+ public function buildNodeName($node)
+ {
+- $result = $this->htmlEscape($node->getName());
++ $result = '[ID: '. $node->getId() . ' ] '.$this->htmlEscape($node->getName());
+ if ($this->_withProductCount) {
+ $result .= ' (' . $node->getProductCount() . ')';
+ }
================================================================
Index: packages/magento/magento-1.3.2.1-cron_export_fix_lang.patch
diff -u /dev/null packages/magento/magento-1.3.2.1-cron_export_fix_lang.patch:1.1
--- /dev/null Mon Jul 12 12:31:40 2010
+++ packages/magento/magento-1.3.2.1-cron_export_fix_lang.patch Mon Jul 12 12:31:34 2010
@@ -0,0 +1,12 @@
+diff -ru magento/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Abstract.php /var/www/shop.mambasoft.it/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Abstract.php
+--- magento/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Abstract.php 2009-06-01 15:17:05.000000000 +0200
++++ /var/www/shop.mambasoft.it/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Abstract.php 2009-09-20 16:19:09.000000000 +0200
+@@ -84,7 +84,7 @@
+ if ($separator != '.') {
+ $number = str_replace($separator, '.', $number);
+ }
+-
++ setlocale(LC_ALL,'en_US');
+ return floatval($number);
+ }
+ }
================================================================
Index: packages/magento/magento-1.3.2.3-php43.patch
diff -u /dev/null packages/magento/magento-1.3.2.3-php43.patch:1.1
--- /dev/null Mon Jul 12 12:31:40 2010
+++ packages/magento/magento-1.3.2.3-php43.patch Mon Jul 12 12:31:34 2010
@@ -0,0 +1,29 @@
+diff -Nru magento.orig/app/code/core/Mage/Core/Controller/Request/Http.php magento/app/code/core/Mage/Core/Controller/Request/Http.php
+--- magento.orig/app/code/core/Mage/Core/Controller/Request/Http.php 2009-07-23 07:28:42.000000000 +0200
++++ magento/app/code/core/Mage/Core/Controller/Request/Http.php 2009-07-24 16:15:35.000000000 +0200
+@@ -271,7 +271,7 @@
+ return false;
+ }
+ if ($trimPort) {
+- $host = split(':', $_SERVER['HTTP_HOST']);
++ $host = explode(':', $_SERVER['HTTP_HOST']);
+ return $host[0];
+ }
+ return $_SERVER['HTTP_HOST'];
+diff -Nru magento.orig/lib/Varien/Object.php magento/lib/Varien/Object.php
+--- magento.orig/lib/Varien/Object.php 2009-07-23 07:30:51.000000000 +0200
++++ magento/lib/Varien/Object.php 2009-07-24 16:16:04.000000000 +0200
+@@ -481,10 +481,10 @@
+ * @param string $valueSeparator
+ * @return string
+ */
+- public function __toString(array $arrAttributes = array(), $valueSeparator=',')
++ public function __toString()
+ {
+- $arrData = $this->toArray($arrAttributes);
+- return implode($valueSeparator, $arrData);
++ $arrData = $this->toArray();
++ return implode(',', $arrData);
+ }
+
+ /**
================================================================
Index: packages/magento/magento-1.3.2.4-homelist_random.patch
diff -u /dev/null packages/magento/magento-1.3.2.4-homelist_random.patch:1.1
--- /dev/null Mon Jul 12 12:31:41 2010
+++ packages/magento/magento-1.3.2.4-homelist_random.patch Mon Jul 12 12:31:34 2010
@@ -0,0 +1,52 @@
+diff -Nru magento.orig/app/code/core/Mage/Catalog/Block/Product/List/Random.php magento/app/code/core/Mage/Catalog/Block/Product/List/Random.php
+--- magento.orig/app/code/core/Mage/Catalog/Block/Product/List/Random.php 2009-09-23 20:52:08.000000000 +0200
++++ magento/app/code/core/Mage/Catalog/Block/Product/List/Random.php 2009-09-24 12:53:33.000000000 +0200
+@@ -43,7 +43,7 @@
+ $collection->addStoreFilter();
+ $numProducts = $this->getNumProducts() ? $this->getNumProducts() : 3;
+ $collection->setPage(1, $numProducts);
+-
++ foreach ($collection as $_p);
+ $this->_productCollection = $collection;
+ }
+ return $this->_productCollection;
+diff -Nru magento.orig/app/design/frontend/default/default/template/catalog/product/homelist.phtml magento/app/design/frontend/default/default/template/catalog/product/homelist.phtml
+--- magento.orig/app/design/frontend/default/default/template/catalog/product/homelist.phtml 1970-01-01 01:00:00.000000000 +0100
++++ magento/app/design/frontend/default/default/template/catalog/product/homelist.phtml 2009-09-24 12:54:02.000000000 +0200
+@@ -0,0 +1,36 @@
++<?php $_productCollection=$this->getLoadedProductCollection() ?>
++<?php if(!$_productCollection->count()): ?>
++<div class="note-msg">
++ <?php echo $this->__('There are no products matching the selection.') ?>
++</div>
++<?php else: ?>
++<div class="box best-selling">
++<?php $_collectionSize = $_productCollection->count() ?>
++<table border="0" cellspacing="0">
++<tbody>
++ <?php $i=0; foreach ($_productCollection as $_product): ?>
++ <?php if($i++%2==0): ?>
++ <tr>
++ <?php endif; ?>
++ <td>
++ <a href="<?php echo $_product->getProductUrl() ?>" >
++ <img class="product-img" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(95, 95); ?>" width="95" height="95" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />
++ </a>
++ <div class="product-description">
++ <p><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName()) ?></a></p>
++ <?php echo $this->getPriceHtml($_product, true) ?>
++ <?php if($_product->getRatingSummary()): ?>
++ <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
++ <?php endif; ?>
++ <?php echo nl2br($_product->getShortDescription()) ?>
++ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><small><?php echo $this->__('Learn More') ?></small></a>
++ </td>
++ <?php if($i%2==0 || $i==$_collectionSize): ?>
++ </tr>
++ <?php endif; ?>
++ <?php endforeach ?>
++ <script type="text/javascript">decorateGeneric($$('tr'), ['last', 'odd', 'even']);</script>
++</tbody>
++</table>
++</div>
++<?php endif; //$_productCollection->count() ?>
================================================================
Index: packages/magento/magento-cron_disabled.php
diff -u /dev/null packages/magento/magento-cron_disabled.php:1.1
--- /dev/null Mon Jul 12 12:31:41 2010
+++ packages/magento/magento-cron_disabled.php Mon Jul 12 12:31:34 2010
@@ -0,0 +1,135 @@
+<?
+if (!$_SERVER["HTTP_USER_AGENT"]) { // to run via local browser use if ($_SERVER["SERVER_ADDR"] == $_SERVER["REMOTE_ADDR"]) {
+ setlocale(LC_ALL, 'it_IT');
+ $profileId = 9; // SYSTEM - IMPORT/EXPORT - ADVANCED PROFILES
+ $storeId = 1; // used when create grouped products only
+ $websiteId = 1; // used when create grouped products only
+
+ require_once 'app/Mage.php';
+ umask(0);
+ Mage::app("default")->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
+ $profile = Mage::getModel('dataflow/profile');
+ $userModel = Mage::getModel('admin/user');
+ $userModel->setUserId(0);
+ Mage::getSingleton('admin/session')->setUser($userModel);
+ $profile->load($profileId);
+ if (!$profile->getId()) {
+ Mage::getSingleton('adminhtml/session')->addError('ERROR: Incorrect profile id');
+ }
+ Mage::register('current_convert_profile', $profile);
+ $profile->run();
+
+ $recordCount = 0;
+ $batchModel = Mage::getSingleton('dataflow/batch');
+ if ($batchModel->getId()) {
+ if ($batchModel->getAdapter()) {
+ $batchId = $batchModel->getId();
+ $batchImportModel = $batchModel->getBatchImportModel();
+ $importIds = $batchImportModel->getIdCollection();
+ $batchModel = Mage::getModel('dataflow/batch')->load($batchId);
+ $adapter = Mage::getModel($batchModel->getAdapter());
+ $resource = Mage::getSingleton('core/resource');
+ $product_table = $resource->getTableName('catalog/product');
+ $attribute_table = $resource->getTableName('eav/attribute');
+ $super_link_table = $resource->getTableName('catalog/product_super_link');
+ $super_attribute_table = $resource->getTableName('catalog/product_super_attribute');
+ $product_link_table = $resource->getTableName('catalog/product_link');
+ $product_link_attribute_decimal_table = $resource->getTableName('catalog/product_link_attribute_decimal');
+ $product_link_attribute_int_table = $resource->getTableName('catalog/product_link_attribute_int');
+ $index_eav_table = $resource->getTableName('catalogindex_eav');
+ $index_minimal_price_table = $resource->getTableName('catalogindex_minimal_price');
+ $index_price_table = $resource->getTableName('catalogindex_price');
+ // $search_fulltext_table = $resource->getTableName('catalogsearch_fulltext');
+ $customer_group_table = $resource->getTableName('customer_group');
+ $write = $resource->getConnection('catalog_write');
+ foreach ($profile->getExceptions() as $e) {
+ printf($e->getMessage() . "\n");
+ }
+ $exceptionCount = count($profile->getExceptions());
+ foreach ($importIds as $importId) {
+ $recordCount++;
+ try{
+ $batchImportModel->load($importId);
+ if (!$batchImportModel->getId()) {
+ $errors[] = Mage::helper('dataflow')->__('WARNING: Skip undefined row');
+ continue;
+ }
+ $importData = $batchImportModel->getBatchData();
+ try {
+ $adapter->saveRow($importData);
+ if ($importData['type'] == 'configurable') { // for configurable products
+ $parent_id = $write->fetchOne("select * from $product_table where sku='".$importData['sku']."'");
+ $attribute_id = $write->fetchOne("select * from $attribute_table where attribute_code='".$importData['config_attributes']."'");
+ if (!$write->fetchOne("select * from $super_attribute_table where product_id=".(int)$parent_id." and attribute_id=".(int)$attribute_id)) {
+ $write->query("insert into $super_attribute_table (product_id, attribute_id) values (".(int)$parent_id.", ".(int)$attribute_id.")");
+ }
+ foreach (explode(',', $importData['associated']) as $product_sku) {
+ try {
+ $product_id = $write->fetchOne("select * from $product_table where sku='$product_sku'");
+ if (!$write->fetchOne("select * from $super_link_table where parent_id=".(int)$parent_id." and product_id=".(int)$product_id)) {
+ $write->query("insert into $super_link_table (parent_id, product_id) values (".(int)$parent_id.", ".(int)$product_id.")");
+ }
+ } catch (Exception $e) {
+ printf("ROW " . $recordCount . ", PARENT SKU " . $importData['sku'] . ", PRODUCT SKU " . $product_sku . " - " . $e->getMessage() . "\n");
+ }
+ }
+ }
+ if ($importData['type'] == 'grouped') { // for grouped products
+ $parent_id = $write->fetchOne("select * from $product_table where sku='".$importData['sku']."'");
+ $valueCount = 1;
+ foreach (explode(',', $importData['associated']) as $product_sku) {
+ try {
+ $product_id = $write->fetchOne("select * from $product_table where sku='$product_sku'");
+ } catch (Exception $e) {
+ printf("ROW " . $recordCount . ", PARENT SKU " . $importData['sku'] . ", PRODUCT SKU " . $product_sku . " - " . $e->getMessage() . "\n");
+ continue;
+ }
+ try {
+ if (!$write->fetchOne("select * from $product_link_table where product_id=".(int)$parent_id." and linked_product_id=".(int)$product_id." and link_type_id=3")) {
+ $write->query("insert into $product_link_table (product_id, linked_product_id, link_type_id) values (".(int)$parent_id.", ".(int)$product_id.",3)");
+ }
+ $link_id = $write->fetchOne("select link_id from $product_link_table where product_id=".(int)$parent_id." and linked_product_id=".(int)$product_id." and link_type_id=3");
+ if (!$write->fetchOne("select * from $product_link_attribute_decimal_table where product_link_attribute_id=8 and link_id=".(int)$link_id)) {
+ $write->query("insert into $product_link_attribute_decimal_table (product_link_attribute_id, link_id) values (8, ".(int)$link_id.")");
+ }
+ if (!$write->fetchOne("select * from $product_link_attribute_int_table where product_link_attribute_id=7 and link_id=".(int)$link_id)) {
+ $write->query("insert into $product_link_attribute_int_table (product_link_attribute_id, link_id) values (7, ".(int)$link_id.")");
+ }
+ $attribute_id = $write->fetchOne("select * from $attribute_table where attribute_code='".$importData['config_attributes']."'");
+ if (!$write->fetchOne("select * from $index_eav_table where store_id=".$storeId." and entity_id=".(int)$parent_id." and attribute_id=".(int)$attribute_id)) {
+ $write->query("insert into $index_eav_table (store_id, entity_id, attribute_id, value) values (".$storeId.", ".(int)$parent_id.", ".$attribute_id.", ".$valueCount++.")");
+ }
+ $customer_groups = $write->query("select customer_group_id from $customer_group_table");
+ $price_attribute = 60;
+ foreach ($customer_groups as $customer_group_id) {
+ if (!$write->fetchOne("select * from $index_minimal_price_table where entity_id=".(int)$parent_id." and customer_group_id=".(int)$customer_group_id['customer_group_id']." and website_id=".$websiteId)) {
+ $write->query("insert into $index_minimal_price_table (entity_id, customer_group_id, website_id) values (".(int)$parent_id.", ".(int)$customer_group_id['customer_group_id'].", ".$websiteId.")");
+ }
+ if (!$write->fetchOne("select * from $index_price_table where entity_id=".(int)$parent_id." and attribute_id=".$price_attribute." and customer_group_id=".(int)$customer_group_id['customer_group_id']." and website_id=".$websiteId)) {
+ $write->query("insert into $index_price_table (entity_id, attribute_id, customer_group_id, value, website_id) values (".(int)$parent_id.", ".$price_attribute.", ".(int)$customer_group_id['customer_group_id'].", ".(int)$importData['price'].", ".$websiteId.")");
+ }
+ }
+ } catch (Exception $e) {
+ printf("ROW " . $recordCount . ", PARENT SKU " . $importData['sku'] . ", PRODUCT SKU " . $product_sku . " - " . $e->getMessage() . "\n");
+ }
+ }
+ }
+ } catch (Exception $e) {
+ printf("ROW " . $recordCount . ", SKU " . $importData['sku'] . " - " . $e->getMessage() . "\n");
+ continue;
+ }
+ if ($recordCount%100 == 0) {
+ printf($recordCount . "...\n");
+ }
+ } catch(Exception $ex) {
+ printf("ROW " . $recordCount . ", SKU " . $importData['sku'] . " - " . $e->getMessage() . "\n");
+ }
+ }
+ foreach ($profile->getExceptions() as $e) {
+ $exceptionCount>0 ? $exceptionCount-- : printf($e->getMessage() . "\n");
+ }
+ }
+ printf("Done\n");
+ }
+}
+?>
================================================================
Index: packages/magento/magento-cron_export.php
diff -u /dev/null packages/magento/magento-cron_export.php:1.1
--- /dev/null Mon Jul 12 12:31:41 2010
+++ packages/magento/magento-cron_export.php Mon Jul 12 12:31:34 2010
@@ -0,0 +1,35 @@
+<?
+//uncomment when moved to server - to ensure this page is not accessed from anywhere else
+if (!$_SERVER["HTTP_USER_AGENT"]) {
+
+require_once 'app/Mage.php';
+// wget -O - http://<www.example.com>/Cron_Import.php
+ umask(0);
+
+ //$_SERVER['SERVER_PORT']='443';
+ Mage::app();
+
+ $profileId = 1; //put your profile id here
+
+ Mage::log("Import Started",null,$logFileName);
+
+ $profile = Mage::getModel('dataflow/profile');
+
+ $userModel = Mage::getModel('admin/user');
+ $userModel->setUserId(0);
+ Mage::getSingleton('admin/session')->setUser($userModel);
+
+ if ($profileId) {
+ $profile->load($profileId);
+ if (!$profile->getId()) {
+ Mage::getSingleton('adminhtml/session')->addError('The profile you are trying to save no longer exists');
+ }
+ }
+
+ Mage::register('current_convert_profile', $profile);
+
+ $profile->run();
+
+ echo 'Export Completed';
+}
+?>
\ No newline at end of file
================================================================
Index: packages/magento/magento-cron_import.php
diff -u /dev/null packages/magento/magento-cron_import.php:1.1
--- /dev/null Mon Jul 12 12:31:41 2010
+++ packages/magento/magento-cron_import.php Mon Jul 12 12:31:34 2010
@@ -0,0 +1,139 @@
+<?
+if (!$_SERVER["HTTP_USER_AGENT"]) { // to run via local browser use if ($_SERVER["SERVER_ADDR"] == $_SERVER["REMOTE_ADDR"]) {
+// $number = "1234.56";
+// echo money_format('%i',$number)."\n";
+ $profileId = 3; // SYSTEM - IMPORT/EXPORT - ADVANCED PROFILES
+ $storeId = 1; // used when create grouped products only
+ $websiteId = 1; // used when create grouped products only
+
+ require_once 'app/Mage.php';
+// setlocale(LC_ALL, Mage::app()->getLocale()->getLocaleCode().'.UTF-8');
+
+ umask(0);
+ setlocale(LC_ALL,'en_EN');
+ Mage::app("default")->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
+ $profile = Mage::getModel('dataflow/profile');
+ $userModel = Mage::getModel('admin/user');
+ $userModel->setUserId(0);
+ Mage::getSingleton('admin/session')->setUser($userModel);
+ $profile->load($profileId);
+ if (!$profile->getId()) {
+ Mage::getSingleton('adminhtml/session')->addError('ERROR: Incorrect profile id');
+ }
+ Mage::register('current_convert_profile', $profile);
+ $profile->run();
+
+ $recordCount = 0;
+ $batchModel = Mage::getSingleton('dataflow/batch');
+ if ($batchModel->getId()) {
+ if ($batchModel->getAdapter()) {
+ $batchId = $batchModel->getId();
+ $batchImportModel = $batchModel->getBatchImportModel();
+ $importIds = $batchImportModel->getIdCollection();
+ $batchModel = Mage::getModel('dataflow/batch')->load($batchId);
+ $adapter = Mage::getModel($batchModel->getAdapter());
+ $resource = Mage::getSingleton('core/resource');
+ $product_table = $resource->getTableName('catalog/product');
+ $attribute_table = $resource->getTableName('eav/attribute');
+ $super_link_table = $resource->getTableName('catalog/product_super_link');
+ $super_attribute_table = $resource->getTableName('catalog/product_super_attribute');
+ $product_link_table = $resource->getTableName('catalog/product_link');
+ $product_link_attribute_decimal_table = $resource->getTableName('catalog/product_link_attribute_decimal');
+ $product_link_attribute_int_table = $resource->getTableName('catalog/product_link_attribute_int');
+ $index_eav_table = $resource->getTableName('catalogindex_eav');
+ $index_minimal_price_table = $resource->getTableName('catalogindex_minimal_price');
+ $index_price_table = $resource->getTableName('catalogindex_price');
+ // $search_fulltext_table = $resource->getTableName('catalogsearch_fulltext');
+ $customer_group_table = $resource->getTableName('customer_group');
+ $write = $resource->getConnection('catalog_write');
+ foreach ($profile->getExceptions() as $e) {
+ printf($e->getMessage() . "\n");
+ }
+ $exceptionCount = count($profile->getExceptions());
+ foreach ($importIds as $importId) {
+ $recordCount++;
+ try{
+ $batchImportModel->load($importId);
+ if (!$batchImportModel->getId()) {
+ $errors[] = Mage::helper('dataflow')->__('WARNING: Skip undefined row');
+ continue;
+ }
+ $importData = $batchImportModel->getBatchData();
+ try {
+ $adapter->saveRow($importData);
+ if ($importData['type'] == 'configurable') { // for configurable products
+ $parent_id = $write->fetchOne("select * from $product_table where sku='".$importData['sku']."'");
+ $attribute_id = $write->fetchOne("select * from $attribute_table where attribute_code='".$importData['config_attributes']."'");
+ if (!$write->fetchOne("select * from $super_attribute_table where product_id=".(int)$parent_id." and attribute_id=".(int)$attribute_id)) {
+ $write->query("insert into $super_attribute_table (product_id, attribute_id) values (".(int)$parent_id.", ".(int)$attribute_id.")");
+ }
+ foreach (explode(',', $importData['associated']) as $product_sku) {
+ try {
+ $product_id = $write->fetchOne("select * from $product_table where sku='$product_sku'");
+ if (!$write->fetchOne("select * from $super_link_table where parent_id=".(int)$parent_id." and product_id=".(int)$product_id)) {
+ $write->query("insert into $super_link_table (parent_id, product_id) values (".(int)$parent_id.", ".(int)$product_id.")");
+ }
+ } catch (Exception $e) {
+ printf("ROW " . $recordCount . ", PARENT SKU " . $importData['sku'] . ", PRODUCT SKU " . $product_sku . " - " . $e->getMessage() . "\n");
+ }
+ }
+ }
+ if ($importData['type'] == 'grouped') { // for grouped products
+ $parent_id = $write->fetchOne("select * from $product_table where sku='".$importData['sku']."'");
+ $valueCount = 1;
+ foreach (explode(',', $importData['associated']) as $product_sku) {
+ try {
+ $product_id = $write->fetchOne("select * from $product_table where sku='$product_sku'");
+ } catch (Exception $e) {
+ printf("ROW " . $recordCount . ", PARENT SKU " . $importData['sku'] . ", PRODUCT SKU " . $product_sku . " - " . $e->getMessage() . "\n");
+ continue;
+ }
+ try {
+ if (!$write->fetchOne("select * from $product_link_table where product_id=".(int)$parent_id." and linked_product_id=".(int)$product_id." and link_type_id=3")) {
+ $write->query("insert into $product_link_table (product_id, linked_product_id, link_type_id) values (".(int)$parent_id.", ".(int)$product_id.",3)");
+ }
+ $link_id = $write->fetchOne("select link_id from $product_link_table where product_id=".(int)$parent_id." and linked_product_id=".(int)$product_id." and link_type_id=3");
+ if (!$write->fetchOne("select * from $product_link_attribute_decimal_table where product_link_attribute_id=8 and link_id=".(int)$link_id)) {
+ $write->query("insert into $product_link_attribute_decimal_table (product_link_attribute_id, link_id) values (8, ".(int)$link_id.")");
+ }
+ if (!$write->fetchOne("select * from $product_link_attribute_int_table where product_link_attribute_id=7 and link_id=".(int)$link_id)) {
+ $write->query("insert into $product_link_attribute_int_table (product_link_attribute_id, link_id) values (7, ".(int)$link_id.")");
+ }
+ $attribute_id = $write->fetchOne("select * from $attribute_table where attribute_code='".$importData['config_attributes']."'");
+ if (!$write->fetchOne("select * from $index_eav_table where store_id=".$storeId." and entity_id=".(int)$parent_id." and attribute_id=".(int)$attribute_id)) {
+ $write->query("insert into $index_eav_table (store_id, entity_id, attribute_id, value) values (".$storeId.", ".(int)$parent_id.", ".$attribute_id.", ".$valueCount++.")");
+ }
+ $customer_groups = $write->query("select customer_group_id from $customer_group_table");
+ $price_attribute = 60;
+ foreach ($customer_groups as $customer_group_id) {
+ if (!$write->fetchOne("select * from $index_minimal_price_table where entity_id=".(int)$parent_id." and customer_group_id=".(int)$customer_group_id['customer_group_id']." and website_id=".$websiteId)) {
+ $write->query("insert into $index_minimal_price_table (entity_id, customer_group_id, website_id) values (".(int)$parent_id.", ".(int)$customer_group_id['customer_group_id'].", ".$websiteId.")");
+ }
+ if (!$write->fetchOne("select * from $index_price_table where entity_id=".(int)$parent_id." and attribute_id=".$price_attribute." and customer_group_id=".(int)$customer_group_id['customer_group_id']." and website_id=".$websiteId)) {
+ $write->query("insert into $index_price_table (entity_id, attribute_id, customer_group_id, value, website_id) values (".(int)$parent_id.", ".$price_attribute.", ".(int)$customer_group_id['customer_group_id'].", ".(int)$importData['price'].", ".$websiteId.")");
+ }
+ }
+ } catch (Exception $e) {
+ printf("ROW " . $recordCount . ", PARENT SKU " . $importData['sku'] . ", PRODUCT SKU " . $product_sku . " - " . $e->getMessage() . "\n");
+ }
+ }
+ }
+ } catch (Exception $e) {
+ printf("ROW " . $recordCount . ", SKU " . $importData['sku'] . " - " . $e->getMessage() . "\n");
+ continue;
+ }
+ if ($recordCount%100 == 0) {
+ printf($recordCount . "...\n");
+ }
+ } catch(Exception $ex) {
+ printf("ROW " . $recordCount . ", SKU " . $importData['sku'] . " - " . $e->getMessage() . "\n");
+ }
+ }
+ foreach ($profile->getExceptions() as $e) {
+ $exceptionCount>0 ? $exceptionCount-- : printf($e->getMessage() . "\n");
+ }
+ }
+ printf("Done\n");
+ }
+}
+?>
================================================================
Index: packages/magento/magento-crontab
diff -u /dev/null packages/magento/magento-crontab:1.1
--- /dev/null Mon Jul 12 12:31:41 2010
+++ packages/magento/magento-crontab Mon Jul 12 12:31:34 2010
@@ -0,0 +1 @@
+*/5 * * * * php /var/www/shop.mambasoft.it/cron.php
================================================================
Index: packages/magento/magento.spec
diff -u /dev/null packages/magento/magento.spec:1.1
--- /dev/null Mon Jul 12 12:31:41 2010
+++ packages/magento/magento.spec Mon Jul 12 12:31:34 2010
@@ -0,0 +1,141 @@
+# $Revision$, $Date$
+Summary: An open-source eCommerce platform focused on flexibility and control
+Name: magento
+Version: 1.4.0.0
+Release: 0.1
+License: Open Software License
+Group: Applications/WWW
+URL: http://www.magentocommerce.com/
+Source0: http://www.magentocommerce.com/downloads/assets/%{version}/%{name}-%{version}.tar.bz2
+# Source0-md5: 74bba43bf8f5429fb26797be3fefbf0f
+Source2: %{name}-crontab
+Source3: %{name}-cron_disabled.php
+Source4: %{name}-cron_import.php
+Source5: %{name}-cron_export.php
+Patch0: %{name}-1.3.2.3-php43.patch
+Patch1: %{name}-1.3.2.1-categories_id.patch
+Patch2: %{name}-1.3.2.1-cron_export_fix_lang.patch
+Patch3: %{name}-1.3.2.4-homelist_random.patch
+Requires: php-mysql
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define _webapps /etc/webapps
+%define _webapp %{name}
+%define _sysconfdir %{_webapps}/%{_webapp}
+%define _appdir %{_datadir}/%{_webapp}
+
+%description
+An open-source eCommerce platform focused on flexibility and control.
+
+%prep
+%setup -q -n %{name}
+#%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+rm -rf app/.svn
+
+cat <<'EOF' > apache.conf
+Alias /magento %{_appdir}/magento
+<Directory %{_appdir}/magento>
+ AllowOverride All
+ RewriteEngine On
+ Order allow,deny
+ Allow from All
+</Directory>
+EOF
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_appdir}
+cp -a . $RPM_BUILD_ROOT%{_appdir}
+
+install -d $RPM_BUILD_ROOT%{_sysconfdir}
+cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
+
+cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_appdir}/crontab
+cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_appdir}/cron_disabled.php
+cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_appdir}/cron_import.php
+cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_appdir}/cron_export.php
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%triggerin -- apache1 < 1.3.37-3, apache1-base
+%webapp_register apache %{_webapp}
+
+%triggerun -- apache1 < 1.3.37-3, apache1-base
+%webapp_unregister apache %{_webapp}
+
+%triggerin -- apache < 2.2.0, apache-base
+%webapp_register httpd %{_webapp}
+
+%triggerun -- apache < 2.2.0, apache-base
+%webapp_unregister httpd %{_webapp}
+
+%files
+%defattr(644,root,root,755)
+%dir %attr(750,root,http) %{_sysconfdir}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
+%dir %{_appdir}
+%{_appdir}/errors
+%dir %{_appdir}/app
+%{_appdir}/app/.htaccess
+%{_appdir}/app/code/*
+%{_appdir}/app/design/*
+%attr(775,root,http) %config(noreplace) %{_appdir}/app/etc/*
+%{_appdir}/app/locale/*
+%{_appdir}/app/Mage.php
+%dir %{_appdir}/downloader
+%{_appdir}/downloader/*
+%{_appdir}/downloader/.htaccess
+%{_appdir}/includes/config.php
+%{_appdir}/includes/.htaccess
+%{_appdir}/index.php.sample
+%{_appdir}/media/downloadable/.htaccess
+%{_appdir}/media/.htaccess
+%dir %{_appdir}/pkginfo
+%{_appdir}/pkginfo/*
+%{_appdir}/pkginfo/.htaccess
+#%dir %{_appdir}/report
+#%{_appdir}/report/*
+#%{_appdir}/report/.htaccess
+%{_appdir}/shell/*.php
+%dir %{_appdir}/skin
+%{_appdir}/skin/*
+%dir %{_appdir}/js
+%{_appdir}/js/*
+%dir %{_appdir}/install.php
+%dir %{_appdir}/lib
+%dir %{_appdir}/lib/.htaccess
+%{_appdir}/lib/*
+%attr(775,root,http) %dir %{_appdir}/media
+%attr(775,root,http) %dir %{_appdir}/var
+%attr(664,root,http) %{_appdir}/var/.htaccess
+%{_appdir}/favicon.ico
+%{_appdir}/cron.php
+%{_appdir}/cron.sh
+%{_appdir}/crontab
+%{_appdir}/cron_disabled.php
+%{_appdir}/cron_import.php
+%{_appdir}/cron_export.php
+%{_appdir}/index.php
+%{_appdir}/LICENSE.txt
+%{_appdir}/LICENSE.html
<<Diff was trimmed, longer than 597 lines>>
More information about the pld-cvs-commit
mailing list