1

(2 replies, posted in Report Bugs here)

The operation kinda failed if you're trying to set status from "Inactive" to "Active";  from "checked" to "unchecked" checkbox.

In this file -> "input_ui.inc"

in this function -> inactive_control_cell($id, $value, $table, $key)

at this line -> update_record_status($id, !$value, $table, $key);

Failed at !$value variable because :

if you !$value when $value = 0 >> it will return 1
if you !$value when $value = 1 >> it will return empty string >> sql will failed to update update record status

I guess if you change !$value to $value ? 0:1

That's kinda solve it.

2

(2 replies, posted in Reporting)

I have created an extension and reporting folder

/modules/extension_name/reporting/

I put all my custom reports in that reporting folder. All the report previously set up with :

$page_security = 'SA_OPEN';

As expected I don't have problem ti view/access all those reports. But when i changed the page security to :

$page_security = 'SA_REPORT_VIEW';

I received the following error message :
The security settings on your account do not permit you to print this report

But I have setup/hook necessary security setting and have enable/activate it. In my hooks.php file i have included the security area as follows :

'SA_REPORT_VIEW' => array(SS_HR_EXTS|50, "Report - view"),

When I used FA security area :

$page_security = 'SA_GLANALYTIC';

Don't have problem at all.

Is this a bug or am I missing something.

3

(1 replies, posted in Reporting)

Sorry, I've figured it out and it's quite simple. Wasn't thinking of it much when I post it yesterday. No wonder no one reply. big_smile

4

(1 replies, posted in Reporting)

My Situation :
I've created an extension called hr and it's working just fine. Have no problem hooking it up.

../modules/hr/

Then, I've created a reporting directory and created "reports_custom.php" file. I put all of my newly created reports in this directory.

../modules/hr/reporting/
../modules/hr/reporting/reports_custom.php
../modules/hr/reporting/rep801.php    (to rep806.php)

All of my reports have the following line :

$rep = new FrontReport('SALARY SLIP', "SalarySlip", user_pagesize());
$rep->SetHeaderType('Header4');

As you might figured out, I'm using/calling my own header function called "Header4" and I place this function in FrontReport class(in pdf_report.inc file).

/reporting/includes/pdf_report.inc

So, what am I trying to achieve here :
1. I don't want to touch/add/alter anything in any files/script that belong to FrontAccounting files.
2. I want to take off the "Header4" function and put it in my extension's reporting directory. The problem is I'm lost on how to hook it up with FrontReport class. Is it possible?
3. There're functions to hook an extension; functions to hook customs report but couldn't find any function to hook custom report "Header". Do enlight me.

5

(1 replies, posted in Reporting)

I have been trying to create new look for a report. Just need some info. Stumble into this function

function Text($c, $txt, $n=0, $corr=0, $r=0, $align='left', $border=0, $fill=0, $link=NULL, $stretch=1)

What does these variables represent?
$c
$n
$corr
$r

6

