Skip to content

Commit

Permalink
Merge branch 'release/v1.8.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosescri committed Mar 21, 2017
2 parents 1922302 + bf9cd07 commit cd934dc
Show file tree
Hide file tree
Showing 48 changed files with 148 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @category blocks
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

class Doofinder_Feed_Block_Adminhtml_Log_View extends Mage_Adminhtml_Block_Widget_Grid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @category blocks
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

class Doofinder_Feed_Block_Adminhtml_Map_Additional extends Mage_Adminhtml_Block_System_Config_Form_Field
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Doofinder/Feed/Block/Integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @category blocks
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

class Doofinder_Feed_Block_Integration extends Mage_Core_Block_Abstract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @category blocks
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

class Doofinder_Feed_Block_Settings_Buttons_Generate extends Mage_Adminhtml_Block_System_Config_Form_Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @category blocks
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

class Doofinder_Feed_Block_Settings_Buttons_ViewLog extends Mage_Adminhtml_Block_System_Config_Form_Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @category blocks
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

class Doofinder_Feed_Block_Settings_Panel_CronDescription extends Doofinder_Feed_Block_Settings_Panel_Description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @category blocks
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

class Doofinder_Feed_Block_Settings_Panel_Datetime extends Mage_Adminhtml_Block_System_Config_Form_Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @category blocks
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

class Doofinder_Feed_Block_Settings_Panel_Description extends Mage_Adminhtml_Block_System_Config_Form_Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @category blocks
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

class Doofinder_Feed_Block_Settings_Panel_File extends Mage_Adminhtml_Block_System_Config_Form_Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @category blocks
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

class Doofinder_Feed_Block_Settings_Panel_LayerDescription extends Doofinder_Feed_Block_Settings_Panel_Description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @category blocks
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

