Re: Additional Fields Extension

poncho1234 wrote:

@emiangel839 Look in your first photo... the directory is called 'additional_fields_master'.

So your current path is:-

It should be:-

You have to unzip the contents of the zip file, not use the outer folder/package... So unzip it somewhere else, copy the directory 'additional_fields' and its contents to your installations /modules dir.

1st deactivate and uninstall 'additional_fields_master', delete folder if necessary

Thanks. & Done it,

well its giving an error in Report Section

banking & general ledger -> general ledger reports -> customer -> ERROR IN ALL REPORTS (NOT GENERATING REPORTS) EXPECT CUSTOMER INFORMATION LISTING....

image ->


Re: Additional Fields Extension

Looks like you may have pdf debugging on...

Open your config.php file around line 37 you will see:-

37:     $pdf_debug         = 0;    // display pdf source instead reports for debugging when $go_debug!=0

If it is set to one change it back to zero

28 (edited by poncho1234 11/08/2018 10:16:55 pm)

Re: Additional Fields Extension


Deep in the bowels of I found this..

File: \includes\ui\

611: /*
612:     Redirector for selector F4 calls.
613:     $sel_editors is array of selname=>editor_page
614: */
615: function editor_redirect($sel_editors, $save_fun='') {
616:     foreach ($sel_editors as $selname=>$editor)
617:         if (isset($_POST['_'.$selname.'_editor'])) {
618:             if (function_exists($save_fun))
619:                 $save_fun();
620:             unset($_POST['_'.$selname.'_editor']);
621:             context_call($editor, array_keys($_POST));
622:         }
623: }
624: /*
625:     Return procedure for selector F4 calls
626: */
627: function editor_return($vars, $restore_fun='') {
628:     if (function_exists($restore_fun))
629:         $restore_fun();
631:     if ($ret = context_restore()) {
632:         foreach ($vars as $postname=>$retname)
633:             if (isset($ret[$retname])) {
634:                 $_POST[$postname] = $ret[$retname];
635:                 set_focus($postname);
636:             }
637:     }
638: }

I think this is it?...Please confirm.
Not so sure how to use though?

editor_redirect($popup_editors, '$new_popup_editors');


Edit or is this fr renaming the function set_editor??????

Re: Additional Fields Extension

After trying to completely over complicate it I found that:-

$popup_editors = $add_field_popup_editors;

Replaces the contents of the arrray $popup_editors with the contents of my new array with changed url's

I added this my new array to the top of sales_order_entry.php and it worked!

Now I have the problem of where (and how) to put it to the ext.

30 (edited by poncho1234 11/09/2018 09:16:31 pm)

Re: Additional Fields Extension

Using existing FA functions this works:-

editor_redirect($popup_editors, 'set');
$popup_editors = array(
    'customer' => array('/modules/additional_fields/manage/customers.php?debtor_no=', 
        113,    _("Customers"), 900, 600),
    'branch' => array('/sales/manage/customer_branches.php?SelectedBranch=', 
        114, _("Branches"), 900, 700),
    'supplier' => array('/modules/additional_fields/manage/suppliers.php?supplier_id=', 
        113, _("Suppliers"), 900, 700),
    'item' => array('/modules/additional_fields/manage/items.php?stock_id=', 
        115, _("Items"), 800, 600),
    'fa_item' => array('/modules/additional_fields/manage/items.php?FixedAsset=1&stock_id=', 
        115, _("Items"), 800, 600)
editor_return($popup_editors, 'set');

but this only works in the page loaded.

So do I need to load this into current session somehow?

but context restore is loading it into session.. so why isn't it loading???

Re: Additional Fields Extension

@notrinos, as I understand so far

ajax 'var editors' array is set on each page, so either:-

$popup_editors needs to be set before the ajax function callEditor by calling the function in post 30 above, this it seems would have to be by ajax?


an ajax function to change the var editors array

But FA seems to have made provision for this by including the editor_redirect function which is otherwise redundant

I would appreciate any help you can give on this please

Re: Additional Fields Extension

@poncho -  If you are really interested to bring the custom fields. We have to make changes in the core to allow it to add additional fields.  Instead of making it as extension.  Try to make it within core. and get the difference of file with help of git difference. So it would be added to the core in next release of FA2.5.

Hope it sounds good. Also @joe waiting to hear your thoughts before he start working inside core.

we are ready to make this one.