Version Notes
Bug Fix - Ability to download the CSV file down to the store view level.
Download this release
Release Info
Developer | Kathir Vel |
Extension | Optimiseweb_Redirects |
Version | 0.1.8 |
Comparing to | |
See all releases |
Code changes from version 0.1.7 to 0.1.8
- app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Download.php +18 -3
- app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Download1.php +18 -3
- app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Downloadquerystringfile.php +22 -5
- app/code/community/Optimiseweb/Redirects/etc/config.xml +1 -1
- package.xml +4 -7
app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Download.php
CHANGED
@@ -19,9 +19,24 @@ class Optimiseweb_Redirects_Block_System_Config_Backend_Download extends Mage_Ad
|
|
19 |
*/
|
20 |
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
21 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
$this->setElement($element);
|
23 |
-
|
24 |
-
|
|
|
25 |
$html = "<a href='" . $url . "'>Download</a>";
|
26 |
} else {
|
27 |
$html = "No CSV file provided.";
|
@@ -29,4 +44,4 @@ class Optimiseweb_Redirects_Block_System_Config_Backend_Download extends Mage_Ad
|
|
29 |
return $html;
|
30 |
}
|
31 |
|
32 |
-
}
|
19 |
*/
|
20 |
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
21 |
{
|
22 |
+
$store = Mage::app()->getRequest()->getParam('store');
|
23 |
+
$website = Mage::app()->getRequest()->getParam('website');
|
24 |
+
if ($store) {
|
25 |
+
$storeData = Mage::getModel('core/store')->getCollection()->addFieldToFilter('code', $store)->getFirstItem();
|
26 |
+
$storeId = $storeData->getStoreId();
|
27 |
+
$fileName = Mage::getStoreConfig('optimisewebredirects/general/upload', $storeId);
|
28 |
+
} elseif ($website) {
|
29 |
+
$websiteData = Mage::getModel('core/website')->getCollection()->addFieldToFilter('code', $website)->getFirstItem();
|
30 |
+
$websiteId = $websiteData->getWebsiteId();
|
31 |
+
$fileName = Mage::app()->getWebsite($websiteId)->getConfig('optimisewebredirects/general/upload');
|
32 |
+
} else {
|
33 |
+
$fileName = Mage::getStoreConfig('optimisewebredirects/general/upload');
|
34 |
+
}
|
35 |
+
|
36 |
$this->setElement($element);
|
37 |
+
|
38 |
+
if ($fileName) {
|
39 |
+
$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'optimiseweb/redirects/' . $fileName;
|
40 |
$html = "<a href='" . $url . "'>Download</a>";
|
41 |
} else {
|
42 |
$html = "No CSV file provided.";
|
44 |
return $html;
|
45 |
}
|
46 |
|
47 |
+
}
|
app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Download1.php
CHANGED
@@ -19,9 +19,24 @@ class Optimiseweb_Redirects_Block_System_Config_Backend_Download1 extends Mage_A
|
|
19 |
*/
|
20 |
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
21 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
$this->setElement($element);
|
23 |
-
|
24 |
-
|
|
|
25 |
$html = "<a href='" . $url . "'>Download</a>";
|
26 |
} else {
|
27 |
$html = "No CSV file provided.";
|
@@ -29,4 +44,4 @@ class Optimiseweb_Redirects_Block_System_Config_Backend_Download1 extends Mage_A
|
|
29 |
return $html;
|
30 |
}
|
31 |
|
32 |
-
}
|
19 |
*/
|
20 |
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
21 |
{
|
22 |
+
$store = Mage::app()->getRequest()->getParam('store');
|
23 |
+
$website = Mage::app()->getRequest()->getParam('website');
|
24 |
+
if ($store) {
|
25 |
+
$storeData = Mage::getModel('core/store')->getCollection()->addFieldToFilter('code', $store)->getFirstItem();
|
26 |
+
$storeId = $storeData->getStoreId();
|
27 |
+
$fileName = Mage::getStoreConfig('optimisewebredirects/redirects1/upload', $storeId);
|
28 |
+
} elseif ($website) {
|
29 |
+
$websiteData = Mage::getModel('core/website')->getCollection()->addFieldToFilter('code', $website)->getFirstItem();
|
30 |
+
$websiteId = $websiteData->getWebsiteId();
|
31 |
+
$fileName = Mage::app()->getWebsite($websiteId)->getConfig('optimisewebredirects/redirects1/upload');
|
32 |
+
} else {
|
33 |
+
$fileName = Mage::getStoreConfig('optimisewebredirects/redirects1/upload');
|
34 |
+
}
|
35 |
+
|
36 |
$this->setElement($element);
|
37 |
+
|
38 |
+
if ($fileName) {
|
39 |
+
$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'optimiseweb/redirects/' . $fileName;
|
40 |
$html = "<a href='" . $url . "'>Download</a>";
|
41 |
} else {
|
42 |
$html = "No CSV file provided.";
|
44 |
return $html;
|
45 |
}
|
46 |
|
47 |
+
}
|
app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Downloadquerystringfile.php
CHANGED
@@ -8,7 +8,8 @@
|
|
8 |
* @copyright Copyright (c) 2013 Optimise Web Limited
|
9 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
*/
|
11 |
-
class Optimiseweb_Redirects_Block_System_Config_Backend_Downloadquerystringfile extends Mage_Adminhtml_Block_System_Config_Form_Field
|
|
|
12 |
|
13 |
/**
|
14 |
* Get the system config field and insert a HTML link
|
@@ -16,10 +17,26 @@ class Optimiseweb_Redirects_Block_System_Config_Backend_Downloadquerystringfile
|
|
16 |
* @param Varien_Data_Form_Element_Abstract $element
|
17 |
* @return string
|
18 |
*/
|
19 |
-
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
$this->setElement($element);
|
21 |
-
|
22 |
-
|
|
|
23 |
$html = "<a href='" . $url . "'>Download</a>";
|
24 |
} else {
|
25 |
$html = "No CSV file provided.";
|
@@ -27,4 +44,4 @@ class Optimiseweb_Redirects_Block_System_Config_Backend_Downloadquerystringfile
|
|
27 |
return $html;
|
28 |
}
|
29 |
|
30 |
-
}
|
8 |
* @copyright Copyright (c) 2013 Optimise Web Limited
|
9 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
*/
|
11 |
+
class Optimiseweb_Redirects_Block_System_Config_Backend_Downloadquerystringfile extends Mage_Adminhtml_Block_System_Config_Form_Field
|
12 |
+
{
|
13 |
|
14 |
/**
|
15 |
* Get the system config field and insert a HTML link
|
17 |
* @param Varien_Data_Form_Element_Abstract $element
|
18 |
* @return string
|
19 |
*/
|
20 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
21 |
+
{
|
22 |
+
$store = Mage::app()->getRequest()->getParam('store');
|
23 |
+
$website = Mage::app()->getRequest()->getParam('website');
|
24 |
+
if ($store) {
|
25 |
+
$storeData = Mage::getModel('core/store')->getCollection()->addFieldToFilter('code', $store)->getFirstItem();
|
26 |
+
$storeId = $storeData->getStoreId();
|
27 |
+
$fileName = Mage::getStoreConfig('optimisewebredirects/querystring/upload', $storeId);
|
28 |
+
} elseif ($website) {
|
29 |
+
$websiteData = Mage::getModel('core/website')->getCollection()->addFieldToFilter('code', $website)->getFirstItem();
|
30 |
+
$websiteId = $websiteData->getWebsiteId();
|
31 |
+
$fileName = Mage::app()->getWebsite($websiteId)->getConfig('optimisewebredirects/querystring/upload');
|
32 |
+
} else {
|
33 |
+
$fileName = Mage::getStoreConfig('optimisewebredirects/querystring/upload');
|
34 |
+
}
|
35 |
+
|
36 |
$this->setElement($element);
|
37 |
+
|
38 |
+
if ($fileName) {
|
39 |
+
$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'optimiseweb/redirects/' . $fileName;
|
40 |
$html = "<a href='" . $url . "'>Download</a>";
|
41 |
} else {
|
42 |
$html = "No CSV file provided.";
|
44 |
return $html;
|
45 |
}
|
46 |
|
47 |
+
}
|
app/code/community/Optimiseweb/Redirects/etc/config.xml
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
|
12 |
<modules>
|
13 |
<Optimiseweb_Redirects>
|
14 |
-
<version>0.1.
|
15 |
</Optimiseweb_Redirects>
|
16 |
</modules>
|
17 |
|
11 |
|
12 |
<modules>
|
13 |
<Optimiseweb_Redirects>
|
14 |
+
<version>0.1.8</version>
|
15 |
</Optimiseweb_Redirects>
|
16 |
</modules>
|
17 |
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Optimiseweb_Redirects</name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
@@ -10,14 +10,11 @@
|
|
10 |
<description>Magento has an internal URL Rewrite Management system. It can be a laborious task to add all your redirects, one by one.
|
11 |

|
12 |
The Optimise Web Redirects extension allows you to upload all your redirect data as a CSV file.</description>
|
13 |
-
<notes>
|
14 |
-
* Improved CSV file support
|
15 |
-
* Ability to provide query string based redirects
|
16 |
-
* Old CSV will still work as the first option</notes>
|
17 |
<authors><author><name>Kathir Vel</name><user>OptimiseWeb</user><email>info@optimiseweb.co.uk</email></author></authors>
|
18 |
<date>2013-11-07</date>
|
19 |
-
<time>
|
20 |
-
<contents><target name="magecommunity"><dir name="Optimiseweb"><dir name="Redirects"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Backend"><file name="Download.php" hash="
|
21 |
<compatible/>
|
22 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
23 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Optimiseweb_Redirects</name>
|
4 |
+
<version>0.1.8</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>
|
10 |
<description>Magento has an internal URL Rewrite Management system. It can be a laborious task to add all your redirects, one by one.
|
11 |

|
12 |
The Optimise Web Redirects extension allows you to upload all your redirect data as a CSV file.</description>
|
13 |
+
<notes>Bug Fix - Ability to download the CSV file down to the store view level.</notes>
|
|
|
|
|
|
|
14 |
<authors><author><name>Kathir Vel</name><user>OptimiseWeb</user><email>info@optimiseweb.co.uk</email></author></authors>
|
15 |
<date>2013-11-07</date>
|
16 |
+
<time>15:49:17</time>
|
17 |
+
<contents><target name="magecommunity"><dir name="Optimiseweb"><dir name="Redirects"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Backend"><file name="Download.php" hash="bf930d4fd2f4ea8ae3dd25d6845c9030"/><file name="Download1.php" hash="b649f20fc49953191b460dc408e34fab"/><file name="Downloadquerystringfile.php" hash="4a003b5a8b9900be6357056e2231d0d8"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="ef4e86f64b9f046a5ccb79b1111e1927"/></dir><dir name="Model"><file name="Redirector.php" hash="6b43bda3e79fa328222fb057c808ffe0"/></dir><dir name="etc"><file name="adminhtml.xml" hash="22de1e5ccbd05fd303d8a09c1682d698"/><file name="config.xml" hash="1a03119788e3dca02f917a5a55daa8b4"/><file name="system.xml" hash="0918c53b9070c2b42ad68f7209956019"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Optimiseweb_Redirects.xml" hash="455126831539cd3afc0aab1125bf41e5"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Optimiseweb_Redirects.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target></contents>
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
</package>
|