class Doofinder_Feed_Block_Settings_Panel_Message extends Mage_Adminhtml_Block_System_Config_Form_Field
Expand Down
47 changes: 42 additions & 5 deletions app/code/community/Doofinder/Feed/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/**
* @category Helpers
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

/**
* Data helper for Doofinder Feed
*
* @version 1.8.2
* @version 1.8.3
* @package Doofinder_Feed
*/
class Doofinder_Feed_Helper_Data extends Mage_Core_Helper_Abstract
Expand Down Expand Up @@ -404,21 +404,58 @@ public function getStoreConfig($storeCode = '', $withPassword = true) {
* Process xml filename
* @param string $name = 'doofinder-{store_code}.xml'
* @param string $code = 'default'
* @param boolean $withPassword = true
* @param string|boolean $password = true
* @return bool
*/
private function _processXmlName($name = 'doofinder-{store_code}.xml', $code = 'default', $withPassword = true) {
private function _processXmlName($name = 'doofinder-{store_code}.xml', $code = 'default', $password = true) {
$pattern = '/\{\s*store_code\s*\}/';

if ($password === true) {
$password = Mage::getStoreConfig('doofinder_cron/feed_settings/password', $storeCode);
}

$replacement = $code;
if ($withPassword && ($password = Mage::getStoreConfig('doofinder_cron/feed_settings/password', $code))) {
if ($password && strlen($password)) {
$replacement .= '-' . $password;
}

$newName = preg_replace($pattern, $replacement, $name);
return $newName;
}

/**
* Change feed file password
*
* @param string $storeCode
* @param string $oldPassword
* @param string $newPassword
*/
public function changeXmlPassword($storeCode, $oldPassword, $newPassword) {
$xmlName = Mage::getStoreConfig('doofinder_cron/schedule_settings/name', $storeCode);
$dir = $this->getFeedDirectory();

$oldFilepath = $dir . DS . $this->_processXmlName($xmlName, $storeCode, $oldPassword);
$newFilename = $this->_processXmlName($xmlName, $storeCode, $newPassword);
$newFilepath = $dir . DS . $newFilename;

if (file_exists($oldFilepath)) {
if (!file_exists($newFilepath) && !rename($oldFilepath, $newFilepath)) {
throw new \Magento\Framework\Exception\LocalizedException(__(
'Feed file could not be renamed accordingly to new %s value because file permission issues or file with name %s already exists.',
$this->getData('field_config/label'),
$newFilename
));
}

$process = Mage::getModel('doofinder_feed/cron')->load($storeCode, 'store_code');
if ($process->getId()) {
$process
->setLastFeedName($newFilename)
->save();
}
}
}

/**
* Create cron expr string
* @param string $time
Expand Down
4 changes: 2 additions & 2 deletions app/code/community/Doofinder/Feed/Helper/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/**
* @category Helpers
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

/**
* Log helper for Doofinder Feed
*
* @version 1.8.2
* @version 1.8.3
* @package Doofinder_Feed
*/
class Doofinder_Feed_Helper_Log extends Mage_Core_Helper_Abstract
Expand Down
4 changes: 2 additions & 2 deletions app/code/community/Doofinder/Feed/Helper/Tax.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/**
* @category Helpers
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

/**
* Tax helper for Doofinder Feed
*
* @version 1.8.2
* @version 1.8.3
* @package Doofinder_Feed
*/
class Doofinder_Feed_Helper_Tax extends Mage_Tax_Helper_Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @category Models
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

class Doofinder_Feed_Model_Adminhtml_System_Config_Backend_Cron extends Mage_Core_Model_Config_Data {
Expand Down
4 changes: 2 additions & 2 deletions app/code/community/Doofinder/Feed/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/**
* @category Models
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

/**
* Config model for Doofinder Feed
*
* @version 1.8.2
* @version 1.8.3
* @package Doofinder_Feed
*/
class Doofinder_Feed_Model_Config extends Mage_Core_Model_Config_Data
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Doofinder/Feed/Model/Cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @category Models
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

class Doofinder_Feed_Model_Cron extends Mage_Core_Model_Abstract {
Expand Down
4 changes: 2 additions & 2 deletions app/code/community/Doofinder/Feed/Model/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/**
* @category Models
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

/**
* Generator model for Doofinder Feed
*
* @version 1.8.2
* @version 1.8.3
* @package Doofinder_Feed
*/
if (!defined('DS'))
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Doofinder/Feed/Model/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @category Models
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

class Doofinder_Feed_Model_Log extends Mage_Core_Model_Abstract {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/**
* @category Models
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

/**
* Abstract Product Map Model for Doofinder Feed
*
* @version 1.8.2
* @version 1.8.3
* @package Doofinder_Feed
*/
class Doofinder_Feed_Model_Map_Product_Abstract extends Varien_Object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/**
* @category Models
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

/**
* Associated Product Map Model for Doofinder Feed
*
* @version 1.8.2
* @version 1.8.3
* @package Doofinder_Feed
*/
class Doofinder_Feed_Model_Map_Product_Associated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/**
* @category Models
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

/**
* Bundle Product Map Model for Doofinder Feed
*
* @version 1.8.2
* @version 1.8.3
* @package Doofinder_Feed
*/
class Doofinder_Feed_Model_Map_Product_Bundle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/**
* @category Models
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

/**
* Configurable Product Map Model for Doofinder Feed
*
* @version 1.8.2
* @version 1.8.3
* @package Doofinder_Feed
*/
class Doofinder_Feed_Model_Map_Product_Configurable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/**
* @category Models
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

/**
* Downloadable Product Map Model for Doofinder Feed
*
* @version 1.8.2
* @version 1.8.3
* @package Doofinder_Feed
*/
class Doofinder_Feed_Model_Map_Product_Downloadable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/**
* @category Models
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

/**
* Grouped Product Map Model for Doofinder Feed
*
* @version 1.8.2
* @version 1.8.3
* @package Doofinder_Feed
*/
class Doofinder_Feed_Model_Map_Product_Grouped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/**
* @category Models
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

/**
* Simple Product Map Model for Doofinder Feed
*
* @version 1.8.2
* @version 1.8.3
* @package Doofinder_Feed
*/
class Doofinder_Feed_Model_Map_Product_Simple
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/**
* @category Models
* @package Doofinder_Feed
* @version 1.8.2
* @version 1.8.3
*/

/**
* Virtual Product Map Model for Doofinder Feed
*
* @version 1.8.2
* @version 1.8.3
* @package Doofinder_Feed
*/
class Doofinder_Feed_Model_Map_Product_Virtual
Expand Down
Loading

0 comments on commit cd934dc

Please sign in to comment.