#285 Tooltip content change

open
nobody
None
1
2015-07-24
2012-10-11
knjigor
No

Hi, I want to change tooltip content, I trying to change the content of the tooltip instead of just the displaing description I would like it to show the duration as well as some custom fields.

Discussion

  • knjigor

    knjigor - 2012-10-24

    Ok, how hard can it be?

     
  • John Beranek

    John Beranek - 2012-10-24

    Is this how you expect to get a response, by being rude?

     
    • knjigor

      knjigor - 2012-10-24

      It is nor rude if you ask how hard is it, it is simple and honest question, if it is to hard, then I don't want to bother any one with that, I'm sure that there are better support requests than this one.

       
  • Campbell Morrison

    The contents of the tooltip are controlled by the various functions in functions_table.inc. You'll need to look at map_add_booking() and day/weekInnerHTML()

    Campbell

     
    • knjigor

      knjigor - 2012-10-24

      Many thanks

       
  • John Beranek

    John Beranek - 2012-10-24

    If it was so easy, I'd imagine you could do it yourself by applying yourself a little

     
    • knjigor

      knjigor - 2012-10-24

      I newer said it is easy, and that's why i'm asking for help

       
  • Huw

    Huw - 2014-05-21

    Hi Campbell
    I am trying to modify the contents of the tooltip too as i would like to show more than just the description.
    The contents of the tooltip are controlled by the various functions in functions_table.inc. You'll need to look at map_add_booking() and day/weekInnerHTML()

    Could you please provide an example of how would add 1 further field to the tool tip
    Thanks for any help

     
  • Campbell Morrison

    The easiest thing to do is to modify the SQL query in functions_table.inc to put the fields that you want into the name field. For example change the query

      $sql = "SELECT R.id AS room_id, start_time, end_time, name, repeat_id,
    

    to

      $sql = "SELECT R.id AS room_id, start_time, end_time, CONCAT(your_field1, ' ', your_field2) AS name, repeat_id,
    

    Campbell

     
  • Huw

    Huw - 2014-05-21

    Thanks a million Campbell - such a simple and elegant solution!
    Best wishes

     
  • Chris Ma

    Chris Ma - 2015-07-23

    Hi Campbell,
    Thanks for providing the example above. It has helped us out with our custom fields and it shows up in Day view. However, when we switch to Week or Month view, we do not see the custom field in the name field.

    Can you please provide another example of having it also show up in the Week and Month view? My apologies if this is obvious; I'm a newbie to PHP and tried looking through 'functions_table.inc'.
    Thanks,
    Chris

     
  • Chris Ma

    Chris Ma - 2015-07-24

    Hi Campbell,

    Please disregard my previous post. I figured it out.

    For anyone looking to do the same, it can be found in 2 places:
    --for Week view, it is further down in the 'functions_table.inc' file.

    Look for:

    $sql = "SELECT room_id, start_time, end_time, type, name, status, repeat_id,

    and edit as per Campbell's example previously, as such

    $sql = "SELECT room_id, start_time, end_time, type, CONCAT(your_field1, ' ', your_field2) AS name, status, repeat_id,

    --for Month view, you will need to edit month.php. Look for:
    $sql = "SELECT start_time, end_time, id, name, type,

    and edit as per above.

    Thanks,
    Chris

     


Anonymous

Cancel  Add attachments