We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47047
    • 43 Posts
    I'm using mycalendar extra to add events by user, the calendar is correctly showed

    [[!myCalendar? 
        &defaultView=`month`
        &instance=`[[+company]][[+id]]`
        &company=`[[+company]]`
    ]]
    

    Now, I want to to see a list of events for the user logged in, that means if I logged in with my username, I just see my own events. I'm not sure how myCalendar extra is doing the relation with the user, cos' in the sql table there are id, title, description, start, end, all_day, properties, and not an id_user

    I have this, with this code I can see all the events but not by user.

     <h2>List of events</h2>
    
    [[!pdoResources?
        &tpl=`tpl.list_events_invitations`
        &loadModels=`mycalendar`
        &sortby=`start`
        &sortdir=`DESC`
        &limit=`5`
     
    ]] 
    

    My question is, how can I know what events are from which user?
    Thanks
      @yulianita
      • 3749
      • 24,544 Posts
      I just looked through the MyCalendar code, and I couldn't find any reference to a user. I don't think that information is saved at all.

      In theory, you could add the user ID to the schema, recreate the class and map files, add the ID to the table, and customize the code to save the user ID, but I don't think it would easy.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 47047
        • 43 Posts
        Quote from: BobRay at Feb 20, 2019, 06:19 AM
        I just looked through the MyCalendar code, and I couldn't find any reference to a user. I don't think that information is saved at all.

        In theory, you could add the user ID to the schema, recreate the class and map files, add the ID to the table, and customize the code to save the user ID, but I don't think it would easy.
        Is not easy but it's a good idea!, I'll try. thanks again BobRay!
          @yulianita