! -> Note
$ -> Affected files
+24-Mar-2010 Janusz Dobrowolski/Joe Hunt
# Fixed problem with multiply zeros a value of option in list selectors
+# Parse error in ui_list.inc. Fix in other files.
$ /includes/ui/ui_lists.inc
+ /gl/includes/db/gl_db_account_types.inc
+ /gl/manage/gl_account_types.php
22-Mar-2010 Joe Hunt
-
# Error editing (updating) Account Groups and problem
with "00" == "0" in php.
$ /gl/includes/db/gl_db_account_types.inc
function can_process()
{
- global $selected_id;
-
if ($_POST['id'] == "")
{
display_error( _("The account group id cannot be empty."));
return false;
}
- if (strcmp($_POST['id'], $_POST['parent']) == 0)
+ //if (strcmp($_POST['id'], $_POST['parent']) == 0)
+ if ($_POST['id'] === $_POST['parent'])
{
- display_error("id = {$_POST['id']}, parent = {$_POST['parent']}");
- //display_error(_("You cannot set an account group to be a subgroup of itself."));
+ display_error(_("You cannot set an account group to be a subgroup of itself."));
return false;
}
{
if (add_account_type($_POST['id'], $_POST['name'], $_POST['class_id'], $_POST['parent'])) {
display_notification(_('New account type has been added'));
- $Mode = 'RESET';
}
}
+ $Mode = 'RESET';
}
}
if ($_POST['parent'] == '-1')
$_POST['parent'] == "";
$_POST['class_id'] = $myrow["class_id"];
- hidden('selected_id', $selected_id);
+ hidden('selected_id', $myrow['id']);
hidden('old_id', $myrow["id"]);
}
- hidden('id');
+ else
+ {
+ hidden('selected_id', $selected_id);
+ hidden('old_id', $_POST["old_id"]);
+ }
}
text_row_ex(_("ID:"), 'id', 10);
text_row_ex(_("Name:"), 'name', 50);
//if($name=='SelectStockFromList') display_error($sql);
foreach($items as $value=>$descr) {
$sel = '';
- if (in_array((string)$value, $selected_id), true) {
+ if (in_array((string)$value, $selected_id, true)) {
$sel = "selected='selected'";
$found = $value;
}