https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292019-10-04T11:30:46ZRedmineRedmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=941552019-10-04T11:30:46ZMarius BĂLTEANU
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/28234">Feature #28234</a>: Add CSV Import for Time Entries</i> added</li></ul> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=942592019-10-08T01:41:45ZKevin Fischer
<ul></ul><p>+1 <br />Sounds good.</p>
<p>I also agree that option 2 would be better.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=943942019-10-19T08:43:23ZMarius BĂLTEANU
<ul><li><strong>Assignee</strong> set to <i>Marius BĂLTEANU</i></li><li><strong>Target version</strong> set to <i>Candidate for next major release</i></li></ul> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=944722019-10-22T03:25:40ZBernhard Rohloff
<ul><li><strong>Category</strong> set to <i>Time tracking</i></li></ul><p>+1<br />I think option 2 is the better one, too.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=945862019-10-27T08:53:24ZMarius BĂLTEANU
<ul><li><strong>Assignee</strong> deleted (<del><i>Marius BĂLTEANU</i></del>)</li><li><strong>Target version</strong> changed from <i>Candidate for next major release</i> to <i>4.1.0</i></li></ul> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=945872019-10-27T08:53:51ZMarius BĂLTEANU
<ul><li><strong>File</strong> <i>0002-Allow-import-time-entries-for-other-users-if-current.patch</i> added</li><li><strong>File</strong> <i>0001-Add-permission-to-import-time-entries.patch</i> added</li></ul><p>I'm attaching two patches:</p>
<p>1. <b>0001-Add-permission-to-import-time-entries.patch</b> which adds the missing "Import time entries" permission. I think it is better to have this permission in order to be consistent with import issues from CSV. Also, some Redmine administrators don't want to allow importing time entries from CSV at all.<br />2. <b>0002-Allow-import-time-entries-for-other-users-if-current.patch</b> which allows users with "log_time_for_other_users" permission to import time entries for other users as well.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=945902019-10-27T08:57:14ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0002-Allow-import-time-entries-for-other-users-if-current.patch</i></del>)</li></ul> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=945912019-10-27T08:57:23ZMarius BĂLTEANU
<ul><li><strong>File</strong> <i>0002-Allow-import-time-entries-for-other-users-if-current.patch</i> added</li></ul> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=945922019-10-27T08:58:47ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0002-Allow-import-time-entries-for-other-users-if-current.patch</i></del>)</li></ul> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=945932019-10-27T09:00:13ZMarius BĂLTEANU
<ul><li><strong>File</strong> <i>0002-Allow-import-time-entries-for-other-users-if-current.patch</i> added</li></ul> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=945982019-10-27T19:20:07ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0001-Add-permission-to-import-time-entries.patch</i></del>)</li></ul> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=945992019-10-27T19:22:29ZMarius BĂLTEANU
<ul><li><strong>File</strong> <i>0001-Add-permission-to-import-time-entries.patch</i> added</li></ul> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=946002019-10-27T21:35:52ZMarius BĂLTEANU
<ul><li><strong>File</strong> <i>0002-Allow-import-time-entries-for-other-users-if-current.patch</i> added</li><li><strong>File</strong> <a href="/attachments/24228">select_user_id.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/24228/select_user_id.png">select_user_id.png</a> added</li></ul><p>Made some minor changes to attachment:0002-Allow-import-time-entries-for-other-users-if-current.patch in order to allow selecting the user from column mapping and not only from CSV.</p>
<p><img src="https://www.redmine.org/attachments/download/24228/select_user_id.png" alt="" /></p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=946012019-10-27T21:35:58ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0002-Allow-import-time-entries-for-other-users-if-current.patch</i></del>)</li></ul> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=946022019-10-28T00:56:20ZGo MAEDA
<ul></ul><p>Marius BALTEANU wrote:</p>
<blockquote>
<p>1. <b>0001-Add-permission-to-import-time-entries.patch</b> which adds the missing "Import time entries" permission. I think it is better to have this permission in order to be consistent with import issues from CSV. Also, some Redmine administrators don't want to allow importing time entries from CSV at all.</p>
</blockquote>
<p>I agree. CSV import feature is a dangerous feature. A malicious or ignorant user can easily ruin the spent time page by bulk-importing junk data. so, the permission is useful to prevent such incidents.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=946082019-10-28T08:05:23ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0001-Add-permission-to-import-time-entries.patch</i></del>)</li></ul> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=946092019-10-28T08:07:29ZMarius BĂLTEANU
<ul><li><strong>File</strong> <a href="/attachments/24232">0001-Add-permission-to-import-time-entries.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/24232/0001-Add-permission-to-import-time-entries.patch">0001-Add-permission-to-import-time-entries.patch</a> added</li></ul><p>Go MAEDA wrote:</p>
<blockquote>
<p>Marius BALTEANU wrote:</p>
<blockquote>
<p>1. <b>0001-Add-permission-to-import-time-entries.patch</b> which adds the missing "Import time entries" permission. I think it is better to have this permission in order to be consistent with import issues from CSV. Also, some Redmine administrators don't want to allow importing time entries from CSV at all.</p>
</blockquote>
<p>I agree. CSV import feature is a dangerous feature. A malicious or ignorant user can easily ruin the spent time page by bulk-importing junk data. so, the permission is useful to prevent such incidents.</p>
</blockquote>
<p>Great, thanks. I'm attaching a new version of the patch which checks for the proper permission in <code>/app/views/timelog/index.html.erb</code>.</p>
<p>I think now both patches are ready for commit as part of <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Add CSV Import for Time Entries (Closed)" href="https://www.redmine.org/issues/28234">#28234</a>.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=946152019-10-28T13:24:53ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/3848">Feature #3848</a>: Permission to log time for another user</i> added</li></ul> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=946182019-10-29T01:57:13ZGo MAEDA
<ul></ul><p>Regarding the patch 0002-Allow-import-time-entries-for-other-users-if-current.patch, I think the field mapping for the User field should default to the current user for the consistency with the behavior when the current user does not have "Import time entries" permission.</p>
<p>When a user does not have "Import time entries" permission, the user cannot (and does not necessary to) to set field mapping for the User field and data are always imported as their own time entries.</p>
<p>But when a user has the permission, the same operation results in an error saying that "User cannot be blank. User is invalid".</p>
<p>This can be resolved if the User field defaults to the current user.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=946262019-10-29T08:03:16ZMarius BĂLTEANU
<ul></ul><p>Go MAEDA wrote:</p>
<blockquote>
<p>Regarding the patch 0002-Allow-import-time-entries-for-other-users-if-current.patch, I think the field mapping for the User field should default to the current user for the consistency with the behavior when the current user does not have "Import time entries" permission.</p>
<p>When a user does not have "Import time entries" permission, the user cannot (and does not necessary to) to set field mapping for the User field and data are always imported as their own time entries.</p>
<p>But when a user has the permission, the same operation results in an error saying that "User cannot be blank. User is invalid".</p>
<p>This can be resolved if the User field defaults to the current user.</p>
</blockquote>
<p>Agree with you, I'll post the updated patch these days.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=946842019-10-31T09:23:16ZDominik Ras
<ul></ul><p>+1 for option 2</p>
<p>+100 for the whole concept of adding time for <strong>other</strong> users (with sufficient permissions!!). That will save several man-days a month. You guys ROCK !!</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=947062019-11-01T22:03:06ZMarius BĂLTEANU
<ul><li><strong>File</strong> deleted (<del><i>0002-Allow-import-time-entries-for-other-users-if-current.patch</i></del>)</li></ul> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=947072019-11-01T22:03:32ZMarius BĂLTEANU
<ul><li><strong>File</strong> <a href="/attachments/24257">0001-Allow-import-time-entries-for-other-users.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/24257/0001-Allow-import-time-entries-for-other-users.patch">0001-Allow-import-time-entries-for-other-users.patch</a> added</li></ul><p>Updated the second patch.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=947152019-11-02T07:50:00ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Marius BALTEANU wrote:</p>
<blockquote>
<p>Updated the second patch.</p>
</blockquote>
<p>Thanks Marius. With this implementation, we can reference users with their numeric ids only. That can be a pain to fill/review in the CSV file. Is it OK or should we allow to use usernames or emails?</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=947162019-11-02T08:04:37ZMarius BĂLTEANU
<ul></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>Thanks Marius. With this implementation, we can reference users with their numeric ids only. That can be a pain to fill/review in the CSV file. Is it OK or should we allow to use usernames or emails?</p>
</blockquote>
<p>I think it's good enough to allow user ids in a first phase and then add support for usernames or emails in 4.1.1.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=947232019-11-02T08:19:54ZMarius BĂLTEANU
<ul></ul><p>Anyway, I'll try to update my patch in the following 2 or 3 hours.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=947242019-11-02T08:20:53ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Marius BALTEANU wrote:</p>
<blockquote>
<p>Anyway, I'll try to update my patch in the following 2 or 3 hours.</p>
</blockquote>
<p>No I think it's OK for now.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=947252019-11-02T08:21:42ZMarius BĂLTEANU
<ul></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>Marius BALTEANU wrote:</p>
<blockquote>
<p>Anyway, I'll try to update my patch in the following 2 or 3 hours.</p>
</blockquote>
<p>No I think it's OK for now.</p>
</blockquote>
<p>Ok, thanks for you quick response.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=947262019-11-02T08:24:03ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li></ul><p>Committed, thanks.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=947282019-11-02T11:53:58ZJean-Philippe Langjp_lang@yahoo.fr
<ul></ul><p>Marius BALTEANU wrote:</p>
<blockquote>
<p>I think it's good enough to allow user ids in a first phase and then add support for usernames or emails in 4.1.1.</p>
</blockquote>
<p>I made the change in order to reference users just like we reference assignees when importing issues.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=947292019-11-02T13:50:42ZMarius BĂLTEANU
<ul><li><strong>File</strong> <a href="/attachments/24259">import_new.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/24259/import_new.png">import_new.png</a> added</li><li><strong>Status</strong> changed from <i>Closed</i> to <i>Reopened</i></li></ul><p><a class="changeset" title="Fixed i18n string for permission (#32196)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/18893">r18893</a> broke the translation in <code>time_entries/imports/new</code>:</p>
<p><img src="https://www.redmine.org/attachments/download/24259/import_new.png" style="width:50%;" alt="" /></p>
<p>I think we need to add both keys in the locales (as we have for issues). Sorry for not catching this.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=947302019-11-02T13:52:22ZMarius BĂLTEANU
<ul></ul><p>Also, I propose to remove this ticket from <a class="version" href="https://www.redmine.org/versions/127">4.1.0</a> because it will appear in the changelog as part of <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Permission to log time for another user (Closed)" href="https://www.redmine.org/issues/3848">#3848</a> and <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Add CSV Import for Time Entries (Closed)" href="https://www.redmine.org/issues/28234">#28234</a>.</p> Redmine - Patch #32196: Allow import time entries for other usershttps://www.redmine.org/issues/32196?journal_id=947342019-11-02T14:39:57ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Closed</i></li><li><strong>Target version</strong> deleted (<del><i>4.1.0</i></del>)</li></ul><p>Marius BALTEANU wrote:</p>
<blockquote>
<p>I think we need to add both keys in the locales (as we have for issues). Sorry for not catching this.</p>
</blockquote>
<p>Fixed, thanks for pointing this out.</p>