Priprava na audit trails, Serazeno pole predavany selectboxu, Pridany TODOs
authorThomas Mudrunka <tomas@mudrunka.cz>
Fri, 5 Aug 2011 02:11:35 +0000 (04:11 +0200)
committerThomas Mudrunka <tomas@mudrunka.cz>
Fri, 5 Aug 2011 02:11:35 +0000 (04:11 +0200)
index.php

index 1138613d9e158f4649b245150dce6af9a213d8bc..0ac7c4f003f58cfafc733d6c63df3bd360a3e846 100755 (executable)
--- a/index.php
+++ b/index.php
@@ -255,10 +255,10 @@ class Sklad_DB extends PDO {
                $join = array(
                        'item'  => array('model', 'category', 'producer', 'vendor', 'room', 'status'),
                        'model' => array('category', 'producer')
-               );
+               ); //TODO Autodetect using foreign keys?
                $search_fields = array(
                        'item'  => array('item_id','model_name','model_barcode','model_descript','producer_name','vendor_name')
-               );
+               ); //TODO Autodetect
 
                //Escaping
                $class = $this->escape($class);
@@ -325,10 +325,16 @@ class Sklad_DB extends PDO {
                        foreach($result as $row) $selectbox[$table.$suffix_id][$row[$table.$suffix_id]]=$row[$table.$suffix_name];
                }
                //echo('<pre>'); print_r($selectbox);
-               return $selectbox;
+               return ksort($selectbox);
+       }
+
+       function contains_history($table) {
+               $history_tables = array('item'); //TODO Autodetect
+               return in_array($table, $history_tables);
        }
 
        function build_query_insert($table, $values, $replace=true, $suffix_id='_id') {
+               //Escaping
                $table = $this->escape($table);
 
                //Get list of POSTed columns
@@ -438,7 +444,7 @@ class Sklad_UI {
                        $html.=$this->render_listing_navigation($class, '*', $limit, $offset);
                }
                if($edit)       {
-                       $html.='<br />TODO UPDATE FORM!<br />';
+                       $html.='<br />TODO UPDATE FORM!<br />'; //TODO: Asi uz je hotovy...
                        $html.= $this->render_form_edit($class, $id);
                        $action = $_SERVER['SCRIPT_NAME']."/$class/$id/delete";
            $html.= "<form action='$action' method='POST'>";
This page took 0.108922 seconds and 4 git commands to generate.