Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

v7.0.9 the calendar...
 
Notifications
Clear all

v7.0.9 the calendar on/off feature does not work

3 Posts
2 Users
0 Reactions
2,594 Views
(@piadm)
Posts: 7
Active Member
Topic starter
 
[#5359]

Hi,

As already reported in this issue the calendar on/off feature does not work when you click on a date.

A quick analysis makes me think the problem comes from the switchDay() function in tool/saveCalendar.php that uses getSingleSqlElementFromCriteria() but the calendar table itself contains one more row for each click on the same day:

select * from calendar where calendardate='2018-08-15';
 id | name | isoffday | calendardate |   day    |  week  | month  | year | idle | idcalendardefinition
----+------+----------+--------------+----------+--------+--------+------+------+----------------------
 27 |      |        1 | 2018-08-15   | 20180815 | 201833 | 201808 | 2018 |    0 |                    2
 29 |      |        1 | 2018-08-15   | 20180815 | 201833 | 201808 | 2018 |    0 |                    1
 37 |      |        1 | 2018-08-15   | 20180815 | 201833 | 201808 | 2018 |    0 |                    1
 44 |      |        0 | 2018-08-15   | 20180815 | 201833 | 201808 | 2018 |    0 |                    1
 45 |      |        0 | 2018-08-15   | 20180815 | 201833 | 201808 | 2018 |    0 |                    1
 46 |      |        0 | 2018-08-15   | 20180815 | 201833 | 201808 | 2018 |    0 |                    1
 47 |      |        0 | 2018-08-15   | 20180815 | 201833 | 201808 | 2018 |    0 |                    1
 48 |      |        0 | 2018-08-15   | 20180815 | 201833 | 201808 | 2018 |    0 |                    1
 49 |      |        0 | 2018-08-15   | 20180815 | 201833 | 201808 | 2018 |    0 |                    1
(9 rows)

In fact an admin closed the default standard calendar (id=1) and the only other one available as well. That was a mistake of course as it was not possible to create resources anymore. I unticked the "close" option for the default calendar and it seems that blindly inserted the rows 37 to 43 in the calendar table... but there was already a row 29 for the date 2018-08-15' in the default calendar. Starting from that time there were 2 rows in the calendar table and each click on that date adds one more.

So the problem is probably not coming from the switchDay() function but from these duplicate rows. As un-closing a calendardefinition insert rows in the calendar table (default rows?), closing a calendar should remove them, but that apparently did not happen.

Question: To fix this can I just delete the calendar rows 37 to 49?


 
Posted : 16 Aug 2018 19H23
(@babynus)
Posts: 14952
Member Admin
 

Yes, you can delete rows in the table.
This one is a simple one.

This will just remove off days from the calendar.


 
Posted : 17 Aug 2018 11H19
(@piadm)
Posts: 7
Active Member
Topic starter
 

Done.

Thank you for your help Babynus.


 
Posted : 17 Aug 2018 17H55
Share:

Scroll to Top