https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292016-12-25T12:47:20ZRedmineRedmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=753252016-12-25T12:47:20ZGo MAEDA
<ul><li><strong>File</strong> <a href="/attachments/17315">screenshot-23954.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/17315/screenshot-23954.png">screenshot-23954.png</a> added</li></ul><p>This is a screenshot of the feature.</p>
<p><img src="https://www.redmine.org/attachments/download/17315/screenshot-23954.png" alt="" /></p>
<p>But it should be considered that processing when <code>event</code> variable is nil in the following code. It causes <code>undefined method `[]' for nil:NilClass</code> error at the next line.</p>
<pre><code class="ruby syntaxhl"> <span class="k">def</span> <span class="nf">last_activity</span><span class="p">(</span><span class="n">project</span><span class="p">)</span>
<span class="n">event</span> <span class="o">=</span> <span class="no">Redmine</span><span class="o">::</span><span class="no">Activity</span><span class="o">::</span><span class="no">Fetcher</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="no">User</span><span class="p">.</span><span class="nf">current</span><span class="p">,</span> <span class="ss">:project</span> <span class="o">=></span> <span class="n">project</span><span class="p">).</span><span class="nf">events</span><span class="p">(</span><span class="kp">nil</span><span class="p">,</span> <span class="kp">nil</span><span class="p">,</span> <span class="ss">:limit</span> <span class="o">=></span> <span class="mi">1</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
<span class="n">byebug</span>
<span class="n">event</span><span class="p">[</span><span class="ss">:updated_on</span><span class="p">].</span><span class="nf">nil?</span> <span class="p">?</span> <span class="n">event</span><span class="p">[</span><span class="ss">:created_on</span><span class="p">]</span> <span class="p">:</span> <span class="n">event</span><span class="p">[</span><span class="ss">:updated_on</span><span class="p">]</span>
<span class="k">end</span>
</code></pre> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=755332017-01-01T03:50:35ZYuuki NARA
<ul></ul><p>+1</p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=755782017-01-02T13:11:44ZFrederico Camara
<ul><li><strong>File</strong> <a href="/attachments/17390">last_activity-1.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/17390/last_activity-1.patch">last_activity-1.patch</a> added</li></ul><p>Go Maeda,</p>
<p>Thank you for your reply. I had already patched production (<a class="external" href="https://github.com/fredsdc/redmine/tree/3.2-patched">https://github.com/fredsdc/redmine/tree/3.2-patched</a>), and I forgot I had posted the patch to Redmine.org. Fixed it again today to call last_activity function only once.</p>
<p>It now returns the project creation date if there is no activity in the project.</p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=759602017-01-15T08:23:10ZGo MAEDA
<ul><li><strong>Target version</strong> set to <i>Candidate for next major release</i></li></ul><p>Thank you for updating the patch. It works fine, looks good to me.</p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=762502017-01-24T05:10:10ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-3 status-1 priority-4 priority-default" href="/issues/13696">Patch #13696</a>: Projects admin, show issues count</i> added</li></ul> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=762522017-01-24T05:23:20ZGo MAEDA
<ul><li><strong>Target version</strong> changed from <i>Candidate for next major release</i> to <i>3.4.0</i></li></ul><p>Although Jean-Phillipe Lang wrote on <a class="issue tracker-3 status-1 priority-4 priority-default" title="Patch: Projects admin, show issues count (New)" href="https://www.redmine.org/issues/13696#note-7">#13696#note-7</a> as follows, last activity is very useful to maintenance projects.</p>
<blockquote>
<p>We'll add this as an optional column when the project list will be made configurable (like the issue list).</p>
</blockquote>
<p>In my opinion, "Last activity" is far more useful information than "Created".<br />Could this be a part of 3.4.0?</p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=762702017-01-25T11:49:41ZRobert Schneider
<ul></ul><p>Go MAEDA wrote:</p>
<blockquote>
<p>In my opinion, "Last activity" is far more useful information than "Created".</p>
</blockquote>
<p>That's true!</p>
<p>+1</p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=763972017-01-29T11:05:23ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Target version</strong> changed from <i>3.4.0</i> to <i>Candidate for next major release</i></li></ul><p>Go MAEDA wrote:</p>
<blockquote>
<p>In my opinion, "Last activity" is far more useful information than "Created".</p>
</blockquote>
<p>I'm not saying that this information is not usefull. It generates dozens of SQL queries and can make the project list really slow. We'll make this information available once the project list can be configured, but we can't add it by default now.</p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=764562017-02-01T18:42:02ZFrederico Camara
<ul></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>I'm not saying that this information is not usefull. It generates dozens of SQL queries and can make the project list really slow. We'll make this information available once the project list can be configured, but we can't add it by default now.</p>
</blockquote>
<p>My thoughts exactly. I got it in production here and if you have dozens of projects, it generates lots and lots of queries. I kept it because it is just so useful, but with 400 projects and near 2000 issues, opening the admin projects page takes near 22 seconds.</p>
<p>I'm studying how to better query the database. Redmine::Activity::Fetcher only uses projects as filters. I would need to construct a table with each project id and its last activity using just a few SQL queries.</p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=839172018-03-08T17:55:52ZFrederico Camara
<ul><li><strong>File</strong> <a href="/attachments/20244">last_activity-2.r3.3.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/20244/last_activity-2.r3.3.patch">last_activity-2.r3.3.patch</a> added</li><li><strong>File</strong> <a href="/attachments/20243">last_activity-2.r3.4.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/20243/last_activity-2.r3.4.patch">last_activity-2.r3.4.patch</a> added</li></ul><p>I have a new patch. I added a new option to the fetcher library, if set, the result is a hash { project_id -> last_activity }, that I use in the view.</p>
<p>Summarizing I reduced the queries to one per event type, which takes now a fraction of a second to complete.</p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=839232018-03-09T21:10:57ZFrederico Camara
<ul><li><strong>File</strong> <a href="/attachments/20248">last_activity-3.r3.3.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/20248/last_activity-3.r3.3.patch">last_activity-3.r3.3.patch</a> added</li><li><strong>File</strong> <a href="/attachments/20249">last_activity-3.r3.4.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/20249/last_activity-3.r3.4.patch">last_activity-3.r3.4.patch</a> added</li></ul><p>I fixed a bug, and moved some code from the helpers to the controllers. I also had an idea how to always show some activity as Feature <a class="issue tracker-2 status-1 priority-4 priority-default" title="Feature: Last activity time window. (New)" href="https://www.redmine.org/issues/3099">#3099</a>.</p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=873482018-09-16T11:45:34ZMarius BĂLTEANU
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/29482">Feature #29482</a>: Query system for Projects page</i> added</li></ul> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=938232019-09-21T04:02:39ZYuuki NARA
<ul><li><strong>File</strong> <a href="/attachments/23889">23954-trunk-note11.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/23889/23954-trunk-note11.png">23954-trunk-note11.png</a> added</li></ul><p>It worked on Redmine trunk with the same changes. note-11</p>
<p>Attach a screen copy of my environment.<br />Last activity is not displayed for projects with 0 tickets. <br />However, as it can be seen from the Created column, I think that it is enough as it is.</p>
<p><img src="https://www.redmine.org/attachments/download/23889/23954-trunk-note11.png" alt="" /></p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=938362019-09-21T09:58:25ZMarius BĂLTEANU
<ul></ul><p>I think we should add this column on top of <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Query system for Projects page (Closed)" href="https://www.redmine.org/issues/29482">#29482</a>.</p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=943462019-10-15T06:50:35ZRyoji Takeuchi
<ul></ul><p>+1</p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=945682019-10-26T19:26:44ZMarius BĂLTEANU
<ul><li><strong>File</strong> <i>0001-Adds-last-activity-column-to-projects-list.patch</i> added</li></ul><p>Based on Frederico Camara work, I've created a patch that adds the "Last activity" column to the projects list.</p>
<p>Sorting by this column is not possible for now because I'm not sure how to implement it easily (the last activity date is calculated based on multiple tables). Any suggestion is welcome.</p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=945692019-10-26T19:43:27ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0001-Adds-last-activity-column-to-projects-list.patch</i></del>)</li></ul> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=945702019-10-26T19:45:05ZMarius BĂLTEANU
<ul><li><strong>File</strong> <i>0001-Adds-last-activity-column-to-projects-list.patch</i> added</li></ul><p>Slightly improved the patch in order to avoid some unnecessary joins when counting the number of results.</p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=945712019-10-26T21:13:34ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0001-Adds-last-activity-column-to-projects-list.patch</i></del>)</li></ul> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=945722019-10-26T21:15:48ZMarius BĂLTEANU
<ul><li><strong>File</strong> <i>0001-Adds-last-activity-column-to-projects-list.patch</i> added</li></ul> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=945752019-10-26T23:33:36ZMarius BĂLTEANU
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/805">Feature #805</a>: Allow projects view to be sorted by activity</i> added</li></ul> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=955012020-01-05T10:12:30ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0001-Adds-last-activity-column-to-projects-list.patch</i></del>)</li></ul> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=955022020-01-05T10:24:11ZMarius BĂLTEANU
<ul><li><strong>File</strong> <i>0001-Adds-last-activity-column-to-projects-list.patch</i> added</li><li><strong>Category</strong> changed from <i>Administration</i> to <i>Projects</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li><li><strong>Target version</strong> changed from <i>Candidate for next major release</i> to <i>4.2.0</i></li></ul><p>Updated the patch for current trunk.</p>
@Jean-Philippe, I'm assigning to you in order to:
<ul>
<li>review the changes proposed by Frederico Camara to activity fetcher</li>
<li>check for any solution to enable projects sorting by last activity date</li>
</ul> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=969852020-03-29T11:58:53ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-1 priority-4 priority-default" href="/issues/3099">Feature #3099</a>: Last activity time window.</i> added</li></ul> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=971232020-04-05T10:17:33ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0001-Adds-last-activity-column-to-projects-list.patch</i></del>)</li></ul> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=971242020-04-05T10:17:56ZMarius BĂLTEANU
<ul><li><strong>File</strong> <a href="/attachments/25144">0001-Adds-last-activity-column-to-projects-list.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/25144/0001-Adds-last-activity-column-to-projects-list.patch">0001-Adds-last-activity-column-to-projects-list.patch</a> added</li></ul><p>Updated the patch to apply cleanly on the current trunk.</p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=1015092021-03-23T20:47:37ZMarius BĂLTEANU
<ul><li><strong>Target version</strong> changed from <i>4.2.0</i> to <i>5.0.0</i></li></ul> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=1021682021-04-21T14:12:42Zzumo de vidrio
<ul></ul><p>Can you please share the SQL query or API request in order to get the last activity date of every project ?</p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=1021712021-04-21T22:28:08ZFrederico Camara
<ul></ul><p>zumo de vidrio wrote:</p>
<blockquote>
<p>Can you please share the SQL query or API request in order to get the last activity date of every project ?</p>
</blockquote>
<p>As a hash:<br /><pre>
Redmine::Activity::Fetcher.new(User.current).events(nil, nil, :last_by_project => true).to_h
</pre></p> Redmine - Patch #23954: Shows the date of the last activity on Projects administration.https://www.redmine.org/issues/23954?journal_id=1060472022-03-20T22:35:34ZMarius BĂLTEANU
<ul><li><strong>Target version</strong> changed from <i>5.0.0</i> to <i>Candidate for next major release</i></li></ul>