PHRAS-2816 #comment add attribute gui_visible to show fields on roll over and detailled view #time 2h

This commit is contained in:
Harrys Ravalomanana
2019-11-12 18:13:05 +04:00
parent beb57b3af2
commit 5f2617e5f7
14 changed files with 63 additions and 10 deletions

View File

@@ -45,6 +45,7 @@ class databox_field implements cache_cacheableInterface
protected $tbranch;
protected $generate_cterms;
protected $gui_editable;
protected $gui_visible;
protected $separator;
protected $thumbtitle;
@@ -170,6 +171,7 @@ class databox_field implements cache_cacheableInterface
$this->tbranch = $row['tbranch'];
$this->generate_cterms = (bool)$row['generate_cterms'];
$this->gui_editable = (bool)$row['gui_editable'];
$this->gui_visible = (bool)$row['gui_visible'];
$this->VocabularyType = $row['VocabularyControlType'];
$this->VocabularyRestriction = (bool)$row['RestrictToVocabularyControl'];
@@ -312,6 +314,7 @@ class databox_field implements cache_cacheableInterface
`tbranch` = :tbranch,
`generate_cterms` = :generate_cterms,
`gui_editable` = :gui_editable,
`gui_visible` = :gui_visible,
`sorter` = :position,
`thumbtitle` = :thumbtitle,
`VocabularyControlType` = :VocabularyControlType,
@@ -337,6 +340,7 @@ class databox_field implements cache_cacheableInterface
':tbranch' => $this->tbranch,
':generate_cterms' => $this->generate_cterms ? '1' : '0',
':gui_editable' => $this->gui_editable ? '1' : '0',
':gui_visible' => $this->gui_visible ? '1' : '0',
':position' => $this->position,
':thumbtitle' => $this->thumbtitle,
':VocabularyControlType' => $this->getVocabularyControl() ? $this->getVocabularyControl()->getType() : null,
@@ -390,6 +394,7 @@ class databox_field implements cache_cacheableInterface
$meta->setAttribute('tbranch', $this->tbranch);
$meta->setAttribute('generate_cterms', $this->generate_cterms ? '1' : '0');
$meta->setAttribute('gui_editable', $this->gui_editable ? '1' : '0');
$meta->setAttribute('gui_visible', $this->gui_visible ? '1' : '0');
if ($this->multi) {
$meta->setAttribute('separator', $this->separator);
}
@@ -743,6 +748,17 @@ class databox_field implements cache_cacheableInterface
return $this;
}
/**
* @param boolean $gui_visible
* @return databox_field
*/
public function set_gui_visible($gui_visible)
{
$this->gui_visible = $gui_visible;
return $this;
}
/**
*
* @param string $separator
@@ -845,6 +861,15 @@ class databox_field implements cache_cacheableInterface
return $this->gui_editable;
}
/**
*
* @return boolean
*/
public function get_gui_visible()
{
return $this->gui_visible;
}
/**
* @param Boolean $all If set to false, returns a one-char separator to use for serialiation
*
@@ -957,6 +982,7 @@ class databox_field implements cache_cacheableInterface
'tbranch' => $this->tbranch,
'generate_cterms' => $this->generate_cterms,
'gui_editable' => $this->gui_editable,
'gui_visible' => $this->gui_visible,
'separator' => $this->separator,
'required' => $this->required,
'report' => $this->report,
@@ -995,10 +1021,10 @@ class databox_field implements cache_cacheableInterface
}
$sql = "INSERT INTO metadatas_structure
(`id`, `name`, `src`, `readonly`, `gui_editable`, `required`, `indexable`, `type`, `tbranch`, `generate_cterms`,
(`id`, `name`, `src`, `readonly`, `gui_editable`,`gui_visible`, `required`, `indexable`, `type`, `tbranch`, `generate_cterms`,
`thumbtitle`, `multi`, `business`, `aggregable`,
`report`, `sorter`, `separator`)
VALUES (null, :name, '', 0, 1, 0, 1, 'string', '', 1,
VALUES (null, :name, '', 0, 1, 1, 0, 1, 'string', '', 1,
null, 0, 0, 0,
1, :sorter, '')";