Pridani pruvodci pro vyskladneni do firmy a vyskladneni k zakaznikovi, upraveno ...
authorThomas Mudrunka <tomas@mudrunka.cz>
Fri, 19 Aug 2011 22:14:41 +0000 (00:14 +0200)
committerThomas Mudrunka <tomas@mudrunka.cz>
Fri, 19 Aug 2011 22:17:25 +0000 (00:17 +0200)
.gitignore
assistants/dispose.inc.php [new file with mode: 0644]
assistants/sell.inc.php [new file with mode: 0644]
index.php

index b181347d42300e3c423ade2b1e2aa55b57827b3e..2ecf49f1480510198f3b1d99fc75080489880ced 100644 (file)
@@ -1,3 +1,4 @@
+_*
 *.bak
 *.conf.php
 .svn
diff --git a/assistants/dispose.inc.php b/assistants/dispose.inc.php
new file mode 100644 (file)
index 0000000..d95dab4
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+$script = $_SERVER['SCRIPT_NAME'].'/assistant/dispose';
+switch($step) {
+       default: case 1:
+?>
+<form action="<?=$script?>/2" method="GET">
+       item_serial: <input type="text" name="serial" />
+       <input type="submit" value="DISPOSE" />
+</form>
+<?php
+               break;
+       case 2:
+               $item_id = $this->db->map_unique('item_serial', $_GET['serial'], 'item_id', 'item');
+               $columns = $this->db->get_columns('item');
+    $selectbox = $this->db->columns_get_selectbox($columns, 'item');
+
+               $current = $this->db->get_listing('item', $item_id, 1);
+               $current[$item_id]['status_id'] = 2;
+
+               $action = $_SERVER['SCRIPT_NAME']."/item/$item_id/edit";
+    echo $this->html->render_insert_form('item', $columns, $selectbox, $current, false, $action);
+               break;
+}
diff --git a/assistants/sell.inc.php b/assistants/sell.inc.php
new file mode 100644 (file)
index 0000000..ab60c7d
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+//TODO: Merge SELL and DISPOSE to single file with parameter!
+//TODO: Add support for selling/disposing multiple items at once...
+//TODO: Reuse /item/$item_id/edit
+$script = $_SERVER['SCRIPT_NAME'].'/assistant/sell';
+switch($step) {
+       default: case 1:
+?>
+<form action="<?=$script?>/2" method="GET">
+       item_serial: <input type="text" name="serial" />
+       <input type="submit" value="SELL" />
+</form>
+<?php
+               break;
+       case 2:
+               $item_id = $this->db->map_unique('item_serial', $_GET['serial'], 'item_id', 'item');
+               $columns = $this->db->get_columns('item');
+    $selectbox = $this->db->columns_get_selectbox($columns, 'item');
+
+               $current = $this->db->get_listing('item', $item_id, 1);
+               $current[$item_id]['status_id'] = 3;
+
+               $action = $_SERVER['SCRIPT_NAME']."/item/$item_id/edit";
+    echo $this->html->render_insert_form('item', $columns, $selectbox, $current, false, $action);
+               break;
+}
index 6508a4d227068122180061b0127497130542c212..c2ffb64d242e70f108db455368826f2657745168 100755 (executable)
--- a/index.php
+++ b/index.php
@@ -149,6 +149,8 @@ class Sklad_HTML extends HTML {
                <li><a href="#">Assistants</a>
                        <menu>
                                <li><a href="$script/assistant/store">store</a></li>
+                               <li><a href="$script/assistant/dispose">dispose</a></li>
+                               <li><a href="$script/assistant/sell">sell</a></li>
                                <li>&darr;&darr; BETA &darr;&darr;</li>
                                <li><a href="$script/assistant/new-item">new-item</a></li>
                        </menu>
This page took 0.169253 seconds and 4 git commands to generate.