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

Add Fields to User Profile Details

Anyone know how to add custom fields to the User Profile?
example url:  .../scp/users.php?id=11

Besides showing: Name, Email, Organization, Status, Created, Updated, I would like to add custom fields.
Im not very proficient in PHP, but I see it is being called from "user-view.inc.php"
I also see that all the fields are calling functions from class.user.php. However, the table "ost_user__cdata" is not being called by the object.

How do you call up data from "ost_user__cdata" to view in the User Profile?

Comments

  • You can use the admin forms editor to add fields to the User Form, which should display there. Hmm, haven't tried though, test it and let us know.
  • Hi Grizly, Thank you.
    Not exactly sure of the Admin Form Editor. Do you mean, 
    ./scp/forms.php?id=1 ?  

    I have added new fields to the contact form. I now want to retrieve the data, notably in the User Profile. This is the only place I can imagine the data can be viewed.
     example url:  .../scp/users.php?id=1

  • v1.10.  I do not know if its the best way, but I did find an array with the data Im looking for.

    What I did.
    In "user-view.inc.php", around line127:
                    <tr>
                        <th><?php echo __('Company'); ?>:</th>
                        <td><?php echo $user->getCompany(); ?></td>
                    </tr>

    In "class.user.php", around line305:
        function getCompany() {
          $tmp2 = ($this->getFilterData());
    /*        foreach($tmp2 as $key=>$value) {
            echo "<p>" . $key . ": " .  $value . "</p>"; }
    */      return $tmp2['field.37'];
        }

    I found the keys and values with a foreach loop.

    Is the a different array to use so that I can use the actual "Variable" name given in the Contact Information Form?
Sign In or Register to comment.