0

I am new to OsTicket, its structure & functionality.

In the "New ticket" view (ticket-open.inc.php) I currently have the following code filling in the "Assign to" Dropdown list:

<select id="assignId" name="assignId">
                    <option value="0" selected="selected">&mdash; <?php echo __('Select an Agent OR a Team');?> &mdash;</option>
                    <?php
                    if(($users=Staff::getAvailableStaffMembers())) {
                        echo '<OPTGROUP label="'.sprintf(__('Agents (%d)'), count($users)).'">';
                        foreach($users as $id => $name) {
                            $k="s$id";
                            echo sprintf('<option value="%s" %s>%s</option>',
                                        $k,(($info['assignId']==$k)?'selected="selected"':''),$name);
                        }
                        echo '</OPTGROUP>';
                    }
                    ?>
</select>&nbsp;<span class='error'>&nbsp;<?php echo $errors['assignId']; ?></span>

I would like to customize this OsTicket view to only show the Agent(current user) as the only option to display for assignment.

Is there any way to hardcode this to ensure that tickets any tickets that are created are assigned to yourself (if you're an Agent) in a simple but surefire way (and without making changes to departments). Here's a screenshot

OsTicket v1.9.12 Thanks!

1 Answers1

0

Your staff info is in $thisstaff variable:

<select id="assignId" name="assignId">
                    <option value="0" selected="selected">&mdash; <?php echo __('Select an Agent OR a Team');?> &mdash;</option>
                    <?php
                        echo '<OPTGROUP label="'.sprintf(__('Agents (%d)'), 1).'">';
                        echo sprintf('<option value="%s" %s>%s</option>',                          
                                $thisstaff->getId(),
                                (($info['assignId']==$thisstaff->getId())?'selected="selected"':''),
                                $thisstaff->getName());
                        echo '</OPTGROUP>';
                    ?>
                </select>&nbsp;<span class='error'>&nbsp;<?php echo $errors['assignId']; ?></span>
Miroslav Adamec
  • 1,060
  • 1
  • 15
  • 23