kimai / kimai

Kimai is a web-based multi-user time-tracking application. Works great for everyone: freelancers, companies, organizations - everyone can track their times, generate reports, create invoices and do so much more. SaaS version available at https://www.kimai.cloud
https://www.kimai.org
GNU Affero General Public License v3.0
3.34k stars 592 forks source link

When logging out and in again, the current filter for the timesheet should not get lost #4521

Closed simonschaufi closed 11 months ago

simonschaufi commented 11 months ago

Describe the issue

I have set a filter (current week) in my timesheet view. When I create an invoice, I need to filter the last month which overwrites my timesheet filter but they should be independent of each other.

I already tried

Kimai version

2.4.0

How do you run Kimai?

Virtual Server or alike

Which PHP version are you using?

8.1

Logfile

No response

Screenshots

No response

kevinpapst commented 11 months ago

They are independent. See kimai2_bookmarks table. The name is the query name. One time InvoiceQuery and one time MyTimesListing. I do not see how they could influence each other. Can you give me a click order to reproduce?

simonschaufi commented 11 months ago

Now that I tried to reproduce it, it works but since I always have a filter active and just created an invoice, I wonder what reset my filter than. Before creating an invoice, I also had to login. Maybe that was the cause? Maybe the filter also depend on a session?

Yes, when I logout and login again, the timesheet filter is reset. That is the issue!

kevinpapst commented 11 months ago

You had to re-authenticate, becuase you are accessing a sensitive area. The remember-me token is not sufficient to access invoicing or some parts of the administration.

There is a search filter that is persisted to DB and one in the session. Maybe that is related. You can simulate that by deleting your PHPSESSION cookie. I recommend to increased session lifetime to a high value (like a week) if this is your own server.

simonschaufi commented 11 months ago

I'm using a shared webhosting and can't adjust the session lifetime.

There is a search filter that is persisted to DB and one in the session. Maybe that is related.

I'm sure this is the case here.

kevinpapst commented 11 months ago

Usually you can add a php.ini in your own home directory. Anyway, I guess this is more of a confusing behavior than a bug?!?

If you can come up with a improved workflow of storing/handling these "search filter bookmarks" I am happy to talk about it.

simonschaufi commented 11 months ago

I would store them in a field in the users table merged all together (serialized or so)

kevinpapst commented 11 months ago

The new tit'e suggests that the filter is deleted upon logout, which is not the case.

If you use the search, the data will be temporarily persisted in the session, thus being cleared when changing the session.

But if you click the star icon in the search field, the filter will be persisted and applied in the new session as well.

simonschaufi commented 11 months ago

You are absolutely right but the thing is that I usually don't save my search because I forget it because I need to do that for every week again. It would be awesome if "current week" would always be selected from the current day.

The problem came up because Kimai forced me to login again which then cleared my search. That is then not a bug but simply a wrong behavior of the user and not the software. I'll close the issue for now but maybe you have a great idea how this can be achieved.

kevinpapst commented 11 months ago

A long outstanding issue is that the search can store filter names instead of absolute ranges for the date. So it show store and translate automatically "last_week" instead of "01.01.2024 - 07.01.2024".

github-actions[bot] commented 8 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you use Kimai on a daily basis, please consider donating to support further development of Kimai.