function create_prior_dlg($parent)
{
    global $prior_table;
    // Remove the line below while not under development
    file_put_contents("dlg_prior.rc.php", "<?php\n\n" . parse_rc(file_get_contents(PATH_DATA . "dlg_prior.rc"), '$dlg', '$parent', 'ModalDialog') . "\n?>");
    include "dlg_prior.rc.php";
    wb_set_handler($dlg, "process_prior");
    $prior_table = "priority";
    wb_set_enabled(wb_get_control($dlg, ID_SETITEM), false);
    wb_set_enabled(wb_get_control($dlg, ID_DELETEITEM), false);
    update_prior_controls($dlg);
    update_priors($dlg);
}
function create_cat_dlg($parent)
{
    // Remove the line below while not under development
    file_put_contents("dlg_cat.rc.php", "<?php\n\n" . parse_rc(file_get_contents(PATH_DATA . "dlg_cat.rc"), '$dlg', '$parent', 'ModalDialog') . "\n?>");
    include "dlg_cat.rc.php";
    wb_set_handler($dlg, "process_cat");
    wb_set_image(wb_get_control($dlg, ID_TREE), PATH_RES . "treeview.bmp", GREEN, 0, 10);
    wb_set_enabled(wb_get_control($dlg, ID_SETITEM), false);
    wb_set_enabled(wb_get_control($dlg, ID_DELETEITEM), false);
    update_cat_controls($dlg);
    update_tree($dlg);
    // Temporarily disabled
    wb_set_text($dlg, "Edit categories (TEMPORARILY DISABLED)");
}
function create_edit_dlg($parent, $id, $cat = null)
{
    global $id_edit, $curr_cat;
    $id_edit = $id;
    $curr_cat = $cat;
    // Remove the line below while not under development
    file_put_contents("dlg_item.rc.php", "<?php\n\n" . parse_rc(file_get_contents(PATH_DATA . "dlg_item.rc"), '$dlg', '$parent', 'ModalDialog', null, WBC_CENTER, WBC_CENTER, WBC_CENTER, WBC_CENTER, 'WBC_INVISIBLE') . "\n?>");
    include "dlg_item.rc.php";
    wb_set_handler($dlg, "process_item");
    wb_set_text($dlg, $id ? "Edit item #{$id}" : "Create new item");
    // Fill up the lists
    $item_data = db_get_data("cat", null, array("name"));
    wb_set_text(wb_get_control($dlg, ID_CATLIST), $item_data);
    $item_data = db_get_data("priority", null, array("name"));
    wb_set_text(wb_get_control($dlg, ID_PRIORLIST), $item_data);
    $item_data = db_get_data("severity", null, array("name"));
    wb_set_text(wb_get_control($dlg, ID_SEVERLIST), $item_data);
    update_item_controls($dlg);
    wb_set_visible($dlg, true);
}