<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
  <title>aC forum: Sorting Discussion Alphabetically</title>
  <link>http://www.activecollab.com/forums/topic/4776/</link>
  <description>Recent posts on topic: Sorting Discussion Alphabetically</description>
  <dc:language>en-us</dc:language>
  <pubDate>Thu, 24 May 2012 03:45:20 CEST</pubDate>
  
  <item>
    <link>http://www.activecollab.com/forums/post/21818/#post21818</link>
    <guid>http://www.activecollab.com/forums/post/21818/#post21818</guid>
    <title>Post #4 by Guy C.</title>
    <dc:creator>Guy Cortesi</dc:creator>
    <description><![CDATA[<p>Thx Ilija - got it to work!  I created an ascending sort for discussions grouped by category, and left the existing date sort for &quot;all discussions&quot;.  I sorted by &quot;name&quot; (the discussion subject / title).<br />
<br />
Edit the file:<br />
activecollab/application/modules/discussions/models/discussions/Discussions.class.php <br />
At the bottom of the file, alter the function paginateByCategory, changing  'order' =&gt; 'boolean_field_1, datetime_field_1 DESC', to  'order' =&gt; 'name ASC',<br />
<br />
The (single line of ) code change is as follows:<br />
<br />
Was:<br />
<br />
    function paginateByCategory($category, $page = 1, $per_page = 30, $min_state = STATE_VISIBLE, $min_visibility = VISIBILITY_NORMAL) {<br />
      return ProjectObjects::paginate(array(<br />
        'conditions' =&gt; array('parent_id = ? AND type = ? AND state &gt;= ? AND visibility &gt;= ?', $category-&gt;getId(), 'Discussion', $min_state, $min_v$<br />
        'order' =&gt; 'boolean_field_1, datetime_field_1 DESC',<br />
      ), $page, $per_page);<br />
    } // paginateByCategory<br />
<br />
  } // Discussions<br />
<br />
Change to:<br />
<br />
    function paginateByCategory($category, $page = 1, $per_page = 30, $min_state = STATE_VISIBLE, $min_visibility = VISIBILITY_NORMAL) {<br />
      return ProjectObjects::paginate(array(<br />
        'conditions' =&gt; array('parent_id = ? AND type = ? AND state &gt;= ? AND visibility &gt;= ?', $category-&gt;getId(), 'Discussion', $min_state, $min_v$<br />
        'order' =&gt; 'name ASC',<br />
      ), $page, $per_page);<br />
    } // paginateByCategory<br />
<br />
  } // Discussions<br />
<br />
------------------------------------<br />
This allows you to sort only the discussions that have been categorized and quickly find the one your looking for, since categorized discussions are sorted by the name (title) of the discussion.<br />
<br />
A nice improvement would be to simply go the the Discussions page in a project, then click on the word &quot;Discussion&quot;, and have the Discussion list sort by discussion name, then click on &quot;Last Reply&quot;, and have the list re-sort by date.  Just a suggestion for a future release.<br />
<br />
</p>]]></description>
    <pubDate>Thu, 30 Jul 2009 19:57:32 CEST</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/21779/#post21779</link>
    <guid>http://www.activecollab.com/forums/post/21779/#post21779</guid>
    <title>Post #3 by Ilija Studen</title>
    <dc:creator>Ilija Studen</dc:creator>
    <description><![CDATA[<p>Hi Guy,<br />
<br />
For this to work, you'll need to hack discussions manager class. You can find this class in models folder of discussions module. Please note that changes to this class will affect all projects.</p>]]></description>
    <pubDate>Wed, 29 Jul 2009 14:51:47 CEST</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/21766/#post21766</link>
    <guid>http://www.activecollab.com/forums/post/21766/#post21766</guid>
    <title>Post #2 by Guy C.</title>
    <dc:creator>Guy Cortesi</dc:creator>
    <description><![CDATA[<p>bump</p>]]></description>
    <pubDate>Tue, 28 Jul 2009 21:24:10 CEST</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/21430/#post21430</link>
    <guid>http://www.activecollab.com/forums/post/21430/#post21430</guid>
    <title>Post #1 by Guy C.</title>
    <dc:creator>Guy Cortesi</dc:creator>
    <description><![CDATA[<p>Does anyone have a suggestion to add the ability to sort discussions alphabetically (by title of the discussion)?  I have a need to have a discussion setup with the title of the discussions as the name of a person.  I'd like to be able to sort the list of discussions using the title field.  Thanks...</p>]]></description>
    <pubDate>Sun, 12 Jul 2009 14:37:50 CEST</pubDate>
  </item>
</channel>
</rss>
