OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Start/End time reset in scheduler

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

Start/End time reset in scheduler

Postby tarjelavik » Fri Aug 21, 2009 4:35 am

Hei!
I am trying to schedule the keynote-presentation on my OCS site running version 2.1.1.2. I check for "date" and set the start time at 14.00 and end time at 15.00 (doesn't matter what time i put in really) and hit save. I then get this error message:

Error occurred processing this form:
    Please check the start and end times for the presentations indicated in red to ensure that they are valid.

The start and end times then gets set to the current time.

I have changed the clock to 24-hour. Can det problem be that the system tries to validate the 24-hour times against a 12-hour clock? How can i fix this?

Sincerly
Tarje Lavik
Librarian, University of Bergen Library
https://konferanse.uib.no/index.php/cre ... ledge/2010
tarjelavik
 
Posts: 11
Joined: Thu Oct 09, 2008 6:29 am

Re: Start/End time reset in scheduler

Postby asmecher » Fri Aug 21, 2009 9:31 am

Hi Tarje,

What did you do to change the form to 24hr? That may be the issue. I suspect the related code is in classes/manager/form/scheduler/ScheduleForm.inc.php near line 229.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8674
Joined: Wed Aug 10, 2005 12:56 pm

Re: Start/End time reset in scheduler

Postby tarjelavik » Wed Aug 26, 2009 3:03 am

Hi!
I followed the instructions in this thread:
http://pkp.sfu.ca/support/forum/viewtopic.php?f=3&t=3529&p=13194&hilit=time+format#p13194

This is taken from my config.inc.php:
date_format_trunc %m-%d
date_format_short %Y-%m-%d
date_format_long %B %e, %Y
datetime_format_short %d-%m-%Y %H:%M
datetime_format_long %B %e, %Y - %H:%M
time_format %H:%M

I had a look at the ScheduleForm.inc.php, but i am afraid it does not make much sense for me. I have not modified this file.

Sincerly
Tarje Sælen Lavik
tarjelavik
 
Posts: 11
Joined: Thu Oct 09, 2008 6:29 am

Re: Start/End time reset in scheduler

Postby asmecher » Wed Aug 26, 2009 10:55 am

Hi Tarje,

Can you confirm that the time fields on the scheduler form are in 24-hour format? The config.inc.php settings shouldn't affect those fields. Did you modify the template file as per that thread?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8674
Joined: Wed Aug 10, 2005 12:56 pm

Re: Start/End time reset in scheduler

Postby tarjelavik » Thu Oct 01, 2009 1:33 am

Hi!
Sorry, this problem suddenly found itself under a pile of other problems...

Yes, the time fields are in 24-hour format.
ck-vi_screenshot.jpg
Screenshot of scheduler error
ck-vi_screenshot.jpg (121.22 KiB) Viewed 761 times


I did modify both templates/manager/scheduler/specialEventsForm.tpl and templates/manager/scheduler/scheduleForm.tpl as James suggested as a solution for the 12-/24-hour problem in that thread.
The special event scheduler is working perfectly and saved the 24-hour format, though.

In the screenshot the time is set to the time the error occured, but i tried to register the presentation from 10:00 to 12:00.

Sincerly Tarje
tarjelavik
 
Posts: 11
Joined: Thu Oct 09, 2008 6:29 am

Re: Start/End time reset in scheduler

Postby asmecher » Thu Oct 01, 2009 10:49 am

Hi Tarje,

That modification was suggested for the special events form, but you'll need to do a little more for the scheduleForm.tpl template. That template uses the meridian in the Javascript as well (see the changeTime) function.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8674
Joined: Wed Aug 10, 2005 12:56 pm

Re: Start/End time reset in scheduler

Postby tarjelavik » Tue Oct 06, 2009 1:27 am

The problem is here?

Code: Select all
// Used to update the actions list when the start or end time of a paper is
// changed.
function changeTime(paperId) {
   var timePrefixName = "document.schedule.paper" + paperId + "StartTime";
   var paperHour = eval(timePrefixName + "Hour.value");
   var paperMinute = eval(timePrefixName + "Minute.value");
   var paperMeridian = eval(timePrefixName + "Meridian.value");

   var paperTime = paperHour + ":" + paperMinute + ' ' + paperMeridian;

   document.schedule.changes.value += "\n" + paperId + " startTime" + " " + paperTime;

   var timePrefixName = "document.schedule.paper" + paperId + "EndTime";
   var paperHour = eval(timePrefixName + "Hour.value");
   var paperMinute = eval(timePrefixName + "Minute.value");
   var paperMeridian = eval(timePrefixName + "Meridian.value");

   var paperTime = paperHour + ":" + paperMinute + ' ' + paperMeridian;

   document.schedule.changes.value += "\n" + paperId + " endTime" + " " + paperTime;
}


I am sorry but I know nothing about javascripts. How should this be changed so that tha scheduler can be used with a 24-hour format? Tried to set "display_meridian=false", but no change. I understand that I can use the 12-hour format in the scheduler and have the program display the presentations in the 24-hour format, but I would like a more user-friendly scheduler :-).

Hopefully this can become a setting in the admin panel?

Sincerly
Tarje Sælen Lavik
tarjelavik
 
Posts: 11
Joined: Thu Oct 09, 2008 6:29 am

Re: Start/End time reset in scheduler

Postby asmecher » Tue Oct 06, 2009 9:20 am

Hi Tarje,

Try replacing the two lines reading:
Code: Select all
var paperMeridian = eval(timePrefixName + "Meridian.value");
...with...
Code: Select all
var paperMeridian = eval("typeof(" + timePrefixName + "Meridian) != \"undefined\"?" + timePrefixName + "Meridian.value:\"\"");
This will only use the meridian (AM/PM) when it's available to the interface, and should therefore work with both 12-hour and 24-hour formats. It sounds like you've already changed the interface to use a 24-hour widget, which is the only other necessary change (OTOH).

If you'd like to see an administration option for this, I'd suggest filing it in Bugzilla at http://pkp.sfu.ca/bugzilla -- please include a link back to this thread for context -- and you'll receive emails whenever the bug status changes.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8674
Joined: Wed Aug 10, 2005 12:56 pm

Re: Start/End time reset in scheduler

Postby tarjelavik » Thu Oct 08, 2009 2:36 am

Hi!
Great! That worked perfectly. Thank you very much for your quick support :-)

Sincerly
Tarje Sælen Lavik
tarjelavik
 
Posts: 11
Joined: Thu Oct 09, 2008 6:29 am


Return to OCS Technical Support

Who is online

Users browsing this forum: Bing [Bot] and 3 guests