fix tabulator name field for orgs
This commit is contained in:
parent
0c758a9370
commit
8892cb3a7f
|
|
@ -1,7 +1,7 @@
|
||||||
import {Controller} from '@hotwired/stimulus'
|
import {Controller} from '@hotwired/stimulus'
|
||||||
// Important: include a build with Ajax + pagination (TabulatorFull is simplest)
|
// Important: include a build with Ajax + pagination (TabulatorFull is simplest)
|
||||||
import {TabulatorFull as Tabulator} from 'tabulator-tables';
|
import {TabulatorFull as Tabulator} from 'tabulator-tables';
|
||||||
import {eyeIconLink, TABULATOR_FR_LANG} from "../js/global.js";
|
import {capitalizeFirstLetter, eyeIconLink, TABULATOR_FR_LANG} from "../js/global.js";
|
||||||
import { Modal } from "bootstrap";
|
import { Modal } from "bootstrap";
|
||||||
|
|
||||||
export default class extends Controller {
|
export default class extends Controller {
|
||||||
|
|
@ -197,6 +197,7 @@ export default class extends Controller {
|
||||||
if (this.currentOrgId) {
|
if (this.currentOrgId) {
|
||||||
formData.append('_method', 'PUT');
|
formData.append('_method', 'PUT');
|
||||||
}
|
}
|
||||||
|
formData.set('name', capitalizeFirstLetter(formData.get('name')));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ class OrganizationController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
$organization->setProjectPrefix($this->organizationsService->generateUniqueProjectPrefix());
|
$organization->setProjectPrefix($this->organizationsService->generateUniqueProjectPrefix());
|
||||||
|
$organization->setName(ucFirst($organization->getName()));
|
||||||
$this->entityManager->persist($organization);
|
$this->entityManager->persist($organization);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
|
|
@ -165,6 +165,7 @@ class OrganizationController extends AbstractController
|
||||||
if ($logoFile) {
|
if ($logoFile) {
|
||||||
$this->organizationsService->handleLogo($organization, $logoFile);
|
$this->organizationsService->handleLogo($organization, $logoFile);
|
||||||
}
|
}
|
||||||
|
$organization->setName(ucFirst($organization->getName()));
|
||||||
$this->entityManager->persist($organization);
|
$this->entityManager->persist($organization);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
$this->actionService->createAction("Edit Organization", $actingUser, $organization, $organization->getName());
|
$this->actionService->createAction("Edit Organization", $actingUser, $organization, $organization->getName());
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class OrganizationsRepository extends ServiceEntityRepository
|
||||||
// 2. Filters
|
// 2. Filters
|
||||||
if (!empty($filters['name'])) {
|
if (!empty($filters['name'])) {
|
||||||
$qb->andWhere('o.name LIKE :name')
|
$qb->andWhere('o.name LIKE :name')
|
||||||
->setParameter('name', '%' . strtolower($filters['name']) . '%');
|
->setParameter('name', '%' . ucfirst($filters['name']) . '%');
|
||||||
}
|
}
|
||||||
if (!empty($filters['email'])) {
|
if (!empty($filters['email'])) {
|
||||||
$qb->andWhere('o.email LIKE :email')
|
$qb->andWhere('o.email LIKE :email')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue