help to better help you:
Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!
Missing "add venue" button in frontend
Re: Missing "add venue" button in frontend
9 years 10 months ago - 9 years 10 months ago
@Hoffi,
that would be by using ajax or something like that.
Did see that with eventlist there were variables called $mode / ajax so guess they were doing with that. Didn't knew at that time how to deal with it but at this time i think it ain't that hard.
that would be by using ajax or something like that.
Did see that with eventlist there were variables called $mode / ajax so guess they were doing with that. Didn't knew at that time how to deal with it but at this time i think it ain't that hard.
Last edit: 9 years 10 months ago by Bluefox.
Please Log in or Create an account to join the conversation.
Re: Missing "add venue" button in frontend
9 years 10 months ago - 9 years 10 months ago
It is a great feature from a user POV indeed. I was impressed how you could create a venue during event Creation in EL (no pop-up for venue creation, new page) and then when returning to event creation everything previously added was still there, without actively saving.
Now if a venue isn't added you have to leave event creation, enter venue creation by seperate menu, create venue, return to event creation and then continue. Or is there a better way (other than checking for venues before beginning)?
Something to consider!
Again, great that development of this continues!
Now if a venue isn't added you have to leave event creation, enter venue creation by seperate menu, create venue, return to event creation and then continue. Or is there a better way (other than checking for venues before beginning)?
Something to consider!
Again, great that development of this continues!
Last edit: 9 years 10 months ago by dtanner. Reason: Clearify
Please Log in or Create an account to join the conversation.
Re: Missing "add venue" button in frontend
9 years 10 months ago - 9 years 10 months ago
hmm, aldo eventlist was calling it $mode = ajax i don't think it was ajax.
the basics are simple:
- in the modal we're referring to the editvenue view
- in the editvenue controller we're checking if we're dealing with $mode=ajax (by catching request) if it is then we're closing the screen, just like a normal modal. if it's not a modal then we're redirecting/saving as normal.
with the modal-select we're retrieving the rows from the venues-table and doing so the newly created venue will also be retrievable. so would say it's definately possible to add.
the basics are simple:
- in the modal we're referring to the editvenue view
- in the editvenue controller we're checking if we're dealing with $mode=ajax (by catching request) if it is then we're closing the screen, just like a normal modal. if it's not a modal then we're redirecting/saving as normal.
with the modal-select we're retrieving the rows from the venues-table and doing so the newly created venue will also be retrievable. so would say it's definately possible to add.
Last edit: 9 years 10 months ago by Bluefox.
Please Log in or Create an account to join the conversation.
Re: Missing "add venue" button in frontend
9 years 10 months ago - 9 years 10 months agoAs workaround you can simply open a new browser tab to create venue. Would say venue list is created when you open the Select venue popup so I would hope the new one is also there without the need to fully leave the event creation form..dtanner wrote: It is a great feature from a user POV indeed. I was impressed how you could create a venue during event Creation in EL (no pop-up for venue creation, new page) and then when returning to event creation everything previously added was still there, without actively saving.
Now if a venue isn't added you have to leave event creation, enter venue creation by seperate menu, create venue, return to event creation and then continue. Or is there a better way (other than checking for venues before beginning)?
Last edit: 9 years 10 months ago by Hoffi.
Please Log in or Create an account to join the conversation.
Re: Missing "add venue" button in frontend
9 years 10 months ago - 9 years 10 months ago
before i forget here some information.
editevent-view, edit.php
here we have to add a modal. ofcourse it would be nice to create a form field but for now a basic link just to test it out.
in the above we're pointing to the editvenue, but that view doesn't know what to do with it so let's adjust things there too.
editvenue, view.html.php
we're catching the string "mode"
editvenue, edit.php
add a hidden input field to store the mode.
and now the tricky parts, when pressing the buttons (save, cancel, save&close) we're going to point to the controller and that one also doesn't know what to do with it so you need to inform him of what to do.
controllers / editvenue.php / cancel
function cancel will be something like
controllers / editvenue.php / save-apply-etc.....
you have to take a look at the function "save" there are a couple of "redirects" in that function
and we need to add some code before the redirect, this as we don't want the script to redirect but to close.
for example the task "apply",
be aware that the code in the postSaveHook function is not being triggered as we are applying a "return" and doing so there won't be a mail sent upon creating a new venue. If you do want to receive a notice then you need to move the dispatcher code to the save function.
notes:
- won't add it myself to Github for a while
- the link in editevent-view should move to a field
- in the above is no security checking, but it would be good to apply it.
editevent-view, edit.php
here we have to add a modal. ofcourse it would be nice to create a form field but for now a basic link just to test it out.
Code:
<a class="flyermodal" title="<?php echo JText::_('DELIVER NEW VENUE'); ?>" href="<?php echo JRoute::_('index.php?option=com_jem&view=editvenue&mode=ajax&tmpl=component'); ?>" rel="{handler: 'iframe', size: {x: 800, y: 500}}">
<span><?php echo JText::_('DELIVER NEW VENUE')?></span>
</a>
in the above we're pointing to the editvenue, but that view doesn't know what to do with it so let's adjust things there too.
editvenue, view.html.php
we're catching the string "mode"
Code:
$jinput = JFactory::getApplication()->input;
$this->mode = $jinput->get('mode');
editvenue, edit.php
add a hidden input field to store the mode.
Code:
<input type="hidden" name="mode" value="<?php echo $this->mode; ?>" />
and now the tricky parts, when pressing the buttons (save, cancel, save&close) we're going to point to the controller and that one also doesn't know what to do with it so you need to inform him of what to do.
controllers / editvenue.php / cancel
function cancel will be something like
Code:
public function cancel($key = 'a_id')
{
$jinput = JFactory::getApplication()->input;
$mode = $jinput->get('mode');
if ($mode == 'ajax')
{
// close the window.
$js = "window.parent.SqueezeBox.close()";
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($js);
return;
}
parent::cancel($key);
// Redirect to the return page.
$this->setRedirect($this->getReturnPage());
}
controllers / editvenue.php / save-apply-etc.....
you have to take a look at the function "save" there are a couple of "redirects" in that function
and we need to add some code before the redirect, this as we don't want the script to redirect but to close.
for example the task "apply",
Code:
switch ($task)
{
case 'apply':
// Set the record data in the session.
$recordId = $model->getState($this->context . '.id');
$this->holdEditId($context, $recordId);
$app->setUserState($context . '.data', null);
$model->checkout($recordId);
$jinput = JFactory::getApplication()->input;
$mode = $jinput->get('mode');
$data = $model->getItem($recordId);
if ($mode == 'ajax')
{
$script[] = "window.parent.jSelectVenue_jform_locid('".$data->id."', '".$data->venue."')";
$script[] = "window.parent.SqueezeBox.close()";
// Add to document head
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
return;
}
// Redirect back to the edit screen.
$this->setRedirect(
JRoute::_(
'index.php?option=' . $this->option . '&view=' . $this->view_item
. $this->getRedirectToItemAppend($recordId, $urlVar), false
)
);
break;
be aware that the code in the postSaveHook function is not being triggered as we are applying a "return" and doing so there won't be a mail sent upon creating a new venue. If you do want to receive a notice then you need to move the dispatcher code to the save function.
notes:
- won't add it myself to Github for a while
- the link in editevent-view should move to a field
- in the above is no security checking, but it would be good to apply it.
Last edit: 9 years 10 months ago by Bluefox.
Please Log in or Create an account to join the conversation.
Re: Missing "add venue" button in frontend
8 years 3 months ago
Hi there
Some time ago I added this code on jem and it work like a charm, but the button "APPLY" don't work well, on click, it close the modal and don't stay in the edit venue page like it would do.
Now I really need it, and I spent the last two days to find how to make it work but without success.
So, please, give me some hint or direction for to make it work.
Thanks in advance.
Some time ago I added this code on jem and it work like a charm, but the button "APPLY" don't work well, on click, it close the modal and don't stay in the edit venue page like it would do.
Now I really need it, and I spent the last two days to find how to make it work but without success.
So, please, give me some hint or direction for to make it work.
Thanks in advance.
Please Log in or Create an account to join the conversation.
Time to create page: 0.797 seconds