Scheduler 3.0 Admin texts missing in WordPress-Backend

Hi,

I’ve loaded the 3.0 Plugin for WordPress – the specs look really great – but unfortunately a lot of the texts in the admin backend are not output. For example the Settings dialog – a few input fields and lots of checkboxes but all without any text to say what they do. I thought this would be a translation problem and briefly switched my WordPress from German to (default) English, but the result was the same (except the texts which do show were then english).

I’m an internet programmer myself - I checked with browser cache off, and I only ever loaded this version of the plugin. File admin_de.js is being loaded with the correct content (checked in FireBug). But FireBug also shows me that the missing labels contain code like this:

<label class="dhtmlxInputLabel" locale="width" for="settings_width"></label>

What’s happening is that the locale attribute of the label tags contains “width” if the for attribute is “settings_width”, or “height” if for is “settings_height”, locale=”day” for=”settings_day” and so on.

Any fixes / workarounds / ideas much appreciated!

Cheers, Tim

Hi, Tim.
For scheduler admin panel localization javascript object is used:

dhtmlxSchedulerConfig.prototype.i18n = {
	settings: {
		settings: "Einstellungen",
		...
	},	

	access: {
		access: "Zugriffsrechte",
		...
	},

	templates: {
		templates: "Vorlagen",
		...
	},

	admin_events: {
		admin_events: "Veranstaltungen Verwaltung",
		...
	},

	customfields: {
		customfields: "Benutzerdefinierte Felder",
		...
	},

	gcal: {
		google_export: "Google Kalender-Export",
		...
	},

	skins: {
		skins: "Kürschnerei",
		...
	}
}

Main script passes required part of localization into according iframe (each tab excluding “Events Administrator” in admin panel is iframe). Script in frame takes all elements with attribute “locale”. Then it sets for such element value from localization hash. Here is code from iframes/settings.html:

		// takes part of localization from main page
		var locale = parent.conf.i18n.settings;
		var els = document.getElementsByTagName('*');
		for (var i in els) {
			...
			if (els[i].getAttribute) {
				var text = els[i].getAttribute('locale');
				if (text) {
					els[i].innerHTML = locale[text];
				}
			}
		}

So you have to make sure that incoming parameter “locale” in settings.html is correct.

Hi,

