+_*
*.bak
*.conf.php
.svn
--- /dev/null
+<?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;
+}
--- /dev/null
+<?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;
+}
<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>↓↓ BETA ↓↓</li>
<li><a href="$script/assistant/new-item">new-item</a></li>
</menu>