Optional additional security roles inscludable from modules/extensions.
[fa-stable.git] / inventory / manage / sales_kits.php
index a45dde70d8ac1784595f2cc8440be3a490efdd28..09cb731a5a7e0fd667c60f3f53ddba81112d8c02 100644 (file)
@@ -9,8 +9,8 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
-$page_security = 11;
-$path_to_root="../..";
+$page_security = 'SA_SALESKIT';
+$path_to_root = "../..";
 include_once($path_to_root . "/includes/session.inc");
 
 page(_("Sales Kits & Alias Codes"));
@@ -84,7 +84,7 @@ function update_component($kit_code, $selected_item)
        elseif ($selected_item == -1)   // adding new item or new alias/kit
        {
                if (get_post('item_code') == '') { // New kit/alias definition
-                       $kit = get_item_kit($_POST['item_code']);
+                       $kit = get_item_kit($_POST['kit_code']);
                if (db_num_rows($kit)) {
                                $input_error = 1;
                        display_error( _("This item code is already assigned to stock item or sale kit."));
@@ -178,7 +178,6 @@ if ($Mode == 'RESET')
        unset($_POST['quantity']);
        unset($_POST['component']);
 }
-
 //--------------------------------------------------------------------------------------------------
 
 start_form();
@@ -188,7 +187,7 @@ sales_kits_list('item_code', null, _('New kit'), true);
 echo "</center><br>";
 $props = get_kit_props($_POST['item_code']);
 
-if (isset($_POST['_item_code_update'])) {
+if (list_updated('item_code')) {
        if (get_post('item_code') == '')
                $_POST['description'] = '';
        $Ajax->activate('_page_body');