1. Fabrik 3.8 has been released. As usual, we strongly recommend that you backup your site (using Akeeba) before upgrading. Report any issues in the forums, we will answer promptly.

classroom registration

Discussion in 'Standard Support' started by juicyfruit, Nov 7, 2009.

  1. juicyfruit

    juicyfruit Member

    Level: Supporter
    Hi ,

    I would like to make Fabrik do the following, hope someone can tell me if its possible with fabrik.

    - using sobi as a business listing.
    - each listing have a signup event ( classroom ).

    - use fabrik to manage the signup event.

    - users signup using fabrik
    - upon signup, fabrik sends an email to user and sobi -> field_email to notify them of a new signup.

    - one month after the signup, fabrik sends email to user to get them to update their interest in the signup, if not fabrik will remove their signup in 1 week.

    So the question is really asking about the scheduling capability of fabrik.

    Thanks in advance.

    Any others advice is appreciated.

  2. Duke3D

    Duke3D Member

    Level: Standard
    I posted a note like this when I started with Fabrik and I can anticipate that you will get the same replies I did.

    1. Fabrik can do this.
    And it can - there is nothing in your list that stands out as an issue.

    2. Only ask one issue per thread - otherwise the answers get convoluted and too hard to follow.

    3. Application design and flowcharting is your job - many here, particularly Hugh, will coach you concerning how to implement specific steps and features - baby steps. (Unless you want to pay for their design services).

    Returning to your details -
    You can create a Fabrik table from any other SQL table including jos_sobi2_fields_data - and you can filter it to extract fieldid=7 to give you the e-mail address for each itemid (directory listing)

    You can modify the sobi template to include the code to launch the Fabrik plugin to insert a signup form, passing the ID of the sobi record to the form via a URL querystring if it's not in the Request.

    A form can be setup to generate numerous e-mails on a submit.
    See Form - submission plugins tab.

    I have not used the cron features to trigger follow-ups, but it looks like all the plumbing is there to do the 30-day follow-up e-mails. I don't see a plug-in for launching a PHP script - for deleting old records, but I imagine that would be fairly straight forward as it's a simple query (delete records with date < (today - 40 days)).

    The only annoyance will be the sobi data structure not being organized in a classic table layout with headings across the top - it takes a couple extra steps to set filters but you'll get used to it.
    1 person likes this.
  3. juicyfruit

    juicyfruit Member

    Level: Supporter
    Thankyou Duke3D,

    At least I know it has been done and can be done.

    Thankyou very much.
  4. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I don't think the existing 'cronemail' scheduled task will do exactly what you want, you'd have to probably use the PHP cron plugin and write some custom code to select rows with create dates 30 days ago and send the email yourself.

    -- hugh
  5. Duke3D

    Duke3D Member

    Level: Standard
    Good to know - thanks Hugh
  6. juicyfruit

    juicyfruit Member

    Level: Supporter
    can fabrik plugins be used against data NOT created by fabrik?

    ie. I have a sobi eventlist integration.

    - the data is in eventlist.

    - I would like to run the cron php plugin against the eventlist table to check the dates and send the email.

  7. peamak

    peamak Moderator

    Level: Community
    In any case I think you should be able to create a new table in Fabrik and instead of creating a new DB table, choose 'Link to' and select your eventlist table. Then select this fabrik table in the cron plugin.
    Does it help?
  8. juicyfruit

    juicyfruit Member

    Level: Supporter
    Thanks peamak for response.

    I went through the video tutorials and it gave me the answer. ie. school and student relationships!

    Fabrik makes it so easy!

    Now I don't need to use eventlist.

    Where can I access the fabrik syntax pages? ie. the fabrik variables I can use in a plugin.

    ie. {fabrik tablename_element},
    { my->email},

    So I can add syntax to the email / submissions plugin.

    Is there a url somewhere which references this all in one place. I'm reading the user manual now, but it doesn't seem to talk much about fabrik variables you can use in forms.

    ie. the [email to] field . etc.,.

  9. juicyfruit

    juicyfruit Member

    Level: Supporter


    Hope someone can give me some pointers.

    I have a more specific question.

    I have a fabrik form.

    I would like to send email to the {tableName__user_id}

    where user_id == joomla userid.

    But it is store only as a number in the table.

    But in the element tab, I can get access to the email address.

    So how do I send to that email address?



  10. juicyfruit

    juicyfruit Member

    Level: Supporter
    So I have afabrik table as follows:

    - sobi_item -> join to sobi2_item
    - user_id -> user element type.

    so far so good.

    Now to add the email address I add another DB join

    - sobi_id_email -> sobi2_fields_data -> key == itemID -> where fieldId=7

    This is where I get problems.

    There is nothing showing ??

    I'm trying to use the fabrikdebug=1 but it's giving me a 404 error.

    Could you please give me some pointers?

    Thanks in advance.


    Attached Files:

  11. peamak

    peamak Moderator

    Level: Community
    From your capture:

    You should actually write 'WHERE fieldid = 7' (you did not write 'WHERE').
    EDIT: write that without the single quotes.
  12. juicyfruit

    juicyfruit Member

    Level: Supporter
    Hi peamak,

    Thanks for your advice.

    When I do put in the code "where field=7"

    in the capture.

    I do not get a result, the result item it

    I am referencing 2 tables

    -1 jos_sobi2_item --> ITEMID database join, --> no problem

    -2 jos_sobi2_fields_data --> itemid database join , with where fieldid=7 -- > problem

    So for [1] above I get a result.
    But when I add [2] to extract the email address, I get errors.

    My desired fabrik table output is
    - uid
    - sobi2_id
    - sobi2_id_email

    There are 2 tables I am referencing with a common field called "itemID" == sobi2_id.

    Is there something wrong with my approach? or is it just the way I am doing it.

    Any assistance would be appreciated.

  13. rob

    rob Administrator Staff Member

    Level: Community
    When you submit the form you have access to both what the user sees (in this case the user name) and what is stored in the database (e.g. the user id)

    {tableName__user_id} would hold the username

    {tableName__user_id_raw} would hold the user id

  14. juicyfruit

    juicyfruit Member

    Level: Supporter
    I'm really pulling my hair out on this one.

    I'm just trying to ad the following:

    Code (Text):

    SELECT *
    FROM `jos_sobi2_fields_data`
    WHERE `fieldid` =7
    GROUP BY `itemid`
    LIMIT 0 , 30
    to the fabrik interface. I am getting it wrong.

    Am I suppose to do subqueries or will a join get me there.

    Sorry, if this is a stupid question, maybe if some one can tell me if its SQL that I need to read up on, or if its a fabrik interface thing I need to manipulate.

    Better still, if someone could tell me exactly what to do ;-)

    In regards to filters that Duke3D mentioned, where do I set them?? in table view, element view??

  15. Duke3D

    Duke3D Member

    Level: Standard
    I just removed sobi from my current installation as my client's current project is better implemented in Mosets Tree + Fabrik so I am speaking from memory.

    The SQL you posted looks like it should execute just fine. I don't think the GroupBy clause adds meaning as there should only be one record per combination of sobi_id and fieldid of 7, but test the query in MyPHPAdmin and see what comes back. I would generally think that a Groupby is not helpful within a Fabrik Eval - Fabrik easily handles values and arrays. (I haven't seen specific plugins for tuples.)

    If you are asking how to recreate that query in Fabrik, note that no join is used in the query.

    In Fabrik - create a new table (Sobi Emails) and on the table data tab, select that it connects to jos_sobi2_fields_data. That will automagically create the form, group and elements for each column in that SQL table. At this point a table - view data is equivalent to SELECT * FROM jos_sobi2_fields_data.

    Now apply a WHERE clause to filter the table view to only retrieve the rows that have the fieldid that indicates that the value in that row is an e-mail by adding a prefilter ... WHERE fieldid EQUALS 7 (Type = TEXT, Apply below SuperAdmin) Now you have SELECT * FROM jos_sobi2_fields_data WHERE 'fieldid' = '7'

    This should give you a list of Sobi User IDs and whatever data is stored in field 7 - as I recall it's their e-mails - you will also have a couple other housekeeping columns like date modified. You can switch to viewing the elements of the table and unpublish anything you will not be using.

    This Table View including the filter can now be the target of a cascading dropdown element added within another table that links on SobiID and returns the associated value for e-mail.
    2 people like this.
  16. rob

    rob Administrator Staff Member

    Level: Community
    just to add a little clarification - the WHERE part of the statement is created by

    editing your fabrik table
    selecting the data tab
    going down to the prefilters section
    pressing add

    that will add in the set of fields that Duke3d was referring to here:

    1 person likes this.
  17. juicyfruit

    juicyfruit Member

    Level: Supporter
    Thanks so much Duke3D,

    I found that the sticking point for me was [Apply below admin], by default it is [public front end]

    If I did not do that, the where filter does not apply.

    So wow, Fabrik even considers this in advance. It is very well thought out.

    Thanks so much.

    I would like to ask another question.

    In sobi I call ed the plugin

    <?php echo HTML_SOBI::execJPlugins("{fabrik view=form id=4}"); ?>

    but it just echos
    {fabrik view=form id=4}

    The form works for a menu link but not embedded in joomla content.

    I think it's to do with the 2.0rc3 instead of rc4.

    hopefully that's the fix.


    Thanks Duke3D.
  18. rob

    rob Administrator Staff Member

    Level: Community
    silly question but do you have the Joomla content: fabrik plugin installed and activated?
  19. juicyfruit

    juicyfruit Member

    Level: Supporter
    Thanks Rob,

    That was the ticket. Silly me.

    So far, beautiful.

    Got the form working with the fieldid=7 filter. Got it inside a sobi details template called via

    <?php echo HTML_SOBI::execJPlugins("{fabrik view=form id=4}"); ?>


    Now for my next question.

    I believe the answer is here, just confirming that is still the best way to do it.





    Also, if I was to run a script to obtain the user id to check if the user has already registered for this event ( record in DB ) where do I do that? in the form processing?

    if user is already registered, then display the registration status.
    if not, then allow the user to register.


    Attached Files:

  20. Duke3D

    Duke3D Member

    Level: Standard
    Assuming I understand the goal, I think it is.

    I presume the context is that you have landed on and are displaying fabrik form id=4 and what's displayed is to be context sensitive in terms of detecting existing registrations for that user and changing the display accordingly.

    I would think that the better solution is to add more code to your PHP snippet within the SOBI template to figure out the next view to show your user. Execute a query to count records and if >1 show a table view filtered to this user to select from the existing class registrations to update/see details or 'Add'. If Count = 1, display the record found. If Count = 0, display the 'Add' empty form.

    It may help to have a 'Landing Pages' menu - a menu that's never displayed but contains menu items as a means to create SEF URLs that load pages containing fabrik tables and forms while passing certain conditions such as constraining to the logged-in user via row = -1.
    The logic above can be used to emulate selecting from these menu items (add a new registration, see my registrations)

    These options are more efficient than doing the detect within a table or form as it's loading and redirecting again.
    2 people like this.

Share This Page