<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Is it possible to extend the function get_ctrl in reports_classes.inc?]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=7719</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7719&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Is it possible to extend the function get_ctrl in reports_classes.inc?.]]></description>
		<lastBuildDate>Sun, 23 Sep 2018 22:48:14 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Is it possible to extend the function get_ctrl in reports_classes.inc?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32718#p32718</link>
			<description><![CDATA[<p>Yes, your right @boxygen, I&#039;d not looked at it for a while</p><p>Thank you</p>]]></description>
			<author><![CDATA[null@example.com (poncho1234)]]></author>
			<pubDate>Sun, 23 Sep 2018 22:48:14 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32718#p32718</guid>
		</item>
		<item>
			<title><![CDATA[Re: Is it possible to extend the function get_ctrl in reports_classes.inc?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32717#p32717</link>
			<description><![CDATA[<p>Why don&#039;t you look at the HR module by @notrinos. This is already done there</p>]]></description>
			<author><![CDATA[null@example.com (boxygen)]]></author>
			<pubDate>Sun, 23 Sep 2018 18:05:51 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32717#p32717</guid>
		</item>
		<item>
			<title><![CDATA[Re: Is it possible to extend the function get_ctrl in reports_classes.inc?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32711#p32711</link>
			<description><![CDATA[<p>@kvvaradha, thinking out loud here, but this may be relevant... a function cannot be extended it seems, but a class can so looking at:-</p><div class="codebox"><pre><code>File: \reporting\includes\reports_classes.inc
458: class Report
459: {
460:     var $id;
461:     var $name;
462:     var $ar_params;
463:     var $controls;
464:     
465:     function __construct($id, $name, $ar_params = null)
466:     {
467:         $this-&gt;id = $id;
468:         $this-&gt;name = $name;
469:         if ($ar_params) $this-&gt;set_controls($ar_params);
470:     }
471:     
472:     function set_controls($ar_params) {
473:         $this-&gt;controls = $ar_params;
474:     }
475:     
476:     function get_controls() {
477:         return $this-&gt;controls;
478:     }
479:     
480: }</code></pre></div><p>So function get_controls is only used once in:-<br /></p><div class="codebox"><pre><code>File: \reporting\includes\reports_classes.inc
104:                     $st_params .= $this-&gt;getOptions($report-&gt;get_controls(), $report-&gt;id);</code></pre></div><p>And in function getOptions is the line:-</p><div class="codebox"><pre><code>File: \reporting\includes\reports_classes.inc
146:                 $ctrl = $this-&gt;get_ctrl(&#039;PARAM_&#039;.$cnt, $type);</code></pre></div><p>also in the same function is:-<br /></p><div class="codebox"><pre><code>File: \reporting\includes\reports_classes.inc
136:             foreach($this-&gt;ctrl_handlers as $fun) { // first check for non-standard controls
137:</code></pre></div><p>I&#039;m struggling with my php knowledge, but has @joe/@janusz left us something here?</p>]]></description>
			<author><![CDATA[null@example.com (poncho1234)]]></author>
			<pubDate>Sat, 22 Sep 2018 19:03:23 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32711#p32711</guid>
		</item>
		<item>
			<title><![CDATA[Re: Is it possible to extend the function get_ctrl in reports_classes.inc?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32709#p32709</link>
			<description><![CDATA[<p>Isn&#039;t it supported already? I forget how but I remember saw a method to add custom parameter.</p>]]></description>
			<author><![CDATA[null@example.com (barbarian)]]></author>
			<pubDate>Sat, 22 Sep 2018 08:03:49 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32709#p32709</guid>
		</item>
		<item>
			<title><![CDATA[Re: Is it possible to extend the function get_ctrl in reports_classes.inc?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32707#p32707</link>
			<description><![CDATA[<p>I questioned similar doubt before. But no clue from the core developer. I think we have to extend the functionality of these functions. So we can write custom report parameters from extension itself.</p>]]></description>
			<author><![CDATA[null@example.com (kvvaradha)]]></author>
			<pubDate>Sat, 22 Sep 2018 01:31:07 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32707#p32707</guid>
		</item>
		<item>
			<title><![CDATA[Is it possible to extend the function get_ctrl in reports_classes.inc?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32706#p32706</link>
			<description><![CDATA[<p>Is it possible to extend the function get_ctrl in reports_classes.inc?</p><p>How can I add a custom report parameter?</p><p>I would like a custom report where a GL account range is selected automatically, to the defined gl accounts needed for the report, but the select gl accounts is still available for the user to select a different range of gl accounts.</p><p>Currently there is:-</p><div class="codebox"><pre><code>File: \reporting\includes\reports_classes.inc
270:                 case &#039;ACCOUNTS&#039;: // not used
271:                     return gl_account_types_list($name, null, _(&quot;No Account Group Filter&quot;), true);
272: 
273:                 case &#039;ACCOUNTS_NO_FILTER&#039;: // not used
274:                     return gl_account_types_list($name);
275: 
276:                 case &#039;GL_ACCOUNTS&#039;:
277:                     return gl_all_accounts_list($name);</code></pre></div><p>I&#039;ve tried to add parameters to reports_custom.php:-<br />_(&#039;From Account&#039;) =&gt; &#039;GL_ACCOUNTS&#039;,<br />_(&#039;To Account&#039;) =&gt; &#039;GL_ACCOUNTS&#039;,<br />but nothing worked for me - is this possible?</p><p>Another alternative would be to delete the gl account selection parameters and hard code the fromacc to the toacc in the report, but I would prefer a solution to the above.</p><p>Any help or advice would be much appreciated</p>]]></description>
			<author><![CDATA[null@example.com (poncho1234)]]></author>
			<pubDate>Fri, 21 Sep 2018 21:52:09 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32706#p32706</guid>
		</item>
	</channel>
</rss>
