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 { ...@@ -101,7 +101,7 @@ class page_action extends tform_actions {
global $app; 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); $tpls = $app->db->queryAllRecords($sql);
$option = ''; $option = '';
$tpl = array(); $tpl = array();
......
...@@ -44,5 +44,6 @@ $app->auth->check_module_permissions('client'); ...@@ -44,5 +44,6 @@ $app->auth->check_module_permissions('client');
if(!$_SESSION["s"]["user"]["typ"] == 'admin') die('Client-Templates are only for Admins.'); if(!$_SESSION["s"]["user"]["typ"] == 'admin') die('Client-Templates are only for Admins.');
$app->uses('listform_actions'); $app->uses('listform_actions');
$app->listform_actions->SQLOrderBy = 'ORDER BY template_name';
$app->listform_actions->onLoad(); $app->listform_actions->onLoad();
?> ?>
...@@ -38,16 +38,16 @@ ...@@ -38,16 +38,16 @@
*/ */
$form["title"] = "Client"; $form["title"] = "Client";
$form["description"] = ""; $form["description"] = "";
$form["name"] = "client"; $form["name"] = "client";
$form["action"] = "client_edit.php"; $form["action"] = "client_edit.php";
$form["db_table"] = "client"; $form["db_table"] = "client";
$form["db_table_idx"] = "client_id"; $form["db_table_idx"] = "client_id";
$form["db_history"] = "yes"; $form["db_history"] = "yes";
$form["tab_default"] = "address"; $form["tab_default"] = "address";
$form["list_default"] = "client_list.php"; $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"]["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 $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 ( ...@@ -101,9 +101,9 @@ $form["tabs"]['address'] = array (
'contact_name' => array ( 'contact_name' => array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'TEXT', 'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'contact_error_empty'), 'errmsg'=> 'contact_error_empty'),
), ),
'default' => '', 'default' => '',
'value' => '', 'value' => '',
'separator' => '', 'separator' => '',
...@@ -129,19 +129,19 @@ $form["tabs"]['address'] = array ( ...@@ -129,19 +129,19 @@ $form["tabs"]['address'] = array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'TEXT', 'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'username_error_empty'), 'errmsg'=> 'username_error_empty'),
1 => array ( 'type' => 'CUSTOM', 1 => array ( 'type' => 'CUSTOM',
'class' => 'validate_client', 'class' => 'validate_client',
'function' => 'username_unique', 'function' => 'username_unique',
'errmsg'=> 'username_error_unique'), 'errmsg'=> 'username_error_unique'),
2 => array ( 'type' => 'CUSTOM', 2 => array ( 'type' => 'CUSTOM',
'class' => 'validate_client', 'class' => 'validate_client',
'function' => 'username_collision', 'function' => 'username_collision',
'errmsg'=> 'username_error_collision'), 'errmsg'=> 'username_error_collision'),
3 => array ( 'type' => 'REGEX', 3 => array ( 'type' => 'REGEX',
'regex' => '/^[\w\.\-\_]{0,64}$/', 'regex' => '/^[\w\.\-\_]{0,64}$/',
'errmsg'=> 'username_error_regex'), 'errmsg'=> 'username_error_regex'),
), ),
'default' => '', 'default' => '',
'value' => '', 'value' => '',
'separator' => '', 'separator' => '',
...@@ -235,14 +235,13 @@ $form["tabs"]['address'] = array ( ...@@ -235,14 +235,13 @@ $form["tabs"]['address'] = array (
), ),
'country' => array ( 'country' => array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'SELECT', 'formtype' => 'SELECT',
'default' => (isset($conf['language']) ? strtoupper($conf['language']) : ''), 'default' => (isset($conf['language']) ? strtoupper($conf['language']) : ''),
'datasource' => array ( 'type' => 'SQL', 'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT iso,printable_name FROM country ORDER BY printable_name', 'querystring' => 'SELECT iso,printable_name FROM country ORDER BY iso ASC',
'keyfield'=> 'iso', 'keyfield' => 'iso',
'valuefield'=> 'printable_name' 'valuefield' => 'printable_name'
), ),
'value' => '' 'value' => ''
), ),
'telephone' => array ( 'telephone' => array (
......
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
// Name of the list // Name of the list
$liste["name"] = "clients"; $liste["name"] = "clients";
// Database table // Database table
$liste["table"] = "client"; $liste["table"] = "client";
// Index index field of the database table // Index index field of the database table
$liste["table_idx"] = "client_id"; $liste["table_idx"] = "client_id";
// Search Field Prefix // Search Field Prefix
$liste["search_prefix"] = "search_"; $liste["search_prefix"] = "search_";
...@@ -28,10 +28,10 @@ $liste["search_prefix"] = "search_"; ...@@ -28,10 +28,10 @@ $liste["search_prefix"] = "search_";
$liste["records_per_page"] = "15"; $liste["records_per_page"] = "15";
// Script File of the list // Script File of the list
$liste["file"] = "client_list.php"; $liste["file"] = "client_list.php";
// Script file of the edit form // Script file of the edit form
$liste["edit_file"] = "client_edit.php"; $liste["edit_file"] = "client_edit.php";
// Script File of the delete script // Script File of the delete script
$liste["delete_file"] = "client_del.php"; $liste["delete_file"] = "client_del.php";
...@@ -40,66 +40,65 @@ $liste["delete_file"] = "client_del.php"; ...@@ -40,66 +40,65 @@ $liste["delete_file"] = "client_del.php";
$liste["paging_tpl"] = "templates/paging.tpl.htm"; $liste["paging_tpl"] = "templates/paging.tpl.htm";
// Enable authe // Enable authe
$liste["auth"] = "yes"; $liste["auth"] = "yes";
/***************************************************** /*****************************************************
* Suchfelder * Suchfelder
*****************************************************/ *****************************************************/
$liste["item"][] = array( 'field' => "client_id", $liste["item"][] = array( 'field' => "client_id",
'datatype' => "INTEGER", 'datatype' => "INTEGER",
'formtype' => "TEXT", 'formtype' => "TEXT",
'op' => "=", 'op' => "=",
'prefix' => "", 'prefix' => "",
'suffix' => "", 'suffix' => "",
'width' => "", 'width' => "",
'value' => ""); 'value' => "");
$liste["item"][] = array( 'field' => "company_name", $liste["item"][] = array( 'field' => "company_name",
'datatype' => "VARCHAR", 'datatype' => "VARCHAR",
'formtype' => "TEXT", 'formtype' => "TEXT",
'op' => "like", 'op' => "like",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'width' => "", 'width' => "",
'value' => ""); 'value' => "");
$liste["item"][] = array( 'field' => "contact_name", $liste["item"][] = array( 'field' => "contact_name",
'datatype' => "VARCHAR", 'datatype' => "VARCHAR",
'formtype' => "TEXT", 'formtype' => "TEXT",
'op' => "like", 'op' => "like",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'width' => "", 'width' => "",
'value' => ""); 'value' => "");
$liste["item"][] = array( 'field' => "username", $liste["item"][] = array( 'field' => "username",
'datatype' => "VARCHAR", 'datatype' => "VARCHAR",
'formtype' => "TEXT", 'formtype' => "TEXT",
'op' => "like", 'op' => "like",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'width' => "", 'width' => "",
'value' => ""); 'value' => "");
$liste["item"][] = array( 'field' => "city", $liste["item"][] = array( 'field' => "city",
'datatype' => "VARCHAR", 'datatype' => "VARCHAR",
'formtype' => "TEXT", 'formtype' => "TEXT",
'op' => "like", 'op' => "like",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'width' => "", 'width' => "",
'value' => ""); 'value' => "");
$liste["item"][] = array( 'field' => "country", $liste["item"][] = array( 'field' => "country",
'datatype' => "VARCHAR", 'datatype' => "VARCHAR",
'formtype' => "TEXT", 'formtype' => "SELECT",
'op' => "like", 'op' => "=",
'prefix' => "%", 'prefix' => "",
'suffix' => "%", 'suffix' => "",
'width' => "", 'width' => "",
'value' => ""); 'value' => "");
?> ?>
\ No newline at end of file
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
// Name of the list // Name of the list
$liste["name"] = "resellers"; $liste["name"] = "resellers";
// Database table // Database table
$liste["table"] = "client"; $liste["table"] = "client";
// Index index field of the database table // Index index field of the database table
$liste["table_idx"] = "client_id"; $liste["table_idx"] = "client_id";
// Search Field Prefix // Search Field Prefix
$liste["search_prefix"] = "search_"; $liste["search_prefix"] = "search_";
...@@ -28,10 +28,10 @@ $liste["search_prefix"] = "search_"; ...@@ -28,10 +28,10 @@ $liste["search_prefix"] = "search_";
$liste["records_per_page"] = "15"; $liste["records_per_page"] = "15";
// Script File of the list // Script File of the list
$liste["file"] = "reseller_list.php"; $liste["file"] = "reseller_list.php";
// Script file of the edit form // Script file of the edit form
$liste["edit_file"] = "reseller_edit.php"; $liste["edit_file"] = "reseller_edit.php";
// Script File of the delete script // Script File of the delete script
$liste["delete_file"] = "reseller_del.php"; $liste["delete_file"] = "reseller_del.php";
...@@ -40,57 +40,56 @@ $liste["delete_file"] = "reseller_del.php"; ...@@ -40,57 +40,56 @@ $liste["delete_file"] = "reseller_del.php";
$liste["paging_tpl"] = "templates/paging.tpl.htm"; $liste["paging_tpl"] = "templates/paging.tpl.htm";
// Enable authe // Enable authe
$liste["auth"] = "yes"; $liste["auth"] = "yes";
/***************************************************** /*****************************************************
* Suchfelder * Suchfelder
*****************************************************/ *****************************************************/
$liste["item"][] = array( 'field' => "client_id", $liste["item"][] = array( 'field' => "client_id",
'datatype' => "INTEGER", 'datatype' => "INTEGER",
'formtype' => "TEXT", 'formtype' => "TEXT",
'op' => "=", 'op' => "=",
'prefix' => "", 'prefix' => "",
'suffix' => "", 'suffix' => "",
'width' => "", 'width' => "",
'value' => ""); 'value' => "");
$liste["item"][] = array( 'field' => "company_name", $liste["item"][] = array( 'field' => "company_name",
'datatype' => "VARCHAR", 'datatype' => "VARCHAR",
'formtype' => "TEXT", 'formtype' => "TEXT",
'op' => "like", 'op' => "like",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'width' => "", 'width' => "",
'value' => ""); 'value' => "");
$liste["item"][] = array( 'field' => "contact_name", $liste["item"][] = array( 'field' => "contact_name",
'datatype' => "VARCHAR", 'datatype' => "VARCHAR",
'formtype' => "TEXT", 'formtype' => "TEXT",
'op' => "like", 'op' => "like",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'width' => "", 'width' => "",
'value' => ""); 'value' => "");
$liste["item"][] = array( 'field' => "city", $liste["item"][] = array( 'field' => "city",
'datatype' => "VARCHAR", 'datatype' => "VARCHAR",
'formtype' => "TEXT", 'formtype' => "TEXT",
'op' => "like", 'op' => "like",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'width' => "", 'width' => "",
'value' => ""); 'value' => "");
$liste["item"][] = array( 'field' => "country", $liste["item"][] = array( 'field' => "country",
'datatype' => "VARCHAR", 'datatype' => "VARCHAR",
'formtype' => "TEXT", 'formtype' => "SELECT",
'op' => "like", 'op' => "=",
'prefix' => "%", 'prefix' => "",
'suffix' => "%", 'suffix' => "",
'width' => "", 'width' => "",
'value' => ""); 'value' => "");
?> ?>
\ No newline at end of file
...@@ -32,7 +32,7 @@ ...@@ -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_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_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_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> <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> </tr>
</thead> </thead>
......
...@@ -30,7 +30,7 @@ ...@@ -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_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_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_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> <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> </tr>
</thead> </thead>
......
...@@ -18,6 +18,7 @@ $app->auth->check_module_permissions('dns'); ...@@ -18,6 +18,7 @@ $app->auth->check_module_permissions('dns');
$app->uses('listform_actions'); $app->uses('listform_actions');
// $app->listform_actions->SQLExtWhere = "access = 'REJECT'"; // $app->listform_actions->SQLExtWhere = "access = 'REJECT'";
$app->listform_actions->SQLOrderBy = 'ORDER BY name';
$app->listform_actions->onLoad(); $app->listform_actions->onLoad();
......
...@@ -56,7 +56,7 @@ if($_SESSION['s']['user']['typ'] == 'admin') { ...@@ -56,7 +56,7 @@ if($_SESSION['s']['user']['typ'] == 'admin') {
// Load the templates // 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 = ''; $template_id_option = '';
$n = 0; $n = 0;
foreach($records as $rec){ foreach($records as $rec){
......
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
// Name of the list // Name of the list
$liste["name"] = "dns_slave"; $liste["name"] = "dns_slave";
// Database table // Database table
$liste["table"] = "dns_slave"; $liste["table"] = "dns_slave";
// Index index field of the database table // Index index field of the database table
$liste["table_idx"] = "id"; $liste["table_idx"] = "id";
// Search Field Prefix // Search Field Prefix
$liste["search_prefix"] = "search_"; $liste["search_prefix"] = "search_";
...@@ -28,10 +28,10 @@ $liste["search_prefix"] = "search_"; ...@@ -28,10 +28,10 @@ $liste["search_prefix"] = "search_";
$liste["records_per_page"] = "15"; $liste["records_per_page"] = "15";
// Script File of the list // Script File of the list
$liste["file"] = "dns_slave_list.php"; $liste["file"] = "dns_slave_list.php";
// Script file of the edit form // 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 // Script File of the delete script
$liste["delete_file"] = "dns_slave_del.php"; $liste["delete_file"] = "dns_slave_del.php";
...@@ -40,7 +40,7 @@ $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"; $liste["paging_tpl"] = "templates/paging.tpl.htm";
// Enable auth // Enable auth
$liste["auth"] = "yes"; $liste["auth"] = "yes";
/***************************************************** /*****************************************************
...@@ -48,50 +48,46 @@ $liste["auth"] = "yes"; ...@@ -48,50 +48,46 @@ $liste["auth"] = "yes";
*****************************************************/ *****************************************************/
$liste["item"][] = array( 'field' => "active", $liste["item"][] = array( 'field' => "active",
'datatype' => "VARCHAR", 'datatype' => "VARCHAR",
'formtype' => "SELECT", 'formtype' => "SELECT",
'op' => "=", 'op' => "=",
'prefix' => "", 'prefix' => "",
'suffix' => "", 'suffix' => "",
'width' => "", '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>")); '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", $liste["item"][] = array( 'field' => "server_id",
'datatype' => "VARCHAR", 'datatype' => "VARCHAR",
'formtype' => "SELECT", 'formtype' => "SELECT",
'op' => "like", 'op' => "like",
'prefix' => "%", 'prefix' => "%",
'suffix' => "%", 'suffix' => "%",
'datasource' => array ( 'type' => 'CUSTOM', 'datasource'=> array ( 'type' => 'CUSTOM',
'class'=> 'custom_datasource',