many thanks for the tip. I have now noticed that the Labels DO appear in Internet Explorer but not in Firefox! Debugging in FF showed “locale” not set:
window.onload = function() {
var locale = parent.conf.i18n.settings;
It seems that there is some scope problem, I did once see an error message in the FF console that accessing parent.conf was not allowed.

BUT there is a further problem, also in Internet Explorer. I can’t save any configuration values, it says:
There was error during configuration saving. Last stable configuration restored.
Error report saved to “com_scheduler_log.xml”
And the log is empty, it apparently can’t write it. Which is weird, your code looks ok and my WordPress runs on Linux with all the files belonging to the Apache Webserver User, so there should not be any problem with write permission.

Any ideas?

Thanks, Tim

Hi,
please, open file wp-content/plugins/event-calendar-scheduler/codebase/dhtmlxSchedulerConfigurator.php and modify it like here:

$this->xml = $xml;
@$this->xmlObj = simplexml_load_string($this->xml);
if ($this->xmlObj === false) {
	$invalid_xml = $this->xml;
	echo $invalid_xml;
	die();
	$this->addProblem("There was error during configuration saving. Last stable configuration restored.<br>Error report saved to \"".$this->log_file."\"");

After that try to save config with Interner Explorer. After saving it will output xml-configuration into browser. Copy provided page source and provide here, please.

Again many thanks for your support.

I have found the basic problem.

I normally administer WordPress via SSL for security reasons. Because your iframes are not loaded via https (probably they should be if the parent page uses https) the browsers (now even IE9) complain about “This page contains insecure data”.

When I administer via HTTP then all the labels are there and I can also save my configuration. The only problem I have now is, that I don’t know how to call the page to display the calendar. I have configured:
Link to Scheduler = rewig-muenchen.de/raumbelegung/
I tried config and call both with/without trailing slash, but always WordPress replies “Sorry, no such page”. I have also installed the Upcoming Events widget, and added an appointment in the Backend which is displayed by the widget. The widget links the appointment like this:
rewig-muenchen.de/raumbelegung/? … mode=month
but again WordPress replies “Sorry, no such page”.

Hope you can help on that, again many thanks!

Tim

Hi,
please, open file wp-content/plugins/event-calendar-scheduler/admin.php, it contains the follow code:

window.onload = function() {
			conf = new dhtmlxSchedulerConfig({
				parent: 'schedulerConfigurator',
				hidden: 'scheduler_xml',
				groups: <?php echo $groups; ?>,
				access: 'wp',
				url: '<?php echo WP_PLUGIN_URL; ?>/event-calendar-scheduler/codebase/',
				url_load: '<?php echo WP_PLUGIN_URL; ?>/event-calendar-scheduler/codebase/dhtmlxSchedulerConfiguratorLoad.php?task=loadxml',
				wp_specific: true
			});
		}

Please, make sure that contant WP_PLUGIN_URL has correct value. If it’s incorrect, you may modify code to provide correct according your needs.

Hi,
and yet again many thanks.
I have looked at what is being produced in FireBug:
url: ‘http://rewig-muenchen.de/wp-content/plugins/event-calendar-scheduler/codebase/’,
url_load: ‘http://rewig-muenchen.de/wp-content/plugins/event-calendar-scheduler/codebase/dhtmlxSchedulerConfiguratorLoad.php?task=loadxml’,
These are correct - and the admin stuff seems to work fine.

The problem is, I can’t get any Scheduler page to load in the front end.

I clicked on “Restore default” in the Settings tab, then it says that the link to Scheduler should be:
rewig-muenchen.de/?page_id=2792

This does not inspire overly great confidence, but of course I tried it. It gets redirected to rewig-muenchen.de/scheduler/ - and WordPress still says “Sorry, no such page.”

Perhaps this may have to do with me having installed about a dozen similar plugins, but have deinstalled them all because they did not do what I want. But maybe some tables / settings got left behind which cause a problem for event calendar scheduler?

Can you tell me the mechanism, how WordPress interprets a URL as to require calling a particular plugin?

Cheers, Tim

Hi,
usually scheduler initialization code is added to a required page.
Scheduler uses URL to load events (and to save them after changes). This url is passed into schedulerInit method. You may find this call in wp-content/plugins/event-calendar-scheduler/scheduler.php:

function scheduler_init() {
	global $scheduler_usertypes, $current_user, $scheduler_userid, $scheduler, $config;
	if (isset($current_user->roles[0]))
		$usertype = $current_user->roles[0];
	else
		$usertype = '-1';
	$usertype = Array($usertype);

	$url = WP_PLUGIN_URL.'/event-calendar-scheduler/codebase/';
	$loader_url = WP_PLUGIN_URL.'/event-calendar-scheduler/codebase/dhtmlxSchedulerConfiguratorLoad.php?scheduler_events=true';
	$final = $scheduler->schedulerInit($usertype, $config->locale, $url, $loader_url);
	return $final;
}

Also you may find in codebase/dhtmlxSchedulerConfigurator.php method replaceHostInURL which make some changes in provided URL to prevent cross-domain security problem.

protected function replaceHostInURL($url) {
		$url_parsed = parse_url($url);
		$host = $_SERVER['SERVER_NAME'];
		$url = preg_replace("/".preg_quote($url_parsed['host'])."/", $host, $url, 1);
		return $url;
	}

But I guess that it may break your correct url.

If still doesn’t work, could you provide me link to your scheduler page?

Eureka!

As I wrote, I tried many plugins, and the page “scheduler” created by your plugin smehow had ended up in the trash bin. I just found it there and got it back out.

In it I found the single line:
[[scheduler_plugin]]

That was all I needed to know - I did not find this most basic piece of information anywhere in your documentation - please consider adding it!!!

Many thanks - it looks great - I’ll post you an updated German translation soon.

Cheers, Tim

Hi,

attached the two files whose german translation I have given a major improvement (I’m originally from England but have lived for over 30 years in Germany).

I do now see the calendar - it looks really great - and can administer it in the backend (via http), but I still have 3 problems:

[]The dropdown menus show behind the scheduler. I have added: .dhx_cal_container { position: static !important; } to my themes CSS, which at least puts it into the context of the menus so that the z-index properties work, but the layout breaks if I do the same to the two header bars. Any ideas on how to do it elegantly?][/]
[]When I move the mouse over an event, the tooltip appears, and the cursor changes to a hand, but when I click it nothing happens.[/]
[]I don’t see any way to add or modify events in the frontend, even when logged in as administrator (yes, Admin has all rights in the settings).[/]

The page is here: rewig-muenchen.de/buerobelegung/

If you need a WordPress-Login e.g. as Editor, mail me at; info at timreeves.de

Again - many thanks!

Tim

tr-mods.zip (2.82 KB)

oops,

.dhx_cal_container { position: static !important; }

breaks the full-screen mode, so I had to take it out again.

Tim

Hi,
to show menu items at the top you have to modify style.css like here:

#branding {
	background:#FFDEAD;
	position:relative;
	z-index: 9998;
}

To prevent showing header over scheduler in full-screen mode you have to modify wp-content/plugins/event-calendar-scheduler/codebase/dhtmlxSchedulerConfigurator.php:

private function getExpandFix() {
		$js = 'scheduler.collapse_original = scheduler.collapse;';
		$js .= 'scheduler.collapse = function() {';
		$js .= 'var bar = document.getElementById("wpadminbar");';
		$js .= 'if (bar) bar.style.display = "block";';
		$js .= 'var header = document.getElementById("branding");';
		$js .= 'if (header) header.style.zIndex = "3";';
		$js .= 'scheduler.collapse_original(); };';
		
		$js = 'scheduler.expand_original = scheduler.expand;';
		$js .= 'scheduler.expand = function() {';
		$js .= 'var bar = document.getElementById("wpadminbar");';
		$js .= 'if (bar) bar.style.display = "none";';
		$js .= 'var header = document.getElementById("branding");';
		$js .= 'if (header) header.style.zIndex = "9998";';
		$js .= 'scheduler.expand_original(); };';
		return $js;
	}

When you click (once or double, it depends of configuration) event details should be shown. If user doesn’t have permissions to edit event then lightbox is shown in readonly mode (unregistred user for example). I tried your scheduler - it shown me details for event.

Please, send me test account in a private message.

Hi,

and again many many thanks for your fast and competent support!
I’ll be giving you a rave review at WordPress soon.

  1. The #branding css works, the dropdown menu is then in front of scheduler.
  2. The PHP fix for full-screen mode does work - but stomps on the previous fix. Z-Index may not be more than 999 or the branding area is in front of scheduler full-screen. But then, after using full-screen mode once, the menu is again behind scheduler - we’re going round in a tight circle. I think what we need is something to increase the z-index of the scheduler layer only when it is in fill-screen mode.

I have left the fixes in, in case you need to debug.

Some other questions / minor problems:

a) marknow: “Mark now” - what does this DO or refer to, I have no idea?

b) I have activated “Add event via single click”. It works nicely. But it would be really good if it would also apply to clicking on events which are already there. For that I still need a double click - and I’m fearing very much that some people will not find it. Normally in a browser, if the cursor changes to a hand then a single click causes action. I myself did not find the double click until you told me.

c) Missing translation: Doubleclick an event and up comes the individual event dialog. The Description area is - in German - labelled “Description” but I can’t see why locale label is not working: section_description: “Beschreibung”,

d) Missing translation: The weekly agenda tab is labeled “Week A.” - where can I change this to German?

Finally usability:
It would be great, when the Event dialog is being displayed, if a click OUTSIDE of it (anywhere on the greyed-over background) would close it again - many people are used to that from other similar applications.

I’ll post you some slightly more improved translation files as soon as we have the translation questions sorted out.

Best regards and heartfelt thanks,

Tim

Hi,

oops - now I understand about the double-click: When a single click starts a new event, then the double click is needed to differentiate which action is required - is that it? Or could the interpretation be dependent on whether an event is below the cursor or not?

Cheers, Tim

Hi,

a minor optical thing: In the views “month” and “week agenda” the boxes are bounded (border) on all sides except at far left, which I found optically “missing” - I thought maybe it was the Firefox table margin-left 1px bug, but no, just not provided in CSS.

I have added this to my theme:
div#scheduler_here { border-left: 1px solid #A4BED4; }

which is not completely elegant, as the scheduler_here is now 1px wider than configured, but since the parent box permits overflow all remains visible. So it more or less does the job.

Cheers, Tim

Hi Tim,

Could you provide us a link after that? :slight_smile:

Here is updated PHP code:

private function getExpandFix() {
      $js = 'scheduler.collapse_original = scheduler.collapse;';
      $js .= 'scheduler.collapse = function() {';
      $js .= 'var bar = document.getElementById("wpadminbar");';
      $js .= 'if (bar) bar.style.display = "block";';
      $js .= 'var header = document.getElementById("branding");';
      $js .= 'if (header) header.style.display = "block";';
      $js .= 'scheduler.collapse_original(); };';
      
      $js = 'scheduler.expand_original = scheduler.expand;';
      $js .= 'scheduler.expand = function() {';
      $js .= 'var bar = document.getElementById("wpadminbar");';
      $js .= 'if (bar) bar.style.display = "none";';
      $js .= 'var header = document.getElementById("branding");';
      $js .= 'if (header) header.style.display = "none";';
      $js .= 'scheduler.expand_original(); };';
      return $js;
   }

By the way, it looks like your code doesn’t include first part of this php-code (collapse method generating).
Changing scheduler’s z-index is not the best idea, because it may cause another problems with correct displaying.

It shows current time line (red line in week or day views).

There is a problem in logic how to detect if user wants to open details by single click or to drag-n-drop event. Maybe this one will be impoved in future. For now single click can only create new event, double click opens lightbox for existing event.

This label is a name of custom field, so you may change it’s label at according tab in scheduler admin panel.

This label is not default and not added into scheduler’s native localizations, so you have to add your translation into scheduler_include.html like here:

<script>
scheduler.locale.labels.week_agenda_tab = 'Week A.';
</script>

It’s possible to customize closing lightbox by clicking outside, but it may cause such scenario:
user writes details of a big event. Then he clicks outside and all data is lost. I think you have to add some confirm window to ask user if he really want to lose event changes.

Could you provide screenshot? I’m not sure if I understand correctly what do you mean.

This would be great, thanks!

Hi again,

many thanks!

The full-screen fix works, block / none being a much better idea. Except you missed a dot in the following line:
$js .= ‘scheduler.expand_original = scheduler.expand;’;
but fortunately I found it without too much trouble. Now it works.

marknow: Thanks, I have made the translation more explicit, and some others too.

Translation of “Description”: I don’t see any such custom field in the backend, have provided 2 Screenshots in the zip file.

“Week A.” -Your fix worked to change the translation, but should not that be a normal config item?

Clicking outside lightbox: Ah, I understand the problem, I will leave it as it is.

Boxes are bounded (border) on all sides except at far left: Just go to rewig-muenchen.de/buerobelegung/ and use FireBug or such on the main box. You’ll see I have added a custom CSS statement:
div#scheduler_here { border-left: 1px solid #A4BED4; }
If you disable this, you can see that there is no left border line.

I have provided the latest version of the german translation in the attached “tr-mods.zip”.

Cheers and again many thanks, Tim
tr-mods.zip (2.67 KB)
description.zip (33.7 KB)

Hi,

I was not sure where to give you a good review. I clicked “Visit the plugin forum” and said “it works” and gave you 5 stars, and added this topic to the wordpress forum:

wordpress.org/support/topic/plug … st-2851403

Anywhere else I can say something nice?

I wanted to donate, using the link “Donate to this plugin”, which takes me to the contact page of your website, where I did not find a “Donate” button…

Cheers again, Tim

Hi,

Custom field text has label Description. I’ve attached screenshot.

Actually week-agenda is not dhtmlxscheduler core view, it’s an extension. So this label is not added in scheduler localization file. Maybe it will be added in the future.

Yes, I see this issue.

Thanks for your translations really much!

If you want to donate you can buy any dhtmlx component here: dhtmlx.com/docs/products/lic … ce_request
But your good feedback is more valuable for us :slight_smile:


I am having the same issue - I administer my site via SSL logins and don’t get any text next to input boxes for the scheduler configuration pages.

I have read through this thread but am not able to follow exactly what needs to be done to get the schedular backend working correctly over SSL.

Any help greatly appreciated.