Merge branch 'develop' into main
commit
35464623e1
|
@ -18,6 +18,20 @@ final class UserOrg extends AbstractMigration
|
||||||
*/
|
*/
|
||||||
public function change(): void
|
public function change(): void
|
||||||
{
|
{
|
||||||
|
<<<<<<< HEAD
|
||||||
|
$exists = $this->table('users')->hasColumn('organisation_id');
|
||||||
|
if (!$exists) {
|
||||||
|
$this->table('users')
|
||||||
|
->addColumn('organisation_id', 'integer', [
|
||||||
|
'default' => null,
|
||||||
|
'null' => true,
|
||||||
|
'signed' => false,
|
||||||
|
'length' => 10
|
||||||
|
])
|
||||||
|
->addIndex('organisation_id')
|
||||||
|
->update();
|
||||||
|
}
|
||||||
|
=======
|
||||||
$alignments = $this->table('users')
|
$alignments = $this->table('users')
|
||||||
->addColumn('organisation_id', 'integer', [
|
->addColumn('organisation_id', 'integer', [
|
||||||
'default' => null,
|
'default' => null,
|
||||||
|
@ -27,6 +41,7 @@ final class UserOrg extends AbstractMigration
|
||||||
])
|
])
|
||||||
->addIndex('organisation_id')
|
->addIndex('organisation_id')
|
||||||
->update();
|
->update();
|
||||||
|
>>>>>>> main
|
||||||
$q1 = $this->getQueryBuilder();
|
$q1 = $this->getQueryBuilder();
|
||||||
$org_id = $q1->select(['min(id)'])->from('organisations')->execute()->fetchAll()[0][0];
|
$org_id = $q1->select(['min(id)'])->from('organisations')->execute()->fetchAll()[0][0];
|
||||||
if (!empty($org_id)) {
|
if (!empty($org_id)) {
|
||||||
|
|
|
@ -71,6 +71,18 @@ class InstanceTable extends AppTable
|
||||||
public function searchAll($value, $limit=5, $model=null)
|
public function searchAll($value, $limit=5, $model=null)
|
||||||
{
|
{
|
||||||
$results = [];
|
$results = [];
|
||||||
|
|
||||||
|
// search in metafields. FIXME: To be replaced by the meta-template system
|
||||||
|
$metaFieldTable = TableRegistry::get('MetaFields');
|
||||||
|
$query = $metaFieldTable->find()->where([
|
||||||
|
'value LIKE' => '%' . $value . '%'
|
||||||
|
]);
|
||||||
|
$results['MetaFields']['amount'] = $query->count();
|
||||||
|
$result = $query->limit($limit)->all()->toList();
|
||||||
|
if (!empty($result)) {
|
||||||
|
$results['MetaFields']['entries'] = $result;
|
||||||
|
}
|
||||||
|
|
||||||
$models = $this->seachAllTables;
|
$models = $this->seachAllTables;
|
||||||
if (!is_null($model)) {
|
if (!is_null($model)) {
|
||||||
if (in_array($model, $this->seachAllTables)) {
|
if (in_array($model, $this->seachAllTables)) {
|
||||||
|
|
|
@ -19,14 +19,25 @@
|
||||||
</span>', h($tableName), $tableResult['amount']);
|
</span>', h($tableName), $tableResult['amount']);
|
||||||
|
|
||||||
foreach ($tableResult['entries'] as $entry) {
|
foreach ($tableResult['entries'] as $entry) {
|
||||||
$section .= sprintf('<a class="dropdown-item" href="%s">%s</a>',
|
if ($entry->getSource() == 'MetaFields') {
|
||||||
Cake\Routing\Router::URL([
|
$section .= sprintf('<a class="dropdown-item" href="%s">%s</a>',
|
||||||
'controller' => Cake\Utility\Inflector::pluralize($entry->getSource()),
|
Cake\Routing\Router::URL([
|
||||||
'action' => 'view',
|
'controller' => Cake\Utility\Inflector::pluralize($entry->scope),
|
||||||
h($entry['id'])
|
'action' => 'view',
|
||||||
]),
|
h($entry->parent_id)
|
||||||
h($entry[$fieldPath])
|
]),
|
||||||
);
|
sprintf('%s (%s::%s)', h($entry->value), h($entry->scope), h($entry->field))
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$section .= sprintf('<a class="dropdown-item" href="%s">%s</a>',
|
||||||
|
Cake\Routing\Router::URL([
|
||||||
|
'controller' => Cake\Utility\Inflector::pluralize($entry->getSource()),
|
||||||
|
'action' => 'view',
|
||||||
|
h($entry['id'])
|
||||||
|
]),
|
||||||
|
h($entry[$fieldPath])
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$remaining = $tableResult['amount'] - count($tableResult['entries']);
|
$remaining = $tableResult['amount'] - count($tableResult['entries']);
|
||||||
if ($remaining > 0) {
|
if ($remaining > 0) {
|
||||||
|
|
Loading…
Reference in New Issue