I’ve just started your grandiose Scheduler for Wordpress.
I’d like to us it for booking schemes of equipment in our (scientific) lab. Different user can book different resources, but only one at a time.
Most worked out of the box, but I couldn’t find out how to show which user has entered which booking. I know that dhtmlxScheduler saves the user in its table and this most likely correspond to the ID of the user in wordpress. But how can I show this realname in the event view (when someone clicks an entry?)
Thanks a lot for this great plugin. I am liking it more and more. Actually, I downloaded dhtmlxSchedulerConfigurator and made some changes to view userid in each event, which worked fine in normal mode, but in PrivateMode Extended, it prevents users from editing or deleting their own events. In the text view mode of calendar, the controls appear but do not function properly. I checked the Log, and it seems that with the new dhtmlxSchedulerConfigurator, readonly is true.
I tried to figure out a solution, but no luck at all. I appreciate any help, with best regards.
Dear radyno, good to hear from you! I used the same file as you posted here, the one above this post. I created an admin user for you, so if you have time, I would appreciate looking into the problem. Please check your Inbox for your id and pw.
Hi.
Update dhtmlxSchedulerConfigurator.php one more time and in event templates replace “event.user” by “event.user_name”, please. dhtmlxSchedulerConfigurator.zip (10.2 KB)
Thanks a lot for your support, but we have another problem now. With the new configurator users can not create new events, the event text will turn red (in bold) right after creating and won’t save. Sorry for the trouble, but could you help with this too?
Update dhtmlxSchedulerConfigurator.php one more time, please.
This fix will work just in PrivateExtended Mode. dhtmlxSchedulerConfigurator.zip (10.2 KB)
Great plugin again!! I have on emore question, how to export the “label” of a custom list and usernames using iCal. I have tried several codes with getlabel or str_replace but no luck. For instance I query the values of custom fields and user. What I get (as $dsc, for example) is only user id (numbers) and text values but not labels or usernames. Any help would be greatly appreciated.
If to talk about custom fields - it generates it’s own keys for every custom field value.
But it doesn’t store them like “key: value”, so you have to work hard to find them out.
You have to take option scheduler_php like here:
$scheduler_php = get_option(‘scheduler_php’);
You have to find custom field serialization in scheduler_php:
optionsList_{customfield_name}{:}{customfield_name}_0:F1,{customfield_name}_1:F2,{customfield_name}_2:F3,…
For example:
optionsList_field{:}field_0:F1,field_1:F2,field_2:F3
where field is customfield name.
Then parse this line to generate hash from keys and values.
Replace custom field keys in request result by corresponding values.
Thanks a lot radyno;
The username worked right out of the box, but honestly I have problem understanding the customfield instructions and make the right code as I am not familiar with php. The custom field is a list (event.text). How should I generate hash from keys and values and replace custom field keys in request result by corresponding values.
The codes works and the user appears as requested.
Instead of user nickname (nicename), I used user display name and again it works.
I noticed that when another user edits an event, it displays “guest” or the creator user and not the editing user. I tryed all the files in this topic (with some modifications) but didnt work.
Is it possible to fix that?
Hi,
is it possible that user which edits event is not logged in? If yes then it’s correct, because system doesn’t know his id and think that’s someone from the street. If it’s logged in user - could you provide files which you updated and step-by-step description what to do to replay your issue at local machine?
It would be usefull if you will provide link to your scheduler with two test user accounts.
It’s correct behavior. If you like to set new event author after editing then you may open file wordpress/wp-content/plugins/event-calendar-scheduler/codebase/dhtmlxSchedulerConfigurator.php and replace set_event_user method with the follow:
public function set_event_user($action) {
$status = $action->get_status();
if ($this->settings["privatemode"] == "ext") {
$user = $action->get_value('user');
if ($user != $this->userid) {
$action->error();
}
} else {
if ($this->settings["privatemode"] == "on") {
if ($status == "inserted")
$action->set_value("user", $this->userid);
} else {
$action->set_value("user", $this->userid);
}
}
if ($action->get_value('event_pid') == '') {
$action->set_value('event_pid', 0);
}
if ($action->get_value('event_length') == '') {
$action->set_value('event_length', 0);
}
}
I’m not sure if I understand correctly logic. Could you describe more in details?
There are users demo1, demo2 and admin. demo1 created event1, demo2 created event2, admin created event_adm.
If guest opens site he will see event1, event2, event_admm but will not have ability to edit them.
If demo1 opens site he will see event1, event2, event_adm, will have ability to edit event1.
If demo2 opens site he will see event1, event2, event_adm, will have ability to edit event2.
If admin opens site he will see event1, event2, event_adm, will have ability to edit event_adm.
It’s a correct logic for this mode - everyone can see all events, but can editor only his own.