[Added info for enum numbers Adrian Georgescu **20070920133624 Added update number ] hunk ./provisioning/ngnpro_client_lib.phtml 3357 + var $FieldsReadOnly=array( + 'reseller' + ); + var $Fields=array( + 'customer' => array('type'=>'integer'), + 'owner' => array('type'=>'integer'), + 'info' => array('type'=>'string') + ); + hunk ./provisioning/ngnpro_client_lib.phtml 3524 + Info hunk ./provisioning/ngnpro_client_lib.phtml 3538 + Info hunk ./provisioning/ngnpro_client_lib.phtml 3597 + $_number_url = $this->url.sprintf("&service=%s&number_filter=%s&tld_filter=%s", + urlencode($this->SOAPEngine->service), + urlencode($number->id->number), + urlencode($number->id->tld) + ); + hunk ./provisioning/ngnpro_client_lib.phtml 3613 - +%s + +%s + %s hunk ./provisioning/ngnpro_client_lib.phtml 3630 + $_number_url, hunk ./provisioning/ngnpro_client_lib.phtml 3639 + $number->info, hunk ./provisioning/ngnpro_client_lib.phtml 3656 + %s hunk ./provisioning/ngnpro_client_lib.phtml 3669 + $number->info, hunk ./provisioning/ngnpro_client_lib.phtml 3687 - %s hunk ./provisioning/ngnpro_client_lib.phtml 3688 + + %s hunk ./provisioning/ngnpro_client_lib.phtml 3711 - %s hunk ./provisioning/ngnpro_client_lib.phtml 3712 + + %s hunk ./provisioning/ngnpro_client_lib.phtml 3741 - $this->showPagination($maxrows); + if ($this->rows == 1 ) { + $this->showRecord($number); + } else { + $this->showPagination($maxrows); + } hunk ./provisioning/ngnpro_client_lib.phtml 4284 + + function showRecord($number) { + + print ""; + print " + +
+

ENUM number

+ "; + printf ("",$_SERVER['PHP_SELF']); + print ""; + + print " + "; + + printf (" + + + "); + foreach ($this->FieldsReadOnly as $item) { + printf (" + + + ", + ucfirst($item), + $number->$item + ); + } + + foreach (array_keys($this->Fields) as $item) { + if ($this->Fields[$item]['name']) { + $item_name=$this->Fields[$item]['name']; + } else { + $item_name=ucfirst($item); + } + + if ($this->Fields[$item]['type'] == 'text') { + printf (" + + + ", + $item_name, + $item, + $number->$item + ); + } else { + printf (" + + + ", + $item_name, + $item, + $number->$item + ); + } + } + + $this->printFiltersToForm(); + $this->printHiddenFormElements(); + + print ""; + print " +
+
FieldValue
%s%s
%s
%s
+ "; + } + + function getRecord($enumid) { + + $this->SOAPEngine->soapclient->addHeader($this->SOAPEngine->SoapAuth); + $result = $this->SOAPEngine->soapclient->getNumber($enumid); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + return $result; + } + } + + function updateRecord () { + //print "

Updating number ..."; + + if (!$_REQUEST['number_filter'] || !$_REQUEST['tld_filter']) return; + + $enumid=array('number' => $_REQUEST['number_filter'], + 'tld' => $_REQUEST['tld_filter'] + ); + + if (!$number = $this->getRecord($enumid)) { + return false; + } + + foreach ($number->mappings as $_property) { + $mappings[]=$_property; + } + + $number->mappings=$mappings; + + $this->SOAPEngine->soapclient->addHeader($this->SOAPEngine->SoapAuth); + $result = $this->SOAPEngine->soapclient->updateNumber($number); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + return true; + } + } hunk ./provisioning/ngnpro_client_lib.phtml 5803 - 'language' => array('name' => 'Language', - 'category' => 'general'), hunk ./provisioning/ngnpro_client_lib.phtml 5823 - var $customerFieldsReadOnly=array( + var $FieldsReadOnly=array( hunk ./provisioning/ngnpro_client_lib.phtml 5827 - var $customerFields=array( + var $Fields=array( hunk ./provisioning/ngnpro_client_lib.phtml 5851 - 'timezone' => array('type'=>'string') + 'timezone' => array('type'=>'string'), + 'language' => array('type'=>'string') hunk ./provisioning/ngnpro_client_lib.phtml 6354 - hunk ./provisioning/ngnpro_client_lib.phtml 6355 - $this->showRecord($customer->id); + $this->showRecord($customer); hunk ./provisioning/ngnpro_client_lib.phtml 6399 - function getCustomer($id) { + function getRecord($id) { hunk ./provisioning/ngnpro_client_lib.phtml 6415 - function showRecord($id) { - - if (!$customer = $this->getCustomer($id)) { - return false; - } + function showRecord($customer){ hunk ./provisioning/ngnpro_client_lib.phtml 6435 - foreach ($this->customerFieldsReadOnly as $item) { + foreach ($this->FieldsReadOnly as $item) { hunk ./provisioning/ngnpro_client_lib.phtml 6444 - foreach (array_keys($this->customerFields) as $item) { - if ($this->customerFields[$item]['name']) { - $item_name=$this->customerFields[$item]['name']; + foreach (array_keys($this->Fields) as $item) { + if ($this->Fields[$item]['name']) { + $item_name=$this->Fields[$item]['name']; hunk ./provisioning/ngnpro_client_lib.phtml 6506 - if ($this->customerFields[$item]['type'] == 'text') { + if ($this->Fields[$item]['type'] == 'text') { hunk ./provisioning/ngnpro_client_lib.phtml 6600 - if (!$customer=$this->getCustomer($_REQUEST['customer_filter'])) { + if (!$customer=$this->getRecord($_REQUEST['customer_filter'])) { hunk ./provisioning/ngnpro_client_lib.phtml 6619 - foreach (array_keys($this->customerFields) as $item) { + foreach (array_keys($this->Fields) as $item) { hunk ./provisioning/ngnpro_client_lib.phtml 6622 - if ($this->customerFields[$item]['type'] == 'integer') { + if ($this->Fields[$item]['type'] == 'integer') {