CRLF
This commit is contained in:
parent
a5a99da21e
commit
557b3f9c9b
2 changed files with 85 additions and 85 deletions
|
@ -556,19 +556,19 @@ class Application_Service_HistoryService
|
|||
return $fields;
|
||||
}
|
||||
|
||||
private function getSqlTypes() {
|
||||
|
||||
$fields = array(
|
||||
TEMPLATE_DATE => "date",
|
||||
TEMPLATE_TIME => "time",
|
||||
TEMPLATE_DATETIME => "datetime",
|
||||
TEMPLATE_STRING => "text",
|
||||
TEMPLATE_BOOLEAN => "boolean",
|
||||
TEMPLATE_INT => "integer",
|
||||
TEMPLATE_FLOAT => "float",
|
||||
);
|
||||
|
||||
return $fields;
|
||||
private function getSqlTypes() {
|
||||
|
||||
$fields = array(
|
||||
TEMPLATE_DATE => "date",
|
||||
TEMPLATE_TIME => "time",
|
||||
TEMPLATE_DATETIME => "datetime",
|
||||
TEMPLATE_STRING => "text",
|
||||
TEMPLATE_BOOLEAN => "boolean",
|
||||
TEMPLATE_INT => "integer",
|
||||
TEMPLATE_FLOAT => "float",
|
||||
);
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
public function getFileMetadataTypes() {
|
||||
|
@ -728,13 +728,13 @@ class Application_Service_HistoryService
|
|||
|
||||
public function getConfiguredTemplateIds() {
|
||||
|
||||
try {
|
||||
$id = Application_Model_Preference::GetHistoryItemTemplate();
|
||||
try {
|
||||
$id = Application_Model_Preference::GetHistoryItemTemplate();
|
||||
|
||||
return array($id);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
throw $e;
|
||||
return array($id);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -784,13 +784,13 @@ class Application_Service_HistoryService
|
|||
}
|
||||
}
|
||||
|
||||
public function updateItemTemplate($id, $name, $fields, $doSetDefault=false) {
|
||||
|
||||
$this->con->beginTransaction();
|
||||
|
||||
try {
|
||||
|
||||
$template = CcPlayoutHistoryTemplateQuery::create()->findPk($id, $this->con);
|
||||
public function updateItemTemplate($id, $name, $fields, $doSetDefault=false) {
|
||||
|
||||
$this->con->beginTransaction();
|
||||
|
||||
try {
|
||||
|
||||
$template = CcPlayoutHistoryTemplateQuery::create()->findPk($id, $this->con);
|
||||
$template->setDbName($name);
|
||||
|
||||
if (count($fields) === 0) {
|
||||
|
@ -798,33 +798,33 @@ class Application_Service_HistoryService
|
|||
$fields = $t["fields"];
|
||||
}
|
||||
|
||||
$template->getCcPlayoutHistoryTemplateFields()->delete($this->con);
|
||||
|
||||
foreach ($fields as $index=>$field) {
|
||||
|
||||
$isMd = ($field["isFileMd"] == 'true') ? true : false;
|
||||
|
||||
$templateField = new CcPlayoutHistoryTemplateField();
|
||||
$templateField->setDbName($field["name"]);
|
||||
$templateField->setDbType($field["type"]);
|
||||
$templateField->setDbIsFileMD($isMd);
|
||||
$templateField->setDbPosition($index);
|
||||
|
||||
$template->addCcPlayoutHistoryTemplateField($templateField);
|
||||
}
|
||||
|
||||
$template->save($this->con);
|
||||
|
||||
if ($doSetDefault) {
|
||||
$this->setConfiguredItemTemplate($template->getDbid());
|
||||
}
|
||||
|
||||
$this->con->commit();
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$this->con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
$template->getCcPlayoutHistoryTemplateFields()->delete($this->con);
|
||||
|
||||
foreach ($fields as $index=>$field) {
|
||||
|
||||
$isMd = ($field["isFileMd"] == 'true') ? true : false;
|
||||
|
||||
$templateField = new CcPlayoutHistoryTemplateField();
|
||||
$templateField->setDbName($field["name"]);
|
||||
$templateField->setDbType($field["type"]);
|
||||
$templateField->setDbIsFileMD($isMd);
|
||||
$templateField->setDbPosition($index);
|
||||
|
||||
$template->addCcPlayoutHistoryTemplateField($templateField);
|
||||
}
|
||||
|
||||
$template->save($this->con);
|
||||
|
||||
if ($doSetDefault) {
|
||||
$this->setConfiguredItemTemplate($template->getDbid());
|
||||
}
|
||||
|
||||
$this->con->commit();
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$this->con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteTemplate($id) {
|
||||
|
@ -836,11 +836,11 @@ class Application_Service_HistoryService
|
|||
$template = CcPlayoutHistoryTemplateQuery::create()->findPk($id, $this->con);
|
||||
$template->delete($this->con);
|
||||
|
||||
$this->con->commit();
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$this->con->rollback();
|
||||
throw $e;
|
||||
$this->con->commit();
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$this->con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue