GUI pro locky
[mirrors/SokoMan.git] / index.php
index b40fc8859596c4afedff1297e45a7f360d5779b8..439ffae800a1644b381708540cea21b030c4d148 100755 (executable)
--- a/index.php
+++ b/index.php
@@ -361,7 +361,7 @@ EOF;
                $relations = array( //TODO: Autodetect??? //TODO: Add [edit] link to all classes
                        'model' => array(
                                'model_id' => array(array('item',$where_url),array('barcode',$where_url),array('edit','model/%v/edit/'),array('barcode',$insert_url)),
-                               //'model_barcode' => array(array('store','assistant/%d?barcode=%v')),
+                               'model_barcode' => array(array('store','assistant/%d?barcode=%v')),
                                'barcode_name' => array(array('store','assistant/%d?barcode=%v')),
                                'model_name' => array(array('google','http://google.com/search?q=%v')) //TODO: add manufacturer to google query
                        ),
@@ -458,8 +458,8 @@ EOF;
 
        function table_hide_columns(&$table, $class) { //TODO: Move to build_query_select() !!! :-)))
                $fields_hide = array(
-                       'model' => array('model_barcode','barcode_name'),
-                       'barcode' => array('model_barcode','model_price_in','model_price_out','model_reserve','producer_name','producer_note','model_eshop_hide','category_name','model_countable','model_descript'),
+                       'model' => array('barcode_name'),
+                       'barcode' => array('model_price_in','model_price_out','model_reserve','producer_name','producer_note','model_eshop_hide','category_name','model_countable','model_descript'),
                        'item' => array('model_descript','model_price_in','model_price_out','barcode_name','model_barcode','model_countable','model_reserve','model_eshop_hide','room_descript','room_author','producer_name','producer_note','vendor_note','location_author','location_gps','location_description')
                );
                //print_r($table); die();
@@ -663,7 +663,6 @@ class Sklad_DB extends PDO {
 
                //SELECT
                $sql="SELECT *$group_concat_query FROM `$class`\n";
-               //$sql="SELECT * FROM `$class`\n";
                //JOIN
                if(isset($join[$class])) foreach($join[$class] as $j) $sql .= "LEFT JOIN `$j` USING($j$suffix_id)\n";
                if(isset($join2[$class])) foreach($join2[$class] as $j => $c) $sql .= "LEFT JOIN `$j` USING($c)\n";
@@ -685,7 +684,7 @@ class Sklad_DB extends PDO {
                //ORDER
                if(!$order) $order = $class.$suffix_id.' DESC';
                if($this->contains_history($class)) $order .= ",${class}_valid_from DESC";
-               //$sql .= "ORDER BY $order\n"; //TODO: fixnout az budou opraveny vicenasobny carovy kody
+               $sql .= "ORDER BY $order\n";
                //LIMIT/OFFSET
                if($limit) {
                        $limit = $this->escape((int)$limit);
@@ -744,7 +743,7 @@ class Sklad_DB extends PDO {
 
        function get_columns($class,$disable_cols=array()) { //TODO: Not sure if compatible with non-MySQL DBs
                $class = $this->escape($class);
-               $sql = "SHOW COLUMNS FROM $class;";
+               $sql = "SHOW COLUMNS FROM `$class`;";
                $columns = $this->safe_query_fetch($sql);
                /*foreach($columns as $colk => $col) foreach($col as $key => $val) {
                        if(in_array($col['Field'],$disable_cols)) $columns[$colk]['Extra']='auto_increment';
This page took 0.137674 seconds and 4 git commands to generate.