|
@@ -1097,7 +1097,7 @@ class Services extends ApiServices
|
|
$ch = new Checks();
|
|
$ch = new Checks();
|
|
$id = $ch->integer($request, "id", true);
|
|
$id = $ch->integer($request, "id", true);
|
|
$workflow = "onu_workflow";
|
|
$workflow = "onu_workflow";
|
|
- $transition = "disable_delete";
|
|
|
|
|
|
+ $transition = "disable_deleted";
|
|
$apiInstance->setDisabledTenancy(true);
|
|
$apiInstance->setDisabledTenancy(true);
|
|
$result = $apiInstance->getById($id);
|
|
$result = $apiInstance->getById($id);
|
|
$apiInstance->setDisabledTenancy(false);
|
|
$apiInstance->setDisabledTenancy(false);
|
|
@@ -1196,6 +1196,44 @@ class Services extends ApiServices
|
|
return Utils::returnJSON($content, $codeResponse);
|
|
return Utils::returnJSON($content, $codeResponse);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public function getONUDeletedToActive(Application $app)
|
|
|
|
+ {
|
|
|
|
+ $app->get('/api/v1/ftth/onu/deletedToActive', function (Application $app, Request $request) {
|
|
|
|
+ $codeResponse = 400;
|
|
|
|
+ try {
|
|
|
|
+ $config = $this->setUserPasswordConfig($request, Configuration::getDefaultConfiguration());
|
|
|
|
+ $apiInstance = new ONUApi(
|
|
|
|
+ new Client(),
|
|
|
|
+ $config
|
|
|
|
+ );
|
|
|
|
+ $ch = new Checks();
|
|
|
|
+ $id = $ch->integer($request, "id", true);
|
|
|
|
+ $workflow = "onu_workflow";
|
|
|
|
+ $transition = "deleted_active";
|
|
|
|
+ $apiInstance->setDisabledTenancy(true);
|
|
|
|
+ $result = $apiInstance->getById($id);
|
|
|
|
+ $apiInstance->setDisabledTenancy(false);
|
|
|
|
+ if (!is_null($result)) {
|
|
|
|
+ $apiInstance->apply($id, $workflow, $transition);
|
|
|
|
+ $apiInstance->setDisabledTenancy(true);
|
|
|
|
+ $result = $apiInstance->getById($id);
|
|
|
|
+ $apiInstance->setDisabledTenancy(false);
|
|
|
|
+ if ($result) {
|
|
|
|
+ $content = $result->__toString();
|
|
|
|
+ $codeResponse = 200;
|
|
|
|
+ } else {
|
|
|
|
+ $content = "No se pudo obtener el acceso cargado. Verifique por sistema si la carga se realizo correctamente.";
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ $content = "No se encontro la onu de id = " . $id;
|
|
|
|
+ }
|
|
|
|
+ } catch (Throwable $t) {
|
|
|
|
+ $content = $t->getCode() . " - " . $t->getMessage();
|
|
|
|
+ }
|
|
|
|
+ return Utils::returnJSON($content, $codeResponse);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
public function getONUSupply(Application $app)
|
|
public function getONUSupply(Application $app)
|
|
{
|
|
{
|
|
@@ -1221,7 +1259,7 @@ class Services extends ApiServices
|
|
"getPonSerialNumber");
|
|
"getPonSerialNumber");
|
|
if (is_null($result)) {
|
|
if (is_null($result)) {
|
|
$apiInstance->setDisabledTenancy(true);
|
|
$apiInstance->setDisabledTenancy(true);
|
|
- $result = $apiInstance->getList(null, null, null, null, null, null, null, null, null, $ponSerialNumber);
|
|
|
|
|
|
+ $result = $apiInstance->getList(null, null, null, null, null, null, null, null, null, null, $ponSerialNumber);
|
|
$apiInstance->setDisabledTenancy(false);
|
|
$apiInstance->setDisabledTenancy(false);
|
|
$result = $util->valueExistsLower($ponSerialNumber,
|
|
$result = $util->valueExistsLower($ponSerialNumber,
|
|
$result,
|
|
$result,
|
|
@@ -1229,7 +1267,7 @@ class Services extends ApiServices
|
|
}
|
|
}
|
|
if (is_null($result)) {
|
|
if (is_null($result)) {
|
|
$apiInstance->setDisabledTenancy(true);
|
|
$apiInstance->setDisabledTenancy(true);
|
|
- $result = $apiInstance->getList(null, null, null, null, null, null, null, null, $ponSerialNumber);
|
|
|
|
|
|
+ $result = $apiInstance->getList(null, null, null, null, null, null, null, null, null, $ponSerialNumber);
|
|
$apiInstance->setDisabledTenancy(false);
|
|
$apiInstance->setDisabledTenancy(false);
|
|
$result = $util->valueExistsLower($ponSerialNumber,
|
|
$result = $util->valueExistsLower($ponSerialNumber,
|
|
$result,
|
|
$result,
|