/SugarCRM/cache/smarty/templates_c/%%54^542^5425BD6A%%ConvertLead.tpl.php
PHP | 606 lines | 564 code | 42 blank | 0 comment | 46 complexity | e8bb7470652f1bc72b745ed4ffea5f01 MD5 | raw file
Possible License(s): AGPL-3.0, LGPL-2.1, MPL-2.0-no-copyleft-exception
- <?php /* Smarty version 2.6.11, created on 2012-10-27 19:43:58
- compiled from cache/modules/Tasks/ConvertLead.tpl */ ?>
- <?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
- smarty_core_load_plugins(array('plugins' => array(array('function', 'sugar_translate', 'cache/modules/Tasks/ConvertLead.tpl', 40, false),array('function', 'counter', 'cache/modules/Tasks/ConvertLead.tpl', 54, false),array('function', 'html_options', 'cache/modules/Tasks/ConvertLead.tpl', 84, false),array('function', 'sugar_getimagepath', 'cache/modules/Tasks/ConvertLead.tpl', 112, false),array('modifier', 'default', 'cache/modules/Tasks/ConvertLead.tpl', 44, false),array('modifier', 'strip_semicolon', 'cache/modules/Tasks/ConvertLead.tpl', 50, false),array('modifier', 'lookup', 'cache/modules/Tasks/ConvertLead.tpl', 109, false),array('modifier', 'count', 'cache/modules/Tasks/ConvertLead.tpl', 189, false),)), $this); ?>
- <span class="color"><?php echo $this->_tpl_vars['ERROR']; ?>
- </span>
- <h4>
- <style>
- input[disabled] {
- background-color:lightgray;
- }
- </style>
- <table><tr><td>
- <input type="hidden" name="convert_create_Tasks" id="convert_create_Tasks"
- <?php if (( $this->_tpl_vars['def']['required'] && empty ( $this->_tpl_vars['def']['select'] ) ) || ( ! empty ( $this->_tpl_vars['def']['default_action'] ) && $this->_tpl_vars['def']['default_action'] == 'create' )): ?> value="true" <?php endif; ?>/>
- <input type="hidden" name="opportunity_id" value="<?php echo $_REQUEST['opportunity_id']; ?>
- ">
- <input type="hidden" name="case_id" value="<?php echo $_REQUEST['case_id']; ?>
- ">
- <input type="hidden" name="bug_id" value="<?php echo $_REQUEST['bug_id']; ?>
- ">
- <input type="hidden" name="email_id" value="<?php echo $_REQUEST['email_id']; ?>
- ">
- <input type="hidden" name="inbound_email_id" value="<?php echo $_REQUEST['inbound_email_id']; ?>
- ">
- <?php if ($this->_tpl_vars['def']['required']): ?>
- <script type="text/javascript">
- mod_array.push('Tasks');//Bug#50590 add all required modules to mod_array
- </script>
- <?php endif; if (! $this->_tpl_vars['def']['required'] || ! empty ( $this->_tpl_vars['def']['select'] )): ?>
- <input class="checkbox" type="checkbox" name="newTasks" id="newTasks" onclick="toggleDisplay('createTasks');if (typeof(addRemoveDropdownElement) == 'function') addRemoveDropdownElement('Tasks');">
- <script type="text/javascript">
- <?php if (! empty ( $this->_tpl_vars['def']['default_action'] ) && $this->_tpl_vars['def']['default_action'] == 'create'): ?>
- <?php if ($this->_tpl_vars['lead_conv_activity_opt'] == 'move' || $this->_tpl_vars['lead_conv_activity_opt'] == 'copy' || $this->_tpl_vars['lead_conv_activity_opt'] == ''): ?>
- YAHOO.util.Event.onContentReady('lead_conv_ac_op_sel', function(){
- <?php else: ?>
- YAHOO.util.Event.onContentReady('createTasks', function(){
- <?php endif; ?>
- toggleDisplay('createTasks');
- document.getElementById('newTasks').checked = true;
- if (typeof(addRemoveDropdownElement) == 'function')
- addRemoveDropdownElement('Tasks');
- });
- <?php endif; endif; ?>
- </script>
- </td><td>
- <?php echo smarty_function_sugar_translate(array('label' => 'LNK_NEW_TASK','module' => 'Leads'), $this);?>
- </td><td>
- </td></tr></table>
- </h4>
- <table width="100%" border="0" cellspacing="1" cellpadding="0" class="<?php echo ((is_array($_tmp=@$this->_tpl_vars['def']['templateMeta']['panelClass'])) ? $this->_run_mod_handler('default', true, $_tmp, 'edit view') : smarty_modifier_default($_tmp, 'edit view')); ?>
- " id ="createTasks" <?php if (! $this->_tpl_vars['def']['required'] || ! empty ( $this->_tpl_vars['def']['select'] )): ?>style="display:none"<?php endif; ?>>
- <tr>
- <td valign="top" id='name_label' width='12.5%' scope="row">
- <?php ob_start(); echo smarty_function_sugar_translate(array('label' => 'LBL_SUBJECT','module' => 'Tasks'), $this);?>
- <?php $this->_smarty_vars['capture']['label'] = ob_get_contents(); $this->assign('label', ob_get_contents());ob_end_clean(); echo ((is_array($_tmp=$this->_tpl_vars['label'])) ? $this->_run_mod_handler('strip_semicolon', true, $_tmp) : smarty_modifier_strip_semicolon($_tmp)); ?>
- :
- <span class="required">*</span>
- </td>
- <td valign="top" width='37.5%' colspan='3'>
- <?php echo smarty_function_counter(array('name' => 'panelFieldCount','print' => false), $this);?>
- <?php if (strlen ( $this->_tpl_vars['fields']['name']['value'] ) <= 0): $this->assign('value', $this->_tpl_vars['fields']['name']['default_value']); else: $this->assign('value', $this->_tpl_vars['fields']['name']['value']); endif; ?>
- <input type='text' name='Tasksname'
- id='Tasksname' size='90'
- maxlength='50'
- value='<?php echo $this->_tpl_vars['value']; ?>
- ' title='' >
- </td>
- </tr>
- <tr>
- <td valign="top" id='status_label' width='12.5%' scope="row">
- <?php ob_start(); echo smarty_function_sugar_translate(array('label' => 'LBL_STATUS','module' => 'Tasks'), $this);?>
- <?php $this->_smarty_vars['capture']['label'] = ob_get_contents(); $this->assign('label', ob_get_contents());ob_end_clean(); echo ((is_array($_tmp=$this->_tpl_vars['label'])) ? $this->_run_mod_handler('strip_semicolon', true, $_tmp) : smarty_modifier_strip_semicolon($_tmp)); ?>
- :
- <span class="required">*</span>
- </td>
- <td valign="top" width='37.5%' >
- <?php echo smarty_function_counter(array('name' => 'panelFieldCount','print' => false), $this);?>
- <?php if (! isset ( $this->_tpl_vars['config']['enable_autocomplete'] ) || $this->_tpl_vars['config']['enable_autocomplete'] == false): ?>
- <select name="Tasksstatus"
- id="Tasksstatus"
- title=''
- >
- <?php if (isset ( $this->_tpl_vars['fields']['status']['value'] ) && $this->_tpl_vars['fields']['status']['value'] != ''): echo smarty_function_html_options(array('options' => $this->_tpl_vars['fields']['status']['options'],'selected' => $this->_tpl_vars['fields']['status']['value']), $this);?>
- <?php else: echo smarty_function_html_options(array('options' => $this->_tpl_vars['fields']['status']['options'],'selected' => $this->_tpl_vars['fields']['status']['default']), $this);?>
- <?php endif; ?>
- </select>
- <?php else: $this->assign('field_options', $this->_tpl_vars['fields']['status']['options']); ob_start(); echo $this->_tpl_vars['fields']['status']['value']; $this->_smarty_vars['capture']['field_val'] = ob_get_contents(); ob_end_clean(); $this->assign('field_val', $this->_smarty_vars['capture']['field_val']); ob_start(); echo $this->_tpl_vars['fields']['status']['name']; $this->_smarty_vars['capture']['ac_key'] = ob_get_contents(); ob_end_clean(); $this->assign('ac_key', $this->_smarty_vars['capture']['ac_key']); ?>
- <select style='display:none' name="Tasksstatus"
- id="Tasksstatus"
- title=''
- >
- <?php if (isset ( $this->_tpl_vars['fields']['status']['value'] ) && $this->_tpl_vars['fields']['status']['value'] != ''): echo smarty_function_html_options(array('options' => $this->_tpl_vars['fields']['status']['options'],'selected' => $this->_tpl_vars['fields']['status']['value']), $this);?>
- <?php else: echo smarty_function_html_options(array('options' => $this->_tpl_vars['fields']['status']['options'],'selected' => $this->_tpl_vars['fields']['status']['default']), $this);?>
- <?php endif; ?>
- </select>
- <input
- id="Tasksstatus-input"
- name="Tasksstatus-input"
- size="30"
- value="<?php echo ((is_array($_tmp=$this->_tpl_vars['field_val'])) ? $this->_run_mod_handler('lookup', true, $_tmp, $this->_tpl_vars['field_options']) : smarty_modifier_lookup($_tmp, $this->_tpl_vars['field_options'])); ?>
- "
- type="text" style="vertical-align: top;">
- <span class="id-ff multiple">
- <button type="button"><img src="<?php echo smarty_function_sugar_getimagepath(array('file' => "id-ff-down.png"), $this);?>
- " id="Tasksstatus-image"></button><button type="button"
- id="btn-clear-Tasksstatus-input"
- title="Clear"
- onclick="SUGAR.clearRelateField(this.form, 'Tasksstatus-input', 'Tasksstatus');sync_Tasksstatus()"><img src="<?php echo smarty_function_sugar_getimagepath(array('file' => "id-ff-clear.png"), $this);?>
- "></button>
- </span>
- <?php echo '
- <script>
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo ' = [];
- '; ?>
- <?php echo '
- (function (){
- var selectElem = document.getElementById("'; ?>
- Tasksstatus<?php echo '");
- if (typeof select_defaults =="undefined")
- select_defaults = [];
- select_defaults[selectElem.id] = {key:selectElem.value,text:\'\'};
- //get default
- for (i=0;i<selectElem.options.length;i++){
- if (selectElem.options[i].value==selectElem.value)
- select_defaults[selectElem.id].text = selectElem.options[i].innerHTML;
- }
- //SUGAR.AutoComplete.{$ac_key}.ds =
- //get options array from vardefs
- var options = SUGAR.AutoComplete.getOptionsArray("");
- YUI().use(\'datasource\', \'datasource-jsonschema\',function (Y) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.ds = new Y.DataSource.Function({
- source: function (request) {
- var ret = [];
- for (i=0;i<selectElem.options.length;i++)
- if (!(selectElem.options[i].value==\'\' && selectElem.options[i].innerHTML==\'\'))
- ret.push({\'key\':selectElem.options[i].value,\'text\':selectElem.options[i].innerHTML});
- return ret;
- }
- });
- });
- })();
- '; ?>
- <?php echo '
- YUI().use("autocomplete", "autocomplete-filters", "autocomplete-highlighters", "node","node-event-simulate", function (Y) {
- '; ?>
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .inputNode = Y.one('#Tasksstatus-input');
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .inputImage = Y.one('#Tasksstatus-image');
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .inputHidden = Y.one('#Tasksstatus');
- <?php echo '
- function SyncToHidden(selectme){
- var selectElem = document.getElementById("'; ?>
- Tasksstatus<?php echo '");
- var doSimulateChange = false;
- if (selectElem.value!=selectme)
- doSimulateChange=true;
- selectElem.value=selectme;
- for (i=0;i<selectElem.options.length;i++){
- selectElem.options[i].selected=false;
- if (selectElem.options[i].value==selectme)
- selectElem.options[i].selected=true;
- }
- if (doSimulateChange)
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'change\');
- }
- //global variable
- sync_'; ?>
- Tasksstatus<?php echo ' = function(){
- SyncToHidden();
- }
- function syncFromHiddenToWidget(){
- var selectElem = document.getElementById("'; ?>
- Tasksstatus<?php echo '");
- //if select no longer on page, kill timer
- if (selectElem==null || selectElem.options == null)
- return;
- var currentvalue = SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.get(\'value\');
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.simulate(\'keyup\');
- for (i=0;i<selectElem.options.length;i++){
- if (selectElem.options[i].value==selectElem.value && document.activeElement != document.getElementById(\''; ?>
- Tasksstatus-input<?php echo '\'))
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.set(\'value\',selectElem.options[i].innerHTML);
- }
- }
- YAHOO.util.Event.onAvailable("'; ?>
- Tasksstatus<?php echo '", syncFromHiddenToWidget);
- '; ?>
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .minQLen = 0;
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .queryDelay = 0;
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .numOptions = <?php echo count($this->_tpl_vars['field_options']); ?>
- ;
- if(SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .numOptions >= 300) <?php echo '{
- '; ?>
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .minQLen = 1;
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .queryDelay = 200;
- <?php echo '
- }
- '; ?>
- if(SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .numOptions >= 3000) <?php echo '{
- '; ?>
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .minQLen = 1;
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .queryDelay = 500;
- <?php echo '
- }
- '; ?>
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .optionsVisible = false;
- <?php echo '
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.plug(Y.Plugin.AutoComplete, {
- activateFirstItem: true,
- '; ?>
- minQueryLength: SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .minQLen,
- queryDelay: SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .queryDelay,
- zIndex: 99999,
- <?php echo '
- source: SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.ds,
- resultTextLocator: \'text\',
- resultHighlighter: \'phraseMatch\',
- resultFilters: \'phraseMatch\',
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.expandHover = function(ex){
- var hover = YAHOO.util.Dom.getElementsByClassName(\'dccontent\');
- if(hover[0] != null){
- if (ex) {
- var h = \'1000px\';
- hover[0].style.height = h;
- }
- else{
- hover[0].style.height = \'\';
- }
- }
- }
- if('; ?>
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .minQLen<?php echo ' == 0){
- // expand the dropdown options upon focus
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'focus\', function () {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.sendRequest(\'\');
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.optionsVisible = true;
- });
- }
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'click\', function(e) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'click\');
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'dblclick\', function(e) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'dblclick\');
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'focus\', function(e) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'focus\');
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'mouseup\', function(e) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'mouseup\');
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'mousedown\', function(e) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'mousedown\');
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'blur\', function(e) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'blur\');
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.optionsVisible = false;
- var selectElem = document.getElementById("'; ?>
- Tasksstatus<?php echo '");
- //if typed value is a valid option, do nothing
- for (i=0;i<selectElem.options.length;i++)
- if (selectElem.options[i].innerHTML==SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.get(\'value\'))
- return;
- //typed value is invalid, so set the text and the hidden to blank
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.set(\'value\', select_defaults[selectElem.id].text);
- SyncToHidden(select_defaults[selectElem.id].key);
- });
- // when they click on the arrow image, toggle the visibility of the options
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputImage.ancestor().on(\'click\', function () {
- if (SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.optionsVisible) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.blur();
- } else {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.focus();
- }
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.on(\'query\', function () {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.set(\'value\', \'\');
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.on(\'visibleChange\', function (e) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.expandHover(e.newVal); // expand
- });
- // when they select an option, set the hidden input with the KEY, to be saved
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.on(\'select\', function(e) {
- SyncToHidden(e.result.raw.key);
- });
- });
- </script>
- '; ?>
- <?php endif; ?>
- </td>
- <td valign="top" id='priority_label' width='12.5%' scope="row">
- <?php ob_start(); echo smarty_function_sugar_translate(array('label' => 'LBL_PRIORITY','module' => 'Tasks'), $this);?>
- <?php $this->_smarty_vars['capture']['label'] = ob_get_contents(); $this->assign('label', ob_get_contents());ob_end_clean(); echo ((is_array($_tmp=$this->_tpl_vars['label'])) ? $this->_run_mod_handler('strip_semicolon', true, $_tmp) : smarty_modifier_strip_semicolon($_tmp)); ?>
- :
- <span class="required">*</span>
- </td>
- <td valign="top" width='37.5%' >
- <?php echo smarty_function_counter(array('name' => 'panelFieldCount','print' => false), $this);?>
- <?php if (! isset ( $this->_tpl_vars['config']['enable_autocomplete'] ) || $this->_tpl_vars['config']['enable_autocomplete'] == false): ?>
- <select name="Taskspriority"
- id="Taskspriority"
- title=''
- >
- <?php if (isset ( $this->_tpl_vars['fields']['priority']['value'] ) && $this->_tpl_vars['fields']['priority']['value'] != ''): echo smarty_function_html_options(array('options' => $this->_tpl_vars['fields']['priority']['options'],'selected' => $this->_tpl_vars['fields']['priority']['value']), $this);?>
- <?php else: echo smarty_function_html_options(array('options' => $this->_tpl_vars['fields']['priority']['options'],'selected' => $this->_tpl_vars['fields']['priority']['default']), $this);?>
- <?php endif; ?>
- </select>
- <?php else: $this->assign('field_options', $this->_tpl_vars['fields']['priority']['options']); ob_start(); echo $this->_tpl_vars['fields']['priority']['value']; $this->_smarty_vars['capture']['field_val'] = ob_get_contents(); ob_end_clean(); $this->assign('field_val', $this->_smarty_vars['capture']['field_val']); ob_start(); echo $this->_tpl_vars['fields']['priority']['name']; $this->_smarty_vars['capture']['ac_key'] = ob_get_contents(); ob_end_clean(); $this->assign('ac_key', $this->_smarty_vars['capture']['ac_key']); ?>
- <select style='display:none' name="Taskspriority"
- id="Taskspriority"
- title=''
- >
- <?php if (isset ( $this->_tpl_vars['fields']['priority']['value'] ) && $this->_tpl_vars['fields']['priority']['value'] != ''): echo smarty_function_html_options(array('options' => $this->_tpl_vars['fields']['priority']['options'],'selected' => $this->_tpl_vars['fields']['priority']['value']), $this);?>
- <?php else: echo smarty_function_html_options(array('options' => $this->_tpl_vars['fields']['priority']['options'],'selected' => $this->_tpl_vars['fields']['priority']['default']), $this);?>
- <?php endif; ?>
- </select>
- <input
- id="Taskspriority-input"
- name="Taskspriority-input"
- size="30"
- value="<?php echo ((is_array($_tmp=$this->_tpl_vars['field_val'])) ? $this->_run_mod_handler('lookup', true, $_tmp, $this->_tpl_vars['field_options']) : smarty_modifier_lookup($_tmp, $this->_tpl_vars['field_options'])); ?>
- "
- type="text" style="vertical-align: top;">
- <span class="id-ff multiple">
- <button type="button"><img src="<?php echo smarty_function_sugar_getimagepath(array('file' => "id-ff-down.png"), $this);?>
- " id="Taskspriority-image"></button><button type="button"
- id="btn-clear-Taskspriority-input"
- title="Clear"
- onclick="SUGAR.clearRelateField(this.form, 'Taskspriority-input', 'Taskspriority');sync_Taskspriority()"><img src="<?php echo smarty_function_sugar_getimagepath(array('file' => "id-ff-clear.png"), $this);?>
- "></button>
- </span>
- <?php echo '
- <script>
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo ' = [];
- '; ?>
- <?php echo '
- (function (){
- var selectElem = document.getElementById("'; ?>
- Taskspriority<?php echo '");
- if (typeof select_defaults =="undefined")
- select_defaults = [];
- select_defaults[selectElem.id] = {key:selectElem.value,text:\'\'};
- //get default
- for (i=0;i<selectElem.options.length;i++){
- if (selectElem.options[i].value==selectElem.value)
- select_defaults[selectElem.id].text = selectElem.options[i].innerHTML;
- }
- //SUGAR.AutoComplete.{$ac_key}.ds =
- //get options array from vardefs
- var options = SUGAR.AutoComplete.getOptionsArray("");
- YUI().use(\'datasource\', \'datasource-jsonschema\',function (Y) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.ds = new Y.DataSource.Function({
- source: function (request) {
- var ret = [];
- for (i=0;i<selectElem.options.length;i++)
- if (!(selectElem.options[i].value==\'\' && selectElem.options[i].innerHTML==\'\'))
- ret.push({\'key\':selectElem.options[i].value,\'text\':selectElem.options[i].innerHTML});
- return ret;
- }
- });
- });
- })();
- '; ?>
- <?php echo '
- YUI().use("autocomplete", "autocomplete-filters", "autocomplete-highlighters", "node","node-event-simulate", function (Y) {
- '; ?>
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .inputNode = Y.one('#Taskspriority-input');
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .inputImage = Y.one('#Taskspriority-image');
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .inputHidden = Y.one('#Taskspriority');
- <?php echo '
- function SyncToHidden(selectme){
- var selectElem = document.getElementById("'; ?>
- Taskspriority<?php echo '");
- var doSimulateChange = false;
- if (selectElem.value!=selectme)
- doSimulateChange=true;
- selectElem.value=selectme;
- for (i=0;i<selectElem.options.length;i++){
- selectElem.options[i].selected=false;
- if (selectElem.options[i].value==selectme)
- selectElem.options[i].selected=true;
- }
- if (doSimulateChange)
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'change\');
- }
- //global variable
- sync_'; ?>
- Taskspriority<?php echo ' = function(){
- SyncToHidden();
- }
- function syncFromHiddenToWidget(){
- var selectElem = document.getElementById("'; ?>
- Taskspriority<?php echo '");
- //if select no longer on page, kill timer
- if (selectElem==null || selectElem.options == null)
- return;
- var currentvalue = SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.get(\'value\');
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.simulate(\'keyup\');
- for (i=0;i<selectElem.options.length;i++){
- if (selectElem.options[i].value==selectElem.value && document.activeElement != document.getElementById(\''; ?>
- Taskspriority-input<?php echo '\'))
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.set(\'value\',selectElem.options[i].innerHTML);
- }
- }
- YAHOO.util.Event.onAvailable("'; ?>
- Taskspriority<?php echo '", syncFromHiddenToWidget);
- '; ?>
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .minQLen = 0;
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .queryDelay = 0;
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .numOptions = <?php echo count($this->_tpl_vars['field_options']); ?>
- ;
- if(SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .numOptions >= 300) <?php echo '{
- '; ?>
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .minQLen = 1;
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .queryDelay = 200;
- <?php echo '
- }
- '; ?>
- if(SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .numOptions >= 3000) <?php echo '{
- '; ?>
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .minQLen = 1;
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .queryDelay = 500;
- <?php echo '
- }
- '; ?>
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .optionsVisible = false;
- <?php echo '
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.plug(Y.Plugin.AutoComplete, {
- activateFirstItem: true,
- '; ?>
- minQueryLength: SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .minQLen,
- queryDelay: SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .queryDelay,
- zIndex: 99999,
- <?php echo '
- source: SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.ds,
- resultTextLocator: \'text\',
- resultHighlighter: \'phraseMatch\',
- resultFilters: \'phraseMatch\',
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.expandHover = function(ex){
- var hover = YAHOO.util.Dom.getElementsByClassName(\'dccontent\');
- if(hover[0] != null){
- if (ex) {
- var h = \'1000px\';
- hover[0].style.height = h;
- }
- else{
- hover[0].style.height = \'\';
- }
- }
- }
- if('; ?>
- SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
- .minQLen<?php echo ' == 0){
- // expand the dropdown options upon focus
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'focus\', function () {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.sendRequest(\'\');
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.optionsVisible = true;
- });
- }
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'click\', function(e) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'click\');
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'dblclick\', function(e) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'dblclick\');
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'focus\', function(e) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'focus\');
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'mouseup\', function(e) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'mouseup\');
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'mousedown\', function(e) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'mousedown\');
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'blur\', function(e) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'blur\');
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.optionsVisible = false;
- var selectElem = document.getElementById("'; ?>
- Taskspriority<?php echo '");
- //if typed value is a valid option, do nothing
- for (i=0;i<selectElem.options.length;i++)
- if (selectElem.options[i].innerHTML==SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.get(\'value\'))
- return;
- //typed value is invalid, so set the text and the hidden to blank
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.set(\'value\', select_defaults[selectElem.id].text);
- SyncToHidden(select_defaults[selectElem.id].key);
- });
- // when they click on the arrow image, toggle the visibility of the options
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputImage.ancestor().on(\'click\', function () {
- if (SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.optionsVisible) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.blur();
- } else {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.focus();
- }
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.on(\'query\', function () {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.set(\'value\', \'\');
- });
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.on(\'visibleChange\', function (e) {
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.expandHover(e.newVal); // expand
- });
- // when they select an option, set the hidden input with the KEY, to be saved
- SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.on(\'select\', function(e) {
- SyncToHidden(e.result.raw.key);
- });
- });
- </script>
- '; ?>
- <?php endif; ?>
- </td>
- </tr>
- <tr>
- <td valign="top" id='description_label' width='12.5%' scope="row">
- <?php ob_start(); echo smarty_function_sugar_translate(array('label' => 'LBL_DESCRIPTION','module' => 'Tasks'), $this);?>
- <?php $this->_smarty_vars['capture']['label'] = ob_get_contents(); $this->assign('label', ob_get_contents());ob_end_clean(); echo ((is_array($_tmp=$this->_tpl_vars['label'])) ? $this->_run_mod_handler('strip_semicolon', true, $_tmp) : smarty_modifier_strip_semicolon($_tmp)); ?>
- :
- </td>
- <td valign="top" width='37.5%' colspan='3'>
- <?php echo smarty_function_counter(array('name' => 'panelFieldCount','print' => false), $this);?>
- <?php if (empty ( $this->_tpl_vars['fields']['description']['value'] )): $this->assign('value', $this->_tpl_vars['fields']['description']['default_value']); else: $this->assign('value', $this->_tpl_vars['fields']['description']['value']); endif; ?>
- <textarea id='Tasksdescription' name='Tasksdescription'
- rows="10"
- cols="90"
- title='' tabindex="0"
- ><?php echo $this->_tpl_vars['value']; ?>
- </textarea>
- </td>
- </tr>
- </table><?php echo '
- <script type="text/javascript">
- addForm(\'ConvertLead\');addToValidateBinaryDependency(\'ConvertLead\', \'assigned_user_name\', \'alpha\', false,\''; echo smarty_function_sugar_translate(array('label' => 'ERR_SQS_NO_MATCH_FIELD','module' => 'Tasks','for_js' => true), $this); echo ': '; echo smarty_function_sugar_translate(array('label' => 'LBL_ASSIGNED_TO','module' => 'Tasks','for_js' => true), $this); echo '\', \'assigned_user_id\' );
- </script>'; ?>