From 8bbfd339a78e80f1753f5b9b29951a72359fb708 Mon Sep 17 00:00:00 2001 From: "Ap.Muthu" Date: Fri, 3 Jun 2016 21:58:47 +0530 Subject: [PATCH] Updated Technical Wiki (markdown) --- Technical-Wiki.md | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/Technical-Wiki.md b/Technical-Wiki.md index 5d5a5b4..21eb766 100644 --- a/Technical-Wiki.md +++ b/Technical-Wiki.md @@ -156,27 +156,35 @@ $field = Array ```` * Hide Auto-increment Primary Key in New Record Form (populate ````$hidePKfields```` as needed). Alternatively, just the table names would suffice where the primary key can be ascertained from the ````$field['primary'] == 1```` taking the field name from ````$field['field']```` element. ```` - function fieldName($field, $order = 0) { -.. -.. -.. - // Hide AutoInc Primary keys during Insert - if (isset($_GET['edit'])) { - $hidePKfields = Array( - Array('htable' => 'cheques', 'hfield' => 'ChqID') - , Array('htable' => 'chq_batches', 'hfield' => 'ORID') - ); - foreach ($hidePKfields as $val) { - if ($_GET['edit'] == $val['htable'] && $field['field'] == $val['hfield'] && !isset($_GET['where'][$val['hfield']])) - return ""; - } - } -.. -.. -.. - return ""; + function fieldName($field, $order = 0) { + if ($order && preg_match('~_(md5|sha1)$~', $field["field"])) { + return ""; // hide hashes in select } + // Hide AutoInc Primary keys during Insert + if (isset($_GET['edit'])) { + $hidePKfields = Array( + Array('htable' => 'employees', 'hfield' => 'EmployeeID') + , Array('htable' => 'leaves', 'hfield' => 'LeaveID') + ); + foreach ($hidePKfields as $val) { + if ($_GET['edit'] == $val['htable'] && $field['field'] == $val['hfield'] && !isset($_GET['where'][$val['hfield']])) + return ""; + } + } + + // display only column with comments, first 60 of them plus searched columns + if ($order < 60) { + return h($field["comment"]); + } + foreach ((array) $_GET["where"] as $key => $where) { + if ($where["col"] == $field["field"] && ($key >= 0 || $where["val"] != "")) { + return h($field["comment"]); + } + } + return ""; + } + ```` * To link a table's (````chq_batches````) displayed field (````ORID````) value to an external file as a link with it's value in the url using a $_GET variable (````orid````): ````