Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mage_Sales - DOC block update #751

Merged
merged 5 commits into from
May 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function getGridUrl()
/**
* Retrieve row url
*
* @param Mage_Sales_Model_Billing_Agreement $item
* @return string
*/
public function getRowUrl($item)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@
* Adminhtml billing agreement info tab
*
* @author Magento Core Team <core@magentocommerce.com>
*
* @method $this setCreatedAt(string $formatDate)
* @method $this setCustomerEmail(string $value)
* @method $this setCustomerUrl(string $value)
* @method $this setReferenceId(string $value)
* @method $this setStatus(string $value)
* @method $this setUpdatedAt(string $value)
*/
class Mage_Sales_Block_Adminhtml_Billing_Agreement_View_Tab_Info extends Mage_Adminhtml_Block_Abstract
implements Mage_Adminhtml_Block_Widget_Tab_Interface
class Mage_Sales_Block_Adminhtml_Billing_Agreement_View_Tab_Info extends Mage_Adminhtml_Block_Abstract implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
/**
* Set custom template
Expand Down Expand Up @@ -111,7 +117,7 @@ protected function _toHtml()
$this->helper('core')->formatDate($agreement->getCreatedAt(), 'short', true)
);
$this->setUpdatedAt(
($agreement->getUpdatedAt())
($agreement->getUpdatedAt())
? $this->helper('core')->formatDate($agreement->getUpdatedAt(), 'short', true) : $this->__('N/A')
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
*
* @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Sales_Block_Adminhtml_Billing_Agreement_View_Tab_Orders extends Mage_Adminhtml_Block_Sales_Order_Grid
implements Mage_Adminhtml_Block_Widget_Tab_Interface
class Mage_Sales_Block_Adminhtml_Billing_Agreement_View_Tab_Orders extends Mage_Adminhtml_Block_Sales_Order_Grid implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
/**
* Initialize grid params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
*
* @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Sales_Block_Adminhtml_Customer_Edit_Tab_Agreement
extends Mage_Sales_Block_Adminhtml_Billing_Agreement_Grid
implements Mage_Adminhtml_Block_Widget_Tab_Interface
class Mage_Sales_Block_Adminhtml_Customer_Edit_Tab_Agreement extends Mage_Sales_Block_Adminhtml_Billing_Agreement_Grid implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
/**
* Columns, that should be removed from grid
Expand Down Expand Up @@ -96,6 +94,9 @@ public function isHidden()
return false;
}

/**
* @return string
*/
public function getGridUrl()
{
return $this->getUrl('*/sales_billing_agreement/customerGrid', array('_current'=>true));
Expand All @@ -114,7 +115,7 @@ public function getAfter()
/**
* Prepare collection for grid
*
* @return $this
* @return Mage_Adminhtml_Block_Widget_Grid
*/
protected function _prepareCollection()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
*
* @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Sales_Block_Adminhtml_Customer_Edit_Tab_Recurring_Profile
extends Mage_Sales_Block_Adminhtml_Recurring_Profile_Grid
implements Mage_Adminhtml_Block_Widget_Tab_Interface
class Mage_Sales_Block_Adminhtml_Customer_Edit_Tab_Recurring_Profile extends Mage_Sales_Block_Adminhtml_Recurring_Profile_Grid implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
/**
* Disable filters and paging
Expand Down Expand Up @@ -87,7 +85,7 @@ public function isHidden()
/**
* Prepare collection for grid
*
* @return $this
* @return Mage_Adminhtml_Block_Widget_Grid
*/
protected function _prepareCollection()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class Mage_Sales_Block_Adminhtml_Recurring_Profile_Edit_Form extends Mage_Adminh
* Setter for parent element
*
* @param Varien_Data_Form_Element_Abstract $element
* @return Mage_Sales_Block_Adminhtml_Recurring_Profile_Edit_Form
*/
public function setParentElement(Varien_Data_Form_Element_Abstract $element)
{
Expand All @@ -72,6 +73,7 @@ public function setParentElement(Varien_Data_Form_Element_Abstract $element)
* Setter for current product
*
* @param Mage_Catalog_Model_Product $product
* @return Mage_Sales_Block_Adminhtml_Recurring_Profile_Edit_Form
*/
public function setProductEntity(Mage_Catalog_Model_Product $product)
{
Expand Down Expand Up @@ -205,11 +207,13 @@ protected function _addField($formOrFieldset, $elementName, $options = array(),
/**
* Getter for period unit options with "Please Select" label
*
* @param string $emptyLabel
* @return array
*/
protected function _getPeriodUnitOptions($emptyLabel)
{
return array_merge(array('' => $emptyLabel),
return array_merge(
array('' => $emptyLabel),
$this->_profile->getAllPeriodUnits()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct()
/**
* Prepare grid collection object
*
* @return $this
* @inheritDoc
*/
protected function _prepareCollection()
{
Expand All @@ -58,7 +58,7 @@ protected function _prepareCollection()
/**
* Prepare grid columns
*
* @return $this
* @inheritDoc
*/
protected function _prepareColumns()
{
Expand Down Expand Up @@ -128,7 +128,7 @@ protected function _prepareColumns()
/**
* Return row url for js event handlers
*
* @param Varien_Object
* @param Varien_Object $row
* @return string
*/
public function getRowUrl($row)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@

/**
* Recurring profile view page
*
* @method string getDestElementId()
* @method $this setViewHtml(string $value)
*/
class Mage_Sales_Block_Adminhtml_Recurring_Profile_View extends Mage_Adminhtml_Block_Widget_Container
{
/**
* Create buttons
* TODO: implement ACL restrictions
* @return $this
* @inheritDoc
*/
protected function _prepareLayout()
{
Expand Down Expand Up @@ -93,7 +96,7 @@ protected function _prepareLayout()
/**
* Set title and a hack for tabs container
*
* @return $this
* @inheritDoc
*/
protected function _beforeToHtml()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public function getRecurringProfileGetawayInformation()
{
$recurringProfile = Mage::registry('current_recurring_profile');
$information = array();
foreach($recurringProfile->getData() as $kay => $value) {
foreach ($recurringProfile->getData() as $kay => $value) {
$information[$recurringProfile->getFieldLabel($kay)] = $value;
}
}
return $information;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public function getRecurringProfileInformation()
{
$recurringProfile = Mage::registry('current_recurring_profile');
$information = array();
foreach($recurringProfile->getData() as $kay => $value) {
foreach ($recurringProfile->getData() as $kay => $value) {
$information[$recurringProfile->getFieldLabel($kay)] = $value;
}
}
return $information;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,3 @@ public function formatPrice($value)
return $store->formatPrice($value);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@

/**
* Recurring profile information tab
* @method string getLabel()
*/
class Mage_Sales_Block_Adminhtml_Recurring_Profile_View_Tab_Info
extends Mage_Adminhtml_Block_Widget
implements Mage_Adminhtml_Block_Widget_Tab_Interface
class Mage_Sales_Block_Adminhtml_Recurring_Profile_View_Tab_Info extends Mage_Adminhtml_Block_Widget implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
/**
* Label getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
/**
* Recurring profile orders grid
*/
class Mage_Sales_Block_Adminhtml_Recurring_Profile_View_Tab_Orders
extends Mage_Adminhtml_Block_Widget_Grid
implements Mage_Adminhtml_Block_Widget_Tab_Interface
class Mage_Sales_Block_Adminhtml_Recurring_Profile_View_Tab_Orders extends Mage_Adminhtml_Block_Widget_Grid implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
/**
* Initialize basic parameters
Expand All @@ -46,7 +44,7 @@ public function __construct()
/**
* Prepare grid collection object
*
* @return $this
* @inheritDoc
*/
protected function _prepareCollection()
{
Expand All @@ -62,7 +60,7 @@ protected function _prepareCollection()
*
* TODO: fix up this mess
*
* @return $this
* @inheritDoc
*/
protected function _prepareColumns()
{
Expand Down Expand Up @@ -123,7 +121,8 @@ protected function _prepareColumns()
));

if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
$this->addColumn('action',
$this->addColumn(
'action',
array(
'header' => Mage::helper('sales')->__('Action'),
'width' => '50px',
Expand All @@ -141,7 +140,8 @@ protected function _prepareColumns()
'index' => 'stores',
'is_system' => true,
'data-column' => 'action',
));
)
);
}

return parent::_prepareColumns();
Expand All @@ -150,7 +150,7 @@ protected function _prepareColumns()
/**
* Return row url for js event handlers
*
* @param Varien_Object
* @param Varien_Object $row
* @return string
*/
public function getRowUrl($row)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ protected function _prepareForm()
$fieldset = $this->getForm()->getElement('base_fieldset');

if (is_object($fieldset) && $fieldset instanceof Varien_Data_Form_Element_Fieldset) {

$statuses = Mage::getModel('sales/order_config')->getStatuses();
$values = array();
foreach ($statuses as $code => $label) {
Expand Down Expand Up @@ -80,8 +79,7 @@ protected function _prepareForm()
$this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence')
->addFieldMap("{$htmlIdPrefix}show_order_statuses", 'show_order_statuses')
->addFieldMap("{$htmlIdPrefix}order_statuses", 'order_statuses')
->addFieldDependence('order_statuses', 'show_order_statuses', '1')
);
->addFieldDependence('order_statuses', 'show_order_statuses', '1'));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ protected function _prepareForm()
$fieldset = $this->getForm()->getElement('base_fieldset');

if (is_object($fieldset) && $fieldset instanceof Varien_Data_Form_Element_Fieldset) {

$fieldset->addField('price_rule_type', 'select', array(
'name' => 'price_rule_type',
'options' => array(
Expand Down Expand Up @@ -80,8 +79,7 @@ protected function _prepareForm()
$this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence')
->addFieldMap($htmlIdPrefix . 'price_rule_type', 'price_rule_type')
->addFieldMap($htmlIdPrefix . 'rules_list', 'rules_list')
->addFieldDependence('rules_list', 'price_rule_type', '1')
);
->addFieldDependence('rules_list', 'price_rule_type', '1'));
}

return $this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@

class Mage_Sales_Block_Adminhtml_Report_Filter_Form_Order extends Mage_Sales_Block_Adminhtml_Report_Filter_Form
{
/**
* @return $this
*/
protected function _prepareForm()
{
parent::_prepareForm();
Expand All @@ -43,7 +46,6 @@ protected function _prepareForm()
$fieldset = $this->getForm()->getElement('base_fieldset');

if (is_object($fieldset) && $fieldset instanceof Varien_Data_Form_Element_Fieldset) {

$fieldset->addField('show_actual_columns', 'select', array(
'name' => 'show_actual_columns',
'options' => array(
Expand All @@ -52,7 +54,6 @@ protected function _prepareForm()
),
'label' => Mage::helper('reports')->__('Show Actual Values'),
));

}

return $this;
Expand Down
9 changes: 9 additions & 0 deletions app/code/core/Mage/Sales/Block/Billing/Agreement/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
* Customer account billing agreement view block
*
* @author Magento Core Team <core@magentocommerce.com>
*
* @method $this setAgreementCreatedAt(string $value)
* @method $this setAgreementUpdatedAt(string $value)
* @method $this setAgreementStatus(string $value)
* @method $this setBackUrl(string $value)
* @method $this setCanCancel(bool $value)
* @method $this setCancelUrl(string $value)
* @method $this setPaymentMethodTitle(string $value)
* @method $this setReferenceId(string $value)
*/
class Mage_Sales_Block_Billing_Agreement_View extends Mage_Core_Block_Template
{
Expand Down
3 changes: 3 additions & 0 deletions app/code/core/Mage/Sales/Block/Billing/Agreements.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
* Customer account billing agreements block
*
* @author Magento Core Team <core@magentocommerce.com>
*
* @method $this setBackUrl(string $value)
* @method $this setCreateUrl(string $value)
*/
class Mage_Sales_Block_Billing_Agreements extends Mage_Core_Block_Template
{
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Sales/Block/Order/Comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ public function getComments()
$entity = $this->getEntity();
if ($entity instanceof Mage_Sales_Model_Order_Invoice) {
$collectionClass = 'sales/order_invoice_comment_collection';
} else if ($entity instanceof Mage_Sales_Model_Order_Creditmemo) {
} elseif ($entity instanceof Mage_Sales_Model_Order_Creditmemo) {
$collectionClass = 'sales/order_creditmemo_comment_collection';
} else if ($entity instanceof Mage_Sales_Model_Order_Shipment) {
} elseif ($entity instanceof Mage_Sales_Model_Order_Shipment) {
$collectionClass = 'sales/order_shipment_comment_collection';
} else {
Mage::throwException(Mage::helper('sales')->__('Invalid entity model'));
Expand Down
Loading