diff --git a/Layout/default/Voicenumberblock/Index.php b/Layout/default/Voicenumberblock/Index.php index 9f9f8da97..3a9a834ad 100644 --- a/Layout/default/Voicenumberblock/Index.php +++ b/Layout/default/Voicenumberblock/Index.php @@ -116,6 +116,7 @@ Name Landeskennzahl Ortskennzahl + Nummernbasis Anfang Ende Kommentar @@ -126,6 +127,7 @@ name?> countrycode?> areacode?> + base?> getFirst()?> getLast()?> comment?> diff --git a/application/Voicenumber/Voicenumber.php b/application/Voicenumber/Voicenumber.php new file mode 100644 index 000000000..a78066748 --- /dev/null +++ b/application/Voicenumber/Voicenumber.php @@ -0,0 +1,5 @@ +last; } + public function getBaseNumber() { + $base = floor($this->first / pow(10, ceil(log10($this->last - $this->first)))); + + if($this->number_prepend_zero) { + return "0".$base; + } + return $base; + } public function getProperty($name) { if($this->$name == null) { @@ -53,6 +62,10 @@ class Voicenumberblock extends mfBaseModel { return $this->getFullNumber(true); } + if($name == "base") { + return $this->getBaseNumber(); + } + $classname = ucfirst($name); $idfield = $name."_id"; $this->$name = new $classname($this->$idfield);