From 7d52e00a51450bc4a080d4e21b7dda02c0a65191 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 14 Nov 2013 05:42:06 -0500
Subject: [PATCH] Fixed list sorting
---
interface/web/sites/form/database.tform.php | 68 ++++++++++++++++++++++-----------
1 files changed, 45 insertions(+), 23 deletions(-)
diff --git a/interface/web/sites/form/database.tform.php b/interface/web/sites/form/database.tform.php
index 973e690..58ce040 100644
--- a/interface/web/sites/form/database.tform.php
+++ b/interface/web/sites/form/database.tform.php
@@ -29,6 +29,11 @@
Hint:
The ID field of the database table is not part of the datafield definition.
The ID field must be always auto incement (int or bigint).
+
+ Search:
+ - searchable = 1 or searchable = 2 include the field in the search
+ - searchable = 1: this field will be the title of the search result
+ - searchable = 2: this field will be included in the description of the search result
*/
@@ -69,6 +74,17 @@
),
'value' => ''
),
+ 'parent_domain_id' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'SELECT',
+ 'default' => '',
+ 'datasource' => array ( 'type' => 'SQL',
+ 'querystring' => "SELECT web_domain.domain_id, CONCAT(web_domain.domain, ' :: ', server.server_name) AS parent_domain FROM web_domain, server WHERE web_domain.type = 'vhost' AND web_domain.server_id = server.server_id AND {AUTHSQL::web_domain} ORDER BY web_domain.domain",
+ 'keyfield'=> 'domain_id',
+ 'valuefield'=> 'parent_domain'
+ ),
+ 'value' => array('0' => 'select_site_txt')
+ ),
'type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
@@ -80,40 +96,45 @@
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'database_name_error_empty'),
- 1 => array ( 'type' => 'UNIQUE',
- 'errmsg'=> 'database_name_error_unique'),
- 2 => array ( 'type' => 'REGEX',
+ 1 => array ( 'type' => 'REGEX',
'regex' => '/^[a-zA-Z0-9_]{2,64}$/',
'errmsg'=> 'database_name_error_regex'),
),
'default' => '',
'value' => '',
'width' => '30',
- 'maxlength' => '255'
+ 'maxlength' => '255',
+ 'searchable' => 1
),
- 'database_user' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
- 'errmsg'=> 'database_user_error_empty'),
- 1 => array ( 'type' => 'UNIQUE',
- 'errmsg'=> 'database_user_error_unique'),
- 2 => array ( 'type' => 'REGEX',
- 'regex' => '/^[a-zA-Z0-9_]{2,64}$/',
- 'errmsg'=> 'database_user_error_regex'),
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'database_password' => array (
+ 'database_name_prefix' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '',
'value' => '',
'width' => '30',
- 'maxlength' => '255'
+ 'maxlength' => '25'
+ ),
+ 'database_user_id' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'SELECT',
+ 'default' => '',
+ 'datasource' => array ( 'type' => 'SQL',
+ 'querystring' => "SELECT database_user_id,database_user FROM web_database_user WHERE {AUTHSQL} ORDER BY database_user",
+ 'keyfield'=> 'database_user_id',
+ 'valuefield'=> 'database_user'
+ ),
+ 'value' => array('0' => 'select_dbuser_txt')
+ ),
+ 'database_ro_user_id' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'SELECT',
+ 'default' => '',
+ 'datasource' => array ( 'type' => 'SQL',
+ 'querystring' => "SELECT database_user_id,database_user FROM web_database_user WHERE {AUTHSQL} ORDER BY database_user",
+ 'keyfield'=> 'database_user_id',
+ 'valuefield'=> 'database_user'
+ ),
+ 'value' => array('0' => 'no_dbuser_txt')
),
'database_charset' => array (
'datatype' => 'VARCHAR',
@@ -143,7 +164,8 @@
),
'default' => '',
'value' => '',
- 'width' => '60'
+ 'width' => '60',
+ 'searchable' => 2
),
##################################
# ENDE Datatable fields
--
Gitblit v1.9.1