I am attempting to have form pre-filled when creating new tickets. There are about 4 parameters that are passed via URL.I have been able to pre-select the topic by setting the variable topicId . However, I cannot understand how to then pre-fill the fields.This is my current attempt. As you can see I imagine that something needs to be done within those foreach loops, but not sure what.$_GET = '10'; // this needs to be set to QA reporting all the time$pat_id = $_GET;$user_id = $_GET;$study_date = $_GET;$frame_number = $_GET;$nav->setActiveNav('new');$inc='open.inc.php';foreach ($form->getFields() as $field) { foreach ($field as $f) { }}include(CLIENTINC_DIR.'header.inc.php');include(CLIENTINC_DIR.$inc);include(CLIENTINC_DIR.'footer.inc.php');

What was your solution?  It might help other people looking to do the same thing.

3 months later

@[deleted] can you update us one your solution?

10 days later

I created a new 'api' page with this coderequire('secure.inc.php');if(!is_object($thisclient) || !$thisclient->isValid()) die('Access denied'); //Double check again.if ($thisclient->isGuest())    $_REQUEST = $thisclient->getTicketId();require_once(INCLUDE_DIR.'class.ticket.php');require_once(INCLUDE_DIR.'class.json.php');$ticket=null;I edited the login code from include/client/login.inc.php:        <input id="username" placeholder="<?php echo __('Email or Username'); ?>" type="text" name="luser" size="30" value="<?php echo $_GET; ?>" class="nowarn">And finally added these lines in include/client/templates/dynamic-form.tmpl.php (Asterix to anonymise company name):            if ($_GET == '1')            {                switch ($field->getLocal('label'))                {                    case 'Patient ID':                        $field->setValue($_GET);                        break;                    case 'Exam Date':                        $field->setValue($_GET);                        break;                    case 'Slice/Frame Number':                        $field->setValue($_GET);                        break;                }            }

Write a Reply...