<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Is it possible to extend the function get_ctrl in reports_classes.inc?]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7719&amp;type=atom" />
	<updated>2018-09-23T22:48:14Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7719</id>
		<entry>
			<title type="html"><![CDATA[Re: Is it possible to extend the function get_ctrl in reports_classes.inc?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32718#p32718" />
			<content type="html"><![CDATA[<p>Yes, your right @boxygen, I&#039;d not looked at it for a while</p><p>Thank you</p>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2018-09-23T22:48:14Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32718#p32718</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Is it possible to extend the function get_ctrl in reports_classes.inc?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32717#p32717" />
			<content type="html"><![CDATA[<p>Why don&#039;t you look at the HR module by @notrinos. This is already done there</p>]]></content>
			<author>
				<name><![CDATA[boxygen]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20175</uri>
			</author>
			<updated>2018-09-23T18:05:51Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32717#p32717</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Is it possible to extend the function get_ctrl in reports_classes.inc?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32711#p32711" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2018-09-22T19:03:23Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32711#p32711</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Is it possible to extend the function get_ctrl in reports_classes.inc?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32709#p32709" />
			<content type="html"><![CDATA[<p>Isn&#039;t it supported already? I forget how but I remember saw a method to add custom parameter.</p>]]></content>
			<author>
				<name><![CDATA[barbarian]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18954</uri>
			</author>
			<updated>2018-09-22T08:03:49Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32709#p32709</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Is it possible to extend the function get_ctrl in reports_classes.inc?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32707#p32707" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2018-09-22T01:31:07Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32707#p32707</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Is it possible to extend the function get_ctrl in reports_classes.inc?]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32706#p32706" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2018-09-21T21:52:09Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32706#p32706</id>
		</entry>
</feed>
