Welcome, Guest
Username: Password: Remember me

TOPIC: Check-in issue using modal forms

Check-in issue using modal forms 16 Jan 2014 03:38 #12012

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Hello Admin/Cooks

I am having an issue with check-out and check-in while using modal forms in the front-end.

The selected record is locked when the modal form is loaded without a problem. However, it only unlocks if the toolbar buttons are used to unload the form. If the close button or mask is clicked, the form unloads but the record remains locked for all other users.

I am looking for the best way to check-in the record for all form unload-events; at least until it is handled within the cook framework directly.

Thanks
vlemos
Last Edit: 16 Jan 2014 03:45 by vlemos.
The administrator has disabled public write access.

Check-in issue using modal forms 17 Jan 2014 13:47 #12032

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Hello Admin

I can only imagine how busy you must be but, I would really appreciate a response on this matter.

For a Joomla 2.5 project:
After selecting a modal layout for my item pages, I am having issues with the check-out and check-in feature. The feature works well if the toolbar buttons are clicked; however, if the user closes the modal window in any other way the record being viewed remains locked.

Can you look into this issue and offer your feedback?

Thanks
vlemos
The administrator has disabled public write access.

Check-in issue using modal forms 17 Jan 2014 13:54 #12035

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
You need to add a javascript somewhere to call 'cancel' ajax task, when the modal is firering the 'onClose' event.

I never did that.
You should write this code in the JDom assets/toolbar/js/toolbar.js

Moved in 'New functionalities'
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: vlemos

Check-in issue using modal forms 17 Jan 2014 14:28 #12036

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Thanks Admin

Do you intend to resolve this issue in the builder? What time-frame can be expected?

Regards
vlemos
The administrator has disabled public write access.

Check-in issue using modal forms 19 Jan 2014 21:55 #12062

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Hello Admin

This is great, [FIXED] FORMS within MODAL windows, thanks alot.

I have successfully implemented an "modal_onclose" feature which allows the parent to define a JavaScript routine which will run when the child closes. However, I am not very excited about updating all my projects each time they are generated.

Are you planning to solve this issue in the near future? It would make modal forms a real option when updating records on the j-cook platform.

Regards
vlemos
The administrator has disabled public write access.

Check-in issue using modal forms 19 Jan 2014 22:05 #12064

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
If you furnish the code, I can do it easily I think.
Coding is now a piece of cake
The administrator has disabled public write access.

Check-in issue using modal forms 19 Jan 2014 23:02 #12065

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
\dom\html.php
class JDomHtml extends JDom
{
	protected $modal_height;
	protected $iconLibrary;
	protected $modal_onclose;
	protected $modal_scrolling;

	function __construct($args)
	{
		.
		.
		.

		$this->arg('iconLibrary', 	null, $args, 'icomoon');
		$this->arg('modal_onclose', 	null, $args);
		$this->arg('modal_scrolling', 	null, $args);
		.
		.
		.
	}
	
	
	protected function embedLink($html)
	{
		.
		.
		.

		if ((isset($this->href) || isset($this->target) ||  isset($this->task)) && (isset($this->dataValue)) && (!empty($this->dataValue)))
		{
			$html = JDom::_("html.link", array(
				.
				.
				.

				'modal_onclose' => (isset($this->modal_onclose)?$this->modal_onclose:null),
				'modal_scrolling' => (isset($this->modal_scrolling)?$this->modal_scrolling:null),
			));
		}

		return $html;
	}
}


\dom\html\link.php
class JDomHtmlLink extends JDomHtml
{
	.
	.
	.
	
	protected $modal_onclose;
	protected $modal_scrolling;

	function __construct($args)
	{
		.
		.
		.

		$this->arg('alertConfirm'	, null, $args);
		$this->arg('modal_onclose'	, null, $args);
		$this->arg('modal_scrolling' , null, $args);

	}

	function modalLink()
	{
		JHTML::_('behavior.modal');

		$this->addClass('modal');

		$rel = "{";
		$rel.= "handler: '" . ($this->handler?$this->handler:'') . "'";

		if ($this->modal_width && $this->modal_height)
		{
			$rel .=	", size: {x: " . ((int)$this->modal_width?(int)$this->modal_width:"null")
						. 	", y: " . ((int)$this->modal_height?(int)$this->modal_height:"null")
						. "}";
		}
		if ($this->modal_scrolling)
		{
			$options = array("auto", "no", "yes");
			if (!in_array(strtolower($this->modal_scrolling), $options))
				$this->modal_scrolling = "auto";

			$rel .=	", iframeOptions: {scrolling:'" . $this->modal_scrolling
						. "'}";
		}
		if ($this->modal_onclose)
		{
			$rel .=	", onClose: function() {" . $this->modal_onclose . "}";
		}
		$rel.=	"}";

		$this->addSelector('rel', $rel);

	}

}


Usage for reloading parent on modal close:
<?php echo JDom::_('html.fly', array(
		'dataKey' => 'account',
		'dataObject' => $row,
		'modal_height' => 350,
		'modal_onclose' => 'var js = window.location.reload();',
		'modal_scrolling' => 'no',
		'modal_width' => 350,
		'route' => array('view' => 'clients','layout' => 'ajax','render=account&account' => $row->id),
		'target' => 'modal'
	));?>

This event can also be used for checking in the record on modal close and many more actions related to the unloading of the form. I and not blissfully happy with this solution so I am continuing my research into this matter; however, this function was the quickest to implement to move my project along.

Regards
vlemos
Last Edit: 19 Jan 2014 23:25 by vlemos.
The administrator has disabled public write access.
The following user(s) said Thank You: admin

Check-in issue using modal forms 22 Jan 2014 18:43 #12085

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Hello Admin

After submitting the code you requested, were you able to update the j-cook framework to resolve the problems of unlocking records when the user clicks the mask or close button: while using modal forms?

I use modal forms in my projects, therefore, I am hoping that I may soon be able to download j-cook projects and not be forced to go through the hassles of making all the changes required.

Thanks
V
The administrator has disabled public write access.

Check-in issue using modal forms 22 Jan 2014 20:34 #12087

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Thank you very much,

I am gonna check and do it soon.
K++
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: vlemos

Check-in issue using modal forms 26 Jan 2014 05:27 #12104

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Hello Admin

Just a glance at the board and I can see that you are very busy. However, please try to fit me in as soon as possible.

Thanks and waiting
V
The administrator has disabled public write access.

Check-in issue using modal forms 02 Feb 2014 03:52 #12117

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Hello Admin, any word on this? Thanks and waiting V
The administrator has disabled public write access.

Check-in issue using modal forms 02 Feb 2014 10:21 #12118

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
It is on the way. I have it on priorities because it is easy.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: vlemos

Check-in issue using modal forms 07 Feb 2014 15:19 #12151

  • vlemos
  • vlemos's Avatar
  • Online
  • Elite Member
  • Posts: 295
  • Thank you received: 41
  • Karma: 21
Thanks for the feedback, Admin.
The administrator has disabled public write access.

Check-in issue using modal forms 09 Feb 2014 03:16 #12160

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Hi vlemos,

I have made the modifications, but it still not work for check-out. I cannot realize this one.
I explain myself :
To liberate the lock of the item, the cancel task must be sent to the controller.
This is realized trough Ajax when you click on the cancel button of the form.

But, this modal is a iframe. And it is really complex (maybe impossible) to reach the form object, from the parent window when is defined the js modal object.
It is really problematic and I searched for a long time how to pass by this.
To realise it differently, it would be possible to store the complete url to send in ajax in case of a cancel. Then handle all this from the caller.
The problem in our case is that the cancel task should be sent from the form already prepared for that.

My conclusion :
This feature will come, but in a different way.
Cook is not gonna use anymore this modal box to edit items. Because it is old-school and I prefer the full javascript way.
I am preparing amazing stuff for soon !!

I do not have answer for this.
Maybe somebody have an idea ?
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: vlemos
Time to create page: 0.079 seconds

Get Started