• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

FullCalendar : customize edit/details url ?

lcollong

FabriKant d'applications web
Hi,

Full calendar is doing great, but my table is huge. I need to display a simplified version of the table (copy) in the viz in order to enhance display speed. But the edit form displayed in the popup (as well as the details one) has to refer to the original table (form). Easy to do with Fabrik's list but the custom url field in the viz's params seems not being able to handle the three ones (add, edit, view).

Currently, I made a popup of the simplified list, hide the regular button in the popup and added a link in the popup html to the edit page. It's not very "nice" but it works. However I can't stay inside the popup. It has to open in "same" or "_blank".

I don't think php template or layout will help as everything is done in JS.

Any solution ?
 
How complicated would it be to use the Fabrik'list (custom) "link" parameters to build the underlying popup button (edit/view) ? Hence we could display in the popup "edit" whatever is indicated in the custom edit link of the list associated with the calendar.
 
Jlayouts override for this viz is not yet implemented. Right ?
If not, would be nice to add a class to the start/end rows in order to not display or style all the thing. Here is the proposed modified plugins/fabrik_visualization/fullcalendar/layouts/fabrik-visualization-fullcalendar-viewevent.php file :

PHP:
<?php
defined('JPATH_BASE') or die;
?>
<div class="form-horizontal" id="viewDetails">

    <div class="row calEventStart">
        <div class="span4"><?php echo FText::_('PLG_VISUALIZATION_FULLCALENDAR_START') ?>:</div>
        <div class="span8" id="viewstart"></div>
    </div>
    <div class="row calEventEnd">
        <div class="span4"><?php echo FText::_('PLG_VISUALIZATION_FULLCALENDAR_END') ?>:</div>
        <div class="span8" id="viewend"></div>
    </div>
    <div class="row">
        <div class="span12" data-role="fabrik-popup-template">

        </div>
    </div>
</div>

as it allows to use fabrik's placeholders rather than raw date/time :

View attachment 17231
 
Last edited:
Strange thing : all the text in the previous pic are placeholders element. The first one "Epicerie du coin" gives the right data, the second one is a date element which does not want to render (always "raw"). The third one is a drop down (60 mn) which gives the right data, not the raw one. However the last one (interv) which is also a regular dropdown gives the raw data instead of the element label. Is there some limitations to the placeholder parsing ?
 
How complicated would it be to use the Fabrik'list (custom) "link" parameters to build the underlying popup button (edit/view) ? Hence we could display in the popup "edit" whatever is indicated in the custom edit link of the list associated with the calendar.

I'll take a look.

Jlayouts override for this viz is not yet implemented. Right ?

Should be. The layout paths we're using for the layout you mentioned on my system are:

Code:
array (
    0 => 'C:\\xampp\\htdocs\\joomla34\\plugins/fabrik_visualization/fullcalendar/layouts/',
    1 => 'C:\\xampp\\htdocs\\joomla34\\templates/yootheme/html/layouts/com_fabrik',
    2 => 'C:\\xampp\\htdocs\\joomla34\\templates/yootheme/html/layouts',
    3 => 'C:\\xampp\\htdocs\\joomla34/layouts',
    4 => 'C:\\xampp\\htdocs\\joomla34\\components/com_fabrik/layouts',
    5 => 'C:\\xampp\\htdocs\\joomla34\\templates/yootheme/html/layouts/com_fabrik',
    6 => 'C:\\xampp\\htdocs\\joomla34/components/com_fabrik/layouts',
    7 => 'C:\\xampp\\htdocs\\joomla34\\templates/yootheme/html/layouts',
    8 => 'C:\\xampp\\htdocs\\joomla34/layouts',
  ),

So it should find an override in any of the usual places - the site template, the main com_fabrik/layouts, etc.

Which location were you trying?

-- hugh
 
Hi Hugh,

thanks for looking to this one.

I did my test with : templates/yoo_avenue/html/layouts/com_fabrik/fullcalendar
I tried with or without "fullcalendar" as well as templates/yoo_avenue/html/layouts/com_fabrik/fabrik_visualization/fullcalendar/fabrik-visualization-fullcalendar-viewevent.php

As for by my understanding, the modified file should be : templates/yoo_avenue/html/layouts/com_fabrik/fabrik-visualization-fullcalendar-viewevent.php ?
But it does not load. Even after cleaning all possible caches.
 
Ooops, I see the problem. OK, after this commit, the locations you'd expect will work:

C:\xampp\htdocs\joomla34\templates/protostar/html/layouts/com_fabrik/visualization
C:\xampp\htdocs\joomla34\templates/protostar/html/layouts/com_fabrik
C:\xampp\htdocs\joomla34/plugins/fabrik_visualization/fullcalendar/views/fullcalendar/tmpl/bootstrap/layouts
C:\xampp\htdocs\joomla34/plugins/fabrik_visualization/fullcalendar/layouts

https://github.com/Fabrik/fabrik/commit/ce99696a96bb2199c44a8fa74b5b2a6c19480553

-- hugh
 
Perfect. Now I can override :)
Regarding my post #4, could you indicate me where I could start to debug the reason why some placeholders in the popup template render as expected and some give back the raw value (ie BD value) ? Both are regular drop downs.
 
Btw, I'm working on having the view and edit links use the list's settings, so if custom links are specified, it'll use those.

The issue with placeholders is that we're not "rendering" the data. So the placeholders are working on the result of a simple query, without the element rendering. So, for example, dates are MySQL format. Dropdowns will be the raw data. Etc. Nothing is being run through the element's renderListData() method.

Code:
SELECT SQL_CALC_FOUND_ROWS DISTINCT `fab_more_events`.`date_time` AS `fab_more_events___date_time`, 
 `fab_more_events`.`date_time` AS `fab_more_events___date_time_raw`, 
 `fab_more_events`.`id` AS `fab_more_events___id`, 
 `fab_more_events`.`id` AS `fab_more_events___id_raw`, 
 `fab_more_events`.`name` AS `fab_more_events___name`, 
 `fab_more_events`.`name` AS `fab_more_events___name_raw`, 
etc etc

... and that's what you get.

The reason we're not rendering the data is for performance. It's the element rendering that takes the time when building a list view. And in a calendar, where you may have dozens (or hundreds) of events in a month, it would kill performance. And for most people, they would be gaining nothing, as very few people use that popup, so have no need for the rendered data.

I'm not sure why / how you are seeing "rendered" data for one of your dropdowns, unless it's actually a join element, not a dropdown element. I don't see any way in the code that you could be seeing the "label" (non-raw) of a dropdown, as the label is only present in the #__fabrik_elements metadata table (in JSON format, in the params), and requires element rendering to display.

I don't really have a good solution for you at the moment.

-- hugh
 
About the only "easy" solution would be to make the popup option eval'able, so you could do your own individual element rendering.

-- hugh
 
Taking a much closer look : none of the placeholders are actually rendered. Only raw values are displayed indeed. My mistake.
I do understand the performance issue. It's important in my case also.

However, the popup view is ideal to have an appointment quick look whereas a direct detail view link would give too much informations most of the case. So the option to substitute the popup by directly opening the target detailed view is not the right solution.

Being able to link to the edit/details view from the popup using the list custom url would be ideal (second level deeper informations). I'll wait your current investigations.

The eval thing in the popup makes senses. But if it is done on page load, I'm concerned about performance issue as well.

Could we consider an ajax solution ? opening the popup would trigger an ajax call giving back the html to display in the popup ? Ideally, in a separate div. On popup opening the current custom content would be displayed (constant and raw values from the sql request as now). Thus without waiting the server answer. A second div would be populated from the server meanwhile (spinner on display, then replaced by the actual content).
I'm not expecting all of this "out of the box". Just the "entry point" to write the right js and, may be, load the userAjax.php file in order to trigger my own function ?

What do you think ?
 
Thinking Aloud.

Turns out it's not as easy as I'd hoped, as the links are built in the controller ...

https://github.com/Fabrik/fabrik/bl...ullcalendar/controllers/fullcalendar.php#L113

When you click the view/edit button on the popup, it's not calling the view/edit links direct, it's calling the fullcalendar viz controller, telling it which view it wants (form or details), and the controller then builds the links "by hand" (doesn't call the list model's methods) and redirects to that view. And the problem is, in order to call the list model's editLink() and viewDetailsLink() methods (to get the custom links if they exist) in that controller, we'd have to load the row data there, eg run a form model getData(), because those methods require the $row object as an argument (so it can get things like the rowid and have row data available for placeholders used in custom links). Which would be a huge performance hit ... loading the form data from the database just to build the redirect link to the form/details view, which would then have to load the data all over again.

Looks like waaaay back we used to build the links when loading the event data ...

https://github.com/Fabrik/fabrik/bl...ion/fullcalendar/models/fullcalendar.php#L523

... which is called (via AJAX) as the month view is loaded, and we do actually include those links in the event data we pass to the Javascript. But those aren't used any more - I seem to recall we used them in the first cut of the original (deprecated) 'calendar' plugin.

However, at the point those (unused) links are built, we do have the row data. So I could call the list model methods, and get custom links. Then I think what I could do is then finagle the Javascript so it passes the ready built form/details links back to the controller, which could then use those, rather than building it's own.

OK, lets try that!

-- hugh
 
I started working on this, then ran into a nasty issue with the staging branch of J! (the 3.8.10 pre-release), which broke our caching, whereby reloading a list of viz page (with J! system cache enabled) none of our JS was loading.

I've almost got that resolved, hopefully get back to working on the calendar stuff this evening.

-- hugh
 
Wowww. Thanks for the follow-up. It's clearly out my Fabrik's skills scope !) The only thing I could done is to renew my sub to support you.... :)

BTW, is this Ajax approach could meet my popup concerns (post #11) ? In my case, the edit/detail links could be built from the ajax call :

Could we consider an ajax solution ? opening the popup would trigger an ajax call giving back the html to display in the popup ? Ideally, in a separate div. On popup opening the current custom content would be displayed (constant and raw values from the sql request as now). Thus without waiting the server answer. A second div would be populated from the server meanwhile (spinner on display, then replaced by the actual content).
I'm not expecting all of this "out of the box". Just the "entry point" to write the right js and, may be, load the userAjax.php file in order to trigger my own function ?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top