<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — reminders in 2.4]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=6476</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6476&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in reminders in 2.4.]]></description>
		<lastBuildDate>Sun, 09 Jul 2017 02:13:28 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: reminders in 2.4]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=28159#p28159</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 09 Jul 2017 02:13:28 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=28159#p28159</guid>
		</item>
		<item>
			<title><![CDATA[Re: reminders in 2.4]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=28152#p28152</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Sat, 08 Jul 2017 21:49:08 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=28152#p28152</guid>
		</item>
		<item>
			<title><![CDATA[Re: reminders in 2.4]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=28148#p28148</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 08 Jul 2017 16:14:35 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=28148#p28148</guid>
		</item>
		<item>
			<title><![CDATA[Re: reminders in 2.4]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=28144#p28144</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Sat, 08 Jul 2017 06:19:15 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=28144#p28144</guid>
		</item>
		<item>
			<title><![CDATA[Re: reminders in 2.4]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=28126#p28126</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 07 Jul 2017 13:31:37 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=28126#p28126</guid>
		</item>
		<item>
			<title><![CDATA[Re: reminders in 2.4]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=28106#p28106</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (toHZLjGk)]]></author>
			<pubDate>Tue, 04 Jul 2017 21:29:37 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=28106#p28106</guid>
		</item>
		<item>
			<title><![CDATA[Re: reminders in 2.4]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=28105#p28105</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Tue, 04 Jul 2017 16:04:30 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=28105#p28105</guid>
		</item>
		<item>
			<title><![CDATA[Re: reminders in 2.4]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=28104#p28104</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (toHZLjGk)]]></author>
			<pubDate>Tue, 04 Jul 2017 13:20:25 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=28104#p28104</guid>
		</item>
		<item>
			<title><![CDATA[Re: reminders in 2.4]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=28101#p28101</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Tue, 04 Jul 2017 01:35:20 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=28101#p28101</guid>
		</item>
		<item>
			<title><![CDATA[Re: reminders in 2.4]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=28100#p28100</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (toHZLjGk)]]></author>
			<pubDate>Mon, 03 Jul 2017 21:32:39 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=28100#p28100</guid>
		</item>
		<item>
			<title><![CDATA[Re: reminders in 2.4]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=28086#p28086</link>
			<description><![CDATA[<p>Clear browser cache. State versions of PHP/MySQL and OS and make sure you have the latest GitMaster version of FA.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 02 Jul 2017 10:37:55 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=28086#p28086</guid>
		</item>
		<item>
			<title><![CDATA[Re: reminders in 2.4]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=28083#p28083</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (toHZLjGk)]]></author>
			<pubDate>Sat, 01 Jul 2017 18:14:24 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=28083#p28083</guid>
		</item>
		<item>
			<title><![CDATA[Re: reminders in 2.4]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26408#p26408</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Tue, 20 Sep 2016 07:29:41 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26408#p26408</guid>
		</item>
		<item>
			<title><![CDATA[Re: reminders in 2.4]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26402#p26402</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (bobloblian)]]></author>
			<pubDate>Mon, 19 Sep 2016 22:56:39 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26402#p26402</guid>
		</item>
		<item>
			<title><![CDATA[Re: reminders in 2.4]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26384#p26384</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 17 Sep 2016 04:10:41 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26384#p26384</guid>
		</item>
	</channel>
</rss>
