PageRenderTime 51ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/SugarCRM/cache/smarty/templates_c/%%54^542^5425BD6A%%ConvertLead.tpl.php

https://github.com/guolong/ggxw
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
  1. <?php /* Smarty version 2.6.11, created on 2012-10-27 19:43:58
  2. compiled from cache/modules/Tasks/ConvertLead.tpl */ ?>
  3. <?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
  4. 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); ?>
  5. <span class="color"><?php echo $this->_tpl_vars['ERROR']; ?>
  6. </span>
  7. <h4>
  8. <style>
  9. input[disabled] {
  10. background-color:lightgray;
  11. }
  12. </style>
  13. <table><tr><td>
  14. <input type="hidden" name="convert_create_Tasks" id="convert_create_Tasks"
  15. <?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; ?>/>
  16. <input type="hidden" name="opportunity_id" value="<?php echo $_REQUEST['opportunity_id']; ?>
  17. ">
  18. <input type="hidden" name="case_id" value="<?php echo $_REQUEST['case_id']; ?>
  19. ">
  20. <input type="hidden" name="bug_id" value="<?php echo $_REQUEST['bug_id']; ?>
  21. ">
  22. <input type="hidden" name="email_id" value="<?php echo $_REQUEST['email_id']; ?>
  23. ">
  24. <input type="hidden" name="inbound_email_id" value="<?php echo $_REQUEST['inbound_email_id']; ?>
  25. ">
  26. <?php if ($this->_tpl_vars['def']['required']): ?>
  27. <script type="text/javascript">
  28. mod_array.push('Tasks');//Bug#50590 add all required modules to mod_array
  29. </script>
  30. <?php endif; if (! $this->_tpl_vars['def']['required'] || ! empty ( $this->_tpl_vars['def']['select'] )): ?>
  31. <input class="checkbox" type="checkbox" name="newTasks" id="newTasks" onclick="toggleDisplay('createTasks');if (typeof(addRemoveDropdownElement) == 'function') addRemoveDropdownElement('Tasks');">
  32. <script type="text/javascript">
  33. <?php if (! empty ( $this->_tpl_vars['def']['default_action'] ) && $this->_tpl_vars['def']['default_action'] == 'create'): ?>
  34. <?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'] == ''): ?>
  35. YAHOO.util.Event.onContentReady('lead_conv_ac_op_sel', function(){
  36. <?php else: ?>
  37. YAHOO.util.Event.onContentReady('createTasks', function(){
  38. <?php endif; ?>
  39. toggleDisplay('createTasks');
  40. document.getElementById('newTasks').checked = true;
  41. if (typeof(addRemoveDropdownElement) == 'function')
  42. addRemoveDropdownElement('Tasks');
  43. });
  44. <?php endif; endif; ?>
  45. </script>
  46. </td><td>
  47. <?php echo smarty_function_sugar_translate(array('label' => 'LNK_NEW_TASK','module' => 'Leads'), $this);?>
  48. </td><td>
  49. </td></tr></table>
  50. </h4>
  51. <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')); ?>
  52. " id ="createTasks" <?php if (! $this->_tpl_vars['def']['required'] || ! empty ( $this->_tpl_vars['def']['select'] )): ?>style="display:none"<?php endif; ?>>
  53. <tr>
  54. <td valign="top" id='name_label' width='12.5%' scope="row">
  55. <?php ob_start(); echo smarty_function_sugar_translate(array('label' => 'LBL_SUBJECT','module' => 'Tasks'), $this);?>
  56. <?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)); ?>
  57. :
  58. <span class="required">*</span>
  59. </td>
  60. <td valign="top" width='37.5%' colspan='3'>
  61. <?php echo smarty_function_counter(array('name' => 'panelFieldCount','print' => false), $this);?>
  62. <?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; ?>
  63. <input type='text' name='Tasksname'
  64. id='Tasksname' size='90'
  65. maxlength='50'
  66. value='<?php echo $this->_tpl_vars['value']; ?>
  67. ' title='' >
  68. </td>
  69. </tr>
  70. <tr>
  71. <td valign="top" id='status_label' width='12.5%' scope="row">
  72. <?php ob_start(); echo smarty_function_sugar_translate(array('label' => 'LBL_STATUS','module' => 'Tasks'), $this);?>
  73. <?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)); ?>
  74. :
  75. <span class="required">*</span>
  76. </td>
  77. <td valign="top" width='37.5%' >
  78. <?php echo smarty_function_counter(array('name' => 'panelFieldCount','print' => false), $this);?>
  79. <?php if (! isset ( $this->_tpl_vars['config']['enable_autocomplete'] ) || $this->_tpl_vars['config']['enable_autocomplete'] == false): ?>
  80. <select name="Tasksstatus"
  81. id="Tasksstatus"
  82. title=''
  83. >
  84. <?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);?>
  85. <?php else: echo smarty_function_html_options(array('options' => $this->_tpl_vars['fields']['status']['options'],'selected' => $this->_tpl_vars['fields']['status']['default']), $this);?>
  86. <?php endif; ?>
  87. </select>
  88. <?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']); ?>
  89. <select style='display:none' name="Tasksstatus"
  90. id="Tasksstatus"
  91. title=''
  92. >
  93. <?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);?>
  94. <?php else: echo smarty_function_html_options(array('options' => $this->_tpl_vars['fields']['status']['options'],'selected' => $this->_tpl_vars['fields']['status']['default']), $this);?>
  95. <?php endif; ?>
  96. </select>
  97. <input
  98. id="Tasksstatus-input"
  99. name="Tasksstatus-input"
  100. size="30"
  101. 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'])); ?>
  102. "
  103. type="text" style="vertical-align: top;">
  104. <span class="id-ff multiple">
  105. <button type="button"><img src="<?php echo smarty_function_sugar_getimagepath(array('file' => "id-ff-down.png"), $this);?>
  106. " id="Tasksstatus-image"></button><button type="button"
  107. id="btn-clear-Tasksstatus-input"
  108. title="Clear"
  109. 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);?>
  110. "></button>
  111. </span>
  112. <?php echo '
  113. <script>
  114. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo ' = [];
  115. '; ?>
  116. <?php echo '
  117. (function (){
  118. var selectElem = document.getElementById("'; ?>
  119. Tasksstatus<?php echo '");
  120. if (typeof select_defaults =="undefined")
  121. select_defaults = [];
  122. select_defaults[selectElem.id] = {key:selectElem.value,text:\'\'};
  123. //get default
  124. for (i=0;i<selectElem.options.length;i++){
  125. if (selectElem.options[i].value==selectElem.value)
  126. select_defaults[selectElem.id].text = selectElem.options[i].innerHTML;
  127. }
  128. //SUGAR.AutoComplete.{$ac_key}.ds =
  129. //get options array from vardefs
  130. var options = SUGAR.AutoComplete.getOptionsArray("");
  131. YUI().use(\'datasource\', \'datasource-jsonschema\',function (Y) {
  132. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.ds = new Y.DataSource.Function({
  133. source: function (request) {
  134. var ret = [];
  135. for (i=0;i<selectElem.options.length;i++)
  136. if (!(selectElem.options[i].value==\'\' && selectElem.options[i].innerHTML==\'\'))
  137. ret.push({\'key\':selectElem.options[i].value,\'text\':selectElem.options[i].innerHTML});
  138. return ret;
  139. }
  140. });
  141. });
  142. })();
  143. '; ?>
  144. <?php echo '
  145. YUI().use("autocomplete", "autocomplete-filters", "autocomplete-highlighters", "node","node-event-simulate", function (Y) {
  146. '; ?>
  147. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  148. .inputNode = Y.one('#Tasksstatus-input');
  149. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  150. .inputImage = Y.one('#Tasksstatus-image');
  151. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  152. .inputHidden = Y.one('#Tasksstatus');
  153. <?php echo '
  154. function SyncToHidden(selectme){
  155. var selectElem = document.getElementById("'; ?>
  156. Tasksstatus<?php echo '");
  157. var doSimulateChange = false;
  158. if (selectElem.value!=selectme)
  159. doSimulateChange=true;
  160. selectElem.value=selectme;
  161. for (i=0;i<selectElem.options.length;i++){
  162. selectElem.options[i].selected=false;
  163. if (selectElem.options[i].value==selectme)
  164. selectElem.options[i].selected=true;
  165. }
  166. if (doSimulateChange)
  167. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'change\');
  168. }
  169. //global variable
  170. sync_'; ?>
  171. Tasksstatus<?php echo ' = function(){
  172. SyncToHidden();
  173. }
  174. function syncFromHiddenToWidget(){
  175. var selectElem = document.getElementById("'; ?>
  176. Tasksstatus<?php echo '");
  177. //if select no longer on page, kill timer
  178. if (selectElem==null || selectElem.options == null)
  179. return;
  180. var currentvalue = SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.get(\'value\');
  181. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.simulate(\'keyup\');
  182. for (i=0;i<selectElem.options.length;i++){
  183. if (selectElem.options[i].value==selectElem.value && document.activeElement != document.getElementById(\''; ?>
  184. Tasksstatus-input<?php echo '\'))
  185. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.set(\'value\',selectElem.options[i].innerHTML);
  186. }
  187. }
  188. YAHOO.util.Event.onAvailable("'; ?>
  189. Tasksstatus<?php echo '", syncFromHiddenToWidget);
  190. '; ?>
  191. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  192. .minQLen = 0;
  193. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  194. .queryDelay = 0;
  195. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  196. .numOptions = <?php echo count($this->_tpl_vars['field_options']); ?>
  197. ;
  198. if(SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  199. .numOptions >= 300) <?php echo '{
  200. '; ?>
  201. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  202. .minQLen = 1;
  203. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  204. .queryDelay = 200;
  205. <?php echo '
  206. }
  207. '; ?>
  208. if(SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  209. .numOptions >= 3000) <?php echo '{
  210. '; ?>
  211. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  212. .minQLen = 1;
  213. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  214. .queryDelay = 500;
  215. <?php echo '
  216. }
  217. '; ?>
  218. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  219. .optionsVisible = false;
  220. <?php echo '
  221. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.plug(Y.Plugin.AutoComplete, {
  222. activateFirstItem: true,
  223. '; ?>
  224. minQueryLength: SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  225. .minQLen,
  226. queryDelay: SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  227. .queryDelay,
  228. zIndex: 99999,
  229. <?php echo '
  230. source: SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.ds,
  231. resultTextLocator: \'text\',
  232. resultHighlighter: \'phraseMatch\',
  233. resultFilters: \'phraseMatch\',
  234. });
  235. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.expandHover = function(ex){
  236. var hover = YAHOO.util.Dom.getElementsByClassName(\'dccontent\');
  237. if(hover[0] != null){
  238. if (ex) {
  239. var h = \'1000px\';
  240. hover[0].style.height = h;
  241. }
  242. else{
  243. hover[0].style.height = \'\';
  244. }
  245. }
  246. }
  247. if('; ?>
  248. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  249. .minQLen<?php echo ' == 0){
  250. // expand the dropdown options upon focus
  251. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'focus\', function () {
  252. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.sendRequest(\'\');
  253. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.optionsVisible = true;
  254. });
  255. }
  256. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'click\', function(e) {
  257. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'click\');
  258. });
  259. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'dblclick\', function(e) {
  260. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'dblclick\');
  261. });
  262. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'focus\', function(e) {
  263. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'focus\');
  264. });
  265. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'mouseup\', function(e) {
  266. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'mouseup\');
  267. });
  268. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'mousedown\', function(e) {
  269. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'mousedown\');
  270. });
  271. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'blur\', function(e) {
  272. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'blur\');
  273. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.optionsVisible = false;
  274. var selectElem = document.getElementById("'; ?>
  275. Tasksstatus<?php echo '");
  276. //if typed value is a valid option, do nothing
  277. for (i=0;i<selectElem.options.length;i++)
  278. if (selectElem.options[i].innerHTML==SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.get(\'value\'))
  279. return;
  280. //typed value is invalid, so set the text and the hidden to blank
  281. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.set(\'value\', select_defaults[selectElem.id].text);
  282. SyncToHidden(select_defaults[selectElem.id].key);
  283. });
  284. // when they click on the arrow image, toggle the visibility of the options
  285. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputImage.ancestor().on(\'click\', function () {
  286. if (SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.optionsVisible) {
  287. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.blur();
  288. } else {
  289. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.focus();
  290. }
  291. });
  292. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.on(\'query\', function () {
  293. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.set(\'value\', \'\');
  294. });
  295. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.on(\'visibleChange\', function (e) {
  296. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.expandHover(e.newVal); // expand
  297. });
  298. // when they select an option, set the hidden input with the KEY, to be saved
  299. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.on(\'select\', function(e) {
  300. SyncToHidden(e.result.raw.key);
  301. });
  302. });
  303. </script>
  304. '; ?>
  305. <?php endif; ?>
  306. </td>
  307. <td valign="top" id='priority_label' width='12.5%' scope="row">
  308. <?php ob_start(); echo smarty_function_sugar_translate(array('label' => 'LBL_PRIORITY','module' => 'Tasks'), $this);?>
  309. <?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)); ?>
  310. :
  311. <span class="required">*</span>
  312. </td>
  313. <td valign="top" width='37.5%' >
  314. <?php echo smarty_function_counter(array('name' => 'panelFieldCount','print' => false), $this);?>
  315. <?php if (! isset ( $this->_tpl_vars['config']['enable_autocomplete'] ) || $this->_tpl_vars['config']['enable_autocomplete'] == false): ?>
  316. <select name="Taskspriority"
  317. id="Taskspriority"
  318. title=''
  319. >
  320. <?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);?>
  321. <?php else: echo smarty_function_html_options(array('options' => $this->_tpl_vars['fields']['priority']['options'],'selected' => $this->_tpl_vars['fields']['priority']['default']), $this);?>
  322. <?php endif; ?>
  323. </select>
  324. <?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']); ?>
  325. <select style='display:none' name="Taskspriority"
  326. id="Taskspriority"
  327. title=''
  328. >
  329. <?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);?>
  330. <?php else: echo smarty_function_html_options(array('options' => $this->_tpl_vars['fields']['priority']['options'],'selected' => $this->_tpl_vars['fields']['priority']['default']), $this);?>
  331. <?php endif; ?>
  332. </select>
  333. <input
  334. id="Taskspriority-input"
  335. name="Taskspriority-input"
  336. size="30"
  337. 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'])); ?>
  338. "
  339. type="text" style="vertical-align: top;">
  340. <span class="id-ff multiple">
  341. <button type="button"><img src="<?php echo smarty_function_sugar_getimagepath(array('file' => "id-ff-down.png"), $this);?>
  342. " id="Taskspriority-image"></button><button type="button"
  343. id="btn-clear-Taskspriority-input"
  344. title="Clear"
  345. 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);?>
  346. "></button>
  347. </span>
  348. <?php echo '
  349. <script>
  350. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo ' = [];
  351. '; ?>
  352. <?php echo '
  353. (function (){
  354. var selectElem = document.getElementById("'; ?>
  355. Taskspriority<?php echo '");
  356. if (typeof select_defaults =="undefined")
  357. select_defaults = [];
  358. select_defaults[selectElem.id] = {key:selectElem.value,text:\'\'};
  359. //get default
  360. for (i=0;i<selectElem.options.length;i++){
  361. if (selectElem.options[i].value==selectElem.value)
  362. select_defaults[selectElem.id].text = selectElem.options[i].innerHTML;
  363. }
  364. //SUGAR.AutoComplete.{$ac_key}.ds =
  365. //get options array from vardefs
  366. var options = SUGAR.AutoComplete.getOptionsArray("");
  367. YUI().use(\'datasource\', \'datasource-jsonschema\',function (Y) {
  368. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.ds = new Y.DataSource.Function({
  369. source: function (request) {
  370. var ret = [];
  371. for (i=0;i<selectElem.options.length;i++)
  372. if (!(selectElem.options[i].value==\'\' && selectElem.options[i].innerHTML==\'\'))
  373. ret.push({\'key\':selectElem.options[i].value,\'text\':selectElem.options[i].innerHTML});
  374. return ret;
  375. }
  376. });
  377. });
  378. })();
  379. '; ?>
  380. <?php echo '
  381. YUI().use("autocomplete", "autocomplete-filters", "autocomplete-highlighters", "node","node-event-simulate", function (Y) {
  382. '; ?>
  383. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  384. .inputNode = Y.one('#Taskspriority-input');
  385. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  386. .inputImage = Y.one('#Taskspriority-image');
  387. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  388. .inputHidden = Y.one('#Taskspriority');
  389. <?php echo '
  390. function SyncToHidden(selectme){
  391. var selectElem = document.getElementById("'; ?>
  392. Taskspriority<?php echo '");
  393. var doSimulateChange = false;
  394. if (selectElem.value!=selectme)
  395. doSimulateChange=true;
  396. selectElem.value=selectme;
  397. for (i=0;i<selectElem.options.length;i++){
  398. selectElem.options[i].selected=false;
  399. if (selectElem.options[i].value==selectme)
  400. selectElem.options[i].selected=true;
  401. }
  402. if (doSimulateChange)
  403. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'change\');
  404. }
  405. //global variable
  406. sync_'; ?>
  407. Taskspriority<?php echo ' = function(){
  408. SyncToHidden();
  409. }
  410. function syncFromHiddenToWidget(){
  411. var selectElem = document.getElementById("'; ?>
  412. Taskspriority<?php echo '");
  413. //if select no longer on page, kill timer
  414. if (selectElem==null || selectElem.options == null)
  415. return;
  416. var currentvalue = SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.get(\'value\');
  417. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.simulate(\'keyup\');
  418. for (i=0;i<selectElem.options.length;i++){
  419. if (selectElem.options[i].value==selectElem.value && document.activeElement != document.getElementById(\''; ?>
  420. Taskspriority-input<?php echo '\'))
  421. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.set(\'value\',selectElem.options[i].innerHTML);
  422. }
  423. }
  424. YAHOO.util.Event.onAvailable("'; ?>
  425. Taskspriority<?php echo '", syncFromHiddenToWidget);
  426. '; ?>
  427. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  428. .minQLen = 0;
  429. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  430. .queryDelay = 0;
  431. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  432. .numOptions = <?php echo count($this->_tpl_vars['field_options']); ?>
  433. ;
  434. if(SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  435. .numOptions >= 300) <?php echo '{
  436. '; ?>
  437. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  438. .minQLen = 1;
  439. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  440. .queryDelay = 200;
  441. <?php echo '
  442. }
  443. '; ?>
  444. if(SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  445. .numOptions >= 3000) <?php echo '{
  446. '; ?>
  447. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  448. .minQLen = 1;
  449. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  450. .queryDelay = 500;
  451. <?php echo '
  452. }
  453. '; ?>
  454. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  455. .optionsVisible = false;
  456. <?php echo '
  457. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.plug(Y.Plugin.AutoComplete, {
  458. activateFirstItem: true,
  459. '; ?>
  460. minQueryLength: SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  461. .minQLen,
  462. queryDelay: SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  463. .queryDelay,
  464. zIndex: 99999,
  465. <?php echo '
  466. source: SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.ds,
  467. resultTextLocator: \'text\',
  468. resultHighlighter: \'phraseMatch\',
  469. resultFilters: \'phraseMatch\',
  470. });
  471. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.expandHover = function(ex){
  472. var hover = YAHOO.util.Dom.getElementsByClassName(\'dccontent\');
  473. if(hover[0] != null){
  474. if (ex) {
  475. var h = \'1000px\';
  476. hover[0].style.height = h;
  477. }
  478. else{
  479. hover[0].style.height = \'\';
  480. }
  481. }
  482. }
  483. if('; ?>
  484. SUGAR.AutoComplete.<?php echo $this->_tpl_vars['ac_key']; ?>
  485. .minQLen<?php echo ' == 0){
  486. // expand the dropdown options upon focus
  487. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'focus\', function () {
  488. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.sendRequest(\'\');
  489. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.optionsVisible = true;
  490. });
  491. }
  492. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'click\', function(e) {
  493. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'click\');
  494. });
  495. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'dblclick\', function(e) {
  496. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'dblclick\');
  497. });
  498. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'focus\', function(e) {
  499. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'focus\');
  500. });
  501. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'mouseup\', function(e) {
  502. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'mouseup\');
  503. });
  504. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'mousedown\', function(e) {
  505. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'mousedown\');
  506. });
  507. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.on(\'blur\', function(e) {
  508. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.simulate(\'blur\');
  509. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.optionsVisible = false;
  510. var selectElem = document.getElementById("'; ?>
  511. Taskspriority<?php echo '");
  512. //if typed value is a valid option, do nothing
  513. for (i=0;i<selectElem.options.length;i++)
  514. if (selectElem.options[i].innerHTML==SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.get(\'value\'))
  515. return;
  516. //typed value is invalid, so set the text and the hidden to blank
  517. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.set(\'value\', select_defaults[selectElem.id].text);
  518. SyncToHidden(select_defaults[selectElem.id].key);
  519. });
  520. // when they click on the arrow image, toggle the visibility of the options
  521. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputImage.ancestor().on(\'click\', function () {
  522. if (SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.optionsVisible) {
  523. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.blur();
  524. } else {
  525. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.focus();
  526. }
  527. });
  528. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.on(\'query\', function () {
  529. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputHidden.set(\'value\', \'\');
  530. });
  531. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.on(\'visibleChange\', function (e) {
  532. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.expandHover(e.newVal); // expand
  533. });
  534. // when they select an option, set the hidden input with the KEY, to be saved
  535. SUGAR.AutoComplete.'; echo $this->_tpl_vars['ac_key']; echo '.inputNode.ac.on(\'select\', function(e) {
  536. SyncToHidden(e.result.raw.key);
  537. });
  538. });
  539. </script>
  540. '; ?>
  541. <?php endif; ?>
  542. </td>
  543. </tr>
  544. <tr>
  545. <td valign="top" id='description_label' width='12.5%' scope="row">
  546. <?php ob_start(); echo smarty_function_sugar_translate(array('label' => 'LBL_DESCRIPTION','module' => 'Tasks'), $this);?>
  547. <?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)); ?>
  548. :
  549. </td>
  550. <td valign="top" width='37.5%' colspan='3'>
  551. <?php echo smarty_function_counter(array('name' => 'panelFieldCount','print' => false), $this);?>
  552. <?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; ?>
  553. <textarea id='Tasksdescription' name='Tasksdescription'
  554. rows="10"
  555. cols="90"
  556. title='' tabindex="0"
  557. ><?php echo $this->_tpl_vars['value']; ?>
  558. </textarea>
  559. </td>
  560. </tr>
  561. </table><?php echo '
  562. <script type="text/javascript">
  563. 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\' );
  564. </script>'; ?>