<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — reminders in 2.4]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6476&amp;type=atom" />
	<updated>2017-07-09T02:13:28Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=6476</id>
		<entry>
			<title type="html"><![CDATA[Re: reminders in 2.4]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28159#p28159" />
			<content type="html"><![CDATA[<p>Hence using the wrapper function <strong>user_use_date_picker()</strong> obviates the need to globalise $SysPrefs here.<br />Thanks.</p><p>Please update the extensions for FA 2.4.1.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-07-09T02:13:28Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28159#p28159</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reminders in 2.4]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28152#p28152" />
			<content type="html"><![CDATA[<p>Ok, sorry my mistake. Then it is per default set to 1 in the sys_pref class. That is to say that the $SysPref-&gt;use_date_picker is set to 1 per default.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2017-07-08T21:49:08Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28152#p28152</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reminders in 2.4]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28148#p28148" />
			<content type="html"><![CDATA[<p>The variable <strong>$use_date_picker</strong> is not in the <strong>config.default.php</strong> file in FA 2.4.1+.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-07-08T16:14:35Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28148#p28148</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reminders in 2.4]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28144#p28144" />
			<content type="html"><![CDATA[<p>In 2.4 all the global defined variables in config.php is assembled into the global $SysPrefs variable, so the name of the global variables is now $SysPrefs-&gt;use_date_picker. Then we only need to declare the $SysPrefs variable as global.<br />However if you are using the old $use_date_picker in an extension and you declare this as global in your routines is should work adequate.<br />For simplicity we have surrounded the new global members by macros, like user_use_date_picker();</p><p>There should be no occurrencies of the old $use_date_picker in the core, besides the one in config.php.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2017-07-08T06:19:15Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28144#p28144</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reminders in 2.4]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28126#p28126" />
			<content type="html"><![CDATA[<p>Did you just swap the last part without wrapping any of the functions? If so we may need it to be as you described. There is no <strong>$use_date_picker</strong> at all in FA 2.4.1 as it is only a property in the <strong>user_prefs</strong> class.</p><p>Actually, the said function <strong>text_input</strong> is just defined in the extension with extra parameters and different order as well since a new parameter is at the beginning. It is not used anywhere in the extension. It is also not used in the dashboard_theme as well. We may consider <strong>removing this function</strong> in the extension. If this function gets used anywhere then the parameters and their order will affect such usage.</p><p>All instances in the core use the following construct:<br /></p><div class="codebox"><pre><code>$js = &quot;&quot;;
if (user_use_date_picker())
    $js = get_js_date_picker();</code></pre></div><p>@joe?</p><p>The original function in the core is used in the standard functions <strong>text_cells()</strong> and <strong>editor_view()</strong>.</p><p><a href="https://github.com/apmuthu/FA24extensions/commit/6aab507376559bcbd1fef815870c9239c67ff5a6">Committed</a> in my FA24Extensions Repo.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-07-07T13:31:37Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28126#p28126</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reminders in 2.4]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28106#p28106" />
			<content type="html"><![CDATA[<p>Hi apmuthu,</p><p>I wrapped up lines 507-515 from ui_input.inc as you suggested, which resulted in a shift of the error code from line 507 to 508. Then I unwrapped these code lines again and wrapped up lines 28-47 in dashboard_ui.inc. </p><div class="codebox"><pre><code>if (!function_exists(&#039;text_input&#039;)) {
function text_input($label, $name, $value=null, $size=&quot;&quot;, $max=&quot;&quot;, $title=false,
    $labparams=&quot;&quot;, $post_label=&quot;&quot;, $inparams=&quot;&quot;)
{
    global $Ajax;

    default_focus($name);
    if ($label != null)
        label_cell($label, $labparams);

    if ($value === null)
        $value = get_post($name);
    echo &quot;&lt;input $inparams type=\&quot;text\&quot; name=\&quot;$name\&quot; size=\&quot;$size\&quot; maxlength=\&quot;$max\&quot; value=\&quot;$value\&quot;&quot;
        .($title ? &quot; title=&#039;$title&#039;&quot; : &#039;&#039;)
        .&quot;&gt;&quot;;

    if ($post_label != &quot;&quot;)
        echo &quot; &quot; . $post_label;

    $Ajax-&gt;addUpdate($name, $name, $value);
}
}</code></pre></div><p>This resulted in an errorless Dashboard setup screen and a non functioning Reminder setup screen with error code &quot;Undefined variable: use_date_picker in file: /X/X/X/X/public_html/fa/modules/dashboard/reminder_setup.php at line 20&quot;. So function text_input() seems to be executed in dashboard_ui.inc later... Do you agree, can I leave it this way?</p><p>After I exchanged line 20 of reminder_setup.php </p><div class="codebox"><pre><code>if ($use_date_picker)
$js .= get_js_date_picker();</code></pre></div><p> with </p><div class="codebox"><pre><code>if (user_use_date_picker ()){
    $js .= get_js_date_picker();
 }</code></pre></div><p>everthing seems to work fine. Is this the way to go or should the variable &quot;$use_date_picker&quot; be used somehow. Please advice on both edits.</p><p>Regards,</p><p>Peter</p>]]></content>
			<author>
				<name><![CDATA[toHZLjGk]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20413</uri>
			</author>
			<updated>2017-07-04T21:29:37Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28106#p28106</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reminders in 2.4]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28105#p28105" />
			<content type="html"><![CDATA[<p>The <strong>function text_input()</strong> is available in <strong>modules/dashboard/includes/dashboard_ui.inc</strong> and is executed first. Therefore when the same function defined in <strong>includes/ui/ui_input.inc</strong> gets executed later, the said error arises. Hence we need to modify the function in the latter file to be executed only if the said function is not defined as yet when it is executed. The code in the latter file at line 507 onwards:<br /></p><div class="codebox"><pre><code>function text_input($name, $value=null, $size=&#039;&#039;, $max=&#039;&#039;, $title=&#039;&#039;, $params=&#039;&#039;)
{
    if ($value === null)
        $value = get_post($name);

    return &quot;&lt;input $params type=\&quot;text\&quot; name=\&quot;$name\&quot; size=\&quot;$size\&quot; maxlength=\&quot;$max\&quot; value=\&quot;$value\&quot;&quot;
        .($title ? &quot; title=&#039;$title&#039;&quot; : &#039;&#039;)
        .&quot;&gt;&quot;;
}</code></pre></div><p>should be wrapped like:<br /></p><div class="codebox"><pre><code>if (!function_exists(&#039;text_input&#039;)) {
function text_input($name, $value=null, $size=&#039;&#039;, $max=&#039;&#039;, $title=&#039;&#039;, $params=&#039;&#039;)
{
    if ($value === null)
        $value = get_post($name);

    return &quot;&lt;input $params type=\&quot;text\&quot; name=\&quot;$name\&quot; size=\&quot;$size\&quot; maxlength=\&quot;$max\&quot; value=\&quot;$value\&quot;&quot;
        .($title ? &quot; title=&#039;$title&#039;&quot; : &#039;&#039;)
        .&quot;&gt;&quot;;
}
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-07-04T16:04:30Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28105#p28105</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reminders in 2.4]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28104#p28104" />
			<content type="html"><![CDATA[<p>Hi Apmuthu,</p><p>Thank you for your help! Yet something must be terribly wrong here. I meticulously followed your instructions and I still get these &quot;Cannot redeclare text_input()&quot;/ blank screen errors, even in an completely new instance, freshly installed from your Git Master link, and looked up in a cacheless browser...</p><p>Any further suggestions?</p><p>Regards,</p><p>Peter</p>]]></content>
			<author>
				<name><![CDATA[toHZLjGk]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20413</uri>
			</author>
			<updated>2017-07-04T13:20:25Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28104#p28104</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reminders in 2.4]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28101#p28101" />
			<content type="html"><![CDATA[<p>Take latest <a href="https://github.com/FrontAccountingERP/FA/archive/master.zip">Git Master</a> or take the changed files from <a href="https://frontaccounting.com/punbb/viewtopic.php?pid=28076#p28076">this post</a>.</p><p>Dashboard is included in the FA 2.4.1. You may at best need the extension and make sure that the <strong>includes/dashboard.inc</strong> does not get overwritten or superseded. You can try to remove the old dashboard theme and extension first before upgrading and then install them afresh aferwards.</p><p>Do not forget to activate the dashboard for your specific company when logged in on the default company. When in the target company, make sure to enable ti for the access roles and permissions, logout, clear cache, close all browser instances and login again.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-07-04T01:35:20Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28101#p28101</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reminders in 2.4]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28100#p28100" />
			<content type="html"><![CDATA[<p>Cache cleared, no avail. Php 5.6.28, MySQL 5.5.38, Linux, FA 2.4.1 (downloaded from SourceForge, modified 2017-05-22). Dashboard &amp; Reminders used to work in FA 2.3.x.</p>]]></content>
			<author>
				<name><![CDATA[toHZLjGk]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20413</uri>
			</author>
			<updated>2017-07-03T21:32:39Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28100#p28100</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reminders in 2.4]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28086#p28086" />
			<content type="html"><![CDATA[<p>Clear browser cache. State versions of PHP/MySQL and OS and make sure you have the latest GitMaster version of FA.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-07-02T10:37:55Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28086#p28086</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reminders in 2.4]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28083#p28083" />
			<content type="html"><![CDATA[<p>Hi Apmuthu, hi bobloblian, dear all,</p><p>I also have the error &quot;Cannot redeclare text_input()...&quot;/ white screen (FA 2.4.1 with a prolonging update history) in Dashboard and Reminder Setup. As described here, I uninstalled, re-installed, deactivated, activated,disabled, enabled, choose default and dashboard themes, logged in and out, without result. Please advise.</p><p>Regards,</p><p>Peter</p>]]></content>
			<author>
				<name><![CDATA[toHZLjGk]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20413</uri>
			</author>
			<updated>2017-07-01T18:14:24Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28083#p28083</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reminders in 2.4]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=26408#p26408" />
			<content type="html"><![CDATA[<p>The Bank Payment is the correct way to go since it also labels it as a different voucher type used by FA in it&#039;s processing of payments allocations.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-09-20T07:29:41Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=26408#p26408</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reminders in 2.4]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=26402#p26402" />
			<content type="html"><![CDATA[<p>Still think something is broken here, but was working out a bank transfer so I could make a journal entry from a different bank account, when I figured out I could accomplish the same GL entries using a bank payment.&nbsp; So good now, thanks.</p>]]></content>
			<author>
				<name><![CDATA[bobloblian]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19664</uri>
			</author>
			<updated>2016-09-19T22:56:39Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=26402#p26402</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: reminders in 2.4]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=26384#p26384" />
			<content type="html"><![CDATA[<p>The <strong>function text_input()</strong> is declared in FA 2.4RC1 only once in <strong>includes/ui_input.inc</strong>. If the said file gets included more than once, then any such <strong>include / require</strong> should be made <strong>include_once / require_once</strong>. Removal of such seemingly redundant <strong>include / require</strong> should be done with caution as it may not always be redundant.</p><p>Dashboard extension v2.4.0.1 and dashboard_theme v2.4.0.1 are available to be installed via the official FA 2.4 extensions repo. Dashboard hooks are already present in FA 2.4 and as the said function above gets re-declared when using these plugins, they must be fixed.</p><p>Alternatively, using disposable functions / <a href="http://stackoverflow.com/questions/8691884/how-to-unset-a-function-definition-just-like-we-unset-a-variable">a check and unload if present</a> can be attempted before re-defining the said function or naming it differently and using this new name in all dashboard functions (will need to be cascaded into all the dashboard type themes). Lets avoid namespaces.....and PECL <a href="http://php.net/manual/en/function.runkit-function-remove.php">runkit</a> / <a href="http://ru2.php.net/manual/en/book.apd.php">APD&#039;s rename_function</a>....</p><p>@joe: your thoughts?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-09-17T04:10:41Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=26384#p26384</id>
		</entry>
</feed>
