Skip to content

Commit

Permalink
Fixing frontend model html of bank accounts data
Browse files Browse the repository at this point in the history
  • Loading branch information
MaWoScha authored and PX-BE1 RL committed Jan 19, 2018
1 parent df87f77 commit 211e993
Show file tree
Hide file tree
Showing 3 changed files with 216 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)

$html .= '<ul id="bank_account_container">';
if ($this->_getValue('account_holder')) {
foreach ($this->_getValue('account_holder') as $i=>$f) {
foreach ($this->_getValue('account_holder') as $i => $f) {
if ($i) {
$html .= $this->_getRowTemplateHtml($i);
}
Expand All @@ -51,26 +51,38 @@ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
* @param int $i
* @return string
*/
protected function _getRowTemplateHtml($i=0)
protected function _getRowTemplateHtml($i = 0)
{
$html = '<li><fieldset>';
$html .= '<label>'.$this->__('Account holder').'</label>';
$html .= '<input class="input-text" type="text" name="'.$this->getElement()->getName().'[account_holder][]" value="' . $this->_getValue('account_holder/'.$i) . '" '.$this->_getDisabled().' />';
$html .= '<label>'.$this->__('Bank name').'</label>';
$html .= '<input class="input-text" type="text" name="'.$this->getElement()->getName().'[bank_name][]" value="' . $this->_getValue('bank_name/'.$i) . '" '.$this->_getDisabled().' />';
$html .= '<br />&nbsp;<br />';
$html .= '<label>'.$this->__('IBAN').'</label>';
$html .= '<input class="input-text" type="text" name="'.$this->getElement()->getName().'[iban][]" value="' . $this->_getValue('iban/'.$i) . '" '.$this->_getDisabled().' />';
$html .= '<label>'.$this->__('BIC').'</label>';
$html .= '<input class="input-text" type="text" name="'.$this->getElement()->getName().'[bic][]" value="' . $this->_getValue('bic/'.$i) . '" '.$this->_getDisabled().' />';
$html .= '<br />&nbsp;<br />';
$html .= '<strong>'.$this->__('Account data for non SEPA countries').'</strong>';
$html .= '<br />&nbsp;<br />';
$html .= '<label>'.$this->__('Account number').'</label>';
$html .= '<input class="input-text" type="text" name="'.$this->getElement()->getName().'[account_number][]" value="' . $this->_getValue('account_number/'.$i) . '" '.$this->_getDisabled().' />';
$html .= '<label>'.$this->__('Sort code').'</label>';
$html .= '<input class="input-text" type="text" name="'.$this->getElement()->getName().'[sort_code][]" value="' . $this->_getValue('sort_code/'.$i) . '" '.$this->_getDisabled().' />';
$html .= '<br />&nbsp;<br />';
$html .= '<p>';
$html .= '<label>' . $this->__('Account holder') . '</label><br />';
$html .= '<input class="input-text" type="text" name="' . $this->getElement()->getName() . '[account_holder][]" value="' . $this->_getValue('account_holder/' . $i) . '" ' . $this->_getDisabled() . ' />';
$html .= '</p>';
$html .= '<p>';
$html .= '<label>' . $this->__('Bank name') . '</label><br />';
$html .= '<input class="input-text" type="text" name="' . $this->getElement()->getName() . '[bank_name][]" value="' . $this->_getValue('bank_name/' . $i) . '" ' . $this->_getDisabled() . ' />';
$html .= '</p>';
$html .= '<p>&nbsp;</p>';
$html .= '<p>';
$html .= '<label>' . $this->__('IBAN') . '</label><br />';
$html .= '<input class="input-text" type="text" name="' . $this->getElement()->getName() . '[iban][]" value="' . $this->_getValue('iban/' . $i) . '" ' . $this->_getDisabled() . ' />';
$html .= '</p>';
$html .= '<p>';
$html .= '<label>' . $this->__('BIC') . '</label><br />';
$html .= '<input class="input-text" type="text" name="' . $this->getElement()->getName() . '[bic][]" value="' . $this->_getValue('bic/' . $i) . '" ' . $this->_getDisabled() . ' />';
$html .= '</p>';
$html .= '<p>&nbsp;</p>';
$html .= '<p>';
$html .= '<strong>' . $this->__('Account data for non SEPA countries') . '</strong>';
$html .= '</p>';
$html .= '<p>';
$html .= '<label>' . $this->__('Account number') . '</label><br />';
$html .= '<input class="input-text" type="text" name="' . $this->getElement()->getName() . '[account_number][]" value="' . $this->_getValue('account_number/' . $i) . '" ' . $this->_getDisabled() . ' />';
$html .= '</p>';
$html .= '<p>';
$html .= '<label>' . $this->__('Sort code') . '</label><br />';
$html .= '<input class="input-text" type="text" name="' . $this->getElement()->getName() . '[sort_code][]" value="' . $this->_getValue('sort_code/' . $i) . '" ' . $this->_getDisabled() . ' />';
$html .= '</p>';
$html .= $this->_getRemoveRowButtonHtml();
$html .= '</fieldset></li>';

Expand All @@ -91,7 +103,7 @@ protected function _getDisabled()
*/
protected function _getValue($key)
{
return $this->getElement()->getData('value/'.$key);
return $this->getElement()->getData('value/' . $key);
}

/**
Expand All @@ -101,7 +113,7 @@ protected function _getValue($key)
*/
protected function _getSelected($key, $value)
{
return $this->getElement()->getData('value/'.$key)==$value ? 'selected="selected"' : '';
return $this->getElement()->getData('value/' . $key) == $value ? 'selected="selected"' : '';
}

/**
Expand All @@ -110,14 +122,14 @@ protected function _getSelected($key, $value)
* @param string $title
* @return mixed
*/
protected function _getAddRowButtonHtml($container, $template, $title='Add')
protected function _getAddRowButtonHtml($container, $template, $title = 'Add')
{
if (!isset($this->_addRowButtonHtml[$container])) {
$this->_addRowButtonHtml[$container] = $this->getLayout()->createBlock('adminhtml/widget_button')
->setType('button')
->setClass('add '.$this->_getDisabled())
->setClass('add ' . $this->_getDisabled())
->setLabel($this->__($title))
->setOnClick("Element.insert($('".$container."'), {bottom: $('".$template."').innerHTML})")
->setOnClick("Element.insert($('" . $container . "'), {bottom: $('" . $template . "').innerHTML})")
->toHtml();
}
return $this->_addRowButtonHtml[$container];
Expand All @@ -128,14 +140,14 @@ protected function _getAddRowButtonHtml($container, $template, $title='Add')
* @param string $title
* @return array
*/
protected function _getRemoveRowButtonHtml($selector='li', $title='Delete Account')
protected function _getRemoveRowButtonHtml($selector = 'li', $title = 'Delete Account')
{
if (!$this->_removeRowButtonHtml) {
$this->_removeRowButtonHtml = $this->getLayout()->createBlock('adminhtml/widget_button')
->setType('button')
->setClass('delete v-middle '.$this->_getDisabled())
->setClass('delete v-middle ' . $this->_getDisabled())
->setLabel($this->__($title))
->setOnClick("Element.remove($(this).up('".$selector."'))")
->setOnClick("Element.remove($(this).up('" . $selector . "'))")
->toHtml();
}
return $this->_removeRowButtonHtml;
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Phoenix/BankPayment/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<config>
<modules>
<Phoenix_BankPayment>
<version>1.3.0</version>
<version>1.3.1</version>
</Phoenix_BankPayment>
</modules>
<global>
Expand Down
176 changes: 176 additions & 0 deletions var/connect/Phoenix_BankPayment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
<_>
<form_key>xXLNW9jbYoZ2QKgV</form_key>
<name>BankPayment</name>
<channel>community</channel>
<version_ids>
<version_ids>2</version_ids>
</version_ids>
<summary>Vorkasse - Bank Prepayment module which notifies the buyer to which bank account he has to transfer the money.</summary>
<description>Bank Prepayment module which notifies the buyer to which bank account he has to transfer the money.</description>
<license>OSL</license>
<license_uri>http://opensource.org/licenses/osl-3.0.php</license_uri>
<version>1.3.1</version>
<stability>stable</stability>
<notes>SEPA ready
Optional account number and sort code for non SEPA countries
Fixed multistore problem
Localization improvements</notes>
<authors>
<name>
<name>Phoenix Media GmbH</name>
</name>
<user>
<user>PHOENIX</user>
</user>
<email>
<email>support@at.phoenix-media.eu</email>
</email>
</authors>
<depends_php_min>5.2.0</depends_php_min>
<depends_php_max>7.5.0</depends_php_max>
<depends>
<package>
<name>
<name/>
</name>
<channel>
<channel/>
</channel>
<min>
<min/>
</min>
<max>
<max/>
</max>
<files>
<files> </files>
</files>
</package>
<extension>
<name>
<name>Core</name>
<name>Core</name>
</name>
<min>
<min/>
<min/>
</min>
<max>
<max/>
<max/>
</max>
</extension>
</depends>
<contents>
<target>
<target>magelocal</target>
<target>magecommunity</target>
<target>mageetc</target>
<target>mageetc</target>
<target>magelocale</target>
<target>magelocale</target>
<target>magelocale</target>
<target>magelocale</target>
<target>magelocale</target>
<target>magelocale</target>
<target>magelocale</target>
<target>magelocale</target>
<target>magelocale</target>
<target>magelocale</target>
<target>magelocale</target>
<target>magelocale</target>
<target>magelocale</target>
<target>magedesign</target>
<target>magedesign</target>
<target>magelocale</target>
</target>
<path>
<path/>
<path>Phoenix/BankPayment</path>
<path>modules/Mage_BankPayment.xml</path>
<path>modules/Phoenix_BankPayment.xml</path>
<path>da_DK/Phoenix_BankPayment.csv</path>
<path>de_DE/Phoenix_BankPayment.csv</path>
<path>el_GR/Phoenix_BankPayment.csv</path>
<path>en_US/Phoenix_BankPayment.csv</path>
<path>es_ES/Phoenix_BankPayment.csv</path>
<path>fr_FR/Phoenix_BankPayment.csv</path>
<path>it_IT/Phoenix_BankPayment.csv</path>
<path>ja_JP/Phoenix_BankPayment.csv</path>
<path>nb_NO/Phoenix_BankPayment.csv</path>
<path>nl_NL/Phoenix_BankPayment.csv</path>
<path>pl_PL/Phoenix_BankPayment.csv</path>
<path>pt_BR/Phoenix_BankPayment.csv</path>
<path>tr_TR/Phoenix_BankPayment.csv</path>
<path>adminhtml/default/default/template/phoenix/bankpayment</path>
<path>frontend/base/default/template/phoenix/bankpayment</path>
<path>pt_PT/Phoenix_BankPayment.csv</path>
</path>
<type>
<type>file</type>
<type>dir</type>
<type>file</type>
<type>file</type>
<type>file</type>
<type>file</type>
<type>file</type>
<type>file</type>
<type>file</type>
<type>file</type>
<type>file</type>
<type>file</type>
<type>file</type>
<type>file</type>
<type>file</type>
<type>file</type>
<type>file</type>
<type>dir</type>
<type>dir</type>
<type>file</type>
</type>
<include>
<include/>
<include/>
<include/>
<include/>
<include/>
<include/>
<include/>
<include/>
<include/>
<include/>
<include/>
<include/>
<include/>
<include/>
<include/>
<include/>
<include/>
<include/>
<include/>
<include/>
</include>
<ignore>
<ignore/>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
<ignore>#^.DS_Store#</ignore>
</ignore>
</contents>
</_>

0 comments on commit 211e993

Please sign in to comment.