<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>GTD Tools - AllMyThingsTodo</title>
	<atom:link href="http://blog.allmythingstodo.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.allmythingstodo.com</link>
	<description>Personal Productivity Blog, tasks management and tips</description>
	<pubDate>Mon, 19 May 2008 20:00:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>AllMyThingsToDo - Projects now ordered</title>
		<link>http://blog.allmythingstodo.com/allmythingstodo-projects-now-ordered/</link>
		<comments>http://blog.allmythingstodo.com/allmythingstodo-projects-now-ordered/#comments</comments>
		<pubDate>Mon, 19 May 2008 20:00:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.allmythingstodo.com/allmythingstodo-projects-now-ordered/</guid>
		<description><![CDATA[Hi all.
Now the projects can be ordered the way you want, using the &#8220;order&#8221; field in each project.
The default value is 1000, and all the same priority projects are alphabetically ordered, as usual.
AND the &#8220;-1&#8243; value hides the project from the main view and the project selector (to add new tasks).
Total programming time: 2 hours, [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all.</p>
<p>Now the projects can be ordered the way you want, using the &#8220;order&#8221; field in each project.</p>
<p>The default value is 1000, and all the same priority projects are alphabetically ordered, as usual.</p>
<p>AND the &#8220;-1&#8243; value hides the project from the main view and the project selector (to add new tasks).</p>
<p>Total programming time: 2 hours, I love cake php !!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allmythingstodo.com/allmythingstodo-projects-now-ordered/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Adding a CSV Export Feature</title>
		<link>http://blog.allmythingstodo.com/adding-a-csv-export-feature/</link>
		<comments>http://blog.allmythingstodo.com/adding-a-csv-export-feature/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 11:32:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[cakephp]]></category>

		<category><![CDATA[csv]]></category>

		<category><![CDATA[export]]></category>

		<guid isPermaLink="false">http://blog.allmythingstodo.com/adding-a-csv-export-feature/</guid>
		<description><![CDATA[Hi All:
This is a mini-howto to add a simple &#8220;export to csv&#8221; feature, so you can control your tasks and projects inside excel, or build reports of what you&#8217;ve done for a group of projects.
All the filters apply before the CSV file is created.
Note: The link to build the CSV is located at the bottom [...]]]></description>
			<content:encoded><![CDATA[<p>Hi All:</p>
<p>This is a mini-howto to add a simple &#8220;export to csv&#8221; feature, so you can control your tasks and projects inside excel, or build reports of what you&#8217;ve done for a group of projects.</p>
<p>All the filters apply before the CSV file is created.</p>
<p>Note: The link to build the CSV is located at the bottom of the Tasks table.</p>
<p>Step by step tutorial:</p>
<ul>
<li>Download this <a href="http://ifunk.net/cakephp/helpers/csv.php.txt">helper code</a>. Note: the original code was posted by Adam Royle <a href="http://groups.google.es/group/cake-php/browse_thread/thread/4e2e5aad49c23b40">here</a> i&#8217;m just copying his code for PHP 4 &amp; 5:</li>
</ul>
<pre>&lt;?php/*** CSV helper for cakePHP. Compatible with version 1.1.x.x and higher.*

* PHP versions 4 and 5

*

* Licensed under The MIT License

*

* @copyright		Adam Royle

* @license			http://www.opensource.org/licenses/mit-license.php The MIT License

*/

class CsvHelper extends Helper {	var $delimiter = ',';

var $enclosure = '"';

var $filename = null;

var $line = array();

var $buffer;

/**

* This option preserves leading zeros on numeric data when opened in Excel.

* Use it ONLY when the csv file is going to be opened in Excel, as it uses

* non-standard syntax, and will probably break in other systems.

*/

var $preserveLeadingZerosInExcel = false;

var $_tmpFile = false;

function CsvHelper() {

$this-&gt;clear();

}

/**

* Adds a multi-dimensional array to the buffer.

*

* @param array $data Multi-dimensional array

* @param boolean $addFieldNames Add a row of field names before adding data

* @access public

*/

function addGrid($data, $addFieldNames = true, $fieldList = null) {

if (!$data) {

return false;

}

if (@is_array(reset($row = reset($data)))) {

// Array generated by cakePHP model

// eg.

// $data = array(array('Model' =&gt; array('field_name' =&gt; 'field value')), array('Model' =&gt; array('field_name' =&gt; 'field value')))

$defaultModel = key($row);

if ($this-&gt;filename === null) {

$this-&gt;setFilename(Inflector::pluralize($defaultModel));

}

if ($fieldList) {

$fields = array();

foreach ($fieldList as $fieldName) {

if (strpos($fieldName, '.')) {

list($modelName, $fieldName) = explode('.', $fieldName);

} else {

$modelName = $defaultModel;

}

$fields[] = array(Inflector::humanize($modelName), $fieldName);

}

if ($addFieldNames){

foreach ($fields as $field) {

if ($field[0] != $defaultModel) {

$this-&gt;addField($field[0].&#8217; &#8216;.Inflector::humanize($field[1]));

} else {

$this-&gt;addField(Inflector::humanize($field[1]));

}

}

$this-&gt;endRow();

}

foreach ($data as $row) {

foreach ($fields as $field) {

@$this-&gt;addField($row[$field[0]][$field[1]]);

}

$this-&gt;endRow();

}

} else {

if ($addFieldNames){

foreach (reset($row) as $key =&gt; $value) {

$this-&gt;addField(Inflector::humanize($key));

}

$this-&gt;endRow();

}

foreach ($data as $row) {

$this-&gt;addRow($row[$defaultModel]);

}

}

} else {

// Regular 2-dimensional array (with or without keys).

// eg.

//			$data = array(array(&#8217;field_name&#8217; =&gt; &#8216;field_value&#8217;), array(&#8217;field_name&#8217; =&gt; &#8216;field_value&#8217;))

//	or

//			$data = array(array(&#8217;field value&#8217;), array(&#8217;field value&#8217;))

if ($fieldList) {

if ($addFieldNames){

foreach ($fieldList as $fieldName) {

$this-&gt;addField(Inflector::humanize($fieldName));

}

$this-&gt;endRow();

}

foreach ($data as $row) {

foreach ($fieldList as $fieldName) {

@$this-&gt;addField($row[$fieldName]);

}

$this-&gt;endRow();

}

} else {

if ($addFieldNames) {

foreach (reset($data) as $key =&gt; $value) {

$this-&gt;addField(Inflector::humanize($key));

}

$this-&gt;endRow();

}

foreach ($data as $row) {

$this-&gt;addRow($row);

}

}

}

}

/**

* Adds a single field value to the buffer. You must call $csv-&gt;endRow() to commit fields to the buffer.

*

* @param string $value Field value

* @access public

*/

function addField($value) {

$this-&gt;line[] = $value;

}

/**

* Commits the row of fields that were added by addField()

*

* @access public

*/

function endRow() {

$this-&gt;addRow($this-&gt;line);

$this-&gt;line = array();

}

/**

* Adds a single row to the buffer.

*

* @param array $row Data to be added

* @access public

*/

function addRow($row) {

if ($this-&gt;preserveLeadingZerosInExcel) {

// convert the number to a string formula

foreach ($row as $key =&gt; $value){

if (strlen($value) &gt; 1 &amp;&amp; $value[0] == &#8216;0&#8242; &amp;&amp; is_numeric($value)) {

$row[$key] = &#8216;=&#8221;&#8216;.$value.&#8217;&#8221;&#8216;;

}

}

}

fputcsv($this-&gt;buffer, $row, $this-&gt;delimiter, $this-&gt;enclosure);

}

/**

* Outputs headers

*

* @param string $filename Filename to save as

* @access public

*/

function renderHeaders($filename = null) {

if (is_string($filename)) {

$this-&gt;setFilename($filename);

}

if ($this-&gt;filename === null) {

$this-&gt;filename = &#8216;Data.csv&#8217;;

}

if ($this-&gt;filename) {

header(&#8221;Content-disposition:attachment;filename=&#8221;.$this-&gt;filename);

}

header(&#8221;Content-type:application/vnd.ms-excel&#8221;);

}

/**

* Sets the output filename. Automatically appends .csv if necessary.

*

* @param string $filename Filename to save as

* @access public

*/

function setFilename($filename) {

$this-&gt;filename = $filename;

if (strtolower(substr($this-&gt;filename, -4)) != &#8216;.csv&#8217;) {

$this-&gt;filename .= &#8216;.csv&#8217;;

}

}

/**

* Returns CSV string and clears internal buffer. Outputs headers() if necessary.

*

* @param mixed $outputHeaders Boolean to determine if should output headers, or a string to set the filename

* @param string $to_encoding Encoding to use

* @param string $from_encoding

* @return string String CSV formatted string

* @access public

*/

function render($outputHeaders = true, $to_encoding = null, $from_encoding = &#8220;auto&#8221;) {

if ($outputHeaders) {

if (is_string($outputHeaders)) {

$this-&gt;setFilename($outputHeaders);

}

$this-&gt;renderHeaders();

}

if ($this-&gt;_tmpFile) {

rewind($this-&gt;buffer);

$output = &#8221;;

while (!feof($this-&gt;buffer)) {

$output .= fread($this-&gt;buffer, 8192);

}

fclose($this-&gt;buffer);

} else {

rewind($this-&gt;buffer);

$output = stream_get_contents($this-&gt;buffer);

}

// get around excel bug (http://support.microsoft.com/kb/323626/)

if (substr($output,0,2) == &#8216;ID&#8217;) {

$pos = strpos($output, $this-&gt;delimiter);

if ($pos === false) {

$pos = strpos($output, &#8220;\n&#8221;);

}

if ($pos !== false) {

$output = $this-&gt;enclosure . substr($output, 0, $pos) . $this-&gt;enclosure . substr($output, $pos);

}

}

if ($to_encoding) {

$output = mb_convert_encoding($output, $to_encoding, $from_encoding);

}

$this-&gt;clear();

return $this-&gt;output($output);

}

/**

* Clears internal buffer. This is called automatically by CsvHelper::render()

*

* @access public

*/

function clear() {

$this-&gt;line = array();

$this-&gt;buffer = @fopen(&#8217;php://temp/maxmemory:&#8217;.(5*1024*1024), &#8216;r+&#8217;);

if ($this-&gt;buffer === false) {

$this-&gt;_tmpFile = true;

$this-&gt;buffer = tmpfile();

}

}

}

/**

* A PHP4 implementation of the equivalent PHP5 function

*

* See (http://www.php.net/manual/en/function.fputcsv.php) for details

*/

if (!function_exists(&#8217;fputcsv&#8217;)) {

function fputcsv(&amp;$handle, $fields = array(), $delimiter = &#8216;,&#8217;, $enclosure = &#8216;&#8221;&#8216;) {

$str = &#8221;;

$escape_char = &#8216;\\&#8217;;

foreach ($fields as $value) {

settype($value, &#8217;string&#8217;);

if (strpos($value, $delimiter) !== false ||

strpos($value, $enclosure) !== false ||

strpos($value, &#8220;\n&#8221;) !== false ||

strpos($value, &#8220;\r&#8221;) !== false ||

strpos($value, &#8220;\t&#8221;) !== false ||

strpos($value, &#8216; &#8216;) !== false) {

$str2 = $enclosure;

$escaped = 0;

$len = strlen($value);

for ($i=0;$i&lt;$len;$i++) {

if ($value[$i] == $escape_char) {

$escaped = 1;

} else if (!$escaped &amp;&amp; $value[$i] == $enclosure) {

$str2 .= $enclosure;

} else {

$escaped = 0;

}

$str2 .= $value[$i];

}

$str2 .= $enclosure;

$str .= $str2.$delimiter;

} else {

$str .= $value.$delimiter;

}

}

$str = substr($str,0,-1);

$str .= &#8220;\n&#8221;;

return fwrite($handle, $str);

}

}

?&gt;</pre>
<ul>
<li>Copy this code into file /app/views/helpers/csv.php</li>
<li>Add the helper to the controller where you are planning to use the CSV export feature.</li>
</ul>
<p><code>class XXXController extends AppController {<br />
</code><code>.....<br />
</code><code>    var $helpers = array('Html', 'Form' , 'Javascript', 'Ajax', <strong>&#8216;Csv&#8217;</strong>);</code><br />
<code>.....</code></p>
<ul>
<li>Create an export method that fetches the data (with a findAll for example) and set the data to the view. This method goes inside the controller with the CSV helper, of course <img src='http://blog.allmythingstodo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p><code>  function exportcsv() {<br />
$this-&gt;layout = '';<br />
$this-&gt;set('dataToExport', $this-&gt;ZZZZ-&gt;findAll());</code></p>
<p><code>  }</code></p>
<ul>
<li>Now, create a file in /app/views/yourcontrollername/exportcsv.ctp with this contents</li>
</ul>
<p><code>&lt;?php<br />
$csv-&gt;addGrid($</code><code>dataToExport</code><code>);<br />
echo $csv-&gt;render(true);<br />
?&gt;</code></p>
<ul>
<li>Done !</li>
</ul>
<p>Notes: If you want to test the code generated, change render(false) for render(true) on the view, and the code will be shown on the browser.</p>
<p>Enjoy this new feature.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allmythingstodo.com/adding-a-csv-export-feature/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CakePHP rss reader component installation</title>
		<link>http://blog.allmythingstodo.com/cakephp-rss-reader-component-installation/</link>
		<comments>http://blog.allmythingstodo.com/cakephp-rss-reader-component-installation/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 12:23:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[cakephp]]></category>

		<guid isPermaLink="false">http://blog.allmythingstodo.com/cakephp-rss-reader-component-installation/</guid>
		<description><![CDATA[Hi all !
Today I&#8217;ve installed an RSS Reader Component in my cake application, so you can read the news at login time.
How ?
First, after searching cake community (bakery), I located this CakePHP RSS component
Following the instructions (very easy), you download the component into your vendors and components folder, then use it to get the feed, [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all !</p>
<p>Today I&#8217;ve installed an RSS Reader Component in my cake application, so you can read the news at login time.</p>
<p>How ?</p>
<p>First, after searching cake community (bakery), I located this <a href="http://bakery.cakephp.org/articles/view/simplepie-cakephp-component" target="_blank">CakePHP RSS component</a></p>
<p>Following the instructions (very easy), you download the component into your vendors and components folder, then use it to get the feed, and display it as you like.</p>
<p>Tip: Cake has a funtion &#8220;truncate&#8221; inside the Text Helper to aid you if you like to get the first N characters for a headline or description of your feed.</p>
<p>Here is the code I&#8217;ve used</p>
<pre>#CONTROLLER</pre>
<pre>var $helpers = array('Javascript','DAuth', 'Text');
var $components = array('DAuth','RequestHandler', 'Simplepie');</pre>
<pre>...... code ......</pre>
<pre>$items = $this-&gt;Simplepie-&gt;feed('http://blog.allmythingstodo.com/rss');
$this-&gt;set('feeds', $items);</pre>
<pre>#END OF CONTROLLER</pre>
<pre></pre>
<pre>#VIEW</pre>
<pre>&lt;?php
foreach($feeds as $feed) {
  echo $html-&gt;link($feed-&gt;get_title(), $feed-&gt;get_permalink()) . '&lt;br/&gt;';
  echo $text-&gt;truncate($feed-&gt;get_description());
}
?&gt;</pre>
<pre>#END OF VIEW</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.allmythingstodo.com/cakephp-rss-reader-component-installation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hello !</title>
		<link>http://blog.allmythingstodo.com/hello/</link>
		<comments>http://blog.allmythingstodo.com/hello/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 17:20:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.allmythingstodo.com/hello/</guid>
		<description><![CDATA[Hello dear allmythingstodo user or casual reader.
My name is Mauro Cabestany and I&#8217;m working now for 3 months in this little project, which aims to be a complete GTD oriented Personal Management Tool, to assist you in your workload planning.
Please feel free to login at my GTD Tools - AllMyThingsToDo page and start using it [...]]]></description>
			<content:encoded><![CDATA[<p>Hello dear allmythingstodo user or casual reader.</p>
<p>My name is Mauro Cabestany and I&#8217;m working now for 3 months in this little project, which aims to be a complete GTD oriented Personal Management Tool, to assist you in your workload planning.</p>
<p>Please feel free to login at my <a href="http://www.allmythingstodo.com">GTD Tools - AllMyThingsToDo</a> page and start using it for free.</p>
<p>By the way, don&#8217;t worry about your email, or use a junk email to register because we are not using any validation. If we need to contact you, we&#8217;ll use this blog to keep in touch with AMTTD users.</p>
<p>Remember, contribute with suggestions or comments. Positive and negative feedback is welcome.</p>
<p>Spammers, please don&#8217;t touch my blogs.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.allmythingstodo.com/hello/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
