|
@@ -30,6 +30,7 @@ class CaptivePortalController extends Controller
|
|
if(!is_null($client) && !is_null($psn)) {
|
|
if(!is_null($client) && !is_null($psn)) {
|
|
|
|
|
|
$em = $this->get("doctrine.orm.entity_manager");
|
|
$em = $this->get("doctrine.orm.entity_manager");
|
|
|
|
+ $em->getFilters()->disable('tenancy_filter');
|
|
$preSales = $em->getRepository(PreSale::class)->findBy(array('clientId' => $client));
|
|
$preSales = $em->getRepository(PreSale::class)->findBy(array('clientId' => $client));
|
|
$onu = $em->getRepository(ONU::class)->findOneBy(array('ponSerialNumber' => $psn));
|
|
$onu = $em->getRepository(ONU::class)->findOneBy(array('ponSerialNumber' => $psn));
|
|
|
|
|
|
@@ -41,7 +42,7 @@ class CaptivePortalController extends Controller
|
|
$sale = $em->getRepository(PreSale::class)->findOneById($preSale);
|
|
$sale = $em->getRepository(PreSale::class)->findOneById($preSale);
|
|
|
|
|
|
if($sale) {
|
|
if($sale) {
|
|
- $this->updateOnu($sale->getClientId(), $sale->getProfile(), $onu, $sale->getAddress());
|
|
|
|
|
|
+ $this->updateOnu($sale->getClientId(), $sale->getProfile(), $onu, $sale->getAddress(), $em);
|
|
|
|
|
|
$onu = $em->getRepository(ONU::class)->findOneBy(array('ponSerialNumber' => $psn));
|
|
$onu = $em->getRepository(ONU::class)->findOneBy(array('ponSerialNumber' => $psn));
|
|
|
|
|
|
@@ -53,6 +54,7 @@ class CaptivePortalController extends Controller
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ $em->getFilters()->enable('tenancy_filter');
|
|
}
|
|
}
|
|
|
|
|
|
return $this->render('FTTHBundle:Portal:index.html.twig', array(
|
|
return $this->render('FTTHBundle:Portal:index.html.twig', array(
|
|
@@ -64,14 +66,12 @@ class CaptivePortalController extends Controller
|
|
));
|
|
));
|
|
}
|
|
}
|
|
|
|
|
|
- private function updateOnu($clientId, $profile, $onu, $address) {
|
|
|
|
|
|
+ private function updateOnu($clientId, $profile, $onu, $address, $em) {
|
|
$onu->setClientId($clientId);
|
|
$onu->setClientId($clientId);
|
|
$onu->setProfile($profile);
|
|
$onu->setProfile($profile);
|
|
|
|
|
|
- $em = $this->get("doctrine.orm.entity_manager");
|
|
|
|
$em->persist($onu);
|
|
$em->persist($onu);
|
|
$em->flush();
|
|
$em->flush();
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|