<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Hooking Up an Extension]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=1869</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=1869&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Hooking Up an Extension.]]></description>
		<lastBuildDate>Mon, 16 May 2011 18:03:12 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Hooking Up an Extension]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=9141#p9141</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (captain_kuro)]]></author>
			<pubDate>Mon, 16 May 2011 18:03:12 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=9141#p9141</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hooking Up an Extension]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=8631#p8631</link>
			<description><![CDATA[<p>No, FA should suport multiply extensions. Maybe you have misconfigured hooks file, or you have found a bug.</p>]]></description>
			<author><![CDATA[null@example.com (itronics)]]></author>
			<pubDate>Fri, 01 Apr 2011 09:28:30 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=8631#p8631</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hooking Up an Extension]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=8614#p8614</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (evilive)]]></author>
			<pubDate>Thu, 31 Mar 2011 00:18:59 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=8614#p8614</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hooking Up an Extension]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=8290#p8290</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (eclipxe)]]></author>
			<pubDate>Wed, 09 Feb 2011 04:23:51 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=8290#p8290</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hooking Up an Extension]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=8230#p8230</link>
			<description><![CDATA[<p>Sue. Clean and easy way.<br />Janusz</p>]]></description>
			<author><![CDATA[null@example.com (itronics)]]></author>
			<pubDate>Tue, 01 Feb 2011 18:54:28 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=8230#p8230</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hooking Up an Extension]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=8229#p8229</link>
			<description><![CDATA[<p>Sure. Clean and easy way.<br />Janusz</p>]]></description>
			<author><![CDATA[null@example.com (itronics)]]></author>
			<pubDate>Tue, 01 Feb 2011 18:54:25 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=8229#p8229</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hooking Up an Extension]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=8226#p8226</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (evilive)]]></author>
			<pubDate>Tue, 01 Feb 2011 13:47:22 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=8226#p8226</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hooking Up an Extension]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=8223#p8223</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (itronics)]]></author>
			<pubDate>Tue, 01 Feb 2011 11:11:59 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=8223#p8223</guid>
		</item>
		<item>
			<title><![CDATA[Hooking Up an Extension]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=8216#p8216</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (evilive)]]></author>
			<pubDate>Tue, 01 Feb 2011 08:29:09 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=8216#p8216</guid>
		</item>
	</channel>
</rss>
