1 (edited by lawmaina78 05/04/2012 10:14:17 am)

Topic: Trying to create Human Resource and Payroll Module but can't see it

Trying my first ever FA module, it's installing without issues but tabs are not created and can't see the links anywhere after installation. Here is the hooks.php file, what am I missing

<?php
define ('SS_HR',102<<8);

class human_resource extends application
{
        function human_resource()
        {
                $this->application("hr", _($this->help_context = "&Human Resource"));

                $this->add_module(_("Human Resource"));
                $this->add_lapp_function(0, _("Staff"),
                        $path_to_root.'/modules/human_resource/staff.php', 'SA_STAFF');
               

                $this->add_module(_("Payroll Management"));
                $this->add_lapp_function(1, _("Payroll Management"),
                        $path_to_root.'/modules/human_resource/payroll.php', 'SA_PAYROLL');
               

                $this->add_extensions();
        }
}


class hooks_hr extends hooks {
        var $module_name = 'human_resource'; // extension module name.

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


        function install_access()
        {
                $security_sections[SS_HR] =     _("Human Resource");

                $security_areas['SA_HR'] = array(SS_HR|1, _("Human Resource"));
                $security_areas['SA_PR'] = array(SS_HR|2, _("Payroll"));
               
                return array($security_areas, $security_sections);
        }

}

?>