<?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>Project Trackr Development Log &#187; Messages</title>
	<atom:link href="http://logbook.projecttrackr.com/category/section/messages/feed/" rel="self" type="application/rss+xml" />
	<link>http://logbook.projecttrackr.com</link>
	<description>Building a better web based project management solution</description>
	<lastBuildDate>Mon, 15 Mar 2010 15:33:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Are messages really that important</title>
		<link>http://logbook.projecttrackr.com/section/messages/are-messages-really-that-important/</link>
		<comments>http://logbook.projecttrackr.com/section/messages/are-messages-really-that-important/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 17:56:25 +0000</pubDate>
		<dc:creator>Damian Jakusz-Gostomski</dc:creator>
				<category><![CDATA[Messages]]></category>

		<guid isPermaLink="false">http://logbook.projecttrackr.com/?p=371</guid>
		<description><![CDATA[


The title of this post may be a bit misleading, especially as I&#8217;ve said in the past that communication is a key part of project management. The thing is, that was before I thought to add tickets, which has the same functionality as the messaging section and more, so really, there is no point in [...]]]></description>
			<content:encoded><![CDATA[<p>The title of this post may be a bit misleading, especially as I&#8217;ve said in the past that communication is a key part of project management. The thing is, that was before I thought to add tickets, which has the same functionality as the messaging section and more, so really, there is no point in replicating the same functionality across 2 sections, as then some of the communication ould take place via messages and some via tickets.</p>
<p>As a result, I&#8217;m removing the messages section although this may cause cofusion with users unfamiliar with the term &#8220;tickets&#8221; so I may leave the messages tab in explaining the decision to leave it out, or just point to the tickets section.</p>
]]></content:encoded>
			<wfw:commentRss>http://logbook.projecttrackr.com/section/messages/are-messages-really-that-important/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problem with nested messages client side</title>
		<link>http://logbook.projecttrackr.com/section/messages/problem-with-nested-messages-client-side/</link>
		<comments>http://logbook.projecttrackr.com/section/messages/problem-with-nested-messages-client-side/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 14:39:03 +0000</pubDate>
		<dc:creator>Damian Jakusz-Gostomski</dc:creator>
				<category><![CDATA[Messages]]></category>

		<guid isPermaLink="false">http://logbook.projecttrackr.com/?p=240</guid>
		<description><![CDATA[The relevant table is shown below:
+----+------------+---------+------------+-----------------+----------------------+
&#124; id &#124; account_id &#124; user_id &#124; project_id &#124; title           &#124; SUBSTR(body, 1, 20)  &#124;
+----+------------+---------+------------+-----------------+----------------------+
&#124;  1 &#124;          1 &#124;       1 &#124;   [...]]]></description>
			<content:encoded><![CDATA[<p>The relevant table is shown below:</p>
<pre class="code">+----+------------+---------+------------+-----------------+----------------------+
| id | account_id | user_id | project_id | title           | SUBSTR(body, 1, 20)  |
+----+------------+---------+------------+-----------------+----------------------+
|  1 |          1 |       1 |          1 | Damians message | Should only be visib |
|  2 |          2 |       2 |          2 | Roms message    | Should only be visib |
|  3 |          1 |       1 |          3 | Branding Info   | A message in a share |
+----+------------+---------+------------+-----------------+----------------------+</pre>
<p>The first message should be visible to the first user, the second message to the second, and then thrid to both. This works fine when viewing just a single project which is a leaf node in the hierachical representation of the project structure, but if viewing a project with one or more sub projects, the message from the sub project should also be displayed.</p>
<p><span id="more-240"></span></p>
<p>The contents of the project table is displayed below:</p>
<pre class="code">+----+-----+-----+-------------------+------------+-----------+
| id | lft | rgt | name              | company_id | client_id |
+----+-----+-----+-------------------+------------+-----------+
|  1 |   1 |   4 | Account root      |          1 |         0 |
|  2 |   1 |   2 | Account root      |          2 |         0 |
|  3 |   2 |   3 | Alumor rebranding |          1 |         2 |
+----+-----+-----+-------------------+------------+-----------+</pre>
<p>Projects 1 and 2 are top level projects which belong to users 1 and 2 respectively. The 3rd project is a project where user 1 is the company and user 2 is the client. This means that user 1 &#8220;owns&#8221; the project. As a direct consequence of this, the project is positioned in the companies project hierachy and not the clients one.</p>
<p>To understand why this causes a problem, I&#8217;ll need to explain the way in which messages are retreived in a project with child projects.</p>
<p>Based on the above schema, we can see that each row in the messages table corresponds to the project it belongs to. So to find all the messages in a leaf project, we just need to do a where clause on this ID. If we have multiple projects, we need to look for messages in a range of project IDs, which can be done using a where in clause. This itself would be easy and would work, but we only want to search projects which are sub projects of the current one.</p>
<p>Given the project we&#8217;re in now, we can get the left and right values for the project. Any node with a left value between these 2 must be a child of that node, as thats the key principle MPTT works on. In order to limit it to projects in this account, we need to also add a where clause to check the account ID is the same as our account ID.</p>
<p>This works fine for the company account, so if user 1 views the messages sectiion when he&#8217;s in the top level account, he see&#8217;s the message in the sub project as expected. If we then do the same on the client side, we don&#8217;t get the message in the child project (but we do when we view messages in that project). This is because we use the clients account ID as the where clause, and the nested project doesn&#8217;t match the clients hierachy.</p>
<p>An easy way to fix this would be to get the companies ID and use that in the where clause. The problem with this is, the company may have other nested projects in that hierachy that the client shouldn&#8217;t be seeing. A way around this would be to get the nested hierachy based on the company ID and then do an intersection of the projects IDs with the clients projects</p>
<h3>Update</h3>
<p>This successfully resolved the problem (but I need to do some checks once I have a more complicated project hierachy to make sure there are no nasty suprises).</p>
<p>However this led to the realisation of another (more serious?) problem. As the project is stored in the companies hierachy, when in the client mode, and in the top level project, it&#8217;s classed as a leaf node, as it&#8217;s left and right vales are one apart.</p>
<p>In order to resolve this, I&#8217;ll have to get all the projects a user is one, get all the projects below the given project in the companies project hierachy, and then intersect the results to get the projets the client should actually see, but I&#8217;ll save that for another entry.</p>
<h3>Update 2</h3>
<p>It turns out this isn&#8217;t actually a problem. Only the company needs to see the account in relation to the hierachy, the client just needs to see the problem as is. So all I need too do, is determine if the user is in the company or client account on the project, and if they&#8217;re in the client account, just show messages relevant to that project, and if they&#8217;re in the company account, we need to check the project hierachy. The only special case for the client is for the account root project, which can easily be identified as it has a left node value of 1. In this case, we just pull back all the users projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://logbook.projecttrackr.com/section/messages/problem-with-nested-messages-client-side/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Messages Intro</title>
		<link>http://logbook.projecttrackr.com/section/messages/messages-intro/</link>
		<comments>http://logbook.projecttrackr.com/section/messages/messages-intro/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 11:07:41 +0000</pubDate>
		<dc:creator>Damian Jakusz-Gostomski</dc:creator>
				<category><![CDATA[Messages]]></category>
		<category><![CDATA[intro]]></category>

		<guid isPermaLink="false">http://logbook.projecttrackr.com/?p=147</guid>
		<description><![CDATA[Communication is key to the success of any project, not only between the company and the client, but within the team. The messages section lets you do just this, it lets clients and companies to send messages between themselves, as well as messages internal to the company.
The messages section acts as a centralised repository for [...]]]></description>
			<content:encoded><![CDATA[<p>Communication is key to the success of any project, not only between the company and the client, but within the team. The messages section lets you do just this, it lets clients and companies to send messages between themselves, as well as messages internal to the company.</p>
<p>The messages section acts as a centralised repository for all the messages sent during the project. By no longer having them scattered through countless email accounts spread across different users email systems, we can ensure all users know what&#8217;s going on, as everyone has the same information available to them. It will also be possible to send messages within the company on a project (just like you could send an internal email to your company) but the default is to be as open as possible.</p>
<p>Standard options such as sorting messages into categories will be available, and you can reply to a message just like you would with an email. A basic WYSIWYG editor will also be available, but will be heavily stripped so as to not take away too much from the content.</p>
]]></content:encoded>
			<wfw:commentRss>http://logbook.projecttrackr.com/section/messages/messages-intro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
