Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: [SOLVED] Myplanning works but not the menu link

[SOLVED] Myplanning works but not the menu link 3 weeks 2 days ago #26858

  • vgnl
  • vgnl's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 4
Beginner in the knowledge of JEM.
There is a calendar by category or by location, but I don't know if it is possible to display a calendar showing all the events of a single joomla user.
There is a list of his own events, but not in the form of a calendar.
Thank you
The following user(s) said Thank You: jojo12

Please Log in or Create an account to join the conversation.

[SOLVED] Myplanning works but not the menu link 3 weeks 2 days ago #26859

  • jojo12
  • jojo12's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 3165
  • Karma: 45
  • Thank you received: 339
Interesting idea. Try and share if you succeed!
Testing JEM 2.3.0 beta3 local on clean latest Joomla (3.9.11) Protostar php7.3.8 (no mails)

Please Log in or Create an account to join the conversation.

[SOLVED] Myplanning works but not the menu link 2 weeks 3 days ago #26878

  • vgnl
  • vgnl's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 4
Hello,
I just added myplanning to the com_jem component by copying and pasting other parts of code.
I then applied some modifications.
It is therefore not an optimized solution.
Then see the description.

After a few tests, it seems to work for my joomla and jem environment.
I then created the menu link under the joomla administrator.
in URL link :
index.php?option=com_jem& view=myplanning

BUT I can create this link automatically by myself without any modification
the selection in Menu Item type by the JEM component by selecting Calendar (Shows a Calendar) !!!!!
Obviously it is practical but I lose the real Calendar which is replaced by myplanning ....

I can't figure out how to change this error.
How jem allows joomla to make menu links?

Anyone have an idea?
Thank you


description to do Myplanning-

Myplanning


1) com_jem/controller.php (edit)

switch ($viewName) {
case 'attendees':
case 'calendar':
case 'myplanning':




2) views/myplanning (new)

a) Copy all View calendar

b) change  in view.html.php:
class JemViewMyplanning extends JviewLegacy

c) change  in view.html.php:
$url_base = 'index.php?option=com_jem&view=myplanning' . $partItemid;


3) models/myplanning.php (new)

a) Copy Model calendar and change
class JemModelMyplanning extends JemModelEventslist

b) change
getListQuery() by protected function getListQuery() from eventlist.php

$query->join('LEFT', '#__jem_countries AS ct ON ct.iso2 = l.country');

$query->join('LEFT', '#__users AS u on u.id = a.created_by');

after ordering

# Get the WHERE clause for the query
$where = $this->_buildWhere();

$query->select('DATEDIFF(a.enddates, a.dates) AS datesdiff, DAYOFMONTH(a.dates) AS start_day, YEAR(a.dates) AS start_year, MONTH(a.dates) AS start_month');

$query->where( $where);

c) add
protected function _buildWhere() from myevents.php

a.access
a.published
Attachments:
The following user(s) said Thank You: jojo12

Please Log in or Create an account to join the conversation.

[SOLVED] Myplanning works but not the menu link 1 week 6 days ago #26881

  • jojo12
  • jojo12's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 3165
  • Karma: 45
  • Thank you received: 339
Hi, I tried to reproduce this myplanning part to understand how it works and where the problems are. But I did not understand all in the models part.
Are you working with JEM 2.2.3?
Testing JEM 2.3.0 beta3 local on clean latest Joomla (3.9.11) Protostar php7.3.8 (no mails)

Please Log in or Create an account to join the conversation.

Last edit: by jojo12. Reason: typos

[SOLVED] Myplanning works but not the menu link 1 week 6 days ago #26882

  • vgnl
  • vgnl's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 4
Hi,

Sorry my explanations on the model are not well formulated.

yes i am using 2.2.3:
Package: 2.2.3 February 2018
Component: 2.2.3 February 2018
Module-Basic: 2.2.3 August 2017
Calendar module: 2.2.3 December 2017
Module-Banner: 2.2.3 February 2018
Module-Jubilee: 2.2.3 February 2018
Module-Teaser: 2.2.3 February 2018
Module-Wide: 2.2.3 August 2017
Plugin-Content: 2.2.3 December 2014
Plugin-Content List Events: 2.2.3 December 2017
Plugin-Finder: 2.2.3 January 2015 deactivated
Plugin-Search: 2.2.3 June 2015 deactivated
Plugin-Comments: 2.2.3 December 2014 disabled
Mailer Plugin: 2.2.3 September 2017 disabled
PHP: 7.3.11-1 ~ deb10u1
GD: 2.2.5
the principle is as follows:
myplanning comes from:
a) calendar.php
I use the calendar model and I modify the calendar getListQuery by replacing it with the getListQuery from myevents.php.
But I don't need the information about country (ct) and author (u) either I delete:
$ query-> join ('LEFT', '#__jem_countries AS ct ON ct.iso2 = l.country');
$ query-> join ('LEFT', '#__users AS u on u.id = a.created_by');

b) then I need to retrieve the where clause from controllers / myevents.php or protected function buildwhere () where is:
// then if the user is the owner of the event
$ where [] = 'a.created_by ='. $ this -> _ db-> Quote ($ user-> id);
I delete the
$ where [] = 'a.access IN ('. implode (',', $ levels). ')';
$ where [] = 'c.access IN ('. implode (',', $ levels). ')';
because already covered in the model calendar.

c) I copy protected function _buildWhere () modified in myplanning.php
and I add in protected function getListQuery () of myplanning.php after
# ordering
$ orderby = $ this-> getState ('filter.orderby');
if ($ orderby) {$ query-> order ($ orderby);}
this
// after
# Get the WHERE clause for the query
$ where = $ this -> _ buildWhere ();

and invalid
// here we can extend the query of the Eventslist model
//$query->select('DATEDIFF(a.enddates, a.dates) AS datesdiff, DAYOFMONTH (a.dates) AS start_day, YEAR (a.dates) AS start_year, MONTH (a.dates) AS start_month ') ;

Thanks
Attachments:
The following user(s) said Thank You: jojo12

Please Log in or Create an account to join the conversation.

[SOLVED] Myplanning works but not the menu link 1 week 6 days ago #26883

  • jojo12
  • jojo12's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 3165
  • Karma: 45
  • Thank you received: 339
you should change in line 3 and 5 of views/myplanning/tmp/default.xml from
COM_JEM_CALENDAR_VIEW_DEFAULT_TITLE to "COM_JEM_MYPLANNING_VIEW_DEFAULT_TITLE"
then you get a menu which links there.
You're great!
It would be awesome to add a menu which shows all the attendings of a user corrresponding to MYATTENDANCES!
Testing JEM 2.3.0 beta3 local on clean latest Joomla (3.9.11) Protostar php7.3.8 (no mails)

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Time to create page: 0.218 seconds

Donate

If you find JEM useful and if you use it on your site, please consider a donation to the project.

Private Messages

You are not logged in.

Follow us......