Most modern browsers have their key bindings changeable. FireFox 31.4.0esr on WinXP SP3 did not need any changes for F4 to work as desired in FA.
Anyway, thanks. Your valuable inputs have been used to create a new Wiki page to address it.
Lines 555 to 582 in includes/ui/ui_controls.inc:
/*
Redirector for selector F4 calls.
$sel_editors is array of selname=>editor_page
*/
function editor_redirect($sel_editors, $save_fun='') {
foreach ($sel_editors as $selname=>$editor)
if (isset($_POST['_'.$selname.'_editor'])) {
if (function_exists($save_fun))
$save_fun();
unset($_POST['_'.$selname.'_editor']);
context_call($editor, array_keys($_POST));
}
}
/*
Return procedure for selector F4 calls
*/
function editor_return($vars, $restore_fun='') {
if (function_exists($restore_fun))
$restore_fun();
if ($ret = context_restore()) {
foreach ($vars as $postname=>$retname)
if (isset($ret[$retname])) {
$_POST[$postname] = $ret[$retname];
set_focus($postname);
}
}
}
Lines 445 to 479 in the same file defines the hotkeys (key 115 => F4 for Items):
/* Table editor interfaces. Key is editor type
0 => url of editor page
1 => hotkey code
2 => context help
*/
$popup_editors = array(
'customer' => array('/sales/manage/customers.php?debtor_no=',
113, _("Customers"), 900, 500),
'branch' => array('/sales/manage/customer_branches.php?SelectedBranch=',
114, _("Branches"), 900, 700),
'supplier' => array('/purchasing/manage/suppliers.php?supplier_id=',
113, _("Suppliers"), 900, 700),
'item' => array('/inventory/manage/items.php?stock_id=',
115, _("Items"), 800, 600)
);
/*
Bind editors for various selectors.
$type - type of editor
$input - name of related input field
$caller - optional function key code (available values F1-F12: 112-123,
true: default)
*/
function set_editor($type, $input, $caller=true)
{
global $path_to_root, $Editors, $popup_editors, $Pagehelp;
$key = $caller===true ? $popup_editors[$type][1] : $caller;
$Editors[$key] = array( $path_to_root . $popup_editors[$type][0], $input,
$popup_editors[$type][3], $popup_editors[$type][4]);
$help = 'F' . ($key - 111) . ' - ';
$help .= $popup_editors[$type][2];
$Pagehelp[] = $help;
}
The file includes/ui_ui_lists.inc has several references to set_editor() function that defines the popup.
Lines 740 to 749 in it are:
function stock_items_list($name, $selected_id=null, $all_option=false,
$submit_on_change=false, $opts=array(), $editkey = false)
{
global $all_items;
$sql = "SELECT stock_id, s.description, c.description, s.inactive, s.editable
FROM ".TB_PREF."stock_master s,".TB_PREF."stock_category c WHERE s.category_id=c.category_id";
if ($editkey)
set_editor('item', $name, $editkey);
...
...