Added the option to override attribute creation in the freetext import tool for site admins

- site admins can now choose to create proposals instead of attributes via the freetext import tool via a checkbox
pull/897/head
Iglocska 2016-01-25 02:01:59 +01:00
parent dedc739da5
commit 3280338205
2 changed files with 7 additions and 0 deletions

View File

@ -2711,6 +2711,7 @@ class EventsController extends AppController {
'fields' => array('orgc_id', 'id', 'distribution', 'published', 'uuid'),
));
if (!$this->_isSiteAdmin() && !empty($event) && $event['Event']['orgc_id'] != $this->Auth->user('org_id')) $objectType = 'ShadowAttribute';
else if ($this->_isSiteAdmin() && isset($this->request->data['Attribute']['force']) && $this->request->data['Attribute']['force']) $objectType = 'ShadowAttribute';
else $objectType = 'Attribute';
$saved = 0;
$failed = 0;

View File

@ -3,6 +3,12 @@
<p>Below you can see the attributes that are to be created based on the results of the free-text import. Make sure that the categories and the types are correct, often several options will be offered based on an inconclusive automatic resolution. </p>
<?php
echo $this->Form->create('Attribute', array('url' => '/events/saveFreeText/' . $event_id));
if ($isSiteAdmin) {
echo $this->Form->input('force', array(
'checked' => false,
'label' => 'Proposals instead of attributes',
));
}
echo $this->Form->input('JsonObject', array(
'label' => false,
'type' => 'text',