We have CCX Premium 7.0(1) with a few CSQ's for various different incoming calls.
Each of these CSQ's have defined opening hours using the Time of Day field in the associated script. Because of the bad weather in our area recently I've had to change the time of day field to reflect the office closing early.
Although not a difficult or particularly time consuming job, it would be nice if I could leave it to someone else to make the changes as and when they need to. I was thinking of giving a user access to a number which they would call, follow some prompts, enter the necessary opening/closing times and then make this live on the necessary CSQ.
Does anyone know if this is possible and if so is there a "best" way to do it?
You have two options on how you can perform this task, what you're thinking is possible. Additionally, you could go about it another way by calling in and setting a flag when you want the center to close down. Either way is not too difficult.
Lets assume you're going with your first version, have your users enter start/stop times in 24 hour format. For example, 930 for 9:30 AM, and 1730 for 5:30PM
Concat your two strings into the format of: startTime + "-" + endTime. I.e: "930-1730"
Write this value to a document
In your scripts, you'll need to read the document with the string we created above (into a variable, 'todString' in this example). You'll need a single dimension String Array as a variable.
Assume you stored the ToD string as 'todString'
Set ToD = todString.split("-")
If (int.valueOf(ToD) <= int.valueOf(T[now].getHours() + "" + T[now].getMinutes()) && int.valueOf(ToD) >= int.valueOf(T[now].getHours() + "" + T[now].getMinutes()))
/* within hours of operation */
/* outside hours of operation */
Essentially what we are doing is this:
storing the hours of operations as "930-1730", once we split it, ToD will be "930", ToD will be "1730"
The "" in T[now].getHours() + "" + T[now].getMinutes() is important, without it you would simply get back a integer result of hours plus minutes.
int.valueOf() turns our Strings into numbers which we can compare. If the startTime is less than or equal to the current time, than we're open. If the endTime is greater than or equal to our current time, we're still open.
If you wished, you could remove the equal to portion of the second check if you wanted to be closed on the minute of 5:30 PM