<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux für alle &#187; nag</title>
	<atom:link href="http://www.simplylinux.ch/tag/nag/feed" rel="self" type="application/rss+xml" />
	<link>http://www.simplylinux.ch</link>
	<description>Jeder kann Linux beherrschen lernen...</description>
	<lastBuildDate>Sat, 19 Nov 2011 17:37:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Kontact / Akonadi  Horde Sync</title>
		<link>http://www.simplylinux.ch/kontact-akonadi-horde-sync</link>
		<comments>http://www.simplylinux.ch/kontact-akonadi-horde-sync#comments</comments>
		<pubDate>Thu, 08 Jul 2010 08:37:35 +0000</pubDate>
		<dc:creator>hyper_ch</dc:creator>
				<category><![CDATA[hyper_ch]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[akonadi]]></category>
		<category><![CDATA[horde]]></category>
		<category><![CDATA[ical]]></category>
		<category><![CDATA[kdepim]]></category>
		<category><![CDATA[kontact]]></category>
		<category><![CDATA[nag]]></category>
		<category><![CDATA[tasks]]></category>
		<category><![CDATA[todo]]></category>

		<guid isPermaLink="false">http://www.simplylinux.ch/?p=362</guid>
		<description><![CDATA[Ich habe eine Horde Installation (eine mit H3 und noch eine Testinstallation mit H4 &#8211; die ich aber erst noch am testen bin) und ich musste feststellen, dass die ToDos nicht sauber von Kontact / Akonadi nach Horde synchronisizert werden. Der Grund dafür ist ziemlich banal. Wenn in Kontact ein Todo als &#8220;fertig&#8221; markiert wird, [...]]]></description>
			<content:encoded><![CDATA[<p>Ich habe eine Horde Installation (eine mit H3 und noch eine Testinstallation mit H4 &#8211; die ich aber erst noch am testen bin) und ich musste feststellen, dass die ToDos nicht sauber von Kontact / Akonadi nach Horde synchronisizert werden.</p>
<p><span id="more-362"></span></p>
<p>Der Grund dafür ist ziemlich banal. Wenn in Kontact ein Todo als &#8220;fertig&#8221; markiert wird, dann benutzt es PERCENTAGE-COMPLETE:100. Horde hingegen betrachtet Todos nur als &#8220;fertig&#8221; an, wenn STATUS:COMPLETED ist. Ich habe dies entsprechend den <a href="http://bugs.horde.org/ticket/8703">Horde</a> wie auch <a href="https://bugs.kde.org/show_bug.cgi?id=216806">Akonadi</a> Enwicklern mitgeteilt, aber beide weigern sich auch nur einen Schritt auf den andern zu zugehen. Die Folge ist, dass die Todos nicht sauber abgeschlossen werden können.</p>
<p>Wie man sieht, sollte das Problem eigentlich ganz einfach zu beheben sein. Trotz vieler Monate die vergangen sind, wurde bisher nichts unternommen.</p>
<p>Also habe ich mich dann dran gesetzt und eine Lösung gesucht und bin zu folgendem Schluss gekommen:</p>
<p>(1) Man öffne folgende Datei horde/nag/lib/api.php</p>
<p>(2) Man suche</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><span class="kw2">function</span> _nag_put<span class="br0">&#40;</span><span class="re0">$path</span><span class="sy0">,</span> <span class="re0">$content</span><span class="sy0">,</span> <span class="re0">$content_type</span><span class="br0">&#41;</span>
<span class="br0">&#123;</span>
    <span class="kw1">require_once</span> <a href="http://www.php.net/dirname"><span class="kw3">dirname</span></a><span class="br0">&#40;</span><span class="kw4">__FILE__</span><span class="br0">&#41;</span> <span class="sy0">.</span> <span class="st_h">'/base.php'</span><span class="sy0">;</span></pre></div></div>
<p>(3) Man füge darunter ein:<br />
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><span class="re0">$tmp</span> <span class="sy0">=</span> <a href="http://www.php.net/explode"><span class="kw3">explode</span></a><span class="br0">&#40;</span><span class="st_h">'BEGIN:VTODO'</span><span class="sy0">,</span> <span class="re0">$content</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re0">$tmp</span> <span class="kw1">as</span> <span class="re0">$val</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
                <span class="re0">$findme</span>   <span class="sy0">=</span> <span class="st_h">'PERCENT-COMPLETE:100'</span><span class="sy0">;</span>
                <span class="re0">$pos</span> <span class="sy0">=</span> <a href="http://www.php.net/strpos"><span class="kw3">strpos</span></a><span class="br0">&#40;</span><span class="re0">$val</span><span class="sy0">,</span> <span class="re0">$findme</span><span class="br0">&#41;</span><span class="sy0">;</span>
                <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$pos</span> <span class="sy0">!==</span> <span class="kw4">false</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
                        <span class="re0">$tmp2</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><span class="st_h">'STATUS:NEEDS-ACTION'</span><span class="sy0">,</span> <span class="st_h">'STATUS:COMPLETED'</span><span class="sy0">,</span> <span class="re0">$val</span><span class="br0">&#41;</span><span class="sy0">;</span>
                <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span>
                        <span class="re0">$tmp2</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><span class="st_h">'STATUS:COMPLETED'</span><span class="sy0">,</span> <span class="st_h">'STATUS:NEEDS-ACTION'</span><span class="sy0">,</span> <span class="re0">$val</span><span class="br0">&#41;</span><span class="sy0">;</span>
                <span class="br0">&#125;</span>
        <span class="br0">&#125;</span>
        <span class="re0">$content</span> <span class="sy0">=</span> <a href="http://www.php.net/implode"><span class="kw3">implode</span></a><span class="br0">&#40;</span><span class="st_h">'BEGIN:VTODO'</span><span class="sy0">,</span> <span class="re0">$tmp2</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div></p>
<p>(4) So dass es nun folgendermassen aussieht:</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.simplylinux.ch/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><span class="kw2">function</span> _nag_put<span class="br0">&#40;</span><span class="re0">$path</span><span class="sy0">,</span> <span class="re0">$content</span><span class="sy0">,</span> <span class="re0">$content_type</span><span class="br0">&#41;</span>
<span class="br0">&#123;</span>
    <span class="kw1">require_once</span> <a href="http://www.php.net/dirname"><span class="kw3">dirname</span></a><span class="br0">&#40;</span><span class="kw4">__FILE__</span><span class="br0">&#41;</span> <span class="sy0">.</span> <span class="st_h">'/base.php'</span><span class="sy0">;</span>
        <span class="re0">$tmp</span> <span class="sy0">=</span> <a href="http://www.php.net/explode"><span class="kw3">explode</span></a><span class="br0">&#40;</span><span class="st_h">'BEGIN:VTODO'</span><span class="sy0">,</span> <span class="re0">$content</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re0">$tmp</span> <span class="kw1">as</span> <span class="re0">$val</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
                <span class="re0">$findme</span>   <span class="sy0">=</span> <span class="st_h">'PERCENT-COMPLETE:100'</span><span class="sy0">;</span>
                <span class="re0">$pos</span> <span class="sy0">=</span> <a href="http://www.php.net/strpos"><span class="kw3">strpos</span></a><span class="br0">&#40;</span><span class="re0">$val</span><span class="sy0">,</span> <span class="re0">$findme</span><span class="br0">&#41;</span><span class="sy0">;</span>
                <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$pos</span> <span class="sy0">!==</span> <span class="kw4">false</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
                        <span class="re0">$tmp2</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><span class="st_h">'STATUS:NEEDS-ACTION'</span><span class="sy0">,</span> <span class="st_h">'STATUS:COMPLETED'</span><span class="sy0">,</span> <span class="re0">$val</span><span class="br0">&#41;</span><span class="sy0">;</span>
                <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span>
                        <span class="re0">$tmp2</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><span class="st_h">'STATUS:COMPLETED'</span><span class="sy0">,</span> <span class="st_h">'STATUS:NEEDS-ACTION'</span><span class="sy0">,</span> <span class="re0">$val</span><span class="br0">&#41;</span><span class="sy0">;</span>
                <span class="br0">&#125;</span>
        <span class="br0">&#125;</span>
        <span class="re0">$content</span> <span class="sy0">=</span> <a href="http://www.php.net/implode"><span class="kw3">implode</span></a><span class="br0">&#40;</span><span class="st_h">'BEGIN:VTODO'</span><span class="sy0">,</span> <span class="re0">$tmp2</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/substr"><span class="kw3">substr</span></a><span class="br0">&#40;</span><span class="re0">$path</span><span class="sy0">,</span> <span class="nu0">0</span><span class="sy0">,</span> <span class="nu0">3</span><span class="br0">&#41;</span> <span class="sy0">==</span> <span class="st_h">'nag'</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="re0">$path</span> <span class="sy0">=</span> <a href="http://www.php.net/substr"><span class="kw3">substr</span></a><span class="br0">&#40;</span><span class="re0">$path</span><span class="sy0">,</span> 3<span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span></pre></div></div>
<p>(5) Man speichere die Datei und nun sollte es funktionieren.</p>
<p>Grundsätzlich wird damit folgendes gemacht:</p>
<p>- es wird der Input übernommen<br />
- es wird der gesamte Input bei jedem &#8216;BEGIN:VTODO&#8217; in einen Array gespalten<br />
- danach wird jedes Array-Element durchsucht, ob dort der String &#8216;PERCENT-COMPLETE:100&#8242; vorkommt.<br />
- ist dies der Fall, dann sollen alle STATUS Felder auf COMPLETE gesetzt werden in diesem Array-Element; ist dies nicht der Fall, dann sollen alle STATUS Felder auf NEEDS-ACTION gesetzt werden<br />
- mit dem Implode am Schluss wird der Array wieder in einen String umgewandelt und &#8216;BEGIN:VTODO&#8217; wird als Verbindungselement zwischen den Array-Elementen eingefügt.</p>
<p>Ich habe das nur auf H3 getestet und habe mir die H4 nag/lib/api.php nicht angeschaut. Ich gehe aber davon aus, dass es dort ähnlich funktionieren dürfte.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simplylinux.ch/kontact-akonadi-horde-sync/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

