1) user invitation 2) app access control 3) txn quota guard
This commit is contained in:
@@ -148,7 +148,17 @@ class ContactManager {
|
||||
*/
|
||||
public function saveContactType(array $data, array $logging): void
|
||||
{
|
||||
$id = (int)($data['id'] ?? 0);
|
||||
$id = (int)($data['id'] ?? 0);
|
||||
$name = (string)($data['contact_type'] ?? '');
|
||||
|
||||
$dupSth = $this->pdo->prepare(
|
||||
"SELECT id FROM md_contact_type
|
||||
WHERE company_id = :cid AND contact_type = :name" . ($id > 0 ? " AND id != :id" : "") . " LIMIT 1"
|
||||
);
|
||||
$dupParams = [':cid' => $this->company_id, ':name' => $name];
|
||||
if ($id > 0) $dupParams[':id'] = $id;
|
||||
$dupSth->execute($dupParams);
|
||||
if ($dupSth->fetchColumn()) throw new Exception("A contact type with this name already exists.");
|
||||
|
||||
$sth = $this->pdo->prepare(
|
||||
"SELECT `log` FROM md_contact_type
|
||||
|
||||
Reference in New Issue
Block a user