<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Hooking Up an Extension]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=1869&amp;type=atom" />
	<updated>2011-05-16T18:03:12Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=1869</id>
		<entry>
			<title type="html"><![CDATA[Re: Hooking Up an Extension]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=9141#p9141" />
			<content type="html"><![CDATA[<p>BTW, I think you forgot to include &quot;global $path_to_root;&quot; inside claim_app constructor.<br /></p><div class="codebox"><pre><code>    function claim_app()
    {
        global $path_to_root;</code></pre></div><p>Without it, $path_to_root will become null or empty string.</p><p>kuro</p>]]></content>
			<author>
				<name><![CDATA[captain_kuro]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=6107</uri>
			</author>
			<updated>2011-05-16T18:03:12Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=9141#p9141</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Hooking Up an Extension]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=8631#p8631" />
			<content type="html"><![CDATA[<p>No, FA should suport multiply extensions. Maybe you have misconfigured hooks file, or you have found a bug.</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2011-04-01T09:28:30Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=8631#p8631</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Hooking Up an Extension]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=8614#p8614" />
			<content type="html"><![CDATA[<p>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&#039;s not the case.</p><p>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.</p><p>Is that the case or am I missing something?</p>]]></content>
			<author>
				<name><![CDATA[evilive]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3549</uri>
			</author>
			<updated>2011-03-31T00:18:59Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=8614#p8614</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Hooking Up an Extension]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=8290#p8290" />
			<content type="html"><![CDATA[<p>Hi! do you experimented this issue ? <br />https://frontaccounting.com/punbb/viewtopic.php?pid=8289</p><p>I have an extension like yours and I have my tab missed when I enter to a link in any tab.</p>]]></content>
			<author>
				<name><![CDATA[eclipxe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=1024</uri>
			</author>
			<updated>2011-02-09T04:23:51Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=8290#p8290</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Hooking Up an Extension]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=8230#p8230" />
			<content type="html"><![CDATA[<p>Sue. Clean and easy way.<br />Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2011-02-01T18:54:28Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=8230#p8230</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Hooking Up an Extension]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=8229#p8229" />
			<content type="html"><![CDATA[<p>Sure. Clean and easy way.<br />Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2011-02-01T18:54:25Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=8229#p8229</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Hooking Up an Extension]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=8226#p8226" />
			<content type="html"><![CDATA[<p>Thanx for the help and clarification Janusz. Finally, it&#039;s working.</p><p>I ended up&nbsp; doing it like this.</p><div class="codebox"><pre><code>&lt;?php
define (&#039;SS_CL&#039;,71&lt;&lt;8);

class claim_app extends application
{
        function claim_app()
        {
                $this-&gt;application(&quot;claim&quot;, _($this-&gt;help_context = &quot;&amp;Claim&quot;));

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


                $this-&gt;add_module(_(&quot;Administer Claim&quot;));
                $this-&gt;add_lapp_function(1, _(&quot;Claim Check Up&quot;),
                        $path_to_root.&#039;/modules/claim/ccheck.php&#039;, &#039;SA_CLCHECK&#039;, MENU_CLAIM);
                $this-&gt;add_lapp_function(1, _(&quot;Approved Claim&quot;),
                        $path_to_root.&#039;/modules/claim/capprove.php&#039;, &#039;SA_CLAPPROVE&#039;, MENU_CLAIM);
                $this-&gt;add_lapp_function(1, _(&quot;Claim Payment&quot;),
                        $path_to_root.&#039;/modules/claim/capprove.php&#039;, &#039;SA_CLPAYMENT&#039;, MENU_CLAIM);
                $this-&gt;add_lapp_function(1, &quot;&quot;,&quot;&quot;);


                $this-&gt;add_extensions();
        }
}


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

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


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

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

                return array($security_areas, $security_sections);
        }

}

?&gt;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[evilive]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3549</uri>
			</author>
			<updated>2011-02-01T13:47:22Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=8226#p8226</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Hooking Up an Extension]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=8223#p8223" />
			<content type="html"><![CDATA[<p>You have to include() your claim_app file into hooks.php - it will not be included automatically even when placed in application folder.</p><p>The blank page is because all the extension files are included before error reporting is switched on in config.php. We will fix this issue in next minor release to make developers live easier. In mean time you can just put<br /></p><div class="codebox"><pre><code>ini_set(&quot;display_errors&quot;, &quot;On&quot;); </code></pre></div><p>at the top of session.inc file to see php errors during development.<br />Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2011-02-01T11:11:59Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=8223#p8223</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Hooking Up an Extension]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=8216#p8216" />
			<content type="html"><![CDATA[<p>I&#039;m trying to install new extension but so far I&#039;m failed to achieved what I wanted. I&#039;m trying to install new :</p><p>1. Tab<br />2. Menu/Link<br />3. Security Access</p><p>So far I have :<br />1. Create a directory named &quot;claim&quot; inside &quot;modules&quot; directory.<br />2. Create file named &quot;hooks.php&quot; inside &quot;claim&quot; directory and it looks like this :</p><div class="codebox"><pre><code>&lt;?php
define (&#039;SS_CL&#039;,71&lt;&lt;8);

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

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

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

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

                return array($security_areas, $security_sections);
        }

}

?&gt;</code></pre></div><p><span style="color: #FF0000"><strong>Result : I got blank/empty page.</strong></span></p><p>I knew that I don&#039;t have any problem with the &quot;install_access&quot;. So I figured that I have problem with the following line in install_tabs :</p><div class="codebox"><pre><code>$app-&gt;add_application(new claim_app); // add menu tab defined by example_class</code></pre></div><p>Don&#039;t have any idea of what it&#039;s mean but I&#039;m sure that what causing the problem. So I ended up create a new file named &quot;claim.php&quot; inside &quot;application&quot; directory. And it looks like this :</p><div class="codebox"><pre><code>&lt;?php

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

        $this-&gt;add_module(_(&quot;Administer Claim&quot;));
        $this-&gt;add_lapp_function(1, _(&quot;Claim Check Up&quot;),
            $path_to_root.&#039;/modules/claim/ccheck.php&#039;, &#039;SA_CLCHECK&#039;, MENU_CLAIM);
        $this-&gt;add_lapp_function(1, _(&quot;Approved Claim&quot;),
            $path_to_root.&#039;/modules/claim/capprove.php&#039;, &#039;SA_CLAPPROVE&#039;, MENU_CLAIM);
        $this-&gt;add_lapp_function(1, _(&quot;Claim Payment&quot;),
            $path_to_root.&#039;/modules/claim/capprove.php&#039;, &#039;SA_CLPAYMENT&#039;, MENU_CLAIM);
        $this-&gt;add_lapp_function(1, &quot;&quot;,&quot;&quot;);
        

        $this-&gt;add_extensions();
    }
}

?&gt;</code></pre></div><p><span style="color: #FF0000"><strong>Result : I still got blank/empty page.</strong></span></p><p>What&#039;s my mistake? Am I missing something? Really need some guidance here.</p>]]></content>
			<author>
				<name><![CDATA[evilive]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3549</uri>
			</author>
			<updated>2011-02-01T08:29:09Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=8216#p8216</id>
		</entry>
</feed>
