Topic: Modules Add-Ons

Hello!
I've got the same problem with repgen and customer-import as described in https://frontaccounting.com/punbb/viewtopic.php?id=1903.
Are updated versions available?

Thks in advance,
barney

Re: Modules Add-Ons

The latest versions are those shown in Install/activate Modules/Extensions. You should probably use at least release 2.3.3 to use repgen extension.

/Joe

Re: Modules Add-Ons

Hi Joe!
Well, I use FA 2.3.3 and just upgraded to 2.3.4.
Ref. repgen: I think, I made a mistake, as repgen already comes via extensions installer?!?! 
Or are there differet repgen modules?
But customer-import still has the problem showing unknown under installed and avaiable.
Any idea?

barney

Re: Modules Add-Ons

Yes there are old repgen modules from the download site. Don't use them with newer releases.

Despite the unknown written, I still think it works. At least the latest versions. I haven't any experience, however, with this module.

/Joe

Re: Modules Add-Ons

I see....
But where will I find the customer-import in the menu?
Best regards,
barney

Re: Modules Add-Ons

I guess it will show up in the Sales tab. Maybe you have to logout and login again. I am not sure.

/Joe

Re: Modules Add-Ons

So it works...
I added a hooks.php.

Could you tell me, what is the meaning of '105<<8' in 'define ('SS_IMPORTCUSTOMERS', 105<<8);' .
Or is some kind of description available?

Bernd

Re: Modules Add-Ons

Hello again, I can only tell you the mathematical expression. somevalue<<8 means that the binary bits are shifted 8 times to the left smile

Maybe someone out there have a better understandable explanation.

/Joe

Re: Modules Add-Ons

Hi, I am new to FA and I am planning to use FA in our new project. So for the past few days I have been inspecting about extension in FA.
I have notice that some extensions use something like this in their hooks.php file:

define('SS_ASSETREGISTER', 101<<8);

What I realize is that every time there is that, there is this:

function install_access()
{
    $security_sections[SS_ASSETREGISTER] = _("Asset Register");
    $security_areas['SA_ASSETTYPE'] = array(SS_ASSETREGISTER|1, _("Asset Type Entries"));
    $security_areas['SA_ASSETS'] = array(SS_ASSETREGISTER|2, _("Assets Entries"));
    $security_areas['SA_AMORTISATION'] = array(SS_ASSETREGISTER|3, _("Amortisation Posting"));
    return array($security_areas, $security_sections);
}

(source taken from asset_register extension)

So I conclude that prefix SS_ means Security Section, the "define" statement above is used to define some kind of unique security level identifier, and that this defined constant will be used to define the security areas used by the extension.

Hope that helps.

Regards, [url=http://captainkuro.com]captain_kuro[/url]

Re: Modules Add-Ons

Hi captain_kuro,

thanks a lot,

barney

Re: Modules Add-Ons

You're welcome

kuro

Regards, [url=http://captainkuro.com]captain_kuro[/url]

Re: Modules Add-Ons

'define ('SS_IMPORTCUSTOMERS', 105<<8);'

I think a more important question is: Does the 105 have to be unique across all add-on modules?
Are we granted security permissions based upon that bit mask?

If two modules have the same SS_ value won't they be controlled together in the security settings?

Tom

Re: Modules Add-Ons

If you read the documentation /doc/access_levels.txt part 5.:

5. Example access control configuration file
--------------------------------------------

This is content of sample access control file for CRM extension module:

<?php
/*
    Define security section codes
*/
define('SS_CRM_C',    101<<8);
define('SS_CRM',    102<<8);
define('SS_CRM_A',    103<<8);

/*
    Additional security sections for CRM module
*/
$security_sections[SS_CRM_C] = _("CRM configuration");
$security_sections[SS_CRM] = _("CRM transactions");
$security_sections[SS_CRM_A] = _("CRM analytics");
/*
    Additional security areas for CRM module
*/
$security_areas['SA_CRMSETUP'] = array(SS_CRM_C|1, _("CRM module setup"));
$security_areas['SA_CRMCONTACTENTRY'] = array(SS_CRM|1, _("Customer contact entry"));
$security_areas['SA_CRMANALYITCS'] = array(SS_CRM|1, _("Pre-sale contact analytics"));

?>

The exact values used for security section codes are not very important, 
as they are rewritten by access control system during integration of
access extensions. Therefore numeric values of security sections/areas should 
never be used directly in the extensions source. Use string representations
instead when needed, or values retrieved from $security_areas array.

The exact values used for security section codes are not very important,
as they are rewritten by access control system during integration of
access extensions.

Though I never try to confirm this.

Regards, [url=http://captainkuro.com]captain_kuro[/url]

Re: Modules Add-Ons

Sounds interesting ....

barney

Re: Modules Add-Ons

So maybe they could all be the same value?
Seems odd to me...

Re: Modules Add-Ons

As I understand, the security section codes are rewritten during integration...
I haven't verfied this until now.

barney

Re: Modules Add-Ons

No, the values have to be defferent (see related php code), but in fact they are rewritten during installation.

Janusz

Re: Modules Add-Ons

How can developers request values for modules they create?

Maybe set a range for local use and any others need to be allocated by the core development team?

tom

Re: Modules Add-Ons

Tom, there is no need for central synchronizing security code numbers. You can use arbitrary numbers yet not  used in core FA code, e.g. 100, 102 etc. The numbers are reassigned later, and you should use only text identifiers in your code (the $security_area array keys).
Read comments at the top of access_leveles.inc file and all should be clear for you

Re: Modules Add-Ons

I have seen that, but it still begs the question:

Is it safe to assume you verify the contributed extensions have unique numbers before posting them on the website?

If I create a new extension from an existing one and forget to change the number, we could have two with the same number.

tom