From 0b217d53f4e01f0b999de791061910de80066bd2 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 19 Oct 2017 16:47:38 +0100 Subject: [PATCH] lib/php/db/table.php --- lib/php/db/table.php | 10 +++------- www/dbq/html/default.min.css | 1 - www/dbq/html/default.min.js | 1 - 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 28a4dac1..798b5daa 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -508,9 +508,8 @@ Class Table extends nb { public function html_edit($values = null,$form_action='?',$add=false) { if ($values === null) $values = $this->p(); if (!is_array($values)) $values = [$values]; -# NB 01.04.17 $fields = array_filter($this->fields(),function($v){return empty($v->extra);}); $fields = $this->fields(); - $keys = $this->fields_keys(); #$fields); $fields = array_merge($keys,$fields); + $keys = $this->fields_keys(); $where = $this->where($fields,$values); if (empty($where)) { @@ -520,13 +519,9 @@ Class Table extends nb { $where .= " LIMIT 1"; } - #$fields = array_filter($fields,function($v){return empty($v->autoincrement);}); - $sql = "SELECT *" . $this->select_extras(); $sql .= " FROM ".$this->sql_name().$where; -# NB 28.03.16 $this->sql = $sql; if ($this->type == 'sql' and !empty($this->sql)) $sql = $this->sql.$where; -#bye($sql); $this->debug(preg_replace('/(,|FROM|WHERE|HAVING|GROUP|ORDER)/i',"\n\\1",$sql),1); $st = $this->db()->conn->prepare($sql); @@ -570,7 +565,8 @@ Class Table extends nb { if ($this->show_hidden_params and !empty(self::$params)) { echo '' - .'' + # NB 19.10.17: reactivate for rent + .(!empty($fields['action']) ? '' : '') .self::form_hidden(['action']) .(!empty($_SERVER['HTTP_REFERER']) ? '' : '') ; diff --git a/www/dbq/html/default.min.css b/www/dbq/html/default.min.css index bed61032..e69de29b 100644 --- a/www/dbq/html/default.min.css +++ b/www/dbq/html/default.min.css @@ -1 +0,0 @@ -html{font:90% 'Trebuchet MS',sans-serif;background-color:#eee}body{display:table;margin-left:auto;margin-right:auto;padding-left:1em;padding-right:1em;color:#444}h1{margin:0 0 .2em 0;font-size:180%;padding-bottom:.3em;margin-bottom:.5em;border-bottom:dashed 1px #444}a{color:inherit}div>a,li a,p a,td a{color:#3572b0}a,a:visited{text-decoration:none}.button:hover,a:hover{opacity:.8}ul{padding:0;margin:0}li{list-style:none;padding:0 0 0 .3em}table{border-collapse:collapse}td,th{padding:.2em .7em}th a.sort{padding:0 .3em}input:not([type]),input[type=''],input[type=date],input[type=email],input[type=password],input[type=text],input[type=url],select,textarea{border-radius:3px;border:solid 1px #ddd;padding:.3em .4em;box-shadow:0 1px 1px #eee}input[size]{max-width:70%}div.row div label:after,form label:after{content:':'}form input,form label,form select{vertical-align:middle;margin:.2em .4em .2em 0}.block,.menu,div.row,form.edit,iframe,object,pre,table.rows,ul.row{border-radius:4px;border-spacing:0;padding:.5em .2em;margin-bottom:.5em;border:solid 1px #ddd;background-color:#fafafa;box-shadow:0 1px 2px #eee}.rows{padding:0}table.rows{border-style:hidden;border-collapse:collapse;box-shadow:0 0 0 1px #ddd;table-layout:fixed}table.rows.fixed{width:100%}table.rows tr:nth-child(even) td{background-color:#fefefe}div.row div,table.rows td,table.rows th,ul.row li{border-bottom:solid 1px #ddd}div.row div,table.rows tr:last-child td,ul.row li{border-bottom:none}table.rows td,table.rows th{border-right:dashed 1px #ddd}table.rows th{text-align:left}table.rows td{padding:.3em .3em}table.rows.fixed td{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}table.rows td.delete,table.rows td.view{width:1%;white-space:nowrap}table.rows.fixed th.view{width:2em}table.rows.fixed th.delete{width:2.7em}div.row div{margin:0}div.row div label,ul.row li label{padding:.1em .5em .1em 0;min-width:20%;display:inline-block}.button{font:inherit;display:inline-block;text-decoration:none;line-height:1.5em;cursor:pointer;border-radius:4px;white-space:nowrap;box-sizing:border-box;margin:0 .1em 0 0;cursor:pointer;padding:0 .3em;border:none;color:#3572b0;background-color:#eee;background:linear-gradient(to bottom right,#eee,#dddDDD);box-shadow:0 1px 1px #bbb}.buttons,.center,.menu,.nav,.rows,td.button{margin-left:auto;margin-right:auto;display:table}form.menu{padding:.5em;background-color:#fafafa}form.menu .button.add{float:right;margin-top:.3ex;display:inline}form.menu .criterias{border-top:dashed 1px #ddd;margin-top:.3em;padding-top:.3em}form.menu .criterias span.label{border-right:solid 1px #fff;padding:.2em .1em;margin:.2em .2em 0 0;border-radius:3px}form.menu .criterias span.label:last-child{border-right:none}form.menu select:focus{max-width:auto}form.menu select{max-width:20%}form.menu .criterias input[type=text]:focus{width:auto}form.menu .criterias input[type=text]{width:4em}form.edit .fields label{width:25%;text-align:right;display:inline-block;margin-right:1em;vertical-align:top}form.edit .fields .label span{width:54%;display:inline-block;text-align:left;vertical-align:middle;margin-top:.2em}form.Wedit .fields .label span input{vertical-align:bottom!important}form.edit .fields input[size],form.edit .fields select,form.edit .fields textarea{width:65%} diff --git a/www/dbq/html/default.min.js b/www/dbq/html/default.min.js index 0302e723..e69de29b 100644 --- a/www/dbq/html/default.min.js +++ b/www/dbq/html/default.min.js @@ -1 +0,0 @@ -function form_clean(e){var t;for(i=0;i'+document.querySelector(".nav.bottom").innerHTML+""),document.querySelectorAll("table").forEach(function(e){parseInt(e.offsetWidth)>parseInt(window.innerWidth)&&(e.className=e.className.replace(/(^| +)fixed($| )/,"")+" fixed",e.className=e.className.trim())}),window._dbq.perm'+(window._dbq.perm>=window._dbq.perms.write?' ':""))})}); -- 2.47.3