]> git.nbdom.net Git - nb.git/commitdiff
lib/php/db/table.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 6 Mar 2018 04:07:37 +0000 (04:07 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 6 Mar 2018 04:07:37 +0000 (04:07 +0000)
lib/php/db/table.php

index 9f3eea6f592539aa08369b69c406c01db65edaea..8eabaacf3feb8c264cde855a198969314ab678b7 100644 (file)
@@ -604,7 +604,7 @@ Class Table extends nb {
                }
 
                // Form
-               echo '<form class="db edit form-table" method="post" action="'.$form_action.'">'.NB_EOL;
+               echo '<form class="db edit '.($add ? 'add ' : '' ).'form-table" method="post" action="'.$form_action.'">'.NB_EOL;
                echo '<div class="fields">'.NB_EOL;
                if ($add or $row) {
 
@@ -1132,6 +1132,7 @@ Class Table extends nb {
                if (!$nosql) $this->create_temporary();
                list($sql,$where,$limit,$select_count) = $this->rows_sql($opt);
 
+               $fct_rows_prepare = null;
                if ($nosql) {
                        $sql = empty($this->sql) ? $this->name : $this->sql;
 
@@ -2045,6 +2046,9 @@ Class Table extends nb {
                } elseif ($action == 'edit') {
                        return $this->html_edit();
 
+               } elseif ($action == 'add') {
+                       return $this->html_edit(null,'?',true);
+
                } elseif ($this->p('table')) {
                # NB 17.03.16 } else {
                        $this->pdef('limit','20');