Commit 222ea214 authored by cfoe's avatar cfoe
Browse files

standard sorting by main characteristic for most lists

parent 14b91f58
......@@ -101,7 +101,7 @@ class page_action extends tform_actions {
global $app;
$sql = "SELECT template_id,template_name FROM client_template WHERE template_type = 'a'";
$sql = "SELECT template_id,template_name FROM client_template WHERE template_type = 'a' ORDER BY template_name ASC";
$tpls = $app->db->queryAllRecords($sql);
$option = '';
$tpl = array();
......
......@@ -44,5 +44,6 @@ $app->auth->check_module_permissions('client');
if(!$_SESSION["s"]["user"]["typ"] == 'admin') die('Client-Templates are only for Admins.');
$app->uses('listform_actions');
$app->listform_actions->SQLOrderBy = 'ORDER BY template_name';
$app->listform_actions->onLoad();
?>
......@@ -38,16 +38,16 @@
*/
$form["title"] = "Client";
$form["description"] = "";
$form["name"] = "client";
$form["action"] = "client_edit.php";
$form["db_table"] = "client";
$form["title"] = "Client";
$form["description"] = "";
$form["name"] = "client";
$form["action"] = "client_edit.php";
$form["db_table"] = "client";
$form["db_table_idx"] = "client_id";
$form["db_history"] = "yes";
$form["db_history"] = "yes";
$form["tab_default"] = "address";
$form["list_default"] = "client_list.php";
$form["auth"] = 'yes';
$form["auth"] = 'yes';
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
......@@ -101,9 +101,9 @@ $form["tabs"]['address'] = array (
'contact_name' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'contact_error_empty'),
),
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'contact_error_empty'),
),
'default' => '',
'value' => '',
'separator' => '',
......@@ -129,19 +129,19 @@ $form["tabs"]['address'] = array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'username_error_empty'),
1 => array ( 'type' => 'CUSTOM',
'class' => 'validate_client',
'function' => 'username_unique',
'errmsg'=> 'username_error_unique'),
2 => array ( 'type' => 'CUSTOM',
'class' => 'validate_client',
'function' => 'username_collision',
'errmsg'=> 'username_error_collision'),
3 => array ( 'type' => 'REGEX',
'regex' => '/^[\w\.\-\_]{0,64}$/',
'errmsg'=> 'username_error_regex'),
),
'errmsg'=> 'username_error_empty'),
1 => array ( 'type' => 'CUSTOM',
'class' => 'validate_client',
'function' => 'username_unique',
'errmsg'=> 'username_error_unique'),
2 => array ( 'type' => 'CUSTOM',
'class' => 'validate_client',
'function' => 'username_collision',
'errmsg'=> 'username_error_collision'),
3 => array ( 'type' => 'REGEX',
'regex' => '/^[\w\.\-\_]{0,64}$/',
'errmsg'=> 'username_error_regex'),
),
'default' => '',
'value' => '',
'separator' => '',
......@@ -235,14 +235,13 @@ $form["tabs"]['address'] = array (
),
'country' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => (isset($conf['language']) ? strtoupper($conf['language']) : ''),
'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT iso,printable_name FROM country ORDER BY printable_name',
'keyfield'=> 'iso',
'valuefield'=> 'printable_name'
),
'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT iso,printable_name FROM country ORDER BY iso ASC',
'keyfield' => 'iso',
'valuefield' => 'printable_name'
),
'value' => ''
),
'telephone' => array (
......
......@@ -13,13 +13,13 @@
// Name of the list
$liste["name"] = "clients";
$liste["name"] = "clients";
// Database table
$liste["table"] = "client";
$liste["table"] = "client";
// Index index field of the database table
$liste["table_idx"] = "client_id";
$liste["table_idx"] = "client_id";
// Search Field Prefix
$liste["search_prefix"] = "search_";
......@@ -28,10 +28,10 @@ $liste["search_prefix"] = "search_";
$liste["records_per_page"] = "15";
// Script File of the list
$liste["file"] = "client_list.php";
$liste["file"] = "client_list.php";
// Script file of the edit form
$liste["edit_file"] = "client_edit.php";
$liste["edit_file"] = "client_edit.php";
// Script File of the delete script
$liste["delete_file"] = "client_del.php";
......@@ -40,66 +40,65 @@ $liste["delete_file"] = "client_del.php";
$liste["paging_tpl"] = "templates/paging.tpl.htm";
// Enable authe
$liste["auth"] = "yes";
$liste["auth"] = "yes";
/*****************************************************
* Suchfelder
*****************************************************/
$liste["item"][] = array( 'field' => "client_id",
'datatype' => "INTEGER",
'formtype' => "TEXT",
'op' => "=",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "company_name",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "contact_name",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "username",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "city",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "country",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "client_id",
'datatype' => "INTEGER",
'formtype' => "TEXT",
'op' => "=",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "company_name",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "contact_name",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "username",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "city",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "country",
'datatype' => "VARCHAR",
'formtype' => "SELECT",
'op' => "=",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => "");
?>
\ No newline at end of file
......@@ -13,13 +13,13 @@
// Name of the list
$liste["name"] = "resellers";
$liste["name"] = "resellers";
// Database table
$liste["table"] = "client";
$liste["table"] = "client";
// Index index field of the database table
$liste["table_idx"] = "client_id";
$liste["table_idx"] = "client_id";
// Search Field Prefix
$liste["search_prefix"] = "search_";
......@@ -28,10 +28,10 @@ $liste["search_prefix"] = "search_";
$liste["records_per_page"] = "15";
// Script File of the list
$liste["file"] = "reseller_list.php";
$liste["file"] = "reseller_list.php";
// Script file of the edit form
$liste["edit_file"] = "reseller_edit.php";
$liste["edit_file"] = "reseller_edit.php";
// Script File of the delete script
$liste["delete_file"] = "reseller_del.php";
......@@ -40,57 +40,56 @@ $liste["delete_file"] = "reseller_del.php";
$liste["paging_tpl"] = "templates/paging.tpl.htm";
// Enable authe
$liste["auth"] = "yes";
$liste["auth"] = "yes";
/*****************************************************
* Suchfelder
*****************************************************/
$liste["item"][] = array( 'field' => "client_id",
'datatype' => "INTEGER",
'formtype' => "TEXT",
'op' => "=",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "company_name",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "contact_name",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "city",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "country",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "client_id",
'datatype' => "INTEGER",
'formtype' => "TEXT",
'op' => "=",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "company_name",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "contact_name",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "city",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "country",
'datatype' => "VARCHAR",
'formtype' => "SELECT",
'op' => "=",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => "");
?>
\ No newline at end of file
......@@ -32,7 +32,7 @@
<td class="tbl_col_contact_name"><input type="text" name="search_contact_name" value="{tmpl_var name='search_contact_name'}" style="width:120px;" /></td>
<td class="tbl_col_username"><input type="text" name="search_username" value="{tmpl_var name='search_username'}" style="width:120px;" /></td>
<td class="tbl_col_city"><input type="text" name="search_city" value="{tmpl_var name='search_city'}" style="width:120px;" /></td>
<td class="tbl_col_country"><input type="text" name="search_country" value="{tmpl_var name='search_country'}" style="width:30px;" /></td>
<td class="tbl_col_country"><select name="search_country" style="width:120px;">{tmpl_var name='search_country'}</select></td>
<td class="tbl_col_buttons"><div class="buttons"><button type="button" class="icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onClick="submitForm('pageForm','client/client_list.php');"><span>{tmpl_var name="filter_txt"}</span></button></div></td>
</tr>
</thead>
......
......@@ -30,7 +30,7 @@
<td class="tbl_col_company_name"><input type="text" name="search_company_name" value="{tmpl_var name='search_company_name'}" style="width:120px;" /></td>
<td class="tbl_col_contact_name"><input type="text" name="search_contact_name" value="{tmpl_var name='search_contact_name'}" style="width:120px;" /></td>
<td class="tbl_col_city"><input type="text" name="search_city" value="{tmpl_var name='search_city'}" style="width:120px;" /></td>
<td class="tbl_col_country"><input type="text" name="search_country" value="{tmpl_var name='search_country'}" style="width:30px;" /></td>
<td class="tbl_col_country"><select name="search_country" style="width:120px;">{tmpl_var name='search_country'}</select></td>
<td class="tbl_col_buttons"><div class="buttons"><button type="button" class="icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onClick="submitForm('pageForm','client/reseller_list.php');"><span>{tmpl_var name="filter_txt"}</span></button></div></td>
</tr>
</thead>
......
......@@ -18,6 +18,7 @@ $app->auth->check_module_permissions('dns');
$app->uses('listform_actions');
// $app->listform_actions->SQLExtWhere = "access = 'REJECT'";
$app->listform_actions->SQLOrderBy = 'ORDER BY name';
$app->listform_actions->onLoad();
......
......@@ -56,7 +56,7 @@ if($_SESSION['s']['user']['typ'] == 'admin') {
// Load the templates
$records = $app->db->queryAllRecords("SELECT * FROM dns_template WHERE visible = 'Y'");
$records = $app->db->queryAllRecords("SELECT * FROM dns_template WHERE visible = 'Y' ORDER BY name ASC");
$template_id_option = '';
$n = 0;
foreach($records as $rec){
......
......@@ -13,13 +13,13 @@
// Name of the list
$liste["name"] = "dns_slave";
$liste["name"] = "dns_slave";
// Database table
$liste["table"] = "dns_slave";
$liste["table"] = "dns_slave";
// Index index field of the database table
$liste["table_idx"] = "id";
$liste["table_idx"] = "id";
// Search Field Prefix
$liste["search_prefix"] = "search_";
......@@ -28,10 +28,10 @@ $liste["search_prefix"] = "search_";
$liste["records_per_page"] = "15";
// Script File of the list
$liste["file"] = "dns_slave_list.php";
$liste["file"] = "dns_slave_list.php";
// Script file of the edit form
$liste["edit_file"] = "dns_slave_edit.php";
$liste["edit_file"] = "dns_slave_edit.php";
// Script File of the delete script
$liste["delete_file"] = "dns_slave_del.php";
......@@ -40,7 +40,7 @@ $liste["delete_file"] = "dns_slave_del.php";
$liste["paging_tpl"] = "templates/paging.tpl.htm";
// Enable auth
$liste["auth"] = "yes";
$liste["auth"] = "yes";
/*****************************************************
......@@ -48,50 +48,46 @@ $liste["auth"] = "yes";
*****************************************************/
$liste["item"][] = array( 'field' => "active",
'datatype' => "VARCHAR",
'formtype' => "SELECT",
'op' => "=",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => array('Y' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>",'N' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>"));
$liste["item"][] = array( 'field' => "server_id",
'datatype' => "VARCHAR",
'formtype' => "SELECT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'datasource' => array ( 'type' => 'CUSTOM',
'class'=> 'custom_datasource',
'function'=> 'dns_servers'
),
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "origin",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "ns",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "active",
'datatype' => "VARCHAR",
'formtype' => "SELECT",
'op' => "=",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => array('Y' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>",'N' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>"));
$liste["item"][] = array( 'field' => "server_id",
'datatype' => "VARCHAR",
'formtype' => "SELECT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'datasource'=> array ( 'type' => 'CUSTOM',
'class'=> 'custom_datasource',
'function'=> 'dns_servers'
),
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "origin",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "ns",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
?>
\ No newline at end of file
......@@ -13,13 +13,13 @@
// Name of the list
$liste["name"] = "dns_template";
$liste["name"] = "dns_template";
// Database table
$liste["table"] = "dns_template";
$liste["table"] = "dns_template";
// Index index field of the database table
$liste["table_idx"] = "template_id";
$liste["table_idx"] = "template_id";
// Search Field Prefix
$liste["search_prefix"] = "search_";
......@@ -28,10 +28,10 @@ $liste["search_prefix"] = "search_";
$liste["records_per_page"] = "15";
// Script File of the list
$liste["file"] = "dns_template_list.php";
$liste["file"] = "dns_template_list.php";
// Script file of the edit form
$liste["edit_file"] = "dns_template_edit.php";
$liste["edit_file"] = "dns_template_edit.php";
// Script File of the delete script
$liste["delete_file"] = "dns_template_del.php";
......@@ -40,7 +40,7 @@ $liste["delete_file"] = "dns_template_del.php";
$liste["paging_tpl"] = "templates/paging.tpl.htm";
// Enable auth
$liste["auth"] = "yes";
$liste["auth"] = "yes";
/*****************************************************
......@@ -48,33 +48,23 @@ $liste["auth"] = "yes";
*****************************************************/