mirror of https://github.com/MISP/MISP
parent
3bec45dafa
commit
010260fbce
|
@ -115,7 +115,7 @@ class TemplateElementsController extends AppController {
|
|||
$this->request->data[$ModelType]['template_element_id'] = $this->TemplateElement->id;
|
||||
$this->TemplateElement->$ModelType->create();
|
||||
if ($this->TemplateElement->$ModelType->save($this->request->data)) {
|
||||
return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'success' => 'Element successfully added to template.')), 'status' => 200));
|
||||
return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'success' => 'Element successfully added to template.')), 'status' => 200, 'type' => 'json'));
|
||||
} else {
|
||||
$this->TemplateElement->delete($this->TemplateElement->id);
|
||||
$errorMessage = $this->TemplateElement->$ModelType->validationErrors;
|
||||
|
@ -135,7 +135,6 @@ class TemplateElementsController extends AppController {
|
|||
));
|
||||
$this->set('template_id', $templateElement['Template']['id']);
|
||||
if (!$this->_isSiteAdmin() && !$this->TemplateElement->Template->checkAuthorisation($id, $this->Auth->user(), true)) return new CakeResponse(array('body'=> json_encode(array('saved' => false, 'errors' => 'You are not authorised to do that.')), 'status' => 200, 'type' => 'json'));
|
||||
|
||||
if (!$this->request->is('ajax')) Throw new MethodNotAllowedException('This action is for ajax requests only.');
|
||||
if ($this->request->is('get')) {
|
||||
$this->set('id', $id);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="template_element_add_text">
|
||||
<?php
|
||||
echo $this->Form->create('TemplateElementText', array('id', 'url' => '/templateElements/add/text/' . $id));
|
||||
echo $this->Form->create('TemplateElementText', array('url' => '/templateElements/add/text/' . $id));
|
||||
?>
|
||||
<legend><?php echo __('Add Text Element To Template'); ?></legend>
|
||||
<fieldset>
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
<table>
|
||||
<tr>
|
||||
<td style="vertical-align:top">
|
||||
<span aria-label="Submit attribute element changes" title="Submit attribute element changes" class="btn btn-primary" onClick="return submitPopoverForm('<?php echo $id;?>', 'editAttributeElement', '<?php echo $template_id; ?>')">Submit</span>
|
||||
<span id="submitButton" aria-label="Submit attribute element changes" title="Submit attribute element changes" class="btn btn-primary" onClick="return submitPopoverForm('<?php echo $id;?>', 'editAttributeElement', '<?php echo $template_id; ?>')">Submit</span>
|
||||
</td>
|
||||
<td style="width:540px;">
|
||||
<p style="color:red;font-weight:bold;display:none;text-align:center" id="warning-message">Warning: You are about to share data that is of a classified nature (Attribution / targeting data). Make sure that you are authorised to share this.</p>
|
||||
|
|
Loading…
Reference in New Issue