problem with "00" == "0" in php.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 23 Mar 2010 15:17:36 +0000 (15:17 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 23 Mar 2010 15:17:36 +0000 (15:17 +0000)
CHANGELOG.txt
gl/manage/gl_account_types.php

index e359a981e12f61e22dbf39d1811e24b49342207e..f5adff05713fbe2d8654fcc7f57150770ce57611 100644 (file)
@@ -20,7 +20,8 @@ Legend:
 $ -> Affected files
 
 22-Mar-2010 Joe Hunt
-# Error editing (updating) Account Groups 
+# Error editing (updating) Account Groups and problem
+  with "00" == "0" in php.
 $ /gl/includes/db/gl_db_account_types.inc
   /gl/manage/gl_account_classes.php
   /gl/manage/gl_account_types.php
index 6fbb9df59a0c3c64a36f13d0d1d011df3baae3a1..628cbc2f8ed8a5a5fb9d3c5863e3a6fd8c9af367 100644 (file)
@@ -26,12 +26,12 @@ function can_process()
 {
        global $selected_id;
 
-       /*if (!input_num('id'))
+       if ($_POST['id'] == "")
        {
-           display_error( _("The account id must be an integer and cannot be empty."));
+           display_error( _("The account group id cannot be empty."));
            set_focus('id');
            return false;
-       }*/
+       }
        if (strlen($_POST['name']) == 0) 
        {
                display_error( _("The account group name cannot be empty."));
@@ -39,9 +39,10 @@ function can_process()
                return false;
        }
 
-       if (isset($selected_id) && ($selected_id == $_POST['parent'])
+       if (strcmp($_POST['id'], $_POST['parent']) == 0
        {
-               display_error(_("You cannot set an account group to be a subgroup of itself."));
+               display_error("id = {$_POST['id']}, parent = {$_POST['parent']}");
+               //display_error(_("You cannot set an account group to be a subgroup of itself."));
                return false;
        }
 
@@ -184,7 +185,7 @@ class_list_row(_("Class Type:"), 'class_id', null);
 
 end_table(1);
 
-submit_add_or_update_center($selected_id == -1, '', 'both');
+submit_add_or_update_center($selected_id == "", '', 'both');
 
 end_form();