Skip to content

Adjust config.example.php for better international area code conversion#49

Open
obnys wants to merge 177 commits into
jens-maus:masterfrom
andig:master
Open

Adjust config.example.php for better international area code conversion#49
obnys wants to merge 177 commits into
jens-maus:masterfrom
andig:master

Conversation

@obnys

@obnys obnys commented Jan 20, 2020

Copy link
Copy Markdown

Currently the international area code '+49' is beeing replaced with nothing '' by default at the config.example.php:

...
'+49' => '',  // router is usually operated in 'DE; '0049' could also be part of a phone number
...

I'd suggest to replace this entry with the following lines in order to keep the phone number intact by default. Otherwise the area code of the phone number would miss the leading '0'

...
'+49'  => '0',
'0049'  => '0',
'+'     => '00',    // keep international area codes for foreign countries intact.
...

As for non-german users (no idea, how big the user community is), it might be even better to define the local international area code in some kind of a variable at the top of the config.example.php. If this entry stays empty, the program could assume let's say for example Germany for the local international area code. I have no idea about that program language, but in Linux style, it might look like this:

...
OWNCOUNTRY='49' // empty by default
[ $OWNCOUNTRY = '' ] && { // when empty, set to 49
   OWNCOUNTRY='49'
}
...
// And at the part for replacing the characters:
...
"+\$OWNCOUNTRY"  => '0', // pls note the double quote becouse of the variable
"00\$OWNCOUNTRY"  => '0', // pls note the double quote becouse of the variable
'+'     => '00',    // keep international area codes for foreign countries intact.
...

BUT: What I'm not sure about is how to prevent the config from replacing the number, let's say 0049, in the middle of a number like 012334 / 90049123454. Would it be possible to inspect the beginning of a string? Like in Linux you would use

// in case of +49
[ $(echo $PHONENUMBER | cut -c 1-3) == "+$OWNCOUNTRY" ] && { 
   $PHONENUMBER = 0$(echo $PHONENUMER | cut -c 3-)  // add a 0 in front and remove first 3 digits
}
// in case of 0049
[ $(echo $PHONENUMBER | cut -c 1-4) == "00$OWNCOUNTRY" ] && { 
   $PHONENUMBER = 0$(echo $PHONENUMER | cut -c 4-)  // add a 0 in front and remove first 3 digits
}

@obnys obnys reopened this Jan 20, 2020
blacksenator and others added 29 commits February 11, 2020 08:49
* replace redundant login code with function
* split exportPhonebook in conversion to contacts and XML phonebook assembly
Updates the requirements on [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) to permit the latest version.
- [Release notes](https://github.com/guzzle/guzzle/releases)
- [Changelog](https://github.com/guzzle/guzzle/blob/master/CHANGELOG.md)
- [Commits](guzzle/guzzle@6.0.0...7.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Fixing VIP attribute examples in config.example.php
* Bug fix restoring internal numbers in contacts including external numbers

* Fixing false background image upload message and update used libraries

* minor adjustments to .gitignore and README.md
…nd vanity numbers were ignored during the restore (#252)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.