(8 replies, posted in Modules Add-on's)

I created second extension called hr and managed to install and activate the extension. The problem is that the tab and setup access for the new extension are not showing up. I thought I messed up the hooks.php file but that's not the case.

When I deactivate my first installed extension called claim, the tab and setup access for hr showing up just fine. So, I came to conclusion that only one installed extension can be use at one time.

Is that the case or am I missing something?

7

(6 replies, posted in FA Modifications)

I'm developing a new extension and I want the extension has same feel and look with the core script.

I would like to learn the framework behind the "Add new item to document" where you add new item into a document without reloading the page.

I have been trying for few days to add new item to a document but nothing showed up.

I want to know :
1. the differences between Ajax->Activate() and Ajax->AddUpdate()
2. when and why do we call these function

Please enlight me...

I have been working with new extension/add-on on FA for few weeks now. Takes me a while since I'm not that good with PHP. I'm still learning.

I can see that you have added new lines into sessions.php which is not something that should be done in the first place. For me, I'm trying not to touch/modified anything in core script especially session.php file.

1. Create new directory in modules directory. Give it a name of course.
2. Create hooks.php file in that new directory. This file will be the bridge that connect your extension with FA core script. So, it's an important file that must be created.
3. In this file :
    If you want to add new tab --> add install_tabs function into this file.
    If you want to add new access level --> add install_access function into this file.
    ... and so on.

Go and take a look on hooks.inc file for more information.

9

(8 replies, posted in Modules Add-on's)

Thanx for the help and clarification Janusz. Finally, it's working.

I ended up  doing it like this.

<?php
define ('SS_CL',71<<8);

class claim_app extends application
{
        function claim_app()
        {
                $this->application("claim", _($this->help_context = "&Claim"));

                $this->add_module(_("Claim Application"));
                $this->add_lapp_function(0, _("Sales Travelling Claim"),
                        $path_to_root.'/modules/claim/travel.php', 'SA_CLAPPLY', MENU_CLAIM);
                $this->add_lapp_function(0, _("Overtime Claim"),
                        $path_to_root.'/modules/claim/overtime.php', 'SA_CLAPPLY', MENU_CLAIM);
                $this->add_lapp_function(0, _("Monthly Claim"),
                        $path_to_root.'/modules/claim/monthly.php', 'SA_CLAPPLY', MENU_CLAIM);
                $this->add_lapp_function(0, _("Petty Cash"),
                        $path_to_root.'/modules/claim/pettycash.php', 'SA_CLAPPLY', MENU_CLAIM);
                $this->add_lapp_function(0, "","");
                $this->add_rapp_function(0, _("View My Claim"),
                        $path_to_root.'/modules/claim/myclaim.php', 'SA_CLVIEW', MENU_CLAIM);


                $this->add_module(_("Administer Claim"));
                $this->add_lapp_function(1, _("Claim Check Up"),
                        $path_to_root.'/modules/claim/ccheck.php', 'SA_CLCHECK', MENU_CLAIM);
                $this->add_lapp_function(1, _("Approved Claim"),
                        $path_to_root.'/modules/claim/capprove.php', 'SA_CLAPPROVE', MENU_CLAIM);
                $this->add_lapp_function(1, _("Claim Payment"),
                        $path_to_root.'/modules/claim/capprove.php', 'SA_CLPAYMENT', MENU_CLAIM);
                $this->add_lapp_function(1, "","");


                $this->add_extensions();
        }
}


class hooks_claim extends hooks {
        var $module_name = 'claim'; // extension module name.

        function install_tabs($app) {
                set_ext_domain('modules/claim');        // set text domain for gettext
                $app->add_application(new claim_app); // add menu tab defined by example_class
                set_ext_domain();
        }


        function install_access()
        {
                $security_sections[SS_CL] =     _("Claim");

                $security_areas['SA_CLAPPLY'] = array(SS_CL|1, _("Claim Application"));
                $security_areas['SA_CLCHECK'] = array(SS_CL|2, _("Check Claim"));
                $security_areas['SA_CLAPPROVE'] = array(SS_CL|3, _("Approve Claim"));
                $security_areas['SA_CLPAYMENT'] = array(SS_CL|4, _("Release Payment"));
                $security_areas['SA_CLVIEW'] = array(SS_CL|5, _("View My Claim"));

                return array($security_areas, $security_sections);
        }

}

?>

10

(8 replies, posted in Modules Add-on's)

I'm trying to install new extension but so far I'm failed to achieved what I wanted. I'm trying to install new :

1. Tab
2. Menu/Link
3. Security Access

So far I have :
1. Create a directory named "claim" inside "modules" directory.
2. Create file named "hooks.php" inside "claim" directory and it looks like this :

<?php
define ('SS_CL',71<<8);

class hooks_claim extends hooks {
        var $module_name = 'claim'; // extension module name.

        function install_tabs($app) {
                set_ext_domain('modules/claim');        // set text domain for gettext
                $app->add_application(new claim_app); // add menu tab defined by example_class
                set_ext_domain();
        }

        function install_access()
        {
                $security_sections[SS_CL] =     _("Claim");

                $security_areas['SA_CLAPPLY'] = array(SS_CL|1, _("Claim Application"));
                $security_areas['SA_CLCHECK'] = array(SS_CL|2, _("Check Claim"));
                $security_areas['SA_CLAPPROVE'] = array(SS_CL|3, _("Approve Claim"));
                $security_areas['SA_CLPAYMENT'] = array(SS_CL|4, _("Release Payment"));
                $security_areas['SA_CLVIEW'] = array(SS_CL|5, _("View My Claim"));

                return array($security_areas, $security_sections);
        }

}

?>

Result : I got blank/empty page.

I knew that I don't have any problem with the "install_access". So I figured that I have problem with the following line in install_tabs :

$app->add_application(new claim_app); // add menu tab defined by example_class

Don't have any idea of what it's mean but I'm sure that what causing the problem. So I ended up create a new file named "claim.php" inside "application" directory. And it looks like this :

<?php

class claim_app extends application 
{
    function claim_app() 
    {
        $this->application("claim", _($this->help_context = "&Claim"));
    
        $this->add_module(_("Claim Application"));
        $this->add_lapp_function(0, _("Sales Travelling Claim"),
            $path_to_root.'/modules/claim/travel.php', 'SA_CLAPPLY', MENU_CLAIM);
        $this->add_lapp_function(0, _("Overtime Claim"),
            $path_to_root.'/modules/claim/overtime.php', 'SA_CLAPPLY', MENU_CLAIM);
        $this->add_lapp_function(0, _("Monthly Claim"),
            $path_to_root.'/modules/claim/monthly.php', 'SA_CLAPPLY', MENU_CLAIM);
        $this->add_lapp_function(0, _("Petty Cash"),
            $path_to_root.'/modules/claim/pettycash.php', 'SA_CLAPPLY', MENU_CLAIM);
        $this->add_lapp_function(0, "","");
        $this->add_rapp_function(0, _("View My Claim"),
            $path_to_root.'/modules/claim/myclaim.php', 'SA_CLVIEW', MENU_CLAIM);
        

        $this->add_module(_("Administer Claim"));
        $this->add_lapp_function(1, _("Claim Check Up"),
            $path_to_root.'/modules/claim/ccheck.php', 'SA_CLCHECK', MENU_CLAIM);
        $this->add_lapp_function(1, _("Approved Claim"),
            $path_to_root.'/modules/claim/capprove.php', 'SA_CLAPPROVE', MENU_CLAIM);
        $this->add_lapp_function(1, _("Claim Payment"),
            $path_to_root.'/modules/claim/capprove.php', 'SA_CLPAYMENT', MENU_CLAIM);
        $this->add_lapp_function(1, "","");
        

        $this->add_extensions();
    }
}

?>

Result : I still got blank/empty page.

What's my mistake? Am I missing something? Really need some guidance here.

11

(2 replies, posted in Modules Add-on's)

Thanx for clearing that up.

12

(2 replies, posted in Modules Add-on's)

In Install/Activate extensions page, what does the "Add third-party extension" button do? What's it function?

When I click on it, it did nothing.

13

(2 replies, posted in Modules Add-on's)

Thanx Joe for the info.

14

(2 replies, posted in Modules Add-on's)

Sorry for the silly question. What the differences between module, add-on and extension?