[Database] Add fk_client_group_id to client query and refactor user session handling in GestionService
This commit is contained in:
parent
19c2ee1cec
commit
db3fa63eea
@ -2371,7 +2371,8 @@ class Bdd {
|
||||
client.id,
|
||||
client.nom as client_nom,
|
||||
client.prenom as client_prenom,
|
||||
client.entreprise as client_entreprise
|
||||
client.entreprise as client_entreprise,
|
||||
client.fk_client_group_id as fk_client_group_id
|
||||
FROM ".$this->tableprefix."client as client
|
||||
WHERE client.id = ?;";
|
||||
$clientList = $this->execSQLNoJsonReturn(
|
||||
|
||||
@ -50,6 +50,7 @@ use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCA\Gestion\Constants\DevisMentionConstant;
|
||||
use OCA\Gestion\Service\Devis\Pdf\DevisPdfService;
|
||||
use OCA\Gestion\Constants\VCalendarPropertyConstant;
|
||||
use function OCP\Log\logger;
|
||||
|
||||
class GestionService {
|
||||
/** @var Bdd */
|
||||
@ -80,18 +81,15 @@ class GestionService {
|
||||
|
||||
private IMAPClientFactory $clientFactory;
|
||||
|
||||
private ?string $currentUserId;
|
||||
|
||||
|
||||
public function __construct(
|
||||
?string $UserId,
|
||||
IUserSession $userSession,
|
||||
Bdd $gestionBdd,
|
||||
OrderBdd $orderBdd,
|
||||
LoggerInterface $logger,
|
||||
OrderPdfService $orderPdfService,
|
||||
DevisPdfService $devisPdfService,
|
||||
TalkService $talkService,
|
||||
IUserSession $userSession,
|
||||
IRootFolder $rootFolder,
|
||||
IMailer $mailer,
|
||||
IConfig $config,
|
||||
@ -101,7 +99,6 @@ class GestionService {
|
||||
|
||||
|
||||
) {
|
||||
$this->currentUserId = $UserId;
|
||||
$this->orderBdd = $orderBdd;
|
||||
$this->logger = $logger;
|
||||
$this->gestionBdd = $gestionBdd;
|
||||
@ -520,9 +517,9 @@ class GestionService {
|
||||
}
|
||||
$messageId = (int) $emailId;
|
||||
try {
|
||||
$message = $this->mailManager->getMessage($this->currentUserId, $messageId);
|
||||
$mailbox = $this->mailManager->getMailbox($this->currentUserId, $message->getMailboxId());
|
||||
$account = $this->accountService->find($this->currentUserId, $mailbox->getAccountId());
|
||||
$message = $this->mailManager->getMessage($this->userConnectedUuid, $messageId);
|
||||
$mailbox = $this->mailManager->getMailbox($this->userConnectedUuid, $message->getMailboxId());
|
||||
$account = $this->accountService->find($this->userConnectedUuid, $mailbox->getAccountId());
|
||||
|
||||
} catch (DoesNotExistException $e) {
|
||||
return [];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user