i am using TYPO3 Version 6.1 with formhandler extension. I try to use two custom markers in formhandler TS of type USER/USER_INT. These markers instanciate a extbase plugin. The first marker will be replaced by the plugin output. The second marker recieves just a .
markers {
# Modify studio search marker
studioSearch.settings {
search {
status = 3
formType = 1
}
formValuesPrefix < plugin.Tx_Formhandler.settings.predef.trialTraining.formValuesPrefix
}
studioTitle = TEXT
studioTitle {
data = DB:tx_mbxstudios_domain_model_studio:{GP:trial|studio}:title
data.insertData = 1
sanitize = 1
wrap = <p class="headline-4 red">Dein gewähltes Studio: <span class="black">|</span></p>
}
# Insert Calendar Extension
calendar = USER_INT
calendar {
userFunc = TYPO3\CMS\Extbase\Core\bootstrap->run
vendorName = TYPO3
pluginName = Pi1
extensionName = MbxStudios
switchableControllerActions.Trial.1 = calendar
settings < plugin.tx_mbxstudios.settings
settings {
formValuesPrefix < plugin.Tx_Formhandler.settings.predef.trialTraining.formValuesPrefix
forms.trialThresholdHour = 16
}
persistence < plugin.tx_mbxstudios.persistence
view < plugin.tx_mbxstudios.view
mvc < plugin.tx_mbxstudios.mvc
}
Any idea whats happening here.
Thanks
Related
I am trying to find guidance in the HERE JS documentation on how to add a custom button to the HERE JS 3.0 map UI we have.
The button is going to move the map to center on the customer's current location (we provide the location outside of HERE functionality and pass it in manually). However, this needs to be triggered by a button on the HERE map itself. But I can't figure out how to attach a button to the map (so far documentation is just about how to customize already existing UI buttons or how to add an info bubble):
https://developer.here.com/documentation/maps/dev_guide/topics/map-controls.html
Is this even possible? Help would be greatly appreciated!
The class H.ui.UI should help you get where you want to reach, and specifically the method addControl (name, control). and using the HERE UI kit makes it easy to craft the UI element (i.e. button) they way you wanted too.
I have written the following piece of code to help you achieve what you are looking for (I assume)
//#region add new UI element
inherits = function (childCtor, parentCtor) {
function tempCtor() { } tempCtor.prototype = parentCtor.prototype; childCtor.superClass_ = parentCtor.prototype; childCtor.prototype = new tempCtor(); childCtor.prototype.constructor = childCtor; childCtor.base = function (me, methodName, var_args) {
var args = new Array(arguments.length - 2);
for (var i = 2; i < arguments.length; i++) {
args[i - 2] = arguments[i];
}
return parentCtor.prototype[methodName].apply(me, args);
};
};
var customUI = function (opt_options) {
'use strict'; var options = opt_options || {};
H.ui.Control.call(this);
this.onButtonClick = this.onButtonClick.bind(this);
// create a button element
this.increaseBtn_ = new H.ui.base.Button({
'label': '<svg class="H_icon H_icon" viewBox="0 0 25 25">' +
'<path d="M 18.5,11 H 14 V 6.5 c 0,-.8 -.7,-1.5 -1.5,-1.5 -.8,0 -1.5,.7 -1.5,1.5 V 11 H 6' +
'.5 C 5.7,11 5,11.7 5,12.5 5,13.3 5.7,14 6.5,14 H 11 v 4.5 c 0,.8 .7,1.5 1.5,1.5 .8,0 1.5,' +
'-.7 1.5,-1.5 V 14 h 4.5 C 19.3,14 20,13.3 20,12.5 20,11.7 19.3,11 18.5,11 z" />' +
'</svg>',
'onStateChange': this.onButtonClick
});
//add the buttons as this control's children
this.addChild(this.increaseBtn_);
this.setAlignment(options['alignment'] || 'top-right');
this.options_ = options;
};
inherits(customUI, H.ui.Control);
customUI.prototype.onButtonClick = function (evt) {
'use strict'; if (evt.currentTarget.getState() === 'down') {
console.log('Hollla, I am the new custom UI element.');
}
};
var WaliedCheetos_CustomUI = new customUI();
ui.addControl('WaliedCheetos_CustomUI', WaliedCheetos_CustomUI);
//#endregion
I use PloneBooking3.0.0a2 with Plone4.3.3, but if I want to show periodic bookings I get an unsufficient privileges error. In my opinion there are two functions responsible for that:
function showPeriodicityResult(url, alt_url, target_id, form_id, waiting_text) {
ajaxobject = getXmlHttpRequest();
form = document.getElementById(form_id);
periodicity_type = getPeriodicityType(form);
periodicity_end_date = form['periodicity_form_periodicity_end_date_0'].value;
periodicity_variable = form['periodicity2_x'].value;
query = getPeriodicityQuery(periodicity_type, periodicity_end_date, periodicity_variable);
url = url + query + "&d=" + (new Date()).getTime();
alt_url = alt_url + query;
// Opera does not support ajax
if (ajaxobject == null) {
window.location = alt_url;
} else {
var node = document.getElementById(target_id);
node.innerHTML = waiting_text;
ajaxobject.open('GET', url, true);
ajaxobject.onreadystatechange = function(){CallBackGenerateAjaxHTML(ajaxobject, target_id);};
ajaxobject.send(null);
}
}
and
function CallBackGenerateAjaxHTML(ajaxobject, target_id) {
if (ajaxobject.readyState == 4) {
if (ajaxobject.status > 299 || ajaxobject.status < 200) {
return;
}
elem = document.getElementById(target_id);
elem.innerHTML = ajaxobject.responseText;
}
}
Especially the innerHTML setting with responseText seems to be a problem. Is there is a quick answer like Plone version diff from 3 to 4 or must I work in-depth?
You mentioned in the comments that the portal.uid_catalog raises the Unauthorized.
When I recall correctly the uid-catalog requires a higher permission since the last Plone hotfix. But you also can search an Item when given a UID with the normal Catalog.
here_obj python:portal.portal_catalog(UID=here_uid)[0].getObject();
This way you should be able to get your Object.
I'm using Jame Ferreira's Google Script: Enterprise Application Essentials to create a product page (Chapter 5). I've created the app that displays thumbnails of the products all on a page, and then the info panel with more detail that pops up when the user mouses over. It's using CSS to achieve this styling.
Problem comes in when placing the info panel. It pops up in only one location, as opposed to being tied to the thumbnail with which it is associated.
Here's the code related to the info panel. I believe the problem exists in the placement of the last few lines, but have tried everything I can think of:
function onInfo(e){
var app = UiApp.getActiveApplication();
var id = e.parameter.source;
for (var i in productDetails){
if(productDetails[i].id == id){
var r = 50;
var c = 0;
var infoPanel = app.createVerticalPanel().setSize('300px', '300px');
var horzPanel = app.createHorizontalPanel();
var image = app.createImage(productDetails[i].imageUrl).setHeight('100px');
var title = app.createLabel(productDetails[i].title);
horzPanel.add(image);
horzPanel.add(title);
var description = app.createLabel(productDetails[i].description);
infoPanel.add(horzPanel);
infoPanel.add(description);
applyCSS(infoPanel, _infoPanel);
applyCSS(image, _infoImage);
applyCSS(horzPanel, _infoBoxSeparator);
applyCSS(title, _infoTitle);
applyCSS(description, _infoDescription);
app.getElementById('infoGrid').setVisible(true)
.setWidget(0,0, infoPanel);
break;
}
c++
if (c == 3){
c = 0;
r = r+250;
}
switch (c)
{
case 0:
c=250;
break;
case 1:
c=500;
break;
case 2:
c=250;
break;
}
}
var _infoLocation =
{
"top":r+"px",
"left":c+"px",}
applyCSS(infoPanel, _infoLocation);
return app;
}
You may get the position of the mouse using e.parameter.x and e.parameter.y based on which you can position the infoPanel
infoPanel.setStyleAttribute('top',e.parameter.y)
.setStyleAttribute('left',e.parameter.x).setStyleAttribute('zIndex','1')
.setStyleAttribute('position','fixed');
You may add some offset to x and y positions of mouse to display it according to your needs.
Position related parameter which you get in handler function are
e.parameter.x
e.parameter.y
e.parameter.clientX
e.parameter.clientY
e.parameter.screenX
e.parameter.screenY
I have a set of components that are added to my Flex 4 stage dynamically.
Problem 1:
How do I address these objects when adding them to print.I cant generate objects on the fly and append them because then the print manager does not wait for the dynamic data to populate.
I currently use the following code to address items dynamically which fails:
public function PrintDashPreview():void{
var ItemsDrawn:int = 0;
var printJob:FlexPrintJob = new FlexPrintJob();
if(printJob.start()){
for each (var item:Object in GetDashBoardPreviewItems.lastResult.DashboardItem)
{
ItemsDrawn ++
this.addElement(dashPreview["flexShape" + TheID]);
printJob.addObject(dashPreview["flexShape" + TheID]);
this.removeElement(dashPreview["flexShape" + TheID]);
}
printJob.send()
Alert.show('Sent: ' + ItemsDrawn + ' items to page for printing.','Print Progress Debug');
}
}
How can I tell flex to grab these specific items and add them to the print job.
Problem 2:
How do I tell flex to lay each item out one below the other 2 per page.
Please and thank you for any help you can provide.
Regards
Craig Mc
The recipe for printing dynamic content usually goes like this:
(1) Start the printJob:
printJob = new FlexPrintJob();
printJob.printAsBitmap = false;
printJob.start();
(2) Obtain the print page dimensions. Use it if you have overflowing content:
printerPageHeight = printJob.pageHeight;
printerPageWidth = printJob.pageWidth;
(3) Create all of the dynamic objects and wait for the corresponding CREATION_COMPLETE events:
var componentsToBeInitialized:Number = 0;
var pages:Array = [];
for each (var itemData:Object in dataProvider) {
var component:UIComponent = new PageComponent();
someContainerOnTheDisplayList.addChild(component);
component.data = itemData;
componentsToBeInitialized ++;
pages.push(component);
component.addEventListener(FlexEvent.CREATION_COMPLETE, handlePageCompletion);
}
(4) Waiting for all CREATION_COMPLETE events:
function handlePageCompletion(e:Event):void {
componentsToBeInitialized --;
if (componentsToBeInitialized == 0)
printAllPages();
}
(5) Print the pages:
function printAllPages():void {
for each (var printPage:UIComponent in pages) {
printJob.addObject(printPage);
}
printJob.send();
}
I am using the following code to bind Crystal Reports in page load event.
using (MilitrymessEntities entity = new MilitrymessEntities())
{
BarporderReports barporpt = new BarporderReports();
barporpt.Refresh();
barporpt.SetDataSource(query);
//barporpt.SetParameterValue("norows", 10);
crviewer_barpurchaseorder.RefreshReport();
crviewer_barpurchaseorder.ReportSource = barporpt;
}
It is binding properly and displaying the report. I applied filter to the report in the button click event, when I click the search button, the report is displaying the same set of data. It's not displaying the filtered value. The button click event code follows:
using (MilitrymessEntities entity = new MilitrymessEntities())
{
DateTime dt1 = Convert.ToDateTime(txt_fromdate.Text);
DateTime dt2 = Convert.ToDateTime(txt_todate.Text);
string strdt1 = dt1.Date.ToString("MM/dd/yyyy");
string strdt2 = dt2.Date.ToString("MM/dd/yyyy");
dt1 = Convert.ToDateTime(strdt1);
dt2 = Convert.ToDateTime(strdt2);
var query = from data in entity.BarPurchaseOrders.AsEnumerable()
where (data.Date >= dt1) && (data.Date <= dt2) && data.ItemName == drp_itemname.SelectedItem.Text
select data;
BarporderReports barporpt = new BarporderReports();
barporpt.Refresh();
barporpt.SetDataSource(query);
crviewer_barpurchaseorder.RefreshReport();
crviewer_barpurchaseorder.ReportSource = barporpt;
}
Do you have any idea about this problem?
You need to be checking for a post back on page load event. Like below,
if(!page.IsPostback())
{
using (MilitrymessEntities entity = new MilitrymessEntities())
{
BarporderReports barporpt = new BarporderReports();
barporpt.Refresh();
barporpt.SetDataSource(query);
crviewer_barpurchaseorder.RefreshReport();
crviewer_barpurchaseorder.ReportSource = barporpt;
}
}
Also, you should be setting your report and data source before refreshing,
BarporderReports barporpt = new BarporderReports();
barporpt.SetDataSource(query);
barporpt.Refresh();
crviewer_barpurchaseorder.ReportSource = barporpt;
crviewer_barpurchaseorder.RefreshReport();