Hi all,I got headache today. My boss request me to make priority only enable for administrator but disable for user and staff. I'm blank now.I know there have builtin priority list in Admin > Manage > Custom Form > Ticket Details. I try to create isAdmin in class.form.php but error on non-object appear. Here is my code:-class ChoicesWidget extends Widget {function render($mode=false) {...<span style="display-block"> <?php if ($thisstaff->isAdmin()) { ?> <select name="<?php echo $this->name; ?>" disabled="disabled"> <?php } if (!$thisstaff->isAdmin()) { ?> <select name="<?php echo $this->name; ?>"> <?php }?>            <?php if (!$have_def) { ?>            <option value="<?php echo $def_key; ?>">&mdash; <?php                echo $def_val; ?> &mdash;</option>            <?php }            foreach ($choices as $key=>$name) {                if (!$have_def && $key == $def_key)                    continue; ?>                <option value="<?php echo $key; ?>" <?php                    if ($value == $key) echo 'selected="selected"';                ?>><?php echo $name; ?></option>            <?php } ?>        </select>        </span>here is my system details:-osTicket Versionv1.8.1Server SoftwareApache/2.4.4 (Win32) PHP/5.4.16PHP Version5.4.16MySQL Version5.6.12

here is the  error Fatal error: Call to a member function isAdmin() on a non-object in C:\wamp\www\osTicket\upload\include\class.forms.php on line 1067

for temporary solution i did thisin staff\ticket-open.inc.php<?php if ($thisstaff -> isAdmin()) { ?>        <tbody id="dynamic-form">        <?php            if ($form) $form->getForm()->render(true);         ?>        </tbody>        <tbody> <?php        $tform = TicketForm:()->getForm($_POST);        if ($_POST) $tform->isValid();        $tform->render(true);        ?>        </tbody>          <?php } ?> the code hide dynamic form if not admin. fortunately I only have one dynamic form. But, as this is not the proper solution that i wanted. Please help me.

I did grab the priority list from database and the list appear just like I want. but when we create new ticket, the priority not enter the database. also when view ticket the priority also not appear.I think i miss some steps. Any idea? should I follow to create new var and so on like  this step?http://www.tmib.net/agencies-dropdown-and-admin-ui-osticket-17st

Write a Reply...