Witam ktoś kiedyś marudził że go w oczy kole konto bankowe wyswietlane na karcie klienta, no cóż mnie też to denerwowało wieć poczyniłem prosty modyfikator smartiego poniżej patch:
diff -ruNa diff-1.7/lib/Smarty/plugins/modifier.iban_fmt.php diff-gaco/lib/Smarty/plugins/modifier.iban_fmt.php --- diff-1.7/lib/Smarty/plugins/modifier.iban_fmt.php 1970-01-01 01:00:00.000000000 +0100 +++ diff-gaco/lib/Smarty/plugins/modifier.iban_fmt.php 2010-05-16 01:36:28.000000000 +0200 @@ -0,0 +1,32 @@ +<?php +/** + * Smarty plugin + * @package Smarty + * @subpackage plugins + */ + + +function smarty_modifier_iban_fmt($string) +{ + preg_match('/(\d{2})(\d{4})(\d{4})(\d{4})(\d{4})(\d{4})(\d{4})/', $string, $matches); + for ($i=1;$i<=7;$i++) { + $bankaccount = $bankaccount . ' ' . $matches[$i]; + } + + return $bankaccount; + +} + +?> diff -ruNa diff-1.7/templates/customerinfobox.html diff-gaco/templates/customerinfobox.html --- diff-1.7/templates/customerinfobox.html 2009-12-14 15:37:15.000000000 +0100 +++ diff-gaco/templates/customerinfobox.html 2010-05-16 01:37:49.000000000 +0200 @@ -158,7 +158,7 @@ <IMG SRC="img/card.gif" ALT=""> </TD> <TD WIDTH="99%" COLSPAN="2" NOWRAP> - {$customerinfo.bankaccount} + {$customerinfo.bankaccount|iban_fmt} </TD> </TR> {/if}