[How to Mods] -> Class & Function for getLastPoster (Staff group to post internal ticket) from ost.Theard_Entity_Table into the Primary Data Source 😅

My web Server detail :
osTicket Version v1.14.1 (f1e9e88)
Web Server Software Microsoft-IIS/8.5
MySQL Version 5.5.45
PHP Version 7.3.7

About Code :

class.ticket.php line 2282

`static function getSearchableFields() {
$base = array(
'number' => new TextboxField(array(
'label' => __('Ticket Number')
)),

        'created' => new DatetimeField(array(
            'label' => __('Create Date'),
            'configuration' => array(
                'fromdb' => true, 'time' => true,
                'format' => 'y-MM-dd HH:mm:ss'),
        )),
        
        /*
        'poster' => new LastPosterChoiceField(array(
            'label' => __('Poster'),
        )),
      */
      
       );
       
    $tform = TicketForm::getInstance();
    foreach ($tform->getFields() as $F) {
        $fname = $F->get('name') ?: ('field_'.$F->get('id'));
        if (!$F->hasData() || $F->isPresentationOnly() || !$F->isEnabled())
            continue;
        if (!$F->isStorable())
            $base[$fname] = $F;
        else
            $base["cdata__{$fname}"] = $F;
    }
    
      return $base;
}
        `

**class.search.php ** line 1720

`class LastPosterChoiceField extends ChoiceField {
function getLastPoster() {


-- concept query MySQL
SELECT th.id, th.`poster` FROM `ost_thread_entry` 
WHERE th.id = 110
ORDER BY th.poster DESC LIMIT 1 */

      --------  coding ??? -------------
}

`

PS -> Old post : https://forum.osticket.com/d/97189-custom-primary-data-source-get-other-data-such-as-updated-last-poster

Thx you for help me ! 😀



[Update Story] Inprogress coding myself :





Write a Reply...