mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 13:33:14 +00:00
PHRAS-2808_disable-cterms_4.1
new : checkbox in admin/field to disable cterms generation. fix : when cterms is cleared (during reindex), rejected terms are kept WIP
This commit is contained in:
@@ -314,6 +314,7 @@ class FieldsController extends Controller
|
|||||||
->set_readonly($data['readonly'])
|
->set_readonly($data['readonly'])
|
||||||
->set_type($data['type'])
|
->set_type($data['type'])
|
||||||
->set_tbranch($data['tbranch'])
|
->set_tbranch($data['tbranch'])
|
||||||
|
->set_publish_cterms($data['publish_cterms'])
|
||||||
->set_report($data['report'])
|
->set_report($data['report'])
|
||||||
->setVocabularyControl(null)
|
->setVocabularyControl(null)
|
||||||
->setVocabularyRestricted(false);
|
->setVocabularyRestricted(false);
|
||||||
@@ -349,7 +350,7 @@ class FieldsController extends Controller
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name', 'multi', 'thumbtitle', 'tag', 'business', 'indexable', 'aggregable',
|
'name', 'multi', 'thumbtitle', 'tag', 'business', 'indexable', 'aggregable',
|
||||||
'required', 'separator', 'readonly', 'type', 'tbranch', 'report',
|
'required', 'separator', 'readonly', 'type', 'tbranch', 'publish_cterms', 'report',
|
||||||
'vocabulary-type', 'vocabulary-restricted', 'dces-element', 'labels'
|
'vocabulary-type', 'vocabulary-restricted', 'dces-element', 'labels'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -594,6 +594,7 @@ class V1Controller extends Controller
|
|||||||
],
|
],
|
||||||
'separator' => $databox_field->get_separator(),
|
'separator' => $databox_field->get_separator(),
|
||||||
'thesaurus_branch' => $databox_field->get_tbranch(),
|
'thesaurus_branch' => $databox_field->get_tbranch(),
|
||||||
|
'publish_cterms' => $databox_field->get_publish_cterms(),
|
||||||
'type' => $databox_field->get_type(),
|
'type' => $databox_field->get_type(),
|
||||||
'indexable' => $databox_field->is_indexable(),
|
'indexable' => $databox_field->is_indexable(),
|
||||||
'multivalue' => $databox_field->is_multi(),
|
'multivalue' => $databox_field->is_multi(),
|
||||||
|
@@ -75,6 +75,7 @@ class EditController extends Controller
|
|||||||
'format' => '',
|
'format' => '',
|
||||||
'explain' => '',
|
'explain' => '',
|
||||||
'tbranch' => $meta->get_tbranch(),
|
'tbranch' => $meta->get_tbranch(),
|
||||||
|
'publish_cterms' => $meta->get_publish_cterms(),
|
||||||
'maxLength' => $meta->get_tag()
|
'maxLength' => $meta->get_tag()
|
||||||
->getMaxLength(),
|
->getMaxLength(),
|
||||||
'minLength' => $meta->get_tag()
|
'minLength' => $meta->get_tag()
|
||||||
|
@@ -16,7 +16,7 @@ class Version
|
|||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $number = '4.1.0-alpha.15a';
|
private $number = '4.1.0-alpha.17a';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
|
@@ -36,6 +36,7 @@ final class DbalDataboxFieldRepository implements DataboxFieldRepository
|
|||||||
'label_fr',
|
'label_fr',
|
||||||
'label_de',
|
'label_de',
|
||||||
'label_nl',
|
'label_nl',
|
||||||
|
'publish_cterms',
|
||||||
];
|
];
|
||||||
|
|
||||||
/** @var DataboxFieldFactory */
|
/** @var DataboxFieldFactory */
|
||||||
|
@@ -42,7 +42,7 @@ class ThesaurusHydrator implements HydratorInterface
|
|||||||
$fields = [];
|
$fields = [];
|
||||||
$index_fields = [];
|
$index_fields = [];
|
||||||
foreach ($structure as $name => $field) {
|
foreach ($structure as $name => $field) {
|
||||||
$fields[$name] = $field->getThesaurusRoots();
|
$fields[$name] = $field; // ->getThesaurusRoots();
|
||||||
$index_fields[$name] = $field->getIndexField();
|
$index_fields[$name] = $field->getIndexField();
|
||||||
}
|
}
|
||||||
// Hydrate records with concepts
|
// Hydrate records with concepts
|
||||||
@@ -51,7 +51,13 @@ class ThesaurusHydrator implements HydratorInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function hydrate(array &$record, array $fields, array $index_fields)
|
/**
|
||||||
|
* @param array $record
|
||||||
|
* @param Field[] $fields
|
||||||
|
* @param array $index_fields
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
private function hydrate(array &$record, $fields, array $index_fields)
|
||||||
{
|
{
|
||||||
if (!isset($record['databox_id'])) {
|
if (!isset($record['databox_id'])) {
|
||||||
throw new Exception('Expected a record with the "databox_id" key set.');
|
throw new Exception('Expected a record with the "databox_id" key set.');
|
||||||
@@ -61,7 +67,8 @@ class ThesaurusHydrator implements HydratorInterface
|
|||||||
$terms = array();
|
$terms = array();
|
||||||
$filters = array();
|
$filters = array();
|
||||||
$field_names = array();
|
$field_names = array();
|
||||||
foreach ($fields as $name => $root_concepts) {
|
foreach ($fields as $name => $field) {
|
||||||
|
$root_concepts = $field->getThesaurusRoots();
|
||||||
// Loop through all values to prepare bulk query
|
// Loop through all values to prepare bulk query
|
||||||
$field_values = \igorw\get_in($record, explode('.', $index_fields[$name]));
|
$field_values = \igorw\get_in($record, explode('.', $index_fields[$name]));
|
||||||
if ($field_values !== null) {
|
if ($field_values !== null) {
|
||||||
@@ -84,13 +91,16 @@ class ThesaurusHydrator implements HydratorInterface
|
|||||||
$bulk = $this->thesaurus->findConceptsBulk($terms, null, $filters, true);
|
$bulk = $this->thesaurus->findConceptsBulk($terms, null, $filters, true);
|
||||||
|
|
||||||
foreach ($bulk as $offset => $item_concepts) {
|
foreach ($bulk as $offset => $item_concepts) {
|
||||||
|
$name = $field_names[$offset];
|
||||||
if ($item_concepts && is_array($item_concepts) && count($item_concepts)>0) {
|
if ($item_concepts && is_array($item_concepts) && count($item_concepts)>0) {
|
||||||
$name = $field_names[$offset];
|
|
||||||
foreach ($item_concepts as $concept) {
|
foreach ($item_concepts as $concept) {
|
||||||
$record['concept_path'][$name][] = $concept->getPath();
|
$record['concept_path'][$name][] = $concept->getPath();
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
$this->candidate_terms->insert($field_names[$offset], $values[$offset]);
|
else {
|
||||||
|
if(($fields[$name])->get_publish_cterms()) {
|
||||||
|
$this->candidate_terms->insert($field_names[$offset], $values[$offset]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -43,6 +43,8 @@ class Field implements Typed
|
|||||||
|
|
||||||
private $thesaurus_roots;
|
private $thesaurus_roots;
|
||||||
|
|
||||||
|
private $publish_cterms;
|
||||||
|
|
||||||
private $used_by_collections;
|
private $used_by_collections;
|
||||||
|
|
||||||
public static function createFromLegacyField(databox_field $field, $with = Structure::WITH_EVERYTHING)
|
public static function createFromLegacyField(databox_field $field, $with = Structure::WITH_EVERYTHING)
|
||||||
@@ -75,6 +77,7 @@ class Field implements Typed
|
|||||||
'private' => $field->isBusiness(),
|
'private' => $field->isBusiness(),
|
||||||
'facet' => $facet,
|
'facet' => $facet,
|
||||||
'thesaurus_roots' => $roots,
|
'thesaurus_roots' => $roots,
|
||||||
|
'publish_cterms' => $field->get_publish_cterms(),
|
||||||
'used_by_collections' => $databox->get_collection_unique_ids()
|
'used_by_collections' => $databox->get_collection_unique_ids()
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -103,6 +106,7 @@ class Field implements Typed
|
|||||||
$this->is_private = \igorw\get_in($options, ['private'], false);
|
$this->is_private = \igorw\get_in($options, ['private'], false);
|
||||||
$this->facet = \igorw\get_in($options, ['facet']);
|
$this->facet = \igorw\get_in($options, ['facet']);
|
||||||
$this->thesaurus_roots = \igorw\get_in($options, ['thesaurus_roots'], null);
|
$this->thesaurus_roots = \igorw\get_in($options, ['thesaurus_roots'], null);
|
||||||
|
$this->publish_cterms = \igorw\get_in($options, ['publish_cterms'], false);
|
||||||
$this->used_by_collections = \igorw\get_in($options, ['used_by_collections'], []);
|
$this->used_by_collections = \igorw\get_in($options, ['used_by_collections'], []);
|
||||||
|
|
||||||
Assertion::boolean($this->is_searchable);
|
Assertion::boolean($this->is_searchable);
|
||||||
@@ -126,6 +130,7 @@ class Field implements Typed
|
|||||||
'private' => $this->is_private,
|
'private' => $this->is_private,
|
||||||
'facet' => $this->facet,
|
'facet' => $this->facet,
|
||||||
'thesaurus_roots' => $this->thesaurus_roots,
|
'thesaurus_roots' => $this->thesaurus_roots,
|
||||||
|
'publish_cterms' => $this->publish_cterms,
|
||||||
'used_by_collections' => $this->used_by_collections
|
'used_by_collections' => $this->used_by_collections
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -190,6 +195,11 @@ class Field implements Typed
|
|||||||
return $this->thesaurus_roots;
|
return $this->thesaurus_roots;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function get_publish_cterms()
|
||||||
|
{
|
||||||
|
return $this->publish_cterms;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merge with another field, returning the new instance
|
* Merge with another field, returning the new instance
|
||||||
*
|
*
|
||||||
|
@@ -462,6 +462,7 @@ class databox extends base implements ThumbnailedElement
|
|||||||
->set_aggregable((isset($field['aggregable']) ? (string) $field['aggregable'] : 0))
|
->set_aggregable((isset($field['aggregable']) ? (string) $field['aggregable'] : 0))
|
||||||
->set_type($type)
|
->set_type($type)
|
||||||
->set_tbranch(isset($field['tbranch']) ? (string) $field['tbranch'] : '')
|
->set_tbranch(isset($field['tbranch']) ? (string) $field['tbranch'] : '')
|
||||||
|
->set_publish_cterms((isset($field['publish_cterms']) && (string) $field['publish_cterms'] == 1))
|
||||||
->set_thumbtitle(isset($field['thumbtitle']) ? (string) $field['thumbtitle'] : (isset($field['thumbTitle']) ? $field['thumbTitle'] : '0'))
|
->set_thumbtitle(isset($field['thumbtitle']) ? (string) $field['thumbtitle'] : (isset($field['thumbTitle']) ? $field['thumbTitle'] : '0'))
|
||||||
->set_report(isset($field['report']) ? (string) $field['report'] : '1')
|
->set_report(isset($field['report']) ? (string) $field['report'] : '1')
|
||||||
->save();
|
->save();
|
||||||
@@ -1214,21 +1215,40 @@ class databox extends base implements ThumbnailedElement
|
|||||||
$domct = $this->get_dom_cterms();
|
$domct = $this->get_dom_cterms();
|
||||||
|
|
||||||
if ($domct !== false) {
|
if ($domct !== false) {
|
||||||
|
$changed = false;
|
||||||
$nodesToDel = [];
|
$nodesToDel = [];
|
||||||
|
// loop on first level : "fields"
|
||||||
for($n = $domct->documentElement->firstChild; $n; $n = $n->nextSibling) {
|
for($n = $domct->documentElement->firstChild; $n; $n = $n->nextSibling) {
|
||||||
if($n->nodeType == XML_ELEMENT_NODE && !($n->getAttribute('delbranch'))){
|
if($n->nodeType == XML_ELEMENT_NODE && !($n->getAttribute('delbranch'))){
|
||||||
$nodesToDel[] = $n;
|
$nodesToDel2 = [];
|
||||||
|
// loop on 2nd level : "terms"
|
||||||
|
for($n2 = $n->firstChild; $n2; $n2 = $n2->nextSibling) {
|
||||||
|
// do not remove "rejected" candidates
|
||||||
|
if(substr($n2->getAttribute('id'), 0, 1) != 'R') {
|
||||||
|
$nodesToDel2[] = $n2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach($nodesToDel2 as $n2) {
|
||||||
|
$n->removeChild($n2);
|
||||||
|
$changed = true;
|
||||||
|
}
|
||||||
|
// if a field has no more candidates, we can remove it
|
||||||
|
if(!($n->firstChild)) {
|
||||||
|
$nodesToDel[] = $n;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach($nodesToDel as $n) {
|
foreach($nodesToDel as $n) {
|
||||||
$n->parentNode->removeChild($n);
|
$n->parentNode->removeChild($n);
|
||||||
|
$changed = true;
|
||||||
}
|
}
|
||||||
if(!empty($nodesToDel)) {
|
if($changed) {
|
||||||
$this->saveCterms($domct);
|
$this->saveCterms($domct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
}
|
||||||
|
catch (\Exception $e) {
|
||||||
|
// no-op
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -43,6 +43,7 @@ class databox_field implements cache_cacheableInterface
|
|||||||
protected $report;
|
protected $report;
|
||||||
protected $type;
|
protected $type;
|
||||||
protected $tbranch;
|
protected $tbranch;
|
||||||
|
protected $publish_cterms;
|
||||||
protected $separator;
|
protected $separator;
|
||||||
protected $thumbtitle;
|
protected $thumbtitle;
|
||||||
|
|
||||||
@@ -166,6 +167,7 @@ class databox_field implements cache_cacheableInterface
|
|||||||
$this->position = (int)$row['sorter'];
|
$this->position = (int)$row['sorter'];
|
||||||
$this->type = $row['type'] ?: self::TYPE_STRING;
|
$this->type = $row['type'] ?: self::TYPE_STRING;
|
||||||
$this->tbranch = $row['tbranch'];
|
$this->tbranch = $row['tbranch'];
|
||||||
|
$this->publish_cterms = (bool)$row['publish_cterms'];
|
||||||
$this->VocabularyType = $row['VocabularyControlType'];
|
$this->VocabularyType = $row['VocabularyControlType'];
|
||||||
$this->VocabularyRestriction = (bool)$row['RestrictToVocabularyControl'];
|
$this->VocabularyRestriction = (bool)$row['RestrictToVocabularyControl'];
|
||||||
|
|
||||||
@@ -306,6 +308,7 @@ class databox_field implements cache_cacheableInterface
|
|||||||
`report` = :report,
|
`report` = :report,
|
||||||
`type` = :type,
|
`type` = :type,
|
||||||
`tbranch` = :tbranch,
|
`tbranch` = :tbranch,
|
||||||
|
`publish_cterms` = :publish_cterms,
|
||||||
`sorter` = :position,
|
`sorter` = :position,
|
||||||
`thumbtitle` = :thumbtitle,
|
`thumbtitle` = :thumbtitle,
|
||||||
`VocabularyControlType` = :VocabularyControlType,
|
`VocabularyControlType` = :VocabularyControlType,
|
||||||
@@ -329,6 +332,7 @@ class databox_field implements cache_cacheableInterface
|
|||||||
':report' => $this->report ? '1' : '0',
|
':report' => $this->report ? '1' : '0',
|
||||||
':type' => $this->type,
|
':type' => $this->type,
|
||||||
':tbranch' => $this->tbranch,
|
':tbranch' => $this->tbranch,
|
||||||
|
':publish_cterms' => $this->publish_cterms ? '1' : '0',
|
||||||
':position' => $this->position,
|
':position' => $this->position,
|
||||||
':thumbtitle' => $this->thumbtitle,
|
':thumbtitle' => $this->thumbtitle,
|
||||||
':VocabularyControlType' => $this->getVocabularyControl() ? $this->getVocabularyControl()->getType() : null,
|
':VocabularyControlType' => $this->getVocabularyControl() ? $this->getVocabularyControl()->getType() : null,
|
||||||
@@ -380,6 +384,7 @@ class databox_field implements cache_cacheableInterface
|
|||||||
$meta->setAttribute('aggregable', $this->aggregable);
|
$meta->setAttribute('aggregable', $this->aggregable);
|
||||||
$meta->setAttribute('type', $this->type);
|
$meta->setAttribute('type', $this->type);
|
||||||
$meta->setAttribute('tbranch', $this->tbranch);
|
$meta->setAttribute('tbranch', $this->tbranch);
|
||||||
|
$meta->setAttribute('publish_cterms', $this->publish_cterms ? '1' : '0');
|
||||||
if ($this->multi) {
|
if ($this->multi) {
|
||||||
$meta->setAttribute('separator', $this->separator);
|
$meta->setAttribute('separator', $this->separator);
|
||||||
}
|
}
|
||||||
@@ -711,6 +716,17 @@ class databox_field implements cache_cacheableInterface
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param boolean $publish_cterms
|
||||||
|
* @return databox_field
|
||||||
|
*/
|
||||||
|
public function set_publish_cterms($publish_cterms)
|
||||||
|
{
|
||||||
|
$this->publish_cterms = $publish_cterms;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param string $separator
|
* @param string $separator
|
||||||
@@ -795,6 +811,15 @@ class databox_field implements cache_cacheableInterface
|
|||||||
return $this->tbranch;
|
return $this->tbranch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function get_publish_cterms()
|
||||||
|
{
|
||||||
|
return $this->publish_cterms;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Boolean $all If set to false, returns a one-char separator to use for serialiation
|
* @param Boolean $all If set to false, returns a one-char separator to use for serialiation
|
||||||
*
|
*
|
||||||
@@ -905,6 +930,7 @@ class databox_field implements cache_cacheableInterface
|
|||||||
'sorter' => $this->position,
|
'sorter' => $this->position,
|
||||||
'thumbtitle' => $this->thumbtitle,
|
'thumbtitle' => $this->thumbtitle,
|
||||||
'tbranch' => $this->tbranch,
|
'tbranch' => $this->tbranch,
|
||||||
|
'publish_cterms' => $this->publish_cterms,
|
||||||
'separator' => $this->separator,
|
'separator' => $this->separator,
|
||||||
'required' => $this->required,
|
'required' => $this->required,
|
||||||
'report' => $this->report,
|
'report' => $this->report,
|
||||||
@@ -943,10 +969,10 @@ class databox_field implements cache_cacheableInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "INSERT INTO metadatas_structure
|
$sql = "INSERT INTO metadatas_structure
|
||||||
(`id`, `name`, `src`, `readonly`, `required`, `indexable`, `type`, `tbranch`,
|
(`id`, `name`, `src`, `readonly`, `required`, `indexable`, `type`, `tbranch`, `publish_cterms`,
|
||||||
`thumbtitle`, `multi`, `business`, `aggregable`,
|
`thumbtitle`, `multi`, `business`, `aggregable`,
|
||||||
`report`, `sorter`, `separator`)
|
`report`, `sorter`, `separator`)
|
||||||
VALUES (null, :name, '', 0, 0, 1, 'string', '',
|
VALUES (null, :name, '', 0, 0, 1, 'string', '', 1,
|
||||||
null, 0, 0, 0,
|
null, 0, 0, 0,
|
||||||
1, :sorter, '')";
|
1, :sorter, '')";
|
||||||
|
|
||||||
|
65
lib/classes/patch/410alpha17a.php
Normal file
65
lib/classes/patch/410alpha17a.php
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2016 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
|
class patch_410alpha17a implements patchInterface
|
||||||
|
{
|
||||||
|
/** @var string */
|
||||||
|
private $release = '4.1.0-alpha.17a';
|
||||||
|
|
||||||
|
/** @var array */
|
||||||
|
private $concern = [base::DATA_BOX];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function get_release()
|
||||||
|
{
|
||||||
|
return $this->release;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function require_all_upgrades()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function concern()
|
||||||
|
{
|
||||||
|
return $this->concern;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function apply(base $databox, Application $app)
|
||||||
|
{
|
||||||
|
// -- done by xml schema --
|
||||||
|
// $sql = "ALTER TABLE `metadatas_structure` ADD `publish_cterms` INT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `tbranch`";
|
||||||
|
// $databox->get_connection()->executeQuery($sql);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@@ -2033,6 +2033,14 @@
|
|||||||
<default></default>
|
<default></default>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
</field>
|
</field>
|
||||||
|
<field>
|
||||||
|
<name>publish_cterms</name>
|
||||||
|
<type>int(1) unsigned</type>
|
||||||
|
<null></null>
|
||||||
|
<extra></extra>
|
||||||
|
<default></default>
|
||||||
|
<comment></comment>
|
||||||
|
</field>
|
||||||
</fields>
|
</fields>
|
||||||
<indexes>
|
<indexes>
|
||||||
<index>
|
<index>
|
||||||
|
@@ -247,6 +247,10 @@
|
|||||||
<td><label for="tbranch">{% trans %}Thesaurus branch{% endtrans %}</label></td>
|
<td><label for="tbranch">{% trans %}Thesaurus branch{% endtrans %}</label></td>
|
||||||
<td><input id="tbranch" type="text" value="<%= field.tbranch %>"/></td>
|
<td><input id="tbranch" type="text" value="<%= field.tbranch %>"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="publish_cterms" class="checkbox">{% trans %}publish_cterms{% endtrans %}</label></td>
|
||||||
|
<td><input id="publish_cterms" type="checkbox" <%= field.publish_cterms ? "checked='checked'" : "" %> /></td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -26,6 +26,7 @@ define([
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"thumbtitle": "0",
|
"thumbtitle": "0",
|
||||||
"tbranch": "",
|
"tbranch": "",
|
||||||
|
"publish_cterms": false,
|
||||||
"separator": "",
|
"separator": "",
|
||||||
"required": false,
|
"required": false,
|
||||||
"report": true,
|
"report": true,
|
||||||
|
@@ -44,6 +44,10 @@ define([
|
|||||||
this.field.get('tbranch').should.equal("");
|
this.field.get('tbranch').should.equal("");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should default publish_cterms property to '0'", function () {
|
||||||
|
this.field.get('publish_cterms').should.equal("0");
|
||||||
|
});
|
||||||
|
|
||||||
it("should default separator property to 'empty'", function () {
|
it("should default separator property to 'empty'", function () {
|
||||||
this.field.get('separator').should.equal("");
|
this.field.get('separator').should.equal("");
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user