<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: P4A 3.0.1 released</title>
	<atom:link href="http://fabrizioballiano.net/2008/06/29/p4a-301-released/feed/" rel="self" type="application/rss+xml" />
	<link>http://fabrizioballiano.net/2008/06/29/p4a-301-released/</link>
	<description></description>
	<lastBuildDate>Thu, 25 Feb 2010 01:32:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Fabrizio Balliano</title>
		<link>http://fabrizioballiano.net/2008/06/29/p4a-301-released/comment-page-1/#comment-3498</link>
		<dc:creator>Fabrizio Balliano</dc:creator>
		<pubDate>Wed, 09 Jul 2008 09:14:05 +0000</pubDate>
		<guid isPermaLink="false">http://fabrizioballiano.net/?p=181#comment-3498</guid>
		<description>@Eddie:added with multi-pk support :-) thank you for suggestion!</description>
		<content:encoded><![CDATA[<p>@Eddie:added with multi-pk support :-) thank you for suggestion!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabrizio Balliano</title>
		<link>http://fabrizioballiano.net/2008/06/29/p4a-301-released/comment-page-1/#comment-3495</link>
		<dc:creator>Fabrizio Balliano</dc:creator>
		<pubDate>Wed, 09 Jul 2008 07:21:09 +0000</pubDate>
		<guid isPermaLink="false">http://fabrizioballiano.net/?p=181#comment-3495</guid>
		<description>@Eddie: I&#039;ll take a look at your second suggestion, for the first please post more info on forums. thank you!</description>
		<content:encoded><![CDATA[<p>@Eddie: I&#8217;ll take a look at your second suggestion, for the first please post more info on forums. thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie</title>
		<link>http://fabrizioballiano.net/2008/06/29/p4a-301-released/comment-page-1/#comment-3484</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Tue, 08 Jul 2008 23:59:47 +0000</pubDate>
		<guid isPermaLink="false">http://fabrizioballiano.net/?p=181#comment-3484</guid>
		<description>I recommend the modification of the line 742 of db_source to incorporate something like:

$pks = $this-&gt;getPk();
$pkvalue = $p4a_db_table-&gt;insert($fields_values);

if (is_string($pks) &amp;&amp; !is_array($pkvalue)) {
   $this-&gt;fields-&gt;$pks-&gt;setValue($pkvalue);
}</description>
		<content:encoded><![CDATA[<p>I recommend the modification of the line 742 of db_source to incorporate something like:</p>
<p>$pks = $this-&gt;getPk();<br />
$pkvalue = $p4a_db_table-&gt;insert($fields_values);</p>
<p>if (is_string($pks) &amp;&amp; !is_array($pkvalue)) {<br />
   $this-&gt;fields-&gt;$pks-&gt;setValue($pkvalue);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie</title>
		<link>http://fabrizioballiano.net/2008/06/29/p4a-301-released/comment-page-1/#comment-3483</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Tue, 08 Jul 2008 23:48:27 +0000</pubDate>
		<guid isPermaLink="false">http://fabrizioballiano.net/?p=181#comment-3483</guid>
		<description>Hi Fabrizio, I use an auto_increment field for my tables, why after insert a record via saveRow() method, the pointer goes to te first row..? I&#039;ve traced the saveRow() and the value of my pk field is actually gathered, but never is setted to the P4A_DB_Field to allow save the multivalue fields and locate the new row.</description>
		<content:encoded><![CDATA[<p>Hi Fabrizio, I use an auto_increment field for my tables, why after insert a record via saveRow() method, the pointer goes to te first row..? I&#8217;ve traced the saveRow() and the value of my pk field is actually gathered, but never is setted to the P4A_DB_Field to allow save the multivalue fields and locate the new row.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabrizio Balliano</title>
		<link>http://fabrizioballiano.net/2008/06/29/p4a-301-released/comment-page-1/#comment-3267</link>
		<dc:creator>Fabrizio Balliano</dc:creator>
		<pubDate>Fri, 04 Jul 2008 08:52:25 +0000</pubDate>
		<guid isPermaLink="false">http://fabrizioballiano.net/?p=181#comment-3267</guid>
		<description>yeah nice suggestion, please post a feature request so we&#039;re not going to forget this :)</description>
		<content:encoded><![CDATA[<p>yeah nice suggestion, please post a feature request so we&#8217;re not going to forget this :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: blas</title>
		<link>http://fabrizioballiano.net/2008/06/29/p4a-301-released/comment-page-1/#comment-3266</link>
		<dc:creator>blas</dc:creator>
		<pubDate>Fri, 04 Jul 2008 08:42:44 +0000</pubDate>
		<guid isPermaLink="false">http://fabrizioballiano.net/?p=181#comment-3266</guid>
		<description>Fabrizio,

  I want to make a comment (or maybe suggestion) about setSource...

  I see that p4a uses the info zend_db_table method in order to know the fields of a table and creates it in the mask.

  I&#039;m thinking that, could be, it will be a useful enhacement, in a future version, using the metadata information provided by this call to set another field property as length (and maybe width ) or some validator (as nullable, type, etc.) by default.

  I don&#039;t know if this culd be possible or I forgot something ...

   TIA,

blas</description>
		<content:encoded><![CDATA[<p>Fabrizio,</p>
<p>  I want to make a comment (or maybe suggestion) about setSource&#8230;</p>
<p>  I see that p4a uses the info zend_db_table method in order to know the fields of a table and creates it in the mask.</p>
<p>  I&#8217;m thinking that, could be, it will be a useful enhacement, in a future version, using the metadata information provided by this call to set another field property as length (and maybe width ) or some validator (as nullable, type, etc.) by default.</p>
<p>  I don&#8217;t know if this culd be possible or I forgot something &#8230;</p>
<p>   TIA,</p>
<p>blas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabrizio Balliano</title>
		<link>http://fabrizioballiano.net/2008/06/29/p4a-301-released/comment-page-1/#comment-3095</link>
		<dc:creator>Fabrizio Balliano</dc:creator>
		<pubDate>Wed, 02 Jul 2008 08:22:04 +0000</pubDate>
		<guid isPermaLink="false">http://fabrizioballiano.net/?p=181#comment-3095</guid>
		<description>@Eddie: thank you, I&#039;ll give that a look asap!</description>
		<content:encoded><![CDATA[<p>@Eddie: thank you, I&#8217;ll give that a look asap!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie</title>
		<link>http://fabrizioballiano.net/2008/06/29/p4a-301-released/comment-page-1/#comment-3087</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Tue, 01 Jul 2008 20:40:33 +0000</pubDate>
		<guid isPermaLink="false">http://fabrizioballiano.net/?p=181#comment-3087</guid>
		<description>Fabrizio, using the exportToCSV method of P4A_DB_Source, I noted that the columns are disordered &#039;cause the Joins; I modified the code to export the data in the order that the $fields_names are setted:

	public function getAsCSV($separator = &#039;,&#039;, $fields_names = null)
	{
		if ($fields_names === true or is_array($fields_names)) {
			$insert_header = true;
		} else {
			$insert_header = false;
		}

		if ($fields_names === null or $fields_names === false or $fields_names === true) {
			$fields_names = array();
			while ($field = $this-&gt;fields-&gt;nextItem()) {
				$name = $field-&gt;getName();
				$fields_names[$name] = $name;
			}
		}

		$csv = &quot;&quot;;
		$rows = $this-&gt;getAll();

		if ($insert_header) {
			array_unshift($rows, $fields_names);
		}

		foreach ($rows as $row) {
			$strrow = &quot;&quot;;
			foreach ($fields_names as $field=&gt;$label) {
				if (array_key_exists($field, $row)) {
					$col = str_replace(&quot;\n&quot;,&quot;&quot;,$row[$field]);
					$col = str_replace(&quot;\r&quot;,&quot;&quot;,$col);
					$strrow .= &#039;&quot;&#039; . str_replace(&#039;&quot;&#039;,&#039;&quot;&quot;&#039;,$col . &quot;\&quot;{$separator}&quot;);
				}
			}
			$csv .= substr($strrow,0,-1) . &quot;\n&quot;;
		}
		return $csv;
	}</description>
		<content:encoded><![CDATA[<p>Fabrizio, using the exportToCSV method of P4A_DB_Source, I noted that the columns are disordered &#8217;cause the Joins; I modified the code to export the data in the order that the $fields_names are setted:</p>
<p>	public function getAsCSV($separator = &#8216;,&#8217;, $fields_names = null)<br />
	{<br />
		if ($fields_names === true or is_array($fields_names)) {<br />
			$insert_header = true;<br />
		} else {<br />
			$insert_header = false;<br />
		}</p>
<p>		if ($fields_names === null or $fields_names === false or $fields_names === true) {<br />
			$fields_names = array();<br />
			while ($field = $this-&gt;fields-&gt;nextItem()) {<br />
				$name = $field-&gt;getName();<br />
				$fields_names[$name] = $name;<br />
			}<br />
		}</p>
<p>		$csv = &#8220;&#8221;;<br />
		$rows = $this-&gt;getAll();</p>
<p>		if ($insert_header) {<br />
			array_unshift($rows, $fields_names);<br />
		}</p>
<p>		foreach ($rows as $row) {<br />
			$strrow = &#8220;&#8221;;<br />
			foreach ($fields_names as $field=&gt;$label) {<br />
				if (array_key_exists($field, $row)) {<br />
					$col = str_replace(&#8220;\n&#8221;,&#8221;",$row[$field]);<br />
					$col = str_replace(&#8220;\r&#8221;,&#8221;",$col);<br />
					$strrow .= &#8216;&#8221;&#8216; . str_replace(&#8216;&#8221;&#8216;,&#8217;&#8221;"&#8216;,$col . &#8220;\&#8221;{$separator}&#8221;);<br />
				}<br />
			}<br />
			$csv .= substr($strrow,0,-1) . &#8220;\n&#8221;;<br />
		}<br />
		return $csv;<br />
	}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
