Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

FAQ Details

Hi,

I am looking to add to the FAQ part of the ticketing system. I would like the post to tell us who created the FAQ, Their job role and the date created. as well as an who updated part and when they updated it. and it needs to be able to be seen by anyone who can view the FAQ.

Whether this is done automatically through the system, or even a simple drop down selection either will be fine.

Any suggestions?

Thanks in advance
Tagged:

Comments

  • creator and job roles are not tracked in the database.
    created date is.
    ost_faq table created field.

    You would have to alter the database structure and then the FAQ save process to save those data points.  Then you would have to change the query that popuylates that information so it can be displayed.
  • Is there a way of some default text being already entered in the FAQ answer box?
  • It's ok, i've found a work around/solution for this now.

    Thanks
    Kind Regards
  • Please post your work around in case someone else needs this sort of thing. :)
  • No problem.

    File changed was

    /opt/osticket/upload/include/staff/faq.inf.php

    and I simply added this to appear in the textarea

    <span style="color:rgb(0, 0, 0);"><strong><em><strong>Author: <br> Position: <br> Date: <br><br> Updated by: <br> Updated on:</strong><br></em></strong><br></span><span></span>

    which is basically shows the below text in the text area. and I simply make the users fill it out.

    Author: 
    Position: 
    Date: 

    Updated by: 
    Updated on:


     This is the code segment with the changes inside it.
    <textarea name="answer" cols="22" rows="12"
                        style="width:98%;" class="richtext draft"
                        data-draft-namespace="faq"
                        data-draft-object-id="<?php if (is_object($faq)) echo $faq->getId(); ?>"
                        ><?php echo $info['answer']; ?><span style="color:rgb(0, 0, 0);"><strong><em><strong>Author: <br> Position: <br> Date: <br><br> Updated by: <br> Updated on:</strong><br></em></strong><br></span><span></span></textarea>
      
    and before it was

    <textarea name="answer" cols="22" rows="12"
                        style="width:98%;" class="richtext draft"
                        data-draft-namespace="faq"
                        data-draft-object-id="<?php if (is_object($faq)) echo $faq->getId(); ?>"
                        ><?php echo $info['answer']; ?></textarea>

    Hope this helps someone.
    Thanks for the replies as well.
    and I hope whoever is reading this has a great day.
  • Thanks! :)
  • Hi,

    I decided to do some more work on this, and I tried adding the php code 
    <?php echo sprintf(__('Author, %s.'), '<strong>'.$thisstaff->getName().'</strong>'); ?>
    Which should get the full name (and it does) but i only see it flash for a short moment when i refresh.

    Any advice?
  • Hi All,

    I have finally done it.

    <?php 
    $name88 = '<strong>'.$thisstaff->getName().'</strong>'
    ?>

    <textarea name="answer" cols="22" rows="12"
                        style="width:98%;" class="richtext draft"
                        data-draft-namespace="faq"
                        data-draft-object-id="<?php if (is_object($faq)) echo $faq->getId(); ?>"
                        ><?php echo $info['answer']; ?><span style="color:rgb(0, 0, 0);"><strong><em><strong>Author: <?php echo nl2br($name88); ?><br> Position: <?php if ($name88 = 'Jim Bob') {echo "IT Apprentice";} elseif ($name88 = "Tom Cat") {echo "IT Manager";} elseif ($name88 = "Mike Tim") {echo "IT Support";} else {echo "";} ?><br> Date: <?php echo date("m/d/y");?> <br><br> Updated by: <br> Updated on:</strong><br></em></strong><br></span><span></span></textarea>


    So the above code sets the variable $name88 to hold the users full name. Then in the text box appears the text and php is used to echo the value in $name88. Php if and elseif statements allow the users role to be echoed. and the date is also a PHP function that is simply implemented.

    The issue of the name disappearing but appearing for a short moment was the draft copy being retrieved. to counter act this, I created a FAQ and then deleted it, and then when you go to create a new FAQ the draft is erased due to it being made into a live FAQ.

    Hope this helps someone.

Sign In or Register to comment.