Merge branch 'main' into develop
commit
3ae32606cc
|
@ -38,6 +38,7 @@ class InstanceController extends AppController
|
||||||
$searchValue = $this->request->getQuery('search');
|
$searchValue = $this->request->getQuery('search');
|
||||||
$model = $this->request->getQuery('model', null);
|
$model = $this->request->getQuery('model', null);
|
||||||
$limit = $this->request->getQuery('limit', 5);
|
$limit = $this->request->getQuery('limit', 5);
|
||||||
|
$limit = is_numeric($limit) ? $limit : 5;
|
||||||
if (!empty($this->request->getQuery('show_all', false))) {
|
if (!empty($this->request->getQuery('show_all', false))) {
|
||||||
$limit = null;
|
$limit = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ class InstanceTable extends AppTable
|
||||||
return $statistics;
|
return $statistics;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchAll($value, $user, $limit=5, $model=null)
|
public function searchAll($value, $user, int $limit=5, $model=null)
|
||||||
{
|
{
|
||||||
$results = [];
|
$results = [];
|
||||||
$models = $this->seachAllTables;
|
$models = $this->seachAllTables;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
$modelForForm = 'Individuals';
|
|
||||||
echo $this->element('genericElements/Form/genericForm', array(
|
echo $this->element('genericElements/Form/genericForm', array(
|
||||||
'data' => array(
|
'data' => array(
|
||||||
'description' => __('Individuals are natural persons. They are meant to describe the basic information about an individual that may or may not be a user of this community. Users in genral require an individual object to identify the person behind them - however, no user account is required to store information about an individual. Individuals can have affiliations to organisations and broods as well as cryptographic keys, using which their messages can be verified and which can be used to securely contact them.'),
|
'description' => __('Individuals are natural persons. They are meant to describe the basic information about an individual that may or may not be a user of this community. Users in genral require an individual object to identify the person behind them - however, no user account is required to store information about an individual. Individuals can have affiliations to organisations and broods as well as cryptographic keys, using which their messages can be verified and which can be used to securely contact them.'),
|
||||||
|
|
|
@ -46,10 +46,14 @@ echo $this->element('genericElements/IndexTable/index_table', [
|
||||||
'sort' => 'meta_template.id',
|
'sort' => 'meta_template.id',
|
||||||
'data_path' => 'meta_template.id',
|
'data_path' => 'meta_template.id',
|
||||||
'element' => 'function',
|
'element' => 'function',
|
||||||
'function' => function($row, $viewContext) {
|
'function' => function($row, $viewContext) use ($baseurl) {
|
||||||
return $viewContext->Bootstrap::node('a', [
|
if (!empty($row->meta_template)) {
|
||||||
|
return $viewContext->Bootstrap->node('a', [
|
||||||
'href' => h($baseurl . '/metaTemplates/view/' . $row->meta_template->id ?? ''),
|
'href' => h($baseurl . '/metaTemplates/view/' . $row->meta_template->id ?? ''),
|
||||||
], !empty($row->meta_template->name) ? (sprintf('%s (v%s)', h($row->meta_template->name), h($row->meta_template->version))) :'');
|
], !empty($row->meta_template->name) ? (sprintf('%s (v%s)', h($row->meta_template->name), h($row->meta_template->version))) :'');
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
|
@ -2,19 +2,10 @@
|
||||||
$seed = mt_rand();
|
$seed = mt_rand();
|
||||||
if (!is_array($fieldDesc)) {
|
if (!is_array($fieldDesc)) {
|
||||||
$fieldDesc = array('info' => $fieldDesc);
|
$fieldDesc = array('info' => $fieldDesc);
|
||||||
$default = 'info';
|
|
||||||
} else {
|
|
||||||
if (!empty($field['options'])) {
|
|
||||||
if (isset($this->request->data[$modelForForm][$field['field']])) {
|
|
||||||
$default = $this->request->data[$modelForForm][$field['field']];
|
|
||||||
} else {
|
|
||||||
reset($field['options']);
|
|
||||||
$default = key($field['options']);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
if (empty($field['options'])) {
|
||||||
reset($fieldDesc);
|
reset($fieldDesc);
|
||||||
$fieldDesc = array('info' => key($fieldDesc));
|
$fieldDesc = array('info' => key($fieldDesc));
|
||||||
$default = 'info';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$popoverID = sprintf("%sInfoPopover%s", h($field['field']), $seed);
|
$popoverID = sprintf("%sInfoPopover%s", h($field['field']), $seed);
|
||||||
|
@ -39,7 +30,7 @@
|
||||||
.text('<?php echo h(\Cake\Utility\Inflector::humanize($field['field'])); ?>')
|
.text('<?php echo h(\Cake\Utility\Inflector::humanize($field['field'])); ?>')
|
||||||
)
|
)
|
||||||
.append(
|
.append(
|
||||||
$('<span>').text(": <?= h($fieldDesc["info"]) ?>")
|
$('<span>').text(": <?= h($fieldDesc["info"] ?? '') ?>")
|
||||||
);
|
);
|
||||||
// var tempSelector = '#<?php echo h($modelForForm . \Cake\Utility\Inflector::camelize($field['field'])); ?>';
|
// var tempSelector = '#<?php echo h($modelForForm . \Cake\Utility\Inflector::camelize($field['field'])); ?>';
|
||||||
// if ($(tempSelector)[0].nodeName === "SELECT" && Object.keys(fieldDesc).length > 1) {
|
// if ($(tempSelector)[0].nodeName === "SELECT" && Object.keys(fieldDesc).length > 1) {
|
||||||
|
|
Loading…
Reference in New Issue