Merge branch '520-email-custom-field' into '3-3-0'
Resolve "cc/bcc Email Custom Fields Not Being Appended To Sent Emails" See merge request mike-koch/Mods-for-HESK!93master
commit
559f2d7011
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
namespace BusinessLogic\Tickets\CustomFields;
|
||||||
|
|
||||||
|
|
||||||
|
class CustomField {
|
||||||
|
/* @var $id int */
|
||||||
|
public $id;
|
||||||
|
|
||||||
|
/* @var $name string */
|
||||||
|
public $name;
|
||||||
|
|
||||||
|
/* @var $type string */
|
||||||
|
public $type;
|
||||||
|
|
||||||
|
/* @var $properties array */
|
||||||
|
public $properties;
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
namespace DataAccess\CustomFields;
|
||||||
|
|
||||||
|
use BusinessLogic\Tickets\CustomFields\CustomField;
|
||||||
|
use DataAccess\CommonDao;
|
||||||
|
|
||||||
|
class CustomFieldsGateway extends CommonDao {
|
||||||
|
public function getCustomField($id, $heskSettings) {
|
||||||
|
$this->init();
|
||||||
|
|
||||||
|
$rs = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($heskSettings['db_pfix']) . "custom_fields` WHERE `id` = " . intval($id));
|
||||||
|
|
||||||
|
if ($row = hesk_dbFetchAssoc($rs)) {
|
||||||
|
$customField = new CustomField();
|
||||||
|
$customField->id = $row['id'];
|
||||||
|
$names = json_decode($row['name'], true);
|
||||||
|
$customField->name = (isset($names[$heskSettings['language']])) ? $names[$heskSettings['language']] : reset($names);
|
||||||
|
$customField->type = $row['type'];
|
||||||
|
$customField->properties = json_decode($row['value'], true);
|
||||||
|
|
||||||
|
return $customField;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue