[Fixed operations on PSTN entities for NNPro 4 Adrian Georgescu **20081119123336] hunk ./library/ngnpro_client.php 737 - print " Customer "; - + $this->showCustomerForm(); + } + } + + function showResellerSelection() { + if ($this->version > 1) { hunk ./library/ngnpro_client.php 744 - $this->showCustomerForm(); - print "."; hunk ./library/ngnpro_client.php 746 - $this->showCustomerForm(); - print "."; hunk ./library/ngnpro_client.php 839 + + $this->showTextBeforeCustomerSelection(); hunk ./library/ngnpro_client.php 842 + $this->showResellerSelection(); hunk ./library/ngnpro_client.php 1189 + function showTextBeforeCustomerSelection() { + print "Customer"; + } hunk ./library/ngnpro_client.php 8099 - if ($this->version > 1) print "Customer"; - print" - IP address - Protocol - From pattern - Description"; - - if ($this->version > 1) print "Change date"; + if ($this->version > 3) { + print " + Reseller + IP address + Protocol + From pattern + Description + Change date + "; hunk ./library/ngnpro_client.php 8109 + } else if ($this->version > 1) { + print " + Customer + IP address + Protocol + From pattern + Description + Change date + "; + } else { + print " + IP address + Protocol + From pattern + Description + "; + } hunk ./library/ngnpro_client.php 8174 - if ($this->version > 1) { + if ($this->version > 3) { + $_customer_url = $this->url.sprintf("&service=customers@%s&customer_filter=%s", + urlencode($this->SoapEngine->customer_engine), + urlencode($peer->reseller) + ); + + printf(" + + %s + %s + %s + %s + %s + %s + %s + %s + ", + $bgcolor, + $index, + $_customer_url, + $peer->reseller, + $peer->ip, + $peer->protocol, + $peer->fromPattern, + $peer->description, + $peer->changeDate, + $_url, + $actionText + ); + + } else if ($this->version > 1) { hunk ./library/ngnpro_client.php 8378 + function showCustomerTextBox () { + print "Reseller"; + $this->showResellerForm('reseller'); + } + + function showTextBeforeCustomerSelection() { + print "Reseller"; + } + + function showCustomerForm() { + } + hunk ./library/ngnpro_client.php 8502 - $_url = $this->url.sprintf("&service=%s&action=Delete&name_filter=%s", + $_url = $this->url.sprintf("&service=%s&action=Delete&name_filter=%s&reseller_filter=%s", hunk ./library/ngnpro_client.php 8504 - urlencode($carrier->name) + urlencode($carrier->name), + urlencode($carrier->reseller) hunk ./library/ngnpro_client.php 8508 - $_carrier_url = $this->url.sprintf("&service=pstn_gateways@%s&carrier_filter=%s", + $_carrier_url = $this->url.sprintf("&service=pstn_gateways@%s&carrier_filter=%s&reseller_filter=%s", hunk ./library/ngnpro_client.php 8510 - urlencode($carrier->name) + urlencode($carrier->name), + urlencode($carrier->reseller) hunk ./library/ngnpro_client.php 8516 - $_REQUEST['name_filter'] == $carrier->name) { + $_REQUEST['name_filter'] == $carrier->name && + $_REQUEST['reseller_filter'] == $carrier->reseller) { hunk ./library/ngnpro_client.php 8692 + function showCustomerForm() { + } + + function showTextBeforeCustomerSelection() { + print "Reseller"; + } + hunk ./library/ngnpro_client.php 9011 + function showCustomerForm() { + } + function showTextBeforeCustomerSelection() { + print "Reseller"; + } + hunk ./library/ngnpro_client.php 9022 - var $sortElements=array( - 'name' => 'Name', - 'group' => 'Group', - 'ip' => 'IP address', - 'prefix' => 'Prefix' - ); hunk ./library/ngnpro_client.php 9028 + if ($this->version > 3) { + $this->sortElements=array( + 'name' => 'Name', + 'group' => 'Carrier', + 'ip' => 'IP address', + 'changeDate' => 'Change date' + ); + } else { + $this->sortElements=array( + 'name' => 'Name', + 'carrier' => 'Carrier', + 'ip' => 'IP address' + ); + } hunk ./library/ngnpro_client.php 9180 - $_url = $this->url.sprintf("&service=%s&action=Delete&name_filter=%s", + $_url = $this->url.sprintf("&service=%s&action=Delete&name_filter=%s&reseller_filter=%s", hunk ./library/ngnpro_client.php 9182 - urlencode($gateway->name) + urlencode($gateway->name), + urlencode($gateway->reseller) hunk ./library/ngnpro_client.php 9187 - $_REQUEST['name_filter'] == $gateway->name) { + $_REQUEST['name_filter'] == $gateway->name && + $_REQUEST['reseller_filter'] == $gateway->reseller) { hunk ./library/ngnpro_client.php 9562 + function showCustomerForm() { + } + function showTextBeforeCustomerSelection() { + print "Reseller"; + } hunk ./library/ngnpro_client.php 9579 - $this->filters = array('prefix' => trim($_REQUEST['prefix_filter']), - 'priority' => trim($_REQUEST['priority_filter']), - 'gatewayGroup' => trim($_REQUEST['gatewayGroup_filter']) + $this->filters = array('prefix' => trim($_REQUEST['prefix_filter']), + 'priority' => trim($_REQUEST['priority_filter']), + 'group' => trim($_REQUEST['group_filter']), + 'reseller' => trim($_REQUEST['reseller_filter']), + 'id' => trim($_REQUEST['id_filter']) hunk ./library/ngnpro_client.php 9600 - $filter=array('prefix' => $this->filters['prefix'], - 'gatewayGroup' => $this->filters['gatewayGroup'], - 'customer' => intval($this->filters['customer']), - 'reseller' => intval($this->filters['reseller']) - ); + // Filter + if ($this->version > 3) { + $filter=array('prefix' => $this->filters['prefix'], + 'carrier' => $this->filters['group'], + 'reseller' => intval($this->filters['reseller']), + 'id' => intval($this->filters['id']) + ); + } else { + $filter=array('prefix' => $this->filters['prefix'], + 'gatewayGroup' => $this->filters['group'], + 'customer' => intval($this->filters['customer']), + 'reseller' => intval($this->filters['reseller']) + ); + } + hunk ./library/ngnpro_client.php 9722 - $_url = $this->url.sprintf("&service=%s&action=Delete&prefix_filter=%s&gatewayGroup_filter=%s&priority_filter=%s", + $_url = $this->url.sprintf("&service=%s&action=Delete&id_filter=%d", hunk ./library/ngnpro_client.php 9724 - urlencode($route->prefix), - urlencode($route->gatewayGroup), - urlencode($route->priority) + urlencode($route->id) hunk ./library/ngnpro_client.php 9727 - $_REQUEST['prefix_filter'] == $route->prefix && - $_REQUEST['carrier_filter'] == $route->carrier && - $_REQUEST['priority_filter'] == $route->priority) { - + $_REQUEST['id_filter'] == $route->id) { hunk ./library/ngnpro_client.php 9735 - $_url = $this->url.sprintf("&service=%s&action=Delete&prefix_filter=%s&carrier_filter=%s&priority_filter=%s", + $_url = $this->url.sprintf("&service=%s&action=Delete&prefix_filter=%s&carrier_filter=%s&priority_filter=%s&reseller_filter=%s", hunk ./library/ngnpro_client.php 9739 - urlencode($route->priority) + urlencode($route->priority), + urlencode($route->reseller) hunk ./library/ngnpro_client.php 9742 + hunk ./library/ngnpro_client.php 9746 - $_REQUEST['priority_filter'] == $route->priority) { + $_REQUEST['priority_filter'] == $route->priority && + $_REQUEST['reseller_filter'] == $route->reseller) { hunk ./library/ngnpro_client.php 9991 - if ($dictionary['prefix']) { - $prefix = $dictionary['prefix']; - } else { - $prefix = trim($this->filters['prefix']); - } - if ($dictionary['gatewayGroup']) { - $gatewayGroup = $dictionary['gatewayGroup']; - } else { - $gatewayGroup = trim($this->filters['gatewayGroup']); - } - if ($dictionary['priority']) { - $priority = $dictionary['priority']; + if ($this->version > 3) { + if ($dictionary['id']) { + $id = $dictionary['id']; + } else { + $id = trim($this->filters['id']); + } + + if (!strlen($id)) { + print "

Error: missing route id. "; + return false; + } + + $route=array('id'=> intval($id)); hunk ./library/ngnpro_client.php 10005 - $priority = trim($this->filters['priority']); - } + if ($dictionary['prefix']) { + $prefix = $dictionary['prefix']; + } else { + $prefix = trim($this->filters['prefix']); + } + if ($dictionary['gatewayGroup']) { + $gatewayGroup = $dictionary['gatewayGroup']; + } else { + $gatewayGroup = trim($this->filters['gatewayGroup']); + } + if ($dictionary['priority']) { + $priority = $dictionary['priority']; + } else { + $priority = trim($this->filters['priority']); + } + + if (!strlen($gatewayGroup)) { + print "

Error: missing gatewayGroup. "; + return false; + } hunk ./library/ngnpro_client.php 10026 - if (!strlen($gatewayGroup)) { - print "

Error: missing gatewayGroup. "; - return false; + $route=array( + 'prefix' => $prefix, + 'gatewayGroup' => $gatewayGroup, + 'priority' => intval($priority) + ); hunk ./library/ngnpro_client.php 10033 - $route=array( - 'prefix' => $prefix, - 'gatewayGroup' => $gatewayGroup, - 'priority' => intval($priority) - ); - hunk ./library/ngnpro_client.php 10049 -