Merge branch 'master' of github.com:hillelcoren/invoice-ninja

This commit is contained in:
Hillel Coren 2014-07-23 18:03:09 +03:00
commit f431426469
2 changed files with 14 additions and 0 deletions

View File

@ -128,6 +128,7 @@ class ConstantsSeeder extends Seeder
Currency::create(array('name' => 'Rand', 'code' => 'ZAR', 'symbol' => 'R', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); Currency::create(array('name' => 'Rand', 'code' => 'ZAR', 'symbol' => 'R', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'));
Currency::create(array('name' => 'Danish Krone', 'code' => 'DKK', 'symbol' => 'kr ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); Currency::create(array('name' => 'Danish Krone', 'code' => 'DKK', 'symbol' => 'kr ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'));
Currency::create(array('name' => 'Israeli Shekel', 'code' => 'ILS', 'symbol' => 'NIS ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); Currency::create(array('name' => 'Israeli Shekel', 'code' => 'ILS', 'symbol' => 'NIS ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'));
Currency::create(array('name' => 'Singapore Dollar', 'code' => 'SGD', 'symbol' => 'SGD ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'));
DatetimeFormat::create(array('format' => 'd/M/Y g:i a', 'label' => '10/Mar/2013')); DatetimeFormat::create(array('format' => 'd/M/Y g:i a', 'label' => '10/Mar/2013'));
DatetimeFormat::create(array('format' => 'd-M-Yk g:i a', 'label' => '10-Mar-2013')); DatetimeFormat::create(array('format' => 'd-M-Yk g:i a', 'label' => '10-Mar-2013'));

View File

@ -140,6 +140,19 @@ class Utils
$phoneNumber = '+'.$countryCode.' ('.$areaCode.') '.$nextThree.'-'.$lastFour; $phoneNumber = '+'.$countryCode.' ('.$areaCode.') '.$nextThree.'-'.$lastFour;
} }
else if(strlen($phoneNumber) == 10 && in_array(substr($phoneNumber, 0, 3), array(653, 656, 658, 659))) {
/**
* SG country code are 653, 656, 658, 659
* US area code consist of 650, 651 and 657
* @see http://en.wikipedia.org/wiki/Telephone_numbers_in_Singapore#Numbering_plan
* @see http://www.bennetyee.org/ucsd-pages/area.html
*/
$countryCode = substr($phoneNumber, 0, 2);
$nextFour = substr($phoneNumber, 2, 4);
$lastFour = substr($phoneNumber, 6, 4);
$phoneNumber = '+'.$countryCode.' '.$nextFour.' '.$lastFour;
}
else if(strlen($phoneNumber) == 10) { else if(strlen($phoneNumber) == 10) {
$areaCode = substr($phoneNumber, 0, 3); $areaCode = substr($phoneNumber, 0, 3);
$nextThree = substr($phoneNumber, 3, 3); $nextThree = substr($phoneNumber, 3, 3);