<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — The Header option from module itself]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8695&amp;type=atom" />
	<updated>2022-10-16T18:34:12Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=8695</id>
		<entry>
			<title type="html"><![CDATA[Re: The Header option from module itself]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41578#p41578" />
			<content type="html"><![CDATA[<p>Just find this function&nbsp; and compare my code. You can update the change in it.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2022-10-16T18:34:12Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41578#p41578</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The Header option from module itself]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41577#p41577" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>kvvaradha wrote:</cite><blockquote><p>There is a small change in the core of pdf_report.inc will&nbsp; give us a good way to add template form from the module itself. </p><p>from the <strong>reporting/includes/pdf_report.inc</strong>:</p><div class="codebox"><pre><code>function NewPage() 
    {
        global $installed_extensions, $path_to_root;
    
    
        if ($this-&gt;pageNumber==0)
        {
            // check if there is pdf header template for this report
            // and set if it is found
            $tmpl_pdf = find_custom_file(&quot;/reporting/forms/&quot;.$this-&gt;headerTmpl.&quot;.pdf&quot;);
            if ($tmpl_pdf) {
                $this-&gt;tmplSize = $this-&gt;setSourceFile($tmpl_pdf);
            } else {
                // include reports installed inside extension modules
                if (count($installed_extensions) &gt; 0)
                {
                    $extensions = $installed_extensions;
                    foreach ($extensions as $ext)
                        if (($ext[&#039;active&#039;] &amp;&amp; $ext[&#039;type&#039;] == &#039;extension&#039;)) {
                            $tmpl_pdf = find_custom_file($path_to_root.&#039;/&#039;.$ext[&#039;path&#039;].&quot;/reporting/forms/&quot;.$this-&gt;headerTmpl.&quot;.pdf&quot;);
                            if ($tmpl_pdf) {
                                $this-&gt;tmplSize = $this-&gt;setSourceFile($tmpl_pdf);
                            }
                        }
                }
            }
        }

        $this-&gt;pageNumber++;
        parent::newPage();

        if ($this-&gt;tmplSize) {
            $this-&gt;row = $this-&gt;pageHeight - $this-&gt;topMargin; // reset row
            $id = $this-&gt;importPage(min($this-&gt;pageNumber, $this-&gt;tmplSize));
            $this-&gt;useTemplate($id);
        }

        // include related php file if any
        $tmpl_php = find_custom_file(&quot;/reporting/forms/&quot;.$this-&gt;headerTmpl.&quot;.php&quot;);
        if ($tmpl_php) {
            include($tmpl_php);
        }  else {
                // include reports installed inside extension modules
                if (count($installed_extensions) &gt; 0)
                {
                    $extensions = $installed_extensions;
                    foreach ($extensions as $ext)
                        if (($ext[&#039;active&#039;] &amp;&amp; $ext[&#039;type&#039;] == &#039;extension&#039;)) {
                            $tmpl_php = find_custom_file($path_to_root.&#039;/&#039;.$ext[&#039;path&#039;].&quot;/reporting/forms/&quot;.$this-&gt;headerTmpl.&quot;.php&quot;);
                            if ($tmpl_php) {
                                $this-&gt;tmplSize = $this-&gt;setSourceFile($tmpl_php);
                            }
                        }
                }
            }

        if (method_exists($this, $this-&gt;headerTmpl))    // draw predefined page layout if any
            $this-&gt;{$this-&gt;headerTmpl}();
    }</code></pre></div><p>This would help us to hook from the modules template to work on.</p></blockquote></div><p>howto use this header template ?</p>]]></content>
			<author>
				<name><![CDATA[tukang.computer]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=45836</uri>
			</author>
			<updated>2022-10-15T18:13:10Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41577#p41577</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The Header option from module itself]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37194#p37194" />
			<content type="html"><![CDATA[<p>@kvvaradha.<br />Sure, I also thought about a global config.php flag if the login was from theme, however for safety I think it is better going from existing login.php where all the tests code is executed here and only the layout would be called from theme if a login.inc file exists.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2020-03-25T15:43:09Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37194#p37194</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The Header option from module itself]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37193#p37193" />
			<content type="html"><![CDATA[<p>@Joe I tired in another way. From config.php we will save the default theme in a constant&nbsp; and then from sessions.inc we will check whether the theme login.php exist or not. If it exist, we can require that file. Otherwise it will require the access/login.php. it&#039;s good alternative i feel. And you can try yourself whether it works or not.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2020-03-25T15:35:52Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37193#p37193</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The Header option from module itself]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37192#p37192" />
			<content type="html"><![CDATA[<p>@kvvaradha<br />Actually I was doing some trial on login.inc file from the themes. The normal login.php checks if there is a login.inc file in the theme directory and if, this is called instead of the default login. It is prepared, but I thought it could wait to 2.5. To implement it in 2.5, I am waiting for some changing that Janusz want to do before we start implementing the 2.5 things. Unfortunately he is very occupied with his normal work at present.<br />In the example I did, I changed the login.php, and all the other helpers timeout etc. so it was easier to implement a theme login.<br />The trials works perfectly and it is safe.<br />The custom fields is also interesting for at least 2.5. And more.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2020-03-25T14:55:33Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37192#p37192</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The Header option from module itself]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37191#p37191" />
			<content type="html"><![CDATA[<p>There is no need to create new functionality for handling functions from modules. The existing program already checks the modules directory like this </p><p>/modules/module_name/reporting/repXXX.php and if anything is there and it was linked in reports_custom.php. that will be replacing with existing core reports. </p><p>With that it&#039;s good to change the rep files.&nbsp; And regarding the headers also it&#039;s connecting from modules directory and works properly.<br />Hope nothing to research more about it. </p><p>Actually I was trying to make few things. </p><p>*login files from themes directory<br />*hooks for custom fields in different area<br />*smtp for emails<br />* nicedit for textareas with on and off option<br />* bring salesman column in sales orders and debtor trans tables and alter queries to work on<br />* my batch functionality which I have done already. </p><br /><p>And I will make an unofficial version for users to get it.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2020-03-25T14:45:00Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37191#p37191</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The Header option from module itself]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37190#p37190" />
			<content type="html"><![CDATA[<p>No, I don&#039;t have any suggestions at present. Please continue experimenting. Maybe some good ideas will show up.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2020-03-25T12:09:25Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37190#p37190</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The Header option from module itself]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37188#p37188" />
			<content type="html"><![CDATA[<p>The changed <em>rep###.php</em> files can be placed in the <strong>company/#/reporting</strong> folder to substitute the standard ones in the core <strong>reporting</strong> folder.</p><p>@joe: any hooks for replacement header files?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2020-03-25T09:14:31Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37188#p37188</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The Header option from module itself]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37186#p37186" />
			<content type="html"><![CDATA[<p>@apmuthu, we created separate header file for each templates and made some changes inside the rep107, rep111, rep109 as well. and also all of these files we put it inside our module to take up here. Nothing touched in the core.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2020-03-25T02:33:21Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37186#p37186</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The Header option from module itself]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37181#p37181" />
			<content type="html"><![CDATA[<p>Wonder how dark backgrounds would go with printing. Pre-printed stationery may do it well too. They look good though! Did you have to <br />1, create a new header file itself or <br />2. just a PDF template like you described earlier or<br />3. make an extension with specific settings much like themes?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2020-03-24T18:11:33Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37181#p37181</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The Header option from module itself]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37172#p37172" />
			<content type="html"><![CDATA[<p>Here I have added the details of my templates to test it as well as change the templates. We have 4 templates now. And still we are adding 3 more soon.</p><p>https://www.kvcodes.com/module/premium-pdf-templates-frontaccounting/</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2020-03-23T03:16:17Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37172#p37172</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The Header option from module itself]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37170#p37170" />
			<content type="html"><![CDATA[<p>can u provide a sample template to test?</p>]]></content>
			<author>
				<name><![CDATA[boxygen]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20175</uri>
			</author>
			<updated>2020-03-22T10:46:16Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37170#p37170</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The Header option from module itself]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37080#p37080" />
			<content type="html"><![CDATA[<p>Then it should be okay if the sysadmin trusts the module&#039;s author.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2020-03-01T09:52:03Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37080#p37080</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The Header option from module itself]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37073#p37073" />
			<content type="html"><![CDATA[<p>No. My suggestion is to get the file from module. Not allowing end users to input into it. Or upload into the system.&nbsp; </p><p>And also I just figured out. The find_custom_file function get the module files too. So we can ignore the&nbsp; changes what I suggested.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2020-02-28T12:51:29Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37073#p37073</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The Header option from module itself]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=37052#p37052" />
			<content type="html"><![CDATA[<p>The pdf forms folder is okay and so is @kvvaradha&#039;s suggestion as long as the sysadmin allows it to be uploaded after vetting. Only that it should not be uploadable by the end user into the FA system especially through a normal web interface or user input form..</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2020-02-27T15:46:17Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=37052#p37052</id>
		</entry>
</feed>
