/** * Create HTML form to enter a new record with the minimum necessary fields. * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. * All Rights Reserved. * Contributor(s): ______________________________________.. */ function get_new_record_form() { if (!isset($_REQUEST['view']) || $_REQUEST['view'] == 'day') { $output = ''; //Appointment require_once 'modules/Calls/CallFormBase.php'; global $mod_strings; $callForm = new CallFormBase(); $output .= $callForm->getFormHeader('', 'Calls', $mod_strings['LNK_NEW_APPOINTMENT']); $output .= $callForm->getWideFormBody('', 'Calls', 'CallSave', false) . "<br>"; $output .= $callForm->getFormFooter('', 'Calls', 'CallSave') . "<br>"; return $output; } }
$xtpl->assign('FORMBODY', $selectAccountButton . "<slot class='dataLabel'><input class='checkbox' type='checkbox' name='newaccount' onclick='document.forms[\"BusinessCard\"].selectedAccount.value=\"\";document.forms[\"BusinessCard\"].display_account_name.value=\"\";toggleDisplay(\"newaccountdiv\");'> " . $mod_strings['LNK_NEW_ACCOUNT'] . "</slot> <div id='newaccountdiv' style='display:none'>" . $accountForm->getWideFormBody('Accounts', 'Accounts', 'BusinessCard', '')); require_once 'modules/Notes/NoteFormBase.php'; $noteForm = new NoteFormBase(); $postform = "<div id='accountnotelink'><p><a href='javascript:toggleDisplay(\"accountnote\");'>{$mod_strings['LNK_NEW_NOTE']}</a></p></div>"; $postform .= '<div id="accountnote" style="display:none">' . $noteForm->getFormBody('AccountNotes', 'Notes', 'BusinessCard', 85) . '</div>'; $xtpl->assign('POSTFORM', $postform); $xtpl->parse("main.headlessform"); //OPPORTUNITTY $xtpl->assign('FORMHEADER', get_form_header($mod_strings['LNK_NEW_OPPORTUNITY'], '', '')); require_once 'modules/Opportunities/OpportunityFormBase.php'; $oppForm = new OpportunityFormBase(); $xtpl->assign('CLASS', 'evenListRow'); $xtpl->assign('FORMBODY', "<slot class='dataLabel'><input class='checkbox' type='checkbox' name='newopportunity' onclick='toggleDisplay(\"newoppdiv\");'> " . $mod_strings['LNK_NEW_OPPORTUNITY'] . "</slot><div id='newoppdiv' style='display:none'>" . $oppForm->getWideFormBody('Opportunities', 'Opportunities', 'BusinessCard', '', false)); require_once 'modules/Notes/NoteFormBase.php'; $noteForm = new NoteFormBase(); $postform = "<div id='oppnotelink'><a href='javascript:toggleDisplay(\"oppnote\");'>{$mod_strings['LNK_NEW_NOTE']}</a></div>"; $postform .= '<div id="oppnote" style="display:none">' . $noteForm->getFormBody('OpportunityNotes', 'Notes', 'BusinessCard', 85) . '</div><br>'; $xtpl->assign('POSTFORM', $postform); $xtpl->parse("main.headlessform"); //Appointment $xtpl->assign('FORMHEADER', $mod_strings['LNK_NEW_APPOINTMENT']); require_once 'modules/Calls/CallFormBase.php'; $callForm = new CallFormBase(); $xtpl->assign('FORMBODY', "<input class='checkbox' type='checkbox' name='newappointment' onclick='toggleDisplay(\"newappointmentdiv\");'> " . $mod_strings['LNK_NEW_APPOINTMENT'] . "<div id='newappointmentdiv' style='display:none'>" . $callForm->getWideFormBody('Appointments', 'Calls', 85)); $xtpl->assign('POSTFORM', ''); $xtpl->parse("main.headlessform"); $xtpl->parse("main.saveend"); $xtpl->parse("main.endform"); $xtpl->parse("main"); $xtpl->out("main"); }
$noteForm = new NoteFormBase(); $postform = "<h5 class='dataLabel'><input class='checkbox' type='checkbox' name='newaccountnote' onclick='toggleDisplay(\"accountnote\");'> {$mod_strings['LNK_NEW_NOTE']}</h5>"; $postform .= '<div id="accountnote" style="display:none">' . $noteForm->getFormBody('AccountNotes', 'Notes', 'ConvertLead', 85) . '</div><br>'; if (!empty($lead->account_name)) { $postform .= '<script>document.forms["ConvertLead"].newaccount.checked=true;toggleDisplay("newaccountdiv");</script>'; } $Related['POSTFORM'] = $postform; array_push($Relateds, $Related); //OPPORTUNITTY $Related['FORMHEADER'] = get_form_header($mod_strings['LNK_NEW_OPPORTUNITY'], '', ''); require_once 'modules/Opportunities/OpportunityFormBase.php'; $oppForm = new OpportunityFormBase(); $Related['CLASS'] = 'evenListRow'; $Related['FORMBODY'] = "<h5 class='dataLabel'><input class='checkbox' type='checkbox' name='newopportunity' onclick='toggleDisplay(\"newoppdiv\");'> " . $mod_strings['LNK_NEW_OPPORTUNITY'] . "</h5><div id='newoppdiv' style='display:none'>" . $oppForm->getWideFormBody('Opportunities', 'Opportunities', 'ConvertLead', $lead, false); //$Related['FORMFOOTER']=get_form_footer(); require_once 'modules/Notes/NoteFormBase.php'; $noteForm = new NoteFormBase(); $postform = "<h5 class='dataLabel'><input class='checkbox' type='checkbox' name='newoppnote' onclick='toggleDisplay(\"oppnote\");'> {$mod_strings['LNK_NEW_NOTE']}</h5>"; $postform .= '<div id="oppnote" style="display:none">' . $noteForm->getFormBody('OpportunityNotes', 'Notes', 'ConvertLead', 85) . '</div><br>'; $Related['POSTFORM'] = $postform; array_push($Relateds, $Related); //Appointment require_once 'modules/Calls/CallFormBase.php'; $callForm = new CallFormBase(); $Related['FORMBODY'] = "<h5 class='dataLabel'><input class='checkbox' type='checkbox' name='newmeeting' onclick='toggleDisplay(\"newmeetingdiv\");'> " . $mod_strings['LNK_NEW_APPOINTMENT'] . "</h5><div id='newmeetingdiv' style='display:none'>" . $callForm->getWideFormBody('Appointments', 'Calls', 'ConvertLead') . "</div><br>"; //Related['FORMFOOTER']=get_form_footer(); $Related['POSTFORM'] = ''; array_push($Relateds, $Related); $sugar_smarty->assign('Related_records', $Relateds); echo $sugar_smarty->fetch('modules/Leads/ConvertLead.tpl'); }