bug fix in commodities list and add sponsers message
This commit is contained in:
parent
a1943fe98a
commit
9b7a037514
|
@ -8,6 +8,7 @@ use App\Entity\PrinterQueue;
|
||||||
use App\Service\Jdate;
|
use App\Service\Jdate;
|
||||||
use App\Service\pdfMGR;
|
use App\Service\pdfMGR;
|
||||||
use App\Service\Provider;
|
use App\Service\Provider;
|
||||||
|
use App\Service\registryMGR;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
|
@ -55,7 +56,7 @@ class GeneralController extends AbstractController
|
||||||
#[Route('/front/print/{id}', name: 'app_front_print')]
|
#[Route('/front/print/{id}', name: 'app_front_print')]
|
||||||
public function app_front_print(Provider $provider, EntityManagerInterface $entityManager, PdfMGR $pdfMGR, string $id): Response
|
public function app_front_print(Provider $provider, EntityManagerInterface $entityManager, PdfMGR $pdfMGR, string $id): Response
|
||||||
{
|
{
|
||||||
|
|
||||||
$print = $entityManager->getRepository(PrinterQueue::class)->findOneBy(['pid' => $id]);
|
$print = $entityManager->getRepository(PrinterQueue::class)->findOneBy(['pid' => $id]);
|
||||||
|
|
||||||
if (!$print) {
|
if (!$print) {
|
||||||
|
@ -83,4 +84,10 @@ class GeneralController extends AbstractController
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[Route('/api/general/sponsors', name: 'api_general_sponsers')]
|
||||||
|
public function api_general_sponsers(registryMGR $registryMGR): JsonResponse
|
||||||
|
{
|
||||||
|
return $this->json(['result' => $registryMGR->get('system', 'sponsers')]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,8 @@ final class RegistrySettingsController extends AbstractController
|
||||||
'unlimitedDuration' => json_decode($registryMGR->get($rootSystem, 'unlimited_duration') ?: '[]', true),
|
'unlimitedDuration' => json_decode($registryMGR->get($rootSystem, 'unlimited_duration') ?: '[]', true),
|
||||||
'smsAlertEnabled' => filter_var($registryMGR->get($rootSystem, 'sms_alert_enabled'), FILTER_VALIDATE_BOOLEAN),
|
'smsAlertEnabled' => filter_var($registryMGR->get($rootSystem, 'sms_alert_enabled'), FILTER_VALIDATE_BOOLEAN),
|
||||||
'smsAlertMobile' => $registryMGR->get($rootTicket, 'managerMobile'),
|
'smsAlertMobile' => $registryMGR->get($rootTicket, 'managerMobile'),
|
||||||
|
'sponsorMessage' => $registryMGR->get('system', 'sponsers'),
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return new JsonResponse([
|
return new JsonResponse([
|
||||||
|
@ -75,6 +77,8 @@ final class RegistrySettingsController extends AbstractController
|
||||||
$registryMGR->update($rootSystem, 'unlimited_duration', json_encode($data['unlimitedDuration']));
|
$registryMGR->update($rootSystem, 'unlimited_duration', json_encode($data['unlimitedDuration']));
|
||||||
$registryMGR->update($rootSystem, 'sms_alert_enabled', $data['smsAlertEnabled'] ? '1' : '0');
|
$registryMGR->update($rootSystem, 'sms_alert_enabled', $data['smsAlertEnabled'] ? '1' : '0');
|
||||||
$registryMGR->update($rootTicket, 'managerMobile', $data['smsAlertMobile'] ?? '');
|
$registryMGR->update($rootTicket, 'managerMobile', $data['smsAlertMobile'] ?? '');
|
||||||
|
$registryMGR->update('system', 'sponsers', $data['sponsorMessage'] ?? '');
|
||||||
|
|
||||||
|
|
||||||
return new JsonResponse([
|
return new JsonResponse([
|
||||||
'result' => 1,
|
'result' => 1,
|
||||||
|
|
|
@ -162,7 +162,7 @@ final class UpdateCoreController extends AbstractController
|
||||||
$isRunning = !isset($state['error']) &&
|
$isRunning = !isset($state['error']) &&
|
||||||
!in_array('post_update_test', $state['completedSteps'] ?? []);
|
!in_array('post_update_test', $state['completedSteps'] ?? []);
|
||||||
|
|
||||||
$status = $state['error'] ? 'error' : ($isRunning ? 'running' : 'success');
|
$status = isset($state['error']) ? 'error' : ($isRunning ? 'running' : 'success');
|
||||||
echo "data: " . json_encode(['status' => $status, 'output' => $output]) . "\n\n";
|
echo "data: " . json_encode(['status' => $status, 'output' => $output]) . "\n\n";
|
||||||
ob_flush();
|
ob_flush();
|
||||||
flush();
|
flush();
|
||||||
|
|
|
@ -214,10 +214,14 @@ class Explore
|
||||||
'name' => $item->getUnit()->getName(),
|
'name' => $item->getUnit()->getName(),
|
||||||
'floatNumber' => $item->getUnit()->getFloatNumber(),
|
'floatNumber' => $item->getUnit()->getFloatNumber(),
|
||||||
],
|
],
|
||||||
|
'cat' => '',
|
||||||
];
|
];
|
||||||
if ($des) {
|
if ($des) {
|
||||||
$result['des'] = $des;
|
$result['des'] = $des;
|
||||||
}
|
}
|
||||||
|
if ($item->getCat()) {
|
||||||
|
$result['cat'] = $item->getCat()->getName();
|
||||||
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue