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

/Smarty/templates/Header.tpl

https://bitbucket.org/thomashii/vtigercrm-6-for-postgresql
Smarty Template | 814 lines | 747 code | 41 blank | 26 comment | 125 complexity | 7a08f57a9342314b94957b866ed1f328 MD5 | raw file
Possible License(s): Apache-2.0, LGPL-3.0, LGPL-2.1, GPL-2.0, GPL-3.0
  1. {*<!--
  2. /*********************************************************************************
  3. ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
  4. * ("License"); You may not use this file except in compliance with the License
  5. * The Original Code is: vtiger CRM Open Source
  6. * The Initial Developer of the Original Code is vtiger.
  7. * Portions created by vtiger are Copyright (C) vtiger.
  8. * All Rights Reserved.
  9. *
  10. ********************************************************************************/
  11. -->*}
  12. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  13. <html>
  14. <head>
  15. <title>{$USER} - {$MODULE_NAME|@getTranslatedString:$MODULE_NAME} - {$APP.LBL_BROWSER_TITLE}</title>
  16. <link REL="SHORTCUT ICON" HREF="themes/images/vtigercrm_icon.ico">
  17. {if $smarty.cookies.vtigerui neq 6}
  18. <style type="text/css">@import url("themes/{$THEME}/style.css?v={$VERSION}");</style>
  19. {else}
  20. <style type="text/css">@import url("themes/softed/style.css?v={$VERSION}");</style>
  21. <style type="text/css">@import url("themes/vtigerui6/{$THEME}.css?v={$VERSION}");</style>
  22. {/if}
  23. <link rel="stylesheet" type="text/css" media="all" href="jscalendar/calendar-win2k-cold-1.css">
  24. {* vtlib customization: Inclusion of custom javascript and css as registered *}
  25. {if $HEADERCSS}
  26. <!-- Custom Header CSS -->
  27. {foreach item=HDRCSS from=$HEADERCSS}
  28. <link rel="stylesheet" type="text/css" href="{$HDRCSS->linkurl}" />
  29. {/foreach}
  30. <!-- END -->
  31. {/if}
  32. {* END *}
  33. <!-- ActivityReminder customization for callback -->
  34. {literal}
  35. <style type="text/css">div.fixedLay1 { position:fixed; }</style>
  36. <!--[if lte IE 6]>
  37. <style type="text/css">div.fixedLay { position:absolute; }</style>
  38. <![endif]-->
  39. <style type="text/css">div.drop_mnu_user { position:fixed; }</style>
  40. <!--[if lte IE 6]>
  41. <style type="text/css">div.drop_mnu_user { position:absolute; }</style>
  42. <![endif]-->
  43. {/literal}
  44. <!-- End -->
  45. </head>
  46. {* NOTE: trigger call to parent-window resize function when running in embed mode *}
  47. <body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0 class=small
  48. {if $smarty.cookies.vtigerui eq 6}onload="if(parent.resizeUI5Iframe)parent.resizeUI5Iframe(self.document.body.scrollHeight);"{/if}
  49. {if $smarty.cookies.vtigerui eq 6}onunload="if(parent.resizeUI5IframeReset)parent.resizeUI5IframeReset();"{/if}
  50. >
  51. <a name="top"></a>
  52. <!-- header -->
  53. <!-- header-vtiger crm name & RSS -->
  54. <script language="JavaScript" type="text/javascript" src="include/js/json.js"></script>
  55. <script language="JavaScript" type="text/javascript" src="include/js/general.js?v={$VERSION}"></script>
  56. <!-- vtlib customization: Javascript hook -->
  57. <script language="JavaScript" type="text/javascript" src="include/js/vtlib.js?v={$VERSION}"></script>
  58. <!-- END -->
  59. <script language="JavaScript" type="text/javascript" id="_current_language_" src="include/js/{php} echo $_SESSION['authenticated_user_language'];{/php}.lang.js?{php} echo $_SESSION['vtiger_version'];{/php}"></script>
  60. <script language="JavaScript" type="text/javascript" src="include/js/QuickCreate.js"></script>
  61. <script language="javascript" type="text/javascript" src="include/scriptaculous/prototype.js"></script>
  62. <script language="JavaScript" type="text/javascript" src="include/js/menu.js?v={$VERSION}"></script>
  63. <script language="JavaScript" type="text/javascript" src="include/calculator/calc.js"></script>
  64. <script language="JavaScript" type="text/javascript" src="modules/Calendar/script.js"></script>
  65. <script language="javascript" type="text/javascript" src="include/scriptaculous/dom-drag.js"></script>
  66. <script language="JavaScript" type="text/javascript" src="include/js/notificationPopup.js"></script>
  67. <script type="text/javascript" src="jscalendar/calendar.js"></script>
  68. <script type="text/javascript" src="jscalendar/calendar-setup.js"></script>
  69. <script type="text/javascript" src="jscalendar/lang/calendar-{$APP.LBL_JSCALENDAR_LANG}.js"></script>
  70. <script type="text/javascript" src="include/jquery/jquery-1.6.2.min.js"></script>
  71. <script type="text/javascript">
  72. jQuery.noConflict();
  73. </script>
  74. <!-- asterisk Integration -->
  75. {if $USE_ASTERISK eq 'true'}
  76. <script type="text/javascript" src="include/js/asterisk.js"></script>
  77. <script type="text/javascript">
  78. if(typeof(use_asterisk) == 'undefined') use_asterisk = true;
  79. </script>
  80. {/if}
  81. <!-- END -->
  82. {* vtlib customization: Inclusion of custom javascript and css as registered *}
  83. {if $HEADERSCRIPTS}
  84. <!-- Custom Header Script -->
  85. {foreach item=HEADERSCRIPT from=$HEADERSCRIPTS}
  86. <script type="text/javascript" src="{$HEADERSCRIPT->linkurl}"></script>
  87. {/foreach}
  88. <!-- END -->
  89. {/if}
  90. {* END *}
  91. {* PREFECTHING IMAGE FOR BLOCKING SCREEN USING VtigerJS_DialogBox API *}
  92. <img src="{'layerPopupBg.gif'|@vtiger_imageurl:$THEME}" style="display: none;"/>
  93. {* END *}
  94. {* NOTE: To enable embedding UI in vtiger6 till its complete *}
  95. {if $smarty.cookies.vtigerui neq 6}
  96. <TABLE border=0 cellspacing=0 cellpadding=0 width=100% class="small">
  97. <tr>
  98. <td valign=top align=left><img src="test/logo/{$LOGO}" alt="{$LOGO}" title="{$LOGO}" border=0 style="width: 15em;height: 4.2em;"></td>
  99. <td align="center" valign=bottom >
  100. <div align ="center" width ="50%" border='3' style="padding:5px;">
  101. <table border=0 cellspacing=0 cellpadding=0 id="search" align="center">
  102. <tr>
  103. <form name="UnifiedSearch" method="post" action="index.php" style="margin:0px" onsubmit="VtigerJS_DialogBox.block();">
  104. <td style="background-color:#ffffef;border:1px;border-color:black;vertical-align:middle;" nowrap>
  105. <input type="hidden" name="action" value="UnifiedSearch" style="margin:0px">
  106. <input type="hidden" name="module" value="Home" style="margin:0px">
  107. <input type="hidden" name="parenttab" value="{$CATEGORY}" style="margin:0px">
  108. <input type="hidden" name="search_onlyin" value="--USESELECTED--" style="margin:0px">
  109. <input type="text" name="query_string" value="{$QUERY_STRING}" class="searchBox" onFocus="this.value=''" >
  110. </td>
  111. <td align ="right" style="background-color:#FFFFEF; vertical-align:middle;padding:5px;" onclick="UnifiedSearch_SelectModuleForm(this);">
  112. <a href='javascript:void(0);' ><img src="{'arrow_down_black.png'|@vtiger_imageurl:$THEME}" align='left' border=0></a>
  113. </td>
  114. <td style="background-color:#cccccc">
  115. <input type="image" class="searchBtn" alt="{$APP.LBL_FIND}" title="{$APP.LBL_FIND}" width = "70%;" height="70%" src="{'searchicon.PNG'|@vtiger_imageurl:$THEME}" align='left' border=1 onsubmit ="submit-form();">
  116. </td>
  117. </form>
  118. </tr>
  119. </table>
  120. </div>
  121. </td>
  122. <td valign=center><a href="vtiger6/index.php" id="switchLook" style="background:#B22222;color:white;padding:5px;border-radius:5px;font-size:14px;">Switch to new look</td>
  123. <td class=small nowrap align="right" style="padding-right:10px;">
  124. <table border=0 cellspacing=0 cellpadding=0>
  125. <tr>
  126. <td valign="top" class="genHeaderSmall" style="padding-left:10px;padding-top:3px;">
  127. <span class="userName">{$USER}</span>
  128. </td>
  129. {* ondemand customization: Header links on the top panel *}
  130. <td class="small" onmouseover="fnDropDownUser(this,'ondemand_sub','~{$CURRENT_USER_MAIL}`');" onmouseout="fnHideDrop('ondemand_sub');" valign="bottom" nowrap style="padding-bottom: 1em;"><img src="{$IMAGEPATH}user.PNG" border=0 style="padding: 0px;padding-left:5px"></td>
  131. {* END *}
  132. {* vtlib customization: Header links on the top panel *}
  133. {if $HEADERLINKS}
  134. <td style="padding-left:10px;padding-right:5px" class=small nowrap>
  135. <a href="javascript:;" onmouseover="fnvshobj(this,'vtlib_headerLinksLay');" onclick="fnvshobj(this,'vtlib_headerLinksLay');">{$APP.LBL_MORE}</a> <img src="{'arrow_down.gif'|@vtiger_imageurl:$THEME}" border=0>
  136. <div style="display: none; left: 193px; top: 106px;width:155px; position:absolute;" id="vtlib_headerLinksLay"
  137. onmouseout="fninvsh('vtlib_headerLinksLay')" onmouseover="fnvshNrm('vtlib_headerLinksLay')">
  138. <table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  139. <tr>
  140. <td style="border-bottom: 1px solid rgb(204, 204, 204); padding: 5px;"><b>{$APP.LBL_MORE}</b></td>
  141. </tr>
  142. <tr>
  143. <td>
  144. {foreach item=HEADERLINK from=$HEADERLINKS}
  145. {assign var="headerlink_href" value=$HEADERLINK->linkurl}
  146. {assign var="headerlink_label" value=$HEADERLINK->linklabel}
  147. {if $headerlink_label eq ''}
  148. {assign var="headerlink_label" value=$headerlink_href}
  149. {else}
  150. {* Pickup the translated label provided by the module *}
  151. {assign var="headerlink_label" value=$headerlink_label|@getTranslatedString:$HEADERLINK->module()}
  152. {/if}
  153. <a href="{$headerlink_href}" class="drop_down">{$headerlink_label}</a>
  154. {/foreach}
  155. </td>
  156. </tr>
  157. </table>
  158. </div>
  159. </td>
  160. {/if}
  161. {* END *}
  162. <td onmouseout="fnHideDrop('usersettings');" onmouseover="fnDropDownUser(this,'usersettings');" valign="bottom" nowrap style="padding-bottom: 1em;" class="small" nowrap> <a> <img src="{$IMAGEPATH}info.PNG" border=0 style="padding: 0px;padding-left:5px"></a></td>
  163. {if $ADMIN_LINK neq ''}
  164. {foreach key=maintabs item=detail from=$HEADERS}
  165. {if $maintabs eq "Settings"}
  166. <td valign="bottom" nowrap style="padding-bottom: 1em;" class="small" onmouseout="fnHideDrop('mainsettings');" onmouseover="fnDropDown(this,'mainsettings');" nowrap><img src="{$IMAGEPATH}mainSettings.PNG" border=0 style="padding: 0px;padding-left:5px "></td>
  167. {/if}
  168. {/foreach}
  169. {/if}
  170. </tr>
  171. </table>
  172. </td>
  173. </tr>
  174. </TABLE>
  175. {if $ANNOUNCEMENT}
  176. <table width ="100%">
  177. <tr colspan="3" width="100%">
  178. <td width="90%" align=center>
  179. {if $APP.$MODULE_NAME eq 'Dashboards'}
  180. <marquee id="rss" direction="left" scrolldelay="10" scrollamount="3" behavior="scroll" class="marStyle" onMouseOver="javascript:stop();" onMouseOut="javascript:start();">&nbsp;{$ANNOUNCEMENT|escape}</marquee>
  181. {else}
  182. <marquee id="rss" direction="left" scrolldelay="10" scrollamount="3" behavior="scroll" class="marStyle" onMouseOver="javascript:stop();" onMouseOut="javascript:start();">&nbsp;{$ANNOUNCEMENT}</marquee>
  183. {/if}
  184. </td>
  185. <td width="10%" align="right" style="padding-right:38px;"><img src="{'Announce.PNG'|@vtiger_imageurl:$THEME}"></td>
  186. </tr>
  187. </table>
  188. {/if}
  189. <div id='miniCal' style='width:300px; position:absolute; display:none; left:100px; top:100px; z-index:100000'></div>
  190. {if $MODULE_NAME eq 'Calendar'}
  191. <div id="CalExport" style="width:300px; position:absolute; display:none; left:500px; top:100px; z-index:100000" class="layerPopup">
  192. <table border=0 cellspacing=0 cellpadding=5 width=100% class=layerHeadingULine>
  193. <tr>
  194. <td class="genHeaderSmall" nowrap align="left" width="30%" >{$APP.LBL_EXPORT} </td>
  195. <td align="right"><a href='javascript:ghide("CalExport");'><img src="{'close.gif'|@vtiger_imageurl:$THEME}" align="right" border="0"></a></td>
  196. </tr>
  197. </table>
  198. <table border=0 cellspacing=0 cellpadding=5 width=95% align=center>
  199. <tr>
  200. <td class="small">
  201. <table border=0 celspacing=0 cellpadding=5 width=100% align=center bgcolor=white>
  202. <tr>
  203. <td align="right" nowrap class="cellLabel small">
  204. <input class="small" type='radio' name='exportCalendar' value = 'iCal' onclick="$('ics_filename').removeAttribute('disabled');" checked /> iCal Format
  205. </td>
  206. <td align="left">
  207. <input class="small" type='text' name='ics_filename' id='ics_filename' size='25' value='vtiger.calendar'/>
  208. </td>
  209. </tr>
  210. </table>
  211. </td>
  212. </tr>
  213. </table>
  214. <table border=0 cellspacing=0 cellpadding=5 width=100% class="layerPopupTransport">
  215. <tr>
  216. <td class="small" align="center">
  217. <input type="button" onclick="return exportCalendar();" value="Export" class="crmbutton small edit" name="button"/>
  218. </td>
  219. </tr>
  220. </table>
  221. </div>
  222. <div id='CalImport' style='width:300px; position:absolute; display:none; left:500px; top:100px; z-index:100000' class="layerPopup">
  223. {assign var='label_filename' value='LBL_FILENAME'}
  224. <form name='ical_import' id='ical_import' onsubmit="VtigerJS_DialogBox.block();" enctype="multipart/form-data" action="index.php" method="POST">
  225. <input type='hidden' name='module' value=''>
  226. <input type='hidden' name='action' value=''>
  227. <table border=0 cellspacing=0 cellpadding=5 width=100% class=layerHeadingULine>
  228. <tr>
  229. <td class="genHeaderSmall" nowrap align="left" width="30%" id="editfolder_info">{$APP.LBL_IMPORT}</td>
  230. <td align="right"><a href='javascript:ghide("CalImport");'><img src="{'close.gif'|@vtiger_imageurl:$THEME}" align="absmiddle" border="0"></a></td>
  231. </tr>
  232. </table>
  233. <table border=0 cellspacing=0 cellpadding=5 width=95% align=center>
  234. <tr>
  235. <td class="small">
  236. <table border=0 celspacing=0 cellpadding=5 width=100% align=center bgcolor=white>
  237. <tr>
  238. <td align="right" nowrap class="cellLabel small"><b>{$label_filename|@getTranslatedString} </b></td>
  239. <td align="left">
  240. <input class="small" type='file' name='ics_file' id='ics_file'/>
  241. </td>
  242. </tr>
  243. </table>
  244. </td>
  245. </tr>
  246. </table>
  247. <table border=0 cellspacing=0 cellpadding=5 width=100% class="layerPopupTransport">
  248. <tr>
  249. <td class="small" align="center">
  250. <input type="button" onclick="return importCalendar();" value="Import" class="crmbutton small edit" name="button"/>
  251. </td>
  252. </tr>
  253. </table>
  254. </form>
  255. </div>
  256. {/if}
  257. <!-- header - master tabs -->
  258. <TABLE border=0 cellspacing=0 cellpadding=0 width=100% class="hdrTabBg">
  259. <tr>
  260. {if $MODULE_NAME eq 'Home'}
  261. <td style="width:50px" class='tabSelected' align = "center"><a href= "index.php?module=Home&action=index"><img src="{$IMAGEPATH}Home.PNG" style="width:16px;height:16px;" border="0" /></a></td>
  262. {else}
  263. <td style="width:50px" class='tabUnSelected' align = "center"><a href= "index.php?module=Home&action=index&parenttab=My Home Page"><img src="{$IMAGEPATH}Home.PNG" style="width:16px;height:16px;" border="0" /></a></td>
  264. {/if}
  265. <td class=small nowrap>
  266. <table border=0 cellspacing=0 cellpadding=0>
  267. <tr>
  268. <td class=tabSeperator ><img src="{'spacer.gif'|@vtiger_imageurl:$THEME}" width=2px height=28px align="right"></td>
  269. {assign var="count" value=1}
  270. {foreach key=maintabs item=detail from=$MENUSTRUCTURE}
  271. {if $maintabs eq 'top'}
  272. {foreach key=number item = name from = $detail}
  273. {assign var="modulename" value=$name[1]|@getTranslatedString:$name[0]}
  274. {assign var="modulelabel" value=$name[0]}
  275. {if $modulelabel ne $MODULE_NAME}
  276. <td class="tabUnSelected" align="center" nowrap><a href="index.php?module={$name[0]}&action=index">{$modulename}</a></td>
  277. <td class="tabSeperator"><img src="{'spacer.gif'|@vtiger_imageurl:$THEME}"></td>
  278. {else}
  279. <td class="tabSelected" align="center" nowrap><a href="index.php?module={$name[0]}&action=index">{$modulename}</a></td>
  280. <td class="tabSeperator"><img src="{'spacer.gif'|@vtiger_imageurl:$THEME}"></td>
  281. {/if}
  282. {/foreach}
  283. {/if}
  284. {/foreach}
  285. {foreach key=maintabs item=detail from=$MENUSTRUCTURE}
  286. {if $maintabs eq 'more' && $detail != null}
  287. <td class="tabUnSelected" align="center" onmouseout="fnHide_Event('allMenu');" onmouseover="fnvshobjMore(this,'allMenu','{if $ANNOUNCEMENT}true{else}false{/if}');" nowrap><a href="javascript:;" >{$APP.LBL_MORE}<img src="{'menuDnArrow.gif'|@vtiger_imageurl:$THEME}" border=0 style="padding-left:5px" /></a></td>
  288. <td class="tabSeperator"><img src="{'spacer.gif'|@vtiger_imageurl:$THEME}"></td>
  289. {/if}
  290. {/foreach}
  291. <td style="padding-left:10px" nowrap>
  292. {if $CNT eq 1}
  293. <select class=small id="qccombo" style="width:110px" onclick="QCreate(this);">
  294. <option value="none">{$APP.LBL_QUICK_CREATE}...</option>
  295. {foreach item=detail from=$QCMODULE}
  296. <option value="{$detail.1}">{$APP.NEW}&nbsp;{$detail.0}</option>
  297. {/foreach}
  298. </select>
  299. {else}
  300. <select class=small id="qccombo" style="width:110px" onchange="QCreate(this);">
  301. <option value="none">{$APP.LBL_QUICK_CREATE}...</option>
  302. {foreach item=detail from=$QCMODULE}
  303. <option value="{$detail.1}">{$APP.NEW}&nbsp;{$detail.0}</option>
  304. {/foreach}
  305. </select>
  306. {/if}
  307. </td>
  308. </tr>
  309. </table>
  310. </td>
  311. <td align=right style="padding-right:10px" nowrap >
  312. </td>
  313. </tr>
  314. </TABLE>
  315. {/if} {* END check for vtigerui neq 6 *}
  316. <div id="calculator_cont" style="position:absolute; z-index:10000" ></div>
  317. {include file="Clock.tpl"}
  318. <div id="qcform" style="position:absolute;width:700px;top:80px;left:450px;z-index:90000;"></div>
  319. <!-- Unified Search module selection feature -->
  320. <div id="UnifiedSearch_moduleformwrapper" style="position:absolute;width:417px;z-index:100002;display:none;"></div>
  321. <script type='text/javascript'>
  322. {literal}
  323. function UnifiedSearch_SelectModuleForm(obj) {
  324. if($('UnifiedSearch_moduleform')) {
  325. // If we have loaded the form already.
  326. UnifiedSearch_SelectModuleFormCallback(obj);
  327. } else {
  328. $('status').show();
  329. new Ajax.Request(
  330. 'index.php',
  331. {queue: {position: 'end', scope: 'command'},
  332. method: 'post',
  333. postBody: 'module=Home&action=HomeAjax&file=UnifiedSearchModules&ajax=true',
  334. onComplete: function(response) {
  335. $('status').hide();
  336. $('UnifiedSearch_moduleformwrapper').innerHTML = response.responseText;
  337. UnifiedSearch_SelectModuleFormCallback(obj);
  338. }
  339. });
  340. }
  341. }
  342. function UnifiedSearch_SelectModuleFormCallback(obj) {
  343. fnvshobjsearch(obj, 'UnifiedSearch_moduleformwrapper');
  344. }
  345. function UnifiedSearch_SelectModuleToggle(flag) {
  346. Form.getElements($('UnifiedSearch_moduleform')).each(
  347. function(element) {
  348. if(element.type == 'checkbox') {
  349. element.checked = flag;
  350. }
  351. }
  352. );
  353. }
  354. function UnifiedSearch_SelectModuleCancel() {
  355. $('UnifiedSearch_moduleformwrapper').hide();
  356. }
  357. function UnifiedSearch_SelectModuleSave() {
  358. var UnifiedSearch_form = document.forms.UnifiedSearch;
  359. UnifiedSearch_form.search_onlyin.value = Form.serialize($('UnifiedSearch_moduleform')).replace(/search_onlyin=/g, '').replace(/&/g,',');
  360. UnifiedSearch_SelectModuleCancel();
  361. }
  362. {/literal}
  363. </script>
  364. <!-- End -->
  365. <script>
  366. var gVTModule = '{$smarty.request.module|@vtlib_purify}';
  367. var gVTTheme = '{$THEME}';
  368. function fetch_clock()
  369. {ldelim}
  370. new Ajax.Request(
  371. 'index.php',
  372. {ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
  373. method: 'post',
  374. postBody: 'module=Utilities&action=UtilitiesAjax&file=Clock',
  375. onComplete: function(response)
  376. {ldelim}
  377. $("clock_cont").innerHTML=response.responseText;
  378. execJS($('clock_cont'));
  379. {rdelim}
  380. {rdelim}
  381. );
  382. {rdelim}
  383. function fetch_calc()
  384. {ldelim}
  385. new Ajax.Request(
  386. 'index.php',
  387. {ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
  388. method: 'post',
  389. postBody: 'module=Utilities&action=UtilitiesAjax&file=Calculator',
  390. onComplete: function(response)
  391. {ldelim}
  392. $("calculator_cont").innerHTML=response.responseText;
  393. execJS($('calculator_cont'));
  394. {rdelim}
  395. {rdelim}
  396. );
  397. {rdelim}
  398. </script>
  399. <script type="text/javascript">
  400. {literal}
  401. function QCreate(qcoptions){
  402. var module = qcoptions.options[qcoptions.options.selectedIndex].value;
  403. if(module != 'none'){
  404. $("status").style.display="inline";
  405. if(module == 'Events'){
  406. module = 'Calendar';
  407. var urlstr = '&activity_mode=Events';
  408. }else if(module == 'Calendar'){
  409. module = 'Calendar';
  410. var urlstr = '&activity_mode=Task';
  411. }else{
  412. var urlstr = '';
  413. }
  414. new Ajax.Request(
  415. 'index.php',
  416. {queue: {position: 'end', scope: 'command'},
  417. method: 'post',
  418. postBody: 'module='+module+'&action='+module+'Ajax&file=QuickCreate'+urlstr,
  419. onComplete: function(response){
  420. $("status").style.display="none";
  421. $("qcform").style.display="inline";
  422. $("qcform").innerHTML = response.responseText;
  423. // Evaluate all the script tags in the response text.
  424. var scriptTags = $("qcform").getElementsByTagName("script");
  425. for(var i = 0; i< scriptTags.length; i++){
  426. var scriptTag = scriptTags[i];
  427. eval(scriptTag.innerHTML);
  428. }
  429. eval($("qcform"));
  430. posLay(qcoptions, "qcform");
  431. }
  432. }
  433. );
  434. }else{
  435. hide('qcform');
  436. }
  437. }
  438. function getFormValidate(divValidate)
  439. {
  440. var st = document.getElementById('qcvalidate');
  441. eval(st.innerHTML);
  442. for (var i=0; i<qcfieldname.length; i++) {
  443. var curr_fieldname = qcfieldname[i];
  444. if(window.document.QcEditView[curr_fieldname] != null)
  445. {
  446. var type=qcfielddatatype[i].split("~")
  447. var input_type = window.document.QcEditView[curr_fieldname].type;
  448. if (type[1]=="M") {
  449. if (!qcemptyCheck(curr_fieldname,qcfieldlabel[i],input_type))
  450. return false
  451. }
  452. switch (type[0]) {
  453. case "O" : break;
  454. case "V" : break;
  455. case "C" : break;
  456. case "DT" :
  457. if (window.document.QcEditView[curr_fieldname] != null && window.document.QcEditView[curr_fieldname].value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
  458. {
  459. if (type[1]=="M")
  460. if (!qcemptyCheck(type[2],qcfieldlabel[i],getObj(type[2]).type))
  461. return false
  462. if(typeof(type[3])=="undefined") var currdatechk="OTH"
  463. else var currdatechk=type[3]
  464. if (!qcdateTimeValidate(curr_fieldname,type[2],qcfieldlabel[i],currdatechk))
  465. return false
  466. if (type[4]) {
  467. if (!dateTimeComparison(curr_fieldname,type[2],qcfieldlabel[i],type[5],type[6],type[4]))
  468. return false
  469. }
  470. }
  471. break;
  472. case "D" :
  473. if (window.document.QcEditView[curr_fieldname] != null && window.document.QcEditView[curr_fieldname].value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
  474. {
  475. if(typeof(type[2])=="undefined") var currdatechk="OTH"
  476. else var currdatechk=type[2]
  477. if (!qcdateValidate(curr_fieldname,qcfieldlabel[i],currdatechk))
  478. return false
  479. if (type[3]) {
  480. if (!qcdateComparison(curr_fieldname,qcfieldlabel[i],type[4],type[5],type[3]))
  481. return false
  482. }
  483. }
  484. break;
  485. case "T" :
  486. if (window.document.QcEditView[curr_fieldname] != null && window.document.QcEditView[curr_fieldname].value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
  487. {
  488. if(typeof(type[2])=="undefined") var currtimechk="OTH"
  489. else var currtimechk=type[2]
  490. if (!timeValidate(curr_fieldname,qcfieldlabel[i],currtimechk))
  491. return false
  492. if (type[3]) {
  493. if (!timeComparison(curr_fieldname,qcfieldlabel[i],type[4],type[5],type[3]))
  494. return false
  495. }
  496. }
  497. break;
  498. case "I" :
  499. if (window.document.QcEditView[curr_fieldname] != null && window.document.QcEditView[curr_fieldname].value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
  500. {
  501. if (window.document.QcEditView[curr_fieldname].value.length!=0)
  502. {
  503. if (!qcintValidate(curr_fieldname,qcfieldlabel[i]))
  504. return false
  505. if (type[2]) {
  506. if (!qcnumConstComp(curr_fieldname,qcfieldlabel[i],type[2],type[3]))
  507. return false
  508. }
  509. }
  510. }
  511. break;
  512. case "N" :
  513. case "NN" :
  514. if (window.document.QcEditView[curr_fieldname] != null && window.document.QcEditView[curr_fieldname].value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
  515. {
  516. if (window.document.QcEditView[curr_fieldname].value.length!=0)
  517. {
  518. if (typeof(type[2])=="undefined") var numformat="any"
  519. else var numformat=type[2]
  520. if (type[0]=="NN") {
  521. if (!numValidate(curr_fieldname,qcfieldlabel[i],numformat,true))
  522. return false
  523. } else {
  524. if (!numValidate(curr_fieldname,qcfieldlabel[i],numformat))
  525. return false
  526. }
  527. if (type[3]) {
  528. if (!numConstComp(curr_fieldname,qcfieldlabel[i],type[3],type[4]))
  529. return false
  530. }
  531. }
  532. }
  533. break;
  534. case "E" :
  535. if (window.document.QcEditView[curr_fieldname] != null && window.document.QcEditView[curr_fieldname].value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0)
  536. {
  537. if (window.document.QcEditView[curr_fieldname].value.length!=0)
  538. {
  539. var etype = "EMAIL"
  540. if (!qcpatternValidate(curr_fieldname,qcfieldlabel[i],etype))
  541. return false
  542. }
  543. }
  544. break;
  545. }
  546. }
  547. }
  548. //added to check Start Date & Time,if Activity Status is Planned.//start
  549. for (var j=0; j<qcfieldname.length; j++)
  550. {
  551. curr_fieldname = qcfieldname[j];
  552. if(window.document.QcEditView[curr_fieldname] != null)
  553. {
  554. if(qcfieldname[j] == "date_start")
  555. {
  556. var datelabel = qcfieldlabel[j]
  557. var datefield = qcfieldname[j]
  558. var startdatevalue = window.document.QcEditView[datefield].value.replace(/^\s+/g, '').replace(/\s+$/g, '')
  559. }
  560. if(qcfieldname[j] == "time_start")
  561. {
  562. var timelabel = qcfieldlabel[j]
  563. var timefield = qcfieldname[j]
  564. var timeval=window.document.QcEditView[timefield].value.replace(/^\s+/g, '').replace(/\s+$/g, '')
  565. }
  566. if(qcfieldname[j] == "eventstatus" || qcfieldname[j] == "taskstatus")
  567. {
  568. var statusvalue = window.document.QcEditView[curr_fieldname].options[window.document.QcEditView[curr_fieldname].selectedIndex].value.replace(/^\s+/g, '').replace(/\s+$/g, '')
  569. var statuslabel = qcfieldlabel[j++]
  570. }
  571. }
  572. }
  573. if(statusvalue == "Planned")
  574. {
  575. var dateelements=splitDateVal(startdatevalue)
  576. var hourval=parseInt(timeval.substring(0,timeval.indexOf(":")))
  577. var minval=parseInt(timeval.substring(timeval.indexOf(":")+1,timeval.length))
  578. var dd=dateelements[0]
  579. var mm=dateelements[1]
  580. var yyyy=dateelements[2]
  581. var chkdate=new Date()
  582. chkdate.setYear(yyyy)
  583. chkdate.setMonth(mm-1)
  584. chkdate.setDate(dd)
  585. chkdate.setMinutes(minval)
  586. chkdate.setHours(hourval)
  587. if(!comparestartdate(chkdate)) return false;
  588. }//end
  589. return true;
  590. }
  591. </script>
  592. {/literal}
  593. {* More menu items *}
  594. <div id="allMenu" onmouseout="fnHide_Event('allMenu');" onMouseOver="fnvshNrm('allMenu');" style="z-index: 2147483647;visibility:hidden;display:block;overflow-x:auto;">
  595. <table border=0 cellpadding="0" cellspacing="0" class="allMnuTable" padding="0" style="width:20px;">
  596. <tr>
  597. {foreach name=modulelist key=more item=childmodules from=$MENUSTRUCTURE}
  598. {if $more eq 'more'}
  599. {foreach key = parent item = childs from = $childmodules}
  600. <td valign="top"><table stye="width:20px;">
  601. <tr><th><a class="drop_downnew_parent"> {$APP[$parent]}</a></th></tr>
  602. {foreach key = number item = modules from = $childs}
  603. {assign var="modulelabel" value=$modules[1]|@getTranslatedString:$modules[0]}
  604. <tr><td><a id = "more" name = "{$modulelabel}" href="index.php?module={$modules.0}&action=index" class="drop_downnew">{$modulelabel}</a></td></tr>
  605. {/foreach}
  606. </table></td>
  607. {/foreach}
  608. {/if}
  609. {/foreach}
  610. </tr>
  611. </table>
  612. </div>
  613. <div id="status" style="position:absolute;display:none;left:850px;top:95px;height:27px;white-space:nowrap;"><img src="{'status.gif'|@vtiger_imageurl:$THEME}"></div>
  614. <script>
  615. function openwin()
  616. {ldelim}
  617. window.open("index.php?module=Users&action=about_us","aboutwin","height=520,width=515,top=200,left=300")
  618. {rdelim}
  619. </script>
  620. <div id="tracker" style="display:none;position:absolute;z-index:100000001;" class="layerPopup">
  621. <table border="0" cellpadding="5" cellspacing="0" width="200">
  622. <tr style="cursor:move;">
  623. <td colspan="2" class="mailClientBg small" id="Track_Handle"><strong>{$APP.LBL_LAST_VIEWED}</strong></td>
  624. <td align="right" style="padding:5px;" class="mailClientBg small">
  625. <a href="javascript:;"><img src="{'close.gif'|@vtiger_imageurl:$THEME}" border="0" onClick="fninvsh('tracker')" hspace="5" align="absmiddle"></a>
  626. </td></tr>
  627. </table>
  628. <table border="0" cellpadding="5" cellspacing="0" width="200" class="hdrNameBg">
  629. {foreach name=trackinfo item=trackelements from=$TRACINFO}
  630. <tr>
  631. <td class="trackerListBullet small" align="center" width="12">{$smarty.foreach.trackinfo.iteration}</td>
  632. <td class="trackerList small"> <a href="index.php?module={$trackelements.module_name}&action=DetailView&record={$trackelements.crmid}&parenttab={$CATEGORY}">{$trackelements.item_summary}</a> </td><td class="trackerList small">&nbsp;</td></tr>
  633. {/foreach}
  634. </table>
  635. </div>
  636. <script>
  637. var THandle = document.getElementById("Track_Handle");
  638. var TRoot = document.getElementById("tracker");
  639. Drag.init(THandle, TRoot);
  640. </script>
  641. <!--for admin users-->
  642. <div class="drop_mnu_user" id="ondemand_sub" onmouseout="fnHideDrop('ondemand_sub')" onmouseover="fnShowDrop('ondemand_sub')" >
  643. <table border="0" cellpadding="0" cellspacing="0" border="0" cellpadding="0" cellspacing="0">
  644. <tr><td style="padding-left:0px;padding-right:10px font-weight:bold" nowrap> <a id="_my_preferences_" href="index.php?module=Users&action=DetailView&record={$CURRENT_USER_ID}&modechk=prefview" class="drop_down_usersettings" >{$APP.LBL_MY_PREFERENCES}</a></td></tr>
  645. <tr><td style="padding-left:0px;padding-right:10px font-weight:bold" nowrap><a class="drop_down_usersettings" href="index.php?module=Ondemand&amp;action=index&amp;mode=Profile">Profile</a></td></tr>
  646. <tr><td style="padding-left:0px;padding-right:10px font-weight:bold" nowrap> <a href="index.php?module=Users&action=Logout" class="drop_down_usersettings" >{$APP.LBL_LOGOUT}</a> </td></tr>
  647. </table>
  648. </div>
  649. <div id="usersettings" class="drop_mnu_user" onmouseout="fnHideDrop('usersettings');" onmouseover="fnvshNrm('usersettings');" style="width:110px;left:1226px;">
  650. <table border=0 width="100%" border="0" cellpadding="0" cellspacing="0" >
  651. <tr >
  652. <td style="padding-left:0px;padding-right:10px font-weight:bold" nowrap> <a href="http://www.vtiger.com/resources/help/" target="_blank" class="drop_down_usersettings">{$APP.LNK_HELP}</a> </td>
  653. </tr>
  654. </table>
  655. </div>
  656. <div id="mainsettings" class="drop_mnu_user" onmouseout="fnHideDrop('mainsettings');" onmouseover="fnvshNrm('mainsettings');" style="width:110px;left:1226px;" >
  657. <table border=0 width="100%" border="0" cellpadding="0" cellspacing="0" >
  658. {foreach key=maintabs item=detail from=$HEADERS}
  659. {if $maintabs eq "Settings"}
  660. <tr><td style="padding-left:0px;padding-right:10px font-weight:bold" nowrap><a href="index.php?module={$detail[0]}&action=index&parenttab=" class="drop_down_usersettings">{'LBL_CRM_SETTINGS'|@getTranslatedString:$MODULE_NAME}</a></td></tr>
  661. {/if}
  662. {/foreach}
  663. {foreach item=ONDEMANDLINK from=$ONDEMANDLINKS}
  664. {assign var="headerlink_href" value=$ONDEMANDLINK->linkurl}
  665. {assign var="headerlink_label" value=$ONDEMANDLINK->linklabel}
  666. {if $headerlink_label eq ''}
  667. {assign var="headerlink_label" value=$headerlink_href}
  668. {else}
  669. {* Pickup the translated label provided by the module *}
  670. {assign var="headerlink_label" value=$headerlink_label|@getTranslatedString:$ONDEMANDLINK->module()}
  671. {/if}
  672. {if $headerlink_label neq 'Profile' && $headerlink_label neq 'Plugin Setup'}
  673. <tr><td><a href="{$headerlink_href}" class="drop_down_usersettings">{$headerlink_label|@getTranslatedString:$MODULE_NAME}</a></td></tr>
  674. {/if}
  675. {/foreach}
  676. </table>
  677. </div>
  678. <!-- vtiger Feedback -->
  679. <script type="text/javascript">
  680. {literal}
  681. function vtiger_feedback() {
  682. window.open("http://vtiger.com/products/crm/od-feedback.php?uid={/literal}{php}global $application_unique_key; echo $application_unique_key;{/php}&version={php}global $vtiger_current_version; echo $vtiger_current_version;{/php}&email={$CURRENT_USER_MAIL}{literal}","feedbackwin","height=300,width=515,top=200,left=300")
  683. }
  684. {/literal}
  685. </script>
  686. <script type="text/javascript">
  687. {literal}
  688. function vtiger_news(obj) {
  689. $('status').style.display = 'inline';
  690. new Ajax.Request(
  691. 'index.php',
  692. {queue: {position: 'end', scope: 'command'},
  693. method: 'post',
  694. postBody: 'module=Home&action=HomeAjax&file=HomeNews',
  695. onComplete: function(response) {
  696. $("vtigerNewsPopupLay").innerHTML=response.responseText;
  697. fnvshobj(obj, 'vtigerNewsPopupLay');
  698. $('status').style.display = 'none';
  699. }
  700. }
  701. );
  702. }
  703. {/literal}
  704. </script>
  705. <div class="lvtCol fixedLay1" id="vtigerNewsPopupLay" style="display: none; height: 250px; bottom: 2px; padding: 2px; z-index: 12; font-weight: normal;" align="left">
  706. </div>
  707. <!-- END -->
  708. <!-- ActivityReminder Customization for callback -->
  709. <div class="lvtCol fixedLay1" id="ActivityRemindercallback" style="border: 0; right: 0px; bottom: 2px; display:none; padding: 2px; z-index: 10; font-weight: normal;" align="left">
  710. </div>
  711. <!-- End -->
  712. <!-- divs for asterisk integration -->
  713. <div class="lvtCol fixedLay1" id="notificationDiv" style="float: right; padding-right: 5px; overflow: hidden; border-style: solid; right: 0px; border-color: rgb(141, 141, 141); bottom: 0px; display: none; padding: 2px; z-index: 10; font-weight: normal;" align="left">
  714. </div>
  715. <div id="OutgoingCall" style="display: none;position: absolute;z-index:200;" class="layerPopup">
  716. <table border='0' cellpadding='5' cellspacing='0' width='100%'>
  717. <tr style='cursor:move;' >
  718. <td class='mailClientBg small' id='outgoing_handle'>
  719. <b>{$APP.LBL_OUTGOING_CALL}</b>
  720. </td>
  721. </tr>
  722. </table>
  723. <table border='0' cellpadding='0' cellspacing='0' width='100%' class='hdrNameBg'>
  724. </tr>
  725. <tr><td style='padding:10px;' colspan='2'>
  726. {$APP.LBL_OUTGOING_CALL_MESSAGE}
  727. </td></tr>
  728. </table>
  729. </div>
  730. <!-- divs for asterisk integration :: end-->
  731. <script type="text/javascript">
  732. {literal}
  733. jQuery(document).ready(function(){
  734. jQuery('#switchLook').click(function(e){
  735. var currentHref = window.location.href;
  736. var splittedArr = currentHref.split('/');
  737. var length = splittedArr.length;
  738. var afterSlice = splittedArr.slice(0,length-1);
  739. var switchLocation = currentHref.split('?');
  740. var newUrl = switchLocation[1].split('&');
  741. for(var i=0; i<newUrl.length; i++){
  742. var value = newUrl[i].split('=');
  743. if(value[0] == 'module'){
  744. var module = value[1];
  745. if(module == 'Settings' || module == 'Rss' || module == 'Integration'
  746. || module == 'Portal' || module == 'PBXManager' || module == 'Dashboard')
  747. module = 'Home';
  748. }else if(value[0] == 'action'){
  749. var action = value[1];
  750. if(action == 'DetailView' || action == 'SaveAndRun'){
  751. action = 'Detail';
  752. }else if(action == 'index' || action == 'ListView'){
  753. action = 'List';
  754. }else if(action == 'EditView'){
  755. action = 'Edit';
  756. }
  757. }else if(value[0] == 'record' && value[1] != ''){
  758. var record = value[1];
  759. }
  760. }
  761. if(module == 'Home')
  762. action = 'DashBoard';
  763. afterSlice.push('vtiger6');
  764. if(record != undefined)
  765. afterSlice.push('index.php?module='+module+'&view='+action+'&record='+record);
  766. else
  767. afterSlice.push('index.php?module='+module+'&view='+action);
  768. window.location.href = afterSlice.join('/');
  769. e.preventDefault();
  770. });
  771. });
  772. {/literal}
  773. </script>