|
@@ -615,7 +615,7 @@ class Services extends ApiServices
|
|
|
$vlan = $ch->integer($request, "vlan", false);
|
|
|
$trafficProfileOut = $ch->integer($request, "trafficProfileOut", false);
|
|
|
$trafficProfileIn = $ch->integer($request, "trafficProfileIn", false);
|
|
|
- $catv = $ch->integer($request, "catv", false);
|
|
|
+ $catv = $ch->boolean($request, "catv", false);
|
|
|
$content = "[";
|
|
|
$result = $apiInstance->getList($id, $clientId, $ponSerialNumber, $currentState, $profile, $nap, $onuProfile, $vlanProfile, $model, $serialNumber, $ponSerialNumberAux, $position, $ip, $mac, $vlan, $trafficProfileOut, $trafficProfileIn, $catv, $olt, $tenancyId, $qb_criteria, $limit, $page);
|
|
|
foreach ($result as $v) {
|
|
@@ -743,6 +743,12 @@ class Services extends ApiServices
|
|
|
$instance->setTrafficProfileIn($onuTemplate->getTrafficProfileIn()->getId());
|
|
|
}
|
|
|
}
|
|
|
+ if (is_null($instance->getCatv()) || !is_bool($instance->getCatv())) {
|
|
|
+ // catv = true or false
|
|
|
+ if (!is_null($onuTemplate->getCatv())) {
|
|
|
+ $instance->setCatv($onuTemplate->getCatv());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// chequeo la tenencia
|
|
@@ -828,14 +834,23 @@ class Services extends ApiServices
|
|
|
}
|
|
|
}
|
|
|
if (is_null($content)) {
|
|
|
- $apiInstance->create($instance);
|
|
|
- // busco el id del cliente, buscandolo por externalid
|
|
|
- $result = $apiValidationFTTH->existsONU($instance->getPonSerialNumber(), $instance->getTenancyId());
|
|
|
- if ($result) {
|
|
|
- $content = $result->__toString();
|
|
|
- $codeResponse = 200;
|
|
|
- } else {
|
|
|
- $content = "No se pudo obtener la ONU cargada. Verifique por sistema si la carga se realizo correctamente.";
|
|
|
+ if (!is_null($instance->getCatv())) {
|
|
|
+ if (!is_bool($instance->getCatv())) {
|
|
|
+ $content = "El CATV deber ser true or false.";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (is_null($content)) {
|
|
|
+ //print_r($instance);
|
|
|
+ //die;
|
|
|
+ $apiInstance->create($instance);
|
|
|
+ // busco el id del cliente, buscandolo por externalid
|
|
|
+ $result = $apiValidationFTTH->existsONU($instance->getPonSerialNumber(), $instance->getTenancyId());
|
|
|
+ if ($result) {
|
|
|
+ $content = $result->__toString();
|
|
|
+ $codeResponse = 200;
|
|
|
+ } else {
|
|
|
+ $content = "No se pudo obtener la ONU cargada. Verifique por sistema si la carga se realizo correctamente.";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|