Assistenti nyni ukladaji aktualni UID
authorThomas Mudrunka <tomas@mudrunka.cz>
Fri, 23 Sep 2011 18:42:25 +0000 (20:42 +0200)
committerThomas Mudrunka <tomas@mudrunka.cz>
Fri, 23 Sep 2011 18:42:25 +0000 (20:42 +0200)
TODO.md
assistants/sell.inc.php
assistants/store-single.inc.php
assistants/store.inc.php

diff --git a/TODO.md b/TODO.md
index ab53ef76fb4b29ade343932247a981258697d3d1..da42d591bd5d1239fc159da5dc01d3c37d30d540 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -13,6 +13,7 @@
     * SQLi (some fixed, some not)
     * XSS (none fixed)
   * Code refactoring
+    * Use something more elegant than get_user_id() (something more universal) and map_unique() (load whole array at once)
     * Optimize magic quotes usage
     * Move classes to separate files
       * Make sure that every method is in the class that it belongs to
index cb038d21d3151cd4bd726c0066792f9fb837d11b..20444e06819f83f8918840bcd8dfb745d312b2e1 100644 (file)
@@ -25,6 +25,7 @@ switch($SUBPATH[0]) {
                $item_id = $this->db->map_unique('item_serial', $item_serial, 'item_id', 'item');
 
                $current = $this->db->get_listing('item', $item_id, 1);
+               $current[$item_id]['item_author'] = $this->db->auth->get_user_id();
                $forked_item = $current;
 
                $model_id = $this->db->map_unique('item_serial', $item_serial, 'model_id', 'item');
index 7af375d19962043843b6541d7763789d28a980f5..5e18f5941fbd24c8448572c2670413acfa8d34dd 100644 (file)
@@ -12,7 +12,8 @@ switch($SUBPATH[0]) {
                $current = array(array(
                        'model_id' => $model_id,
                        'item_quantity' => 1,
-                       'status_id' => 1
+                       'status_id' => 1,
+                       'item_author' => $this->db->auth->get_user_id()
                ));
 
                $action = $_SERVER['SCRIPT_NAME'].'/item/new';
index b7818abb33dee6eb32be15557979cf5d02ca6e4b..cf482920b1001540b2a6bb24d0f4f72fc412d57f 100644 (file)
@@ -40,7 +40,8 @@ switch($SUBPATH[0]) {
                        'item_quantity' => $item_quantity,
                        'status_id' => 1,
                        'item_price_in' => $this->db->map_unique('model_barcode', $_GET['barcode'], 'model_price_in', 'model'),
-                       'item_price_out' => $this->db->map_unique('model_barcode', $_GET['barcode'], 'model_price_out', 'model')
+                       'item_price_out' => $this->db->map_unique('model_barcode', $_GET['barcode'], 'model_price_out', 'model'),
+                       'item_author' => $this->db->auth->get_user_id()
                ));
 
     echo $this->html->render_insert_form('item', $columns, $selectbox, $current, $disable_cols, $action);
This page took 0.12268 seconds and 4 git commands to generate.