Version Notes
This extension will allow you to add/delete/search attribute labels
Download this release
Release Info
| Developer | Magento Core Team |
| Extension | Quick_Action_Attribute_Values_or_Labels |
| Version | 1.1 |
| Comparing to | |
| See all releases | |
Version 1.1
- app/code/community/CueBlocks/All/Helper/Data.php +12 -0
- app/code/community/CueBlocks/All/etc/config.xml +33 -0
- app/code/community/CueBlocks/Cueattributevalue/Block/Adminhtml/Cueattributevalue.php +20 -0
- app/code/community/CueBlocks/Cueattributevalue/Block/Adminhtml/Cueattributevalue/Edit.php +17 -0
- app/code/community/CueBlocks/Cueattributevalue/Block/Adminhtml/Cueattributevalue/Edit/Tabs.php +27 -0
- app/code/community/CueBlocks/Cueattributevalue/Block/Adminhtml/Cueattributevaluedelete.php +20 -0
- app/code/community/CueBlocks/Cueattributevalue/Block/Adminhtml/Cueattributevaluedelete/Edit.php +16 -0
- app/code/community/CueBlocks/Cueattributevalue/Block/Adminhtml/Cueattributevaluedelete/Edit/Tabs.php +27 -0
- app/code/community/CueBlocks/Cueattributevalue/Helper/Data.php +12 -0
- app/code/community/CueBlocks/Cueattributevalue/controllers/Adminhtml/CueattributevalueController.php +129 -0
- app/code/community/CueBlocks/Cueattributevalue/controllers/Adminhtml/CueattributevaluedeleteController.php +83 -0
- app/code/community/CueBlocks/Cueattributevalue/etc/config.xml +107 -0
- app/design/adminhtml/default/default/layout/cueattributevalue.xml +18 -0
- app/design/adminhtml/default/default/template/cueattributevalue/cueattributevalueadd.phtml +84 -0
- app/design/adminhtml/default/default/template/cueattributevalue/cueattributevaluedelete.phtml +170 -0
- app/etc/modules/CueBlocks_All.xml +18 -0
- app/etc/modules/CueBlocks_Cueattributevalue.xml +18 -0
- package.xml +18 -0
app/code/community/CueBlocks/All/Helper/Data.php
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
*
|
| 4 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 5 |
+
* Version :- 1.0
|
| 6 |
+
* Edition :- community
|
| 7 |
+
* Developed By :- CueBlocks.com
|
| 8 |
+
*
|
| 9 |
+
*/
|
| 10 |
+
class CueBlocks_All_Helper_Data extends Mage_Core_Helper_Abstract
|
| 11 |
+
{
|
| 12 |
+
}
|
app/code/community/CueBlocks/All/etc/config.xml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
*
|
| 5 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 6 |
+
* Version :- 1.0
|
| 7 |
+
* Edition :- community
|
| 8 |
+
* Developed By :- CueBlocks.com
|
| 9 |
+
*
|
| 10 |
+
*/
|
| 11 |
+
-->
|
| 12 |
+
<config>
|
| 13 |
+
<modules>
|
| 14 |
+
<CueBlocks_All>
|
| 15 |
+
<version>0.1.0</version>
|
| 16 |
+
</CueBlocks_All>
|
| 17 |
+
</modules>
|
| 18 |
+
<global>
|
| 19 |
+
<helpers>
|
| 20 |
+
<all>
|
| 21 |
+
<class>CueBlocks_All_Helper</class>
|
| 22 |
+
</all>
|
| 23 |
+
</helpers>
|
| 24 |
+
</global>
|
| 25 |
+
<adminhtml>
|
| 26 |
+
<menu>
|
| 27 |
+
<cueblocks module="all">
|
| 28 |
+
<title>CueBlocks</title>
|
| 29 |
+
<sort_order>71</sort_order>
|
| 30 |
+
</cueblocks>
|
| 31 |
+
</menu>
|
| 32 |
+
</adminhtml>
|
| 33 |
+
</config>
|
app/code/community/CueBlocks/Cueattributevalue/Block/Adminhtml/Cueattributevalue.php
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
*
|
| 4 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 5 |
+
* Version :- 1.0
|
| 6 |
+
* Edition :- community
|
| 7 |
+
* Developed By :- CueBlocks.com
|
| 8 |
+
*
|
| 9 |
+
*/
|
| 10 |
+
class CueBlocks_Cueattributevalue_Block_Adminhtml_Cueattributevalue extends Mage_Adminhtml_Block_Widget_Grid_Container
|
| 11 |
+
{
|
| 12 |
+
public function __construct()
|
| 13 |
+
{
|
| 14 |
+
$this->_controller = 'adminhtml_cueattributevalue';
|
| 15 |
+
$this->_blockGroup = 'cueattributevalue';
|
| 16 |
+
$this->_headerText = Mage::helper('cueattributevalue')->__('Attribute Manager');
|
| 17 |
+
$this->_addButtonLabel = Mage::helper('cueattributevalue')->__('Add Attribute Options');
|
| 18 |
+
parent::__construct();
|
| 19 |
+
}
|
| 20 |
+
}
|
app/code/community/CueBlocks/Cueattributevalue/Block/Adminhtml/Cueattributevalue/Edit.php
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
*
|
| 4 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 5 |
+
* Version :- 1.0
|
| 6 |
+
* Edition :- community
|
| 7 |
+
* Developed By :- CueBlocks.com
|
| 8 |
+
*
|
| 9 |
+
*/
|
| 10 |
+
class CueBlocks_Cueattributevalue_Block_Adminhtml_Cueattributevalue_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
| 11 |
+
{
|
| 12 |
+
public function __construct()
|
| 13 |
+
{
|
| 14 |
+
$this->setTemplate('cueattributevalue/cueattributevalueadd.phtml');
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
}
|
app/code/community/CueBlocks/Cueattributevalue/Block/Adminhtml/Cueattributevalue/Edit/Tabs.php
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
*
|
| 4 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 5 |
+
* Version :- 1.0
|
| 6 |
+
* Edition :- community
|
| 7 |
+
* Developed By :- CueBlocks.com
|
| 8 |
+
*
|
| 9 |
+
*/
|
| 10 |
+
class CueBlocks_Cueattributevalue_Block_Adminhtml_Cueattributevalue_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
| 11 |
+
{
|
| 12 |
+
public function __construct()
|
| 13 |
+
{
|
| 14 |
+
parent::__construct();
|
| 15 |
+
$this->setId('cueattributevalue_tabs');
|
| 16 |
+
$this->setDestElementId('edit_form');
|
| 17 |
+
$this->setTitle(Mage::helper('cueattributevalue')->__('Add Attribute Label'));
|
| 18 |
+
}
|
| 19 |
+
protected function _beforeToHtml()
|
| 20 |
+
{
|
| 21 |
+
$this->addTab('form_section', array(
|
| 22 |
+
'label' => Mage::helper('cueattributevalue')->__('Attribute Information'),
|
| 23 |
+
'title' => Mage::helper('cueattributevalue')->__('Attribute Information'),
|
| 24 |
+
));
|
| 25 |
+
return parent::_beforeToHtml();
|
| 26 |
+
}
|
| 27 |
+
}
|
app/code/community/CueBlocks/Cueattributevalue/Block/Adminhtml/Cueattributevaluedelete.php
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
*
|
| 4 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 5 |
+
* Version :- 1.0
|
| 6 |
+
* Edition :- community
|
| 7 |
+
* Developed By :- CueBlocks.com
|
| 8 |
+
*
|
| 9 |
+
*/
|
| 10 |
+
class CueBlocks_Cueattributevalue_Block_Adminhtml_Cueattributevaluedelete extends Mage_Adminhtml_Block_Widget_Grid_Container
|
| 11 |
+
{
|
| 12 |
+
public function __construct()
|
| 13 |
+
{
|
| 14 |
+
$this->_controller = 'adminhtml_cueattributevaluedelete';
|
| 15 |
+
$this->_blockGroup = 'cueattributevalue';
|
| 16 |
+
$this->_headerText = Mage::helper('cueattributevalue')->__('Attribute Manager');
|
| 17 |
+
$this->_addButtonLabel = Mage::helper('cueattributevalue')->__('Delete Attribute Options');
|
| 18 |
+
parent::__construct();
|
| 19 |
+
}
|
| 20 |
+
}
|
app/code/community/CueBlocks/Cueattributevalue/Block/Adminhtml/Cueattributevaluedelete/Edit.php
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
*
|
| 4 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 5 |
+
* Version :- 1.0
|
| 6 |
+
* Edition :- community
|
| 7 |
+
* Developed By :- CueBlocks.com
|
| 8 |
+
*
|
| 9 |
+
*/
|
| 10 |
+
class CueBlocks_Cueattributevalue_Block_Adminhtml_Cueattributevaluedelete_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
| 11 |
+
{
|
| 12 |
+
public function __construct()
|
| 13 |
+
{
|
| 14 |
+
$this->setTemplate('cueattributevalue/cueattributevaluedelete.phtml');
|
| 15 |
+
}
|
| 16 |
+
}
|
app/code/community/CueBlocks/Cueattributevalue/Block/Adminhtml/Cueattributevaluedelete/Edit/Tabs.php
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
*
|
| 4 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 5 |
+
* Version :- 1.0
|
| 6 |
+
* Edition :- community
|
| 7 |
+
* Developed By :- CueBlocks.com
|
| 8 |
+
*
|
| 9 |
+
*/
|
| 10 |
+
class CueBlocks_Cueattributevalue_Block_Adminhtml_Cueattributevaluedelete_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
| 11 |
+
{
|
| 12 |
+
public function __construct()
|
| 13 |
+
{
|
| 14 |
+
parent::__construct();
|
| 15 |
+
$this->setId('cueattributevalue_tabs');
|
| 16 |
+
$this->setDestElementId('edit_form');
|
| 17 |
+
$this->setTitle(Mage::helper('cueattributevalue')->__('Delete Attribute Label'));
|
| 18 |
+
}
|
| 19 |
+
protected function _beforeToHtml()
|
| 20 |
+
{
|
| 21 |
+
$this->addTab('form_section', array(
|
| 22 |
+
'label' => Mage::helper('cueattributevalue')->__('Attribute Information'),
|
| 23 |
+
'title' => Mage::helper('cueattributevalue')->__('Attribute Information'),
|
| 24 |
+
));
|
| 25 |
+
return parent::_beforeToHtml();
|
| 26 |
+
}
|
| 27 |
+
}
|
app/code/community/CueBlocks/Cueattributevalue/Helper/Data.php
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
*
|
| 4 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 5 |
+
* Version :- 1.0
|
| 6 |
+
* Edition :- community
|
| 7 |
+
* Developed By :- CueBlocks.com
|
| 8 |
+
*
|
| 9 |
+
*/
|
| 10 |
+
class CueBlocks_Cueattributevalue_Helper_Data extends Mage_Core_Helper_Abstract
|
| 11 |
+
{
|
| 12 |
+
}
|
app/code/community/CueBlocks/Cueattributevalue/controllers/Adminhtml/CueattributevalueController.php
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
*
|
| 4 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 5 |
+
* Version :- 1.0
|
| 6 |
+
* Edition :- community
|
| 7 |
+
* Developed By :- CueBlocks.com
|
| 8 |
+
*
|
| 9 |
+
*/
|
| 10 |
+
class CueBlocks_Cueattributevalue_Adminhtml_CueattributevalueController extends Mage_Adminhtml_Controller_Action
|
| 11 |
+
{
|
| 12 |
+
protected function _initAction()
|
| 13 |
+
{
|
| 14 |
+
$this->_forward('edit');
|
| 15 |
+
return $this;
|
| 16 |
+
}
|
| 17 |
+
public function indexAction()
|
| 18 |
+
{
|
| 19 |
+
$this->_initAction();
|
| 20 |
+
$this->renderLayout();
|
| 21 |
+
}
|
| 22 |
+
public function editAction()
|
| 23 |
+
{
|
| 24 |
+
$cueattributevalueId = $this->getRequest()->getParam('id');
|
| 25 |
+
if ($cueattributevalueId == 0)
|
| 26 |
+
{
|
| 27 |
+
$this->loadLayout();
|
| 28 |
+
$this->_setActiveMenu('cueattributevalue/items');
|
| 29 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
| 30 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
|
| 31 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
| 32 |
+
$this->_addContent($this->getLayout()->createBlock('cueattributevalue/adminhtml_cueattributevalue_edit'))
|
| 33 |
+
->_addLeft($this->getLayout()->createBlock('cueattributevalue/adminhtml_cueattributevalue_edit_tabs'));
|
| 34 |
+
$this->renderLayout();
|
| 35 |
+
}
|
| 36 |
+
else
|
| 37 |
+
{
|
| 38 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('cueattributevalue')->__('Item does not exist'));
|
| 39 |
+
$this->_redirect('*/*/');
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
public function newAction()
|
| 43 |
+
{
|
| 44 |
+
$this->_forward('edit');
|
| 45 |
+
}
|
| 46 |
+
public function saveAction()
|
| 47 |
+
{
|
| 48 |
+
if ( $this->getRequest()->getPost() )
|
| 49 |
+
{
|
| 50 |
+
try
|
| 51 |
+
{
|
| 52 |
+
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
| 53 |
+
$eavattributeoptionObj = Mage::getModel('eav/entity_attribute_option');
|
| 54 |
+
$eavattributeObj = Mage::getModel('eav/entity_attribute');
|
| 55 |
+
$storeObj = Mage::getModel('core/store');
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
$write->beginTransaction();
|
| 59 |
+
$attribute_id=$this->getRequest()->getParam('attribute_id');
|
| 60 |
+
|
| 61 |
+
$StoreDetails = Mage::getModel('core/store')->getCollection()->addFilter('`is_active`','1')->setLoadDefault(true)->load();
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
foreach($StoreDetails as $store)
|
| 65 |
+
{
|
| 66 |
+
$optionvalue=$this->getRequest()->getParam('attribute_option_value_'.$store['store_id']);
|
| 67 |
+
if($optionvalue!='')
|
| 68 |
+
{
|
| 69 |
+
$eavattoptioncollObj = Mage::getModel('eav/entity_attribute_option')->getCollection()->join('attribute_option_value','(attribute_option_value.option_id = main_table.option_id) and main_table.attribute_id='.$attribute_id.' where attribute_option_value.store_id='.$store["store_id"].' and UPPER(value)="'.strtoupper($optionvalue).'"');
|
| 70 |
+
foreach($eavattoptioncollObj as $val)
|
| 71 |
+
{
|
| 72 |
+
if(!empty($val))
|
| 73 |
+
{
|
| 74 |
+
$optionvaluearr[]=array('option_id' => $val['option_id'],'value'=>$val['value'],'store_id' => $val['store_id']);
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
if(!empty($optionvaluearr))
|
| 80 |
+
{
|
| 81 |
+
$StoreName = Mage::getModel('core/store')->getCollection()->addFilter('`is_active`','1')->addFilter('`store_id`',$optionvaluearr[0]['store_id'])->setLoadDefault(true)->load();
|
| 82 |
+
foreach($StoreName as $name)
|
| 83 |
+
{
|
| 84 |
+
$sname=$name['name'];
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
Mage::getSingleton('core/session')->setTempSessionVariable($this->getRequest()->getParams());
|
| 88 |
+
Mage::getSingleton('core/session')->addError(Mage::helper('core')->__('Attribute label '.$optionvaluearr[0]['value'].' already exists for '.$sname));
|
| 89 |
+
Mage::getSingleton('core/session')->setCueattributevalueData(false);
|
| 90 |
+
$this->_redirect('*/*/');
|
| 91 |
+
return;
|
| 92 |
+
}
|
| 93 |
+
else
|
| 94 |
+
{
|
| 95 |
+
$dataatt = array('attribute_id' => $attribute_id,'sort_order' => '0');
|
| 96 |
+
$write->insert('eav_attribute_option', $dataatt);
|
| 97 |
+
$insertedId=$write->lastInsertId();
|
| 98 |
+
foreach ($StoreDetails as $store)
|
| 99 |
+
{
|
| 100 |
+
$optionvalue=$this->getRequest()->getParam('attribute_option_value_'.$store['store_id']);
|
| 101 |
+
if($this->getRequest()->getParam('attribute_option_value_'.$store['store_id']) != '')
|
| 102 |
+
{
|
| 103 |
+
$data = array(
|
| 104 |
+
'option_id' => $insertedId,
|
| 105 |
+
'store_id' => $store->getId(),
|
| 106 |
+
'value' => $optionvalue,
|
| 107 |
+
);
|
| 108 |
+
$write->insert('eav_attribute_option_value', $data);
|
| 109 |
+
}
|
| 110 |
+
}
|
| 111 |
+
$write->commit();
|
| 112 |
+
Mage::getSingleton('core/session')->setTempSessionVariable();
|
| 113 |
+
Mage::getSingleton('core/session')->addSuccess(Mage::helper('core')->__('Attribute label was sucessfully saved. '));
|
| 114 |
+
Mage::getSingleton('core/session')->setCueattributevalueData(false);
|
| 115 |
+
$this->_redirect('*/*/');
|
| 116 |
+
return;
|
| 117 |
+
}
|
| 118 |
+
}
|
| 119 |
+
catch (Exception $e)
|
| 120 |
+
{
|
| 121 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
| 122 |
+
Mage::getSingleton('adminhtml/session')->setCueattributevalueData($this->getRequest()->getPost());
|
| 123 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
| 124 |
+
return;
|
| 125 |
+
}
|
| 126 |
+
}
|
| 127 |
+
$this->_redirect('*/*/');
|
| 128 |
+
}
|
| 129 |
+
}
|
app/code/community/CueBlocks/Cueattributevalue/controllers/Adminhtml/CueattributevaluedeleteController.php
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
*
|
| 4 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 5 |
+
* Version :- 1.0
|
| 6 |
+
* Edition :- community
|
| 7 |
+
* Developed By :- CueBlocks.com
|
| 8 |
+
*
|
| 9 |
+
*/
|
| 10 |
+
class CueBlocks_Cueattributevalue_Adminhtml_CueattributevaluedeleteController extends Mage_Adminhtml_Controller_Action
|
| 11 |
+
{
|
| 12 |
+
protected function _initAction()
|
| 13 |
+
{
|
| 14 |
+
$this->_forward('edit');
|
| 15 |
+
return $this;
|
| 16 |
+
}
|
| 17 |
+
public function indexAction()
|
| 18 |
+
{
|
| 19 |
+
$this->_initAction();
|
| 20 |
+
$this->renderLayout();
|
| 21 |
+
}
|
| 22 |
+
public function editAction()
|
| 23 |
+
{
|
| 24 |
+
$cueattributevalueId = $this->getRequest()->getParam('id');
|
| 25 |
+
if ($cueattributevalueId == 0)
|
| 26 |
+
{
|
| 27 |
+
$this->loadLayout();
|
| 28 |
+
$this->_setActiveMenu('cueattributevalue/items');
|
| 29 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
|
| 30 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
|
| 31 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
| 32 |
+
$this->_addContent($this->getLayout()->createBlock('cueattributevalue/adminhtml_cueattributevaluedelete_edit'))
|
| 33 |
+
->_addLeft($this->getLayout()->createBlock('cueattributevalue/adminhtml_cueattributevaluedelete_edit_tabs'));
|
| 34 |
+
$this->renderLayout();
|
| 35 |
+
}
|
| 36 |
+
else
|
| 37 |
+
{
|
| 38 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('cueattributevalue')->__('Item does not exist'));
|
| 39 |
+
$this->_redirect('*/*/');
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
public function newAction()
|
| 43 |
+
{
|
| 44 |
+
$this->_forward('edit');
|
| 45 |
+
}
|
| 46 |
+
public function deleteAction()
|
| 47 |
+
{
|
| 48 |
+
if($this->getRequest()->getParam('value_id') !='' && $this->getRequest()->getParam('option_id') !='')
|
| 49 |
+
{
|
| 50 |
+
try
|
| 51 |
+
{
|
| 52 |
+
$value_id=$this->getRequest()->getParam('value_id');
|
| 53 |
+
$option_id=$this->getRequest()->getParam('option_id');
|
| 54 |
+
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
| 55 |
+
$optionvalue = Mage::getModel('eav/entity_attribute_option')->getCollection()->join('attribute_option_value','(attribute_option_value.option_id = main_table.option_id) and attribute_option_value.value_id='.$value_id);
|
| 56 |
+
foreach($optionvalue as $option)
|
| 57 |
+
{
|
| 58 |
+
if($option['store_id']=='0')
|
| 59 |
+
{ $val=$option['value'];
|
| 60 |
+
$eavattributeoptionObj = Mage::getModel('eav/entity_attribute_option');
|
| 61 |
+
$eavattributeoptionObj->setId($option_id)
|
| 62 |
+
->delete();
|
| 63 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__("All labels associated with '".$val."' were successfully deleted."));
|
| 64 |
+
$this->_redirect('*/*/');
|
| 65 |
+
}
|
| 66 |
+
else
|
| 67 |
+
{
|
| 68 |
+
$write->delete('eav_attribute_option_value', $write->quoteInto('value_id=?', $value_id));
|
| 69 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Label was successfully deleted.'));
|
| 70 |
+
$this->_redirect('*/*/');
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
}
|
| 75 |
+
catch (Exception $e)
|
| 76 |
+
{
|
| 77 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
| 78 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
}
|
app/code/community/CueBlocks/Cueattributevalue/etc/config.xml
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
*
|
| 5 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 6 |
+
* Version :- 1.0
|
| 7 |
+
* Edition :- community
|
| 8 |
+
* Developed By :- CueBlocks.com
|
| 9 |
+
*
|
| 10 |
+
*/
|
| 11 |
+
-->
|
| 12 |
+
<config>
|
| 13 |
+
<modules>
|
| 14 |
+
<CueBlocks_Cueattributevalue>
|
| 15 |
+
<version>0.1.0</version>
|
| 16 |
+
</CueBlocks_Cueattributevalue>
|
| 17 |
+
</modules>
|
| 18 |
+
<global>
|
| 19 |
+
<resources>
|
| 20 |
+
<cueattributevalue_setup>
|
| 21 |
+
<setup>
|
| 22 |
+
<module>CueBlocks_Cueattributevalue</module>
|
| 23 |
+
</setup>
|
| 24 |
+
<connection>
|
| 25 |
+
<use>core_setup</use>
|
| 26 |
+
</connection>
|
| 27 |
+
</cueattributevalue_setup>
|
| 28 |
+
<cueattributevalue_write>
|
| 29 |
+
<connection>
|
| 30 |
+
<use>core_write</use>
|
| 31 |
+
</connection>
|
| 32 |
+
</cueattributevalue_write>
|
| 33 |
+
<cueattributevalue_read>
|
| 34 |
+
<connection>
|
| 35 |
+
<use>core_read</use>
|
| 36 |
+
</connection>
|
| 37 |
+
</cueattributevalue_read>
|
| 38 |
+
</resources>
|
| 39 |
+
<blocks>
|
| 40 |
+
<cueattributevalue>
|
| 41 |
+
<class>CueBlocks_Cueattributevalue_Block</class>
|
| 42 |
+
</cueattributevalue>
|
| 43 |
+
</blocks>
|
| 44 |
+
<helpers>
|
| 45 |
+
<cueattributevalue>
|
| 46 |
+
<class>CueBlocks_Cueattributevalue_Helper</class>
|
| 47 |
+
</cueattributevalue>
|
| 48 |
+
</helpers>
|
| 49 |
+
</global>
|
| 50 |
+
<admin>
|
| 51 |
+
<routers>
|
| 52 |
+
<cueattributevalue>
|
| 53 |
+
<use>admin</use>
|
| 54 |
+
<args>
|
| 55 |
+
<module>CueBlocks_Cueattributevalue</module>
|
| 56 |
+
<frontName>cueattributevalue</frontName>
|
| 57 |
+
</args>
|
| 58 |
+
</cueattributevalue>
|
| 59 |
+
</routers>
|
| 60 |
+
</admin>
|
| 61 |
+
<adminhtml>
|
| 62 |
+
<menu>
|
| 63 |
+
<cueblocks module="cueattributevalue">
|
| 64 |
+
<children>
|
| 65 |
+
<items module="cueattributevalue">
|
| 66 |
+
<title>Attribute Labels</title>
|
| 67 |
+
<sort_order>0</sort_order>
|
| 68 |
+
<children>
|
| 69 |
+
<additems module="cueattributevalue">
|
| 70 |
+
<title>Add Attribute Labels</title>
|
| 71 |
+
<sort_order>0</sort_order>
|
| 72 |
+
<action>cueattributevalue/adminhtml_cueattributevalue</action>
|
| 73 |
+
</additems>
|
| 74 |
+
<deleteitems module="cueattributevalue">
|
| 75 |
+
<title>Delete Attribute Labels</title>
|
| 76 |
+
<sort_order>1</sort_order>
|
| 77 |
+
<action>cueattributevalue/adminhtml_cueattributevaluedelete</action>
|
| 78 |
+
</deleteitems>
|
| 79 |
+
</children>
|
| 80 |
+
</items>
|
| 81 |
+
</children>
|
| 82 |
+
</cueblocks>
|
| 83 |
+
</menu>
|
| 84 |
+
<acl>
|
| 85 |
+
<resources>
|
| 86 |
+
<all>
|
| 87 |
+
<title>Allow Everything</title>
|
| 88 |
+
</all>
|
| 89 |
+
<admin>
|
| 90 |
+
<children>
|
| 91 |
+
<cueattributevalue>
|
| 92 |
+
<title>Cueattributevalue Module</title>
|
| 93 |
+
<sort_order>200</sort_order>
|
| 94 |
+
</cueattributevalue>
|
| 95 |
+
</children>
|
| 96 |
+
</admin>
|
| 97 |
+
</resources>
|
| 98 |
+
</acl>
|
| 99 |
+
<layout>
|
| 100 |
+
<updates>
|
| 101 |
+
<cueattributevalue>
|
| 102 |
+
<file>cueattributevalue.xml</file>
|
| 103 |
+
</cueattributevalue>
|
| 104 |
+
</updates>
|
| 105 |
+
</layout>
|
| 106 |
+
</adminhtml>
|
| 107 |
+
</config>
|
app/design/adminhtml/default/default/layout/cueattributevalue.xml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
*
|
| 5 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 6 |
+
* Version :- 1.0
|
| 7 |
+
* Edition :- community
|
| 8 |
+
* Developed By :- CueBlocks.com
|
| 9 |
+
*
|
| 10 |
+
*/
|
| 11 |
+
-->
|
| 12 |
+
<layout version="0.1.0">
|
| 13 |
+
<cueattributevalue_adminhtml_cueattributevalue_index>
|
| 14 |
+
<reference name="content">
|
| 15 |
+
<block type="cueattributevalue/adminhtml_cueattributevalue" name="cueattributevalue" />
|
| 16 |
+
</reference>
|
| 17 |
+
</cueattributevalue_adminhtml_cueattributevalue_index>
|
| 18 |
+
</layout>
|
app/design/adminhtml/default/default/template/cueattributevalue/cueattributevalueadd.phtml
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
*
|
| 4 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 5 |
+
* Version :- 1.0
|
| 6 |
+
* Edition :- community
|
| 7 |
+
* Developed By :- CueBlocks.com
|
| 8 |
+
*
|
| 9 |
+
*/
|
| 10 |
+
$Data = Mage::getSingleton('core/session')->getTempSessionVariable();
|
| 11 |
+
|
| 12 |
+
$eavattributeObj = Mage::getModel('eav/entity_attribute');
|
| 13 |
+
$filter_a = array('multiselect');
|
| 14 |
+
$filter_b = array('select');
|
| 15 |
+
$rows = $eavattributeObj->getCollection()->addFilter('`is_user_defined`','1')->addFieldToFilter('`frontend_input`',array($filter_a,$filter_b))->load();
|
| 16 |
+
$arrdefault[]=array('value' => '',
|
| 17 |
+
'label' => '---Select Attribute Code---');
|
| 18 |
+
foreach($rows as $attribute)
|
| 19 |
+
{
|
| 20 |
+
$attributelabelsarr[] = array(
|
| 21 |
+
'value' => $attribute['attribute_id'],
|
| 22 |
+
'label' => $attribute['attribute_code'],
|
| 23 |
+
);
|
| 24 |
+
}
|
| 25 |
+
$combinedarr=array_merge($arrdefault,$attributelabelsarr);
|
| 26 |
+
$storeObj = Mage::getModel('core/store');
|
| 27 |
+
$websiteObj = Mage::getModel('core/website');
|
| 28 |
+
$StoreDetails = $storeObj->getCollection()->addFilter('`is_active`','1')->setLoadDefault(true)->load();
|
| 29 |
+
$storegroupObj = Mage::getModel('core/store_group');
|
| 30 |
+
?>
|
| 31 |
+
<div class="content-header">
|
| 32 |
+
<table cellspacing="0" class="grid-header">
|
| 33 |
+
<tr>
|
| 34 |
+
<td><h3><?=$this->__('Add Attribute Labels')?></h3></td>
|
| 35 |
+
<td class="a-right">
|
| 36 |
+
<button onclick="editForm.submit()" class="scalable save" type="button"><span>Add Label</span></button>
|
| 37 |
+
</td>
|
| 38 |
+
</tr>
|
| 39 |
+
</table>
|
| 40 |
+
</div>
|
| 41 |
+
<div class="entry-edit">
|
| 42 |
+
<div class="entry-edit-head">
|
| 43 |
+
<h4 class="icon-head head-edit-form fieldset-legend"><?=$this->__('Manage Options (values of your attribute)')?></h4>
|
| 44 |
+
</div>
|
| 45 |
+
<fieldset id="my-fieldset">
|
| 46 |
+
<?php /***Add Form Starts***/ ?>
|
| 47 |
+
<form id="edit_form" name="edit_form" method="post" action="<?=$this->getUrl('*/*/save')?>">
|
| 48 |
+
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
|
| 49 |
+
<table cellspacing="0" class="form-list">
|
| 50 |
+
<tr>
|
| 51 |
+
<td class="label"><?=$this->__('Select Attribute Code')?> <span class="required">*</span></td>
|
| 52 |
+
<td class="input-ele"> <select class="required-entry" name="attribute_id" id="attribute_id">
|
| 53 |
+
<?php foreach($combinedarr as $arratt){?>
|
| 54 |
+
<option value="<?php echo $arratt['value']?>" <?php echo $Data['attribute_id']==$arratt['value'] ?'selected=selected':''?>><?php echo $arratt['label']?></option>
|
| 55 |
+
<?php }?>
|
| 56 |
+
</select>
|
| 57 |
+
</td>
|
| 58 |
+
</tr>
|
| 59 |
+
<?php foreach($StoreDetails as $store)
|
| 60 |
+
{
|
| 61 |
+
$Website = $websiteObj->getCollection()->addFilter('`website_id`',$store['website_id'])->setLoadDefault(true)->load();
|
| 62 |
+
foreach($Website as $Websitename){}
|
| 63 |
+
$storegroup = $storegroupObj->getCollection()->addFilter('`group_id`',$store['group_id'])->setLoadDefault(true)->load();
|
| 64 |
+
foreach($storegroup as $storegroupname){}
|
| 65 |
+
?>
|
| 66 |
+
<tr>
|
| 67 |
+
<td class="label"><?=$this->__($Websitename['name']." > ".$store['name'])?><?php if($store['store_id']=='0'){?><span class="required">*</span><?php }?></td>
|
| 68 |
+
<td class="input-ele"><input type="text" class="<?php echo $store['store_id']=='0'?'required-entry':''?>" value="<?php echo @$Data['attribute_option_value_'.$store['store_id']]?>" name="attribute_option_value_<?php echo $store['store_id']?>" id="attribute_option_value_<?php echo $store['store_id']?>"></td>
|
| 69 |
+
</tr>
|
| 70 |
+
<?php }?>
|
| 71 |
+
</table>
|
| 72 |
+
</form>
|
| 73 |
+
<?php /***Search Form Ends***/?>
|
| 74 |
+
|
| 75 |
+
</fieldset>
|
| 76 |
+
|
| 77 |
+
</div>
|
| 78 |
+
<script type="text/javascript">
|
| 79 |
+
var editForm = new varienForm('edit_form');
|
| 80 |
+
var deleteForm = new varienForm('delete_form');
|
| 81 |
+
</script>
|
| 82 |
+
<?php
|
| 83 |
+
$Data = Mage::getSingleton('core/session')->setTempSessionVariable();
|
| 84 |
+
?>
|
app/design/adminhtml/default/default/template/cueattributevalue/cueattributevaluedelete.phtml
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
*
|
| 4 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 5 |
+
* Version :- 1.0
|
| 6 |
+
* Edition :- community
|
| 7 |
+
* Developed By :- CueBlocks.com
|
| 8 |
+
*
|
| 9 |
+
*/
|
| 10 |
+
$eavattributeObj = Mage::getModel('eav/entity_attribute');
|
| 11 |
+
$eavattributeoptionObj = Mage::getModel('eav/entity_attribute_option');
|
| 12 |
+
$attribute_id=$this->getRequest()->getParam('attribute_id');
|
| 13 |
+
$store_id=$this->getRequest()->getParam('store_id');
|
| 14 |
+
$searchlabel=$this->getRequest()->getParam('search_attribute');
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
$filter_a = array('multiselect');
|
| 18 |
+
$filter_b = array('select');
|
| 19 |
+
$rows = $eavattributeObj->getCollection()->addFilter('`is_user_defined`','1')->addFieldToFilter('`frontend_input`',array($filter_a,$filter_b))->load();
|
| 20 |
+
|
| 21 |
+
$arrdefault[]=array('value' => '',
|
| 22 |
+
'label' => '---Select Attribute Code---');
|
| 23 |
+
foreach($rows as $attribute)
|
| 24 |
+
{
|
| 25 |
+
$attributelabelsarr[] = array(
|
| 26 |
+
'value' => $attribute['attribute_id'],
|
| 27 |
+
'label' => $attribute['attribute_code'],
|
| 28 |
+
);
|
| 29 |
+
}
|
| 30 |
+
$combinedarr=array_merge($arrdefault,$attributelabelsarr);
|
| 31 |
+
|
| 32 |
+
$storeObj = Mage::getModel('core/store');
|
| 33 |
+
$StoreDetails = $storeObj->getCollection()->addFilter('`is_active`','1')->setLoadDefault(true)->load();
|
| 34 |
+
|
| 35 |
+
$arrstorerdefault[]=array('value' => '',
|
| 36 |
+
'label' => '---Select Store---');
|
| 37 |
+
foreach($StoreDetails as $store)
|
| 38 |
+
{
|
| 39 |
+
$storearr[] = array(
|
| 40 |
+
'value' => $store['store_id'],
|
| 41 |
+
'label' => $store['name'],
|
| 42 |
+
);
|
| 43 |
+
}
|
| 44 |
+
$finalstorearr=array_merge($arrstorerdefault,$storearr);
|
| 45 |
+
$websiteObj = Mage::getModel('core/website');
|
| 46 |
+
$storegroupObj = Mage::getModel('core/store_group');
|
| 47 |
+
$Website = $websiteObj->getCollection()->setLoadDefault(true)->load();
|
| 48 |
+
?>
|
| 49 |
+
<div class="content-header">
|
| 50 |
+
<table cellspacing="0" class="grid-header">
|
| 51 |
+
<tr>
|
| 52 |
+
<td><h3><?=$this->__('Delete Attribute Labels')?></h3></td>
|
| 53 |
+
<td class="a-right">
|
| 54 |
+
<button onclick="editForm.submit()" class="scalable save" type="button"><span>Search</span></button>
|
| 55 |
+
</td>
|
| 56 |
+
</tr>
|
| 57 |
+
</table>
|
| 58 |
+
</div>
|
| 59 |
+
<div class="entry-edit">
|
| 60 |
+
<div class="entry-edit-head">
|
| 61 |
+
<h4 class="icon-head head-edit-form fieldset-legend"><?=$this->__("Delete Attribute Labels")?></h4>
|
| 62 |
+
</div>
|
| 63 |
+
<fieldset id="my-fieldset">
|
| 64 |
+
<?php /***Search Form Starts***/ ?>
|
| 65 |
+
<form id="edit_form" name="edit_form" method="post" action="<?=$this->getUrl('*/*/index')?>">
|
| 66 |
+
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
|
| 67 |
+
<table cellspacing="0" class="form-list">
|
| 68 |
+
<tr>
|
| 69 |
+
<td colspan="2"><strong>Note:</strong>
|
| 70 |
+
<ol style="margin:0 0 30px 50px;"><li>1. If you delete 'admin' label, store labels will also be deleted.</li><li>2. If you delete label for particular store then admin label will be displayed.</li></ol></td>
|
| 71 |
+
</tr>
|
| 72 |
+
<tr>
|
| 73 |
+
<td class="label"><?=$this->__('Select Attribute Code')?> <span class="required">*</span></td>
|
| 74 |
+
<td class="input-ele"> <select class="required-entry" name="attribute_id" id="attribute_id">
|
| 75 |
+
<?php foreach($combinedarr as $arratt){?>
|
| 76 |
+
<option value="<?php echo $arratt['value']?>" <?php echo $arratt['value']==$attribute_id ?'selected=selected':''?>><?php echo $arratt['label']?></option>
|
| 77 |
+
<?php }?>
|
| 78 |
+
</select>
|
| 79 |
+
</td>
|
| 80 |
+
</tr>
|
| 81 |
+
<tr>
|
| 82 |
+
<td class="label"><?=$this->__('Select Store')?> <span class="required">*</span></td>
|
| 83 |
+
<td class="input-ele"> <select name="store_id" id="store_id" class="required-entry">
|
| 84 |
+
<option value="">---Select Store---</option>
|
| 85 |
+
<?php foreach($Website as $Websitename){?>
|
| 86 |
+
<option value="" disabled="disabled" style="color:black;font-weight:bold"><?php echo $Websitename['name']?></option>
|
| 87 |
+
<?php $Store = $storeObj->getCollection()->addFilter('`is_active`','1')->addFilter('`website_id`',$Websitename['website_id'])->setLoadDefault(true)->load();
|
| 88 |
+
?>
|
| 89 |
+
<?php $arr='';
|
| 90 |
+
foreach($Store as $Storename)
|
| 91 |
+
{
|
| 92 |
+
$storegroup = $storegroupObj->getCollection()->addFilter('`group_id`',$Storename['group_id'])->setLoadDefault(true)->load();
|
| 93 |
+
foreach($storegroup as $storegroupname){}
|
| 94 |
+
if($arr!=$storegroupname['name'])
|
| 95 |
+
{
|
| 96 |
+
?>
|
| 97 |
+
<optgroup style="padding-left: 16px;" label="<?php echo $storegroupname['name']; $arr=$storegroupname['name'];?>">
|
| 98 |
+
|
| 99 |
+
<? }?>
|
| 100 |
+
|
| 101 |
+
<option style="" value="<?php echo $Storename['store_id']?>" <?php echo $Storename['store_id']?>><?php echo $Storename['name']?></option>
|
| 102 |
+
|
| 103 |
+
<?php }?></optgroup>
|
| 104 |
+
<?php }?>
|
| 105 |
+
</select>
|
| 106 |
+
</td>
|
| 107 |
+
</tr>
|
| 108 |
+
<tr>
|
| 109 |
+
<td class="label"><?=$this->__('Search Label')?> <span class="required">*</span></td>
|
| 110 |
+
<td class="input-ele"><input class="required-entry" value="<?php echo @$searchlabel?>" name="search_attribute" id="search_attribute" /></td>
|
| 111 |
+
</tr>
|
| 112 |
+
</table>
|
| 113 |
+
</form>
|
| 114 |
+
<?php /***Search Form Ends***/?>
|
| 115 |
+
|
| 116 |
+
<?php /***Search Result Starts***/
|
| 117 |
+
|
| 118 |
+
if($this->getRequest()->getParam('search_attribute')!='')
|
| 119 |
+
{
|
| 120 |
+
?>
|
| 121 |
+
<table cellspacing="0" width="100%">
|
| 122 |
+
<tr>
|
| 123 |
+
<td class="label" height="20px" style="padding-top:10px;padding-bottom:10px"><span class="required"><?=$this->__('Search Result')?></span></td>
|
| 124 |
+
</tr>
|
| 125 |
+
|
| 126 |
+
</table>
|
| 127 |
+
<table cellspacing="0" border="0" class="form-list">
|
| 128 |
+
<?php
|
| 129 |
+
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
|
| 130 |
+
$datavalues = Mage::getModel('eav/entity_attribute_option')->getCollection()->join('attribute_option_value','(attribute_option_value.option_id = main_table.option_id) and main_table.attribute_id='.$attribute_id.' and attribute_option_value.store_id='.$store_id.' and value like "'.$searchlabel.'%"');
|
| 131 |
+
$rowcount=count($datavalues);
|
| 132 |
+
if($rowcount>0)
|
| 133 |
+
{?>
|
| 134 |
+
<tr>
|
| 135 |
+
<td class="label"><strong><?=$this->__('Label Value')?></strong></td>
|
| 136 |
+
<td class="label"><strong><?=$this->__('Action')?></strong></td>
|
| 137 |
+
</tr>
|
| 138 |
+
<?php foreach($datavalues as $val)
|
| 139 |
+
{?>
|
| 140 |
+
<form id="delete_form" name="delete_form" method="post" action="<?=$this->getUrl('*/*/delete')?>">
|
| 141 |
+
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
|
| 142 |
+
<tr>
|
| 143 |
+
<td class="label"><?=$this->__($val['value'])?></td>
|
| 144 |
+
<td align="left">
|
| 145 |
+
<button class="scalable delete" type="submit"><span>Delete Label</span></button>
|
| 146 |
+
<input type="hidden" value="<?php echo $val['value_id'];?>" name="value_id" id="value_id" />
|
| 147 |
+
<input type="hidden" value="<?php echo $val['option_id'];?>" name="option_id" id="option_id" />
|
| 148 |
+
</td>
|
| 149 |
+
|
| 150 |
+
</tr>
|
| 151 |
+
</form>
|
| 152 |
+
<?php }
|
| 153 |
+
}
|
| 154 |
+
if($rowcount==0)
|
| 155 |
+
{?>
|
| 156 |
+
<tr>
|
| 157 |
+
<td class="label"><?=$this->__('No Result Found')?></td>
|
| 158 |
+
</tr>
|
| 159 |
+
<?php }
|
| 160 |
+
?>
|
| 161 |
+
</table>
|
| 162 |
+
<?php }?>
|
| 163 |
+
<?php /***Search Result Ends***/?>
|
| 164 |
+
</fieldset>
|
| 165 |
+
</div>
|
| 166 |
+
<script type="text/javascript">
|
| 167 |
+
var editForm = new varienForm('edit_form');
|
| 168 |
+
var deleteForm = new varienForm('delete_form');
|
| 169 |
+
</script>
|
| 170 |
+
|
app/etc/modules/CueBlocks_All.xml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!--
|
| 2 |
+
/**
|
| 3 |
+
*
|
| 4 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 5 |
+
* Version :- 1.0
|
| 6 |
+
* Edition :- community
|
| 7 |
+
* Developed By :- CueBlocks.com
|
| 8 |
+
*
|
| 9 |
+
*/
|
| 10 |
+
-->
|
| 11 |
+
<config>
|
| 12 |
+
<modules>
|
| 13 |
+
<CueBlocks_All>
|
| 14 |
+
<active>true</active>
|
| 15 |
+
<codePool>community</codePool>
|
| 16 |
+
</CueBlocks_All>
|
| 17 |
+
</modules>
|
| 18 |
+
</config>
|
app/etc/modules/CueBlocks_Cueattributevalue.xml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!--
|
| 2 |
+
/**
|
| 3 |
+
*
|
| 4 |
+
* Package :- CueBlocks_Attributevalue-1.0.tgz
|
| 5 |
+
* Version :- 1.0
|
| 6 |
+
* Edition :- community
|
| 7 |
+
* Developed By :- CueBlocks.com
|
| 8 |
+
*
|
| 9 |
+
*/
|
| 10 |
+
-->
|
| 11 |
+
<config>
|
| 12 |
+
<modules>
|
| 13 |
+
<CueBlocks_Cueattributevalue>
|
| 14 |
+
<active>true</active>
|
| 15 |
+
<codePool>community</codePool>
|
| 16 |
+
</CueBlocks_Cueattributevalue>
|
| 17 |
+
</modules>
|
| 18 |
+
</config>
|
package.xml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<package>
|
| 3 |
+
<name>Quick_Action_Attribute_Values_or_Labels</name>
|
| 4 |
+
<version>1.1</version>
|
| 5 |
+
<stability>beta</stability>
|
| 6 |
+
<license>OSL v3.0</license>
|
| 7 |
+
<channel>community</channel>
|
| 8 |
+
<extends/>
|
| 9 |
+
<summary>Extension to add Attribute Labels by CueBlocks.com</summary>
|
| 10 |
+
<description>This extension has been developed by CueBlocks.com to add attirbute labels.</description>
|
| 11 |
+
<notes>This extension will allow you to add/delete/search attribute labels</notes>
|
| 12 |
+
<authors><author><name>ekta puri</name><user>auto-converted</user><email>ekta.puri@cueblocks.com</email></author></authors>
|
| 13 |
+
<date>2011-01-20</date>
|
| 14 |
+
<time>11:09:08</time>
|
| 15 |
+
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="cueattributevalue.xml" hash="64b142226000d0fb5e5728b8ff2f31ee"/></dir><dir name="template"><dir name="cueattributevalue"><file name="cueattributevalueadd.phtml" hash="7cdbb8d35f898385262c67047cc39e16"/><file name="cueattributevaluedelete.phtml" hash="37c02326c9c21e6bece08c77786313a7"/></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="CueBlocks"><dir name="All"><dir name="etc"><file name="config.xml" hash="51a0c89b0506b5fe4b3f55e94e0de900"/></dir><dir name="Helper"><file name="Data.php" hash="5586b843856fc78d082e020e05027ea6"/></dir></dir><dir name="Cueattributevalue"><dir name="Block"><dir name="Adminhtml"><dir name="Cueattributevalue"><dir name="Edit"><file name="Tabs.php" hash="83ccbdd12613847d49f2c8a4195b91de"/></dir><file name="Edit.php" hash="e3f6de4cccb85bed78921cf36db43859"/></dir><dir name="Cueattributevaluedelete"><dir name="Edit"><file name="Tabs.php" hash="f64ce72a28cbbad3d606ff0b7ac75131"/></dir><file name="Edit.php" hash="3154f450bab57ed518ec2a8c71bff761"/></dir><file name="Cueattributevalue.php" hash="fe39b0d29682a0f786ebc57092bc2714"/><file name="Cueattributevaluedelete.php" hash="67d229ba5f08993d54a388f35cde9132"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CueattributevalueController.php" hash="3e5f1b9f072259fce13e7a2f162e5f52"/><file name="CueattributevaluedeleteController.php" hash="a7e0c248a982e65df5f1fd4b7d131b1b"/></dir></dir><dir name="etc"><file name="config.xml" hash="49a3632797d7bc80e3b6eb756f35241f"/></dir><dir name="Helper"><file name="Data.php" hash="51881dcee48b1cb15a980ac0ca0e5fee"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="CueBlocks_All.xml" hash="3e01066825596afe849de6f874974a6b"/><file name="CueBlocks_Cueattributevalue.xml" hash="f33594b9010b8022d77972c821738e66"/></dir></target></contents>
|
| 16 |
+
<compatible/>
|
| 17 |
+
<dependencies/>
|
| 18 |
+
</package>
|
