PageRenderTime 50ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 1ms

/Popup.php

https://bitbucket.org/yousef_fadila/vtiger
PHP | 442 lines | 378 code | 36 blank | 28 comment | 140 complexity | 83158258bf87accef04ad6a989dd28df MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0
  1. <?php
  2. /*********************************************************************************
  3. * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
  4. * ("License"); You may not use this file except in compliance with the
  5. * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
  6. * Software distributed under the License is distributed on an "AS IS" basis,
  7. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
  8. * the specific language governing rights and limitations under the License.
  9. * The Original Code is: SugarCRM Open Source
  10. * The Initial Developer of the Original Code is SugarCRM, Inc.
  11. * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
  12. * All Rights Reserved.
  13. * Contributor(s): ______________________________________.
  14. ********************************************************************************/
  15. require_once('Smarty_setup.php');
  16. require_once("data/Tracker.php");
  17. require_once('include/logging.php');
  18. require_once('include/ListView/ListView.php');
  19. require_once('include/utils/utils.php');
  20. global $app_strings, $default_charset;
  21. global $currentModule, $current_user;
  22. global $theme, $adb;
  23. $url_string = '';
  24. $smarty = new vtigerCRM_Smarty;
  25. if (!isset($where)) $where = "";
  26. $parent_tab=getParentTab();
  27. $smarty->assign("CATEGORY",$parent_tab);
  28. $url = '';
  29. $popuptype = '';
  30. $popuptype = vtlib_purify($_REQUEST["popuptype"]);
  31. $theme_path="themes/".$theme."/";
  32. $image_path=$theme_path."images/";
  33. $smarty->assign("MOD", $mod_strings);
  34. $smarty->assign("APP", $app_strings);
  35. $smarty->assign("THEME", $theme);
  36. $smarty->assign("THEME_PATH",$theme_path);
  37. $smarty->assign("MODULE",$currentModule);
  38. $form = vtlib_purify($_REQUEST['form']);
  39. //added to get relatedto field value for todo, while selecting from the popup list, after done the alphabet or basic search.
  40. if(isset($_REQUEST['maintab']) && $_REQUEST['maintab'] != '')
  41. {
  42. $act_tab = vtlib_purify($_REQUEST['maintab']);
  43. $url = "&maintab=".$act_tab;
  44. }
  45. $smarty->assign("MAINTAB",$act_tab);
  46. // This is added to support the type of popup and callback
  47. if(isset($_REQUEST['popupmode']) && isset($_REQUEST['callback'])) {
  48. $url = "&popupmode=".$_REQUEST['popupmode']."&callback=".$_REQUEST['callback'];
  49. $smarty->assign("POPUPMODE", $_REQUEST['popupmode']);
  50. $smarty->assign("CALLBACK", $_REQUEST['callback']);
  51. }
  52. switch($currentModule)
  53. {
  54. case 'Contacts':
  55. require_once("modules/$currentModule/Contacts.php");
  56. $focus = new Contacts();
  57. $log = LoggerManager::getLogger('contact_list');
  58. $smarty->assign("SINGLE_MOD",'Contact');
  59. if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
  60. $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module']));
  61. else
  62. $smarty->assign("RETURN_MODULE",'Emails');
  63. if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable');
  64. $alphabetical = AlphabeticalSearch($currentModule,'Popup','lastname','true','basic',$popuptype,"","",$url);
  65. break;
  66. case 'Campaigns':
  67. require_once("modules/$currentModule/Campaigns.php");
  68. $focus = new Campaigns();
  69. $log = LoggerManager::getLogger('campaign_list');
  70. $smarty->assign("SINGLE_MOD",'Campaign');
  71. if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
  72. $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module']));
  73. if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable');
  74. $alphabetical = AlphabeticalSearch($currentModule,'Popup','campaignname','true','basic',$popuptype,"","",$url);
  75. break;
  76. case 'Accounts':
  77. require_once("modules/$currentModule/Accounts.php");
  78. $focus = new Accounts();
  79. $log = LoggerManager::getLogger('account_list');
  80. if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable');
  81. $smarty->assign("SINGLE_MOD",'Account');
  82. if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
  83. $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module']));
  84. else
  85. $smarty->assign("RETURN_MODULE",'Emails');
  86. $alphabetical = AlphabeticalSearch($currentModule,'Popup','accountname','true','basic',$popuptype,"","",$url);
  87. break;
  88. case 'Leads':
  89. require_once("modules/$currentModule/Leads.php");
  90. $focus = new Leads();
  91. $log = LoggerManager::getLogger('contact_list');
  92. $smarty->assign("SINGLE_MOD",'Lead');
  93. if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable');
  94. if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
  95. $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module']));
  96. else
  97. $smarty->assign("RETURN_MODULE",'Emails');
  98. $alphabetical = AlphabeticalSearch($currentModule,'Popup','lastname','true','basic',$popuptype,"","",$url);
  99. break;
  100. case 'Potentials':
  101. require_once("modules/$currentModule/Potentials.php");
  102. $focus = new Potentials();
  103. $log = LoggerManager::getLogger('potential_list');
  104. if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable');
  105. $smarty->assign("SINGLE_MOD",'Opportunity');
  106. if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
  107. $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module']));
  108. $alphabetical = AlphabeticalSearch($currentModule,'Popup','potentialname','true','basic',$popuptype,"","",$url);
  109. break;
  110. case 'Quotes':
  111. require_once("modules/$currentModule/Quotes.php");
  112. $focus = new Quotes();
  113. $log = LoggerManager::getLogger('quotes_list');
  114. $smarty->assign("SINGLE_MOD",'Quote');
  115. $alphabetical = AlphabeticalSearch($currentModule,'Popup','subject','true','basic',$popuptype,"","",$url);
  116. break;
  117. case 'Invoice':
  118. require_once("modules/$currentModule/Invoice.php");
  119. $focus = new Invoice();
  120. $smarty->assign("SINGLE_MOD",'Invoice');
  121. if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
  122. $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module']));
  123. $alphabetical = AlphabeticalSearch($currentModule,'Popup','subject','true','basic',$popuptype,"","",$url);
  124. break;
  125. case 'Products':
  126. require_once("modules/$currentModule/$currentModule.php");
  127. $focus = new $currentModule();
  128. $smarty->assign("SINGLE_MOD",getTranslatedString('SINGLE_'.$currentModule));
  129. if(isset($_REQUEST['curr_row']))
  130. {
  131. $curr_row = vtlib_purify($_REQUEST['curr_row']);
  132. $smarty->assign("CURR_ROW", $curr_row);
  133. $url_string .="&curr_row=".vtlib_purify($_REQUEST['curr_row']);
  134. }
  135. if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
  136. $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module']));
  137. if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable');
  138. $alphabetical = AlphabeticalSearch($currentModule,'Popup','productname','true','basic',$popuptype,"","",$url);
  139. break;
  140. case 'Vendors':
  141. require_once("modules/$currentModule/Vendors.php");
  142. $focus = new Vendors();
  143. $smarty->assign("SINGLE_MOD",'Vendor');
  144. $alphabetical = AlphabeticalSearch($currentModule,'Popup','vendorname','true','basic',$popuptype,"","",$url);
  145. break;
  146. case 'SalesOrder':
  147. require_once("modules/$currentModule/SalesOrder.php");
  148. $focus = new SalesOrder();
  149. $smarty->assign("SINGLE_MOD",'SalesOrder');
  150. if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
  151. $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module']));
  152. $alphabetical = AlphabeticalSearch($currentModule,'Popup','subject','true','basic',$popuptype,"","",$url);
  153. break;
  154. case 'PurchaseOrder':
  155. require_once("modules/$currentModule/PurchaseOrder.php");
  156. $focus = new PurchaseOrder();
  157. $smarty->assign("SINGLE_MOD",'PurchaseOrder');
  158. if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
  159. $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module']));
  160. $alphabetical = AlphabeticalSearch($currentModule,'Popup','subject','true','basic',$popuptype,"","",$url);
  161. break;
  162. case 'PriceBooks':
  163. require_once("modules/$currentModule/PriceBooks.php");
  164. $focus = new PriceBooks();
  165. $smarty->assign("SINGLE_MOD",'PriceBook');
  166. if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
  167. $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module']));
  168. if(isset($_REQUEST['fldname']) && $_REQUEST['fldname'] !='')
  169. {
  170. $smarty->assign("FIELDNAME",vtlib_purify($_REQUEST['fldname']));
  171. $url_string .="&fldname=".vtlib_purify($_REQUEST['fldname']);
  172. }
  173. if(isset($_REQUEST['productid']) && $_REQUEST['productid'] !='')
  174. {
  175. $smarty->assign("PRODUCTID",vtlib_purify($_REQUEST['productid']));
  176. $url_string .="&productid=".vtlib_purify($_REQUEST['productid']);
  177. }
  178. $alphabetical = AlphabeticalSearch($currentModule,'Popup','bookname','true','basic',$popuptype,"","",$url);
  179. break;
  180. case 'Users':
  181. require_once("modules/$currentModule/Users.php");
  182. $focus = new Users();
  183. $smarty->assign("SINGLE_MOD",'Users');
  184. if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
  185. $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module']));
  186. $alphabetical = AlphabeticalSearch($currentModule,'Popup','user_name','true','basic',$popuptype,"","",$url);
  187. if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable');
  188. break;
  189. case 'HelpDesk':
  190. require_once("modules/$currentModule/HelpDesk.php");
  191. $focus = new HelpDesk();
  192. $smarty->assign("SINGLE_MOD",'HelpDesk');
  193. if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
  194. $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module']));
  195. $alphabetical = AlphabeticalSearch($currentModule,'Popup','ticket_title','true','basic',$popuptype,"","",$url);
  196. if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable');
  197. break;
  198. case 'Documents':
  199. require_once("modules/$currentModule/Documents.php");
  200. $focus = new Documents();
  201. $smarty->assign("SINGLE_MOD",'Document');
  202. if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
  203. $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module']));
  204. else
  205. $smarty->assign("RETURN_MODULE",'Emails');
  206. if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable');
  207. $alphabetical = AlphabeticalSearch($currentModule,'Popup','notes_title','true','basic',$popuptype,"","",$url);
  208. break;
  209. // Special case handling (for curr_row value) for Services module
  210. case 'Services':
  211. if(isset($_REQUEST['curr_row']))
  212. {
  213. $curr_row = vtlib_purify($_REQUEST['curr_row']);
  214. $smarty->assign("CURR_ROW", $curr_row);
  215. $url_string .="&curr_row=".vtlib_purify($_REQUEST['curr_row']);
  216. }
  217. // vtlib customization: Generic hook for Popup selection
  218. default:
  219. require_once("modules/$currentModule/$currentModule.php");
  220. $focus = new $currentModule();
  221. $smarty->assign("SINGLE_MOD", $currentModule);
  222. if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
  223. $smarty->assign("RETURN_MODULE",vtlib_purify($_REQUEST['return_module']));
  224. $alphabetical = AlphabeticalSearch($currentModule,'Popup',$focus->def_basicsearch_col,'true','basic',$popuptype,"","",$url);
  225. if (isset($_REQUEST['select'])) $smarty->assign("SELECT",'enable');
  226. break;
  227. // END
  228. }
  229. // vtlib customization: Initialize focus to get generic popup
  230. if($_REQUEST['form'] == 'vtlibPopupView') {
  231. vtlib_setup_modulevars($currentModule, $focus);
  232. }
  233. // END
  234. $smarty->assign("RETURN_ACTION",vtlib_purify($_REQUEST['return_action']));
  235. //Retreive the list from Database
  236. if($currentModule == 'PriceBooks')
  237. {
  238. $productid=$_REQUEST['productid'];
  239. $currency_id=$_REQUEST['currencyid'];
  240. if($currency_id == null) $currency_id = fetchCurrency($current_user->id);
  241. $query = 'select vtiger_pricebook.*, vtiger_pricebookproductrel.productid, vtiger_pricebookproductrel.listprice, ' .
  242. 'vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime ' .
  243. 'from vtiger_pricebook inner join vtiger_pricebookproductrel on vtiger_pricebookproductrel.pricebookid = vtiger_pricebook.pricebookid ' .
  244. 'inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_pricebook.pricebookid ' .
  245. 'where vtiger_pricebookproductrel.productid='.$adb->sql_escape_string($productid).' and vtiger_crmentity.deleted=0 ' .
  246. 'and vtiger_pricebook.currency_id='.$adb->sql_escape_string($currency_id).' and vtiger_pricebook.active=1';
  247. }
  248. else
  249. {
  250. if(isset($_REQUEST['recordid']) && $_REQUEST['recordid'] != '')
  251. {
  252. $smarty->assign("RECORDID",vtlib_purify($_REQUEST['recordid']));
  253. $url_string .='&recordid='.vtlib_purify($_REQUEST['recordid']);
  254. $where_relquery = getRelCheckquery($currentModule,$_REQUEST['return_module'],$_REQUEST['recordid']);
  255. }
  256. if(isset($_REQUEST['relmod_id']) || isset($_REQUEST['fromPotential']))
  257. {
  258. if($_REQUEST['relmod_id'] !='')
  259. {
  260. $mod = vtlib_purify($_REQUEST['parent_module']);
  261. $id = vtlib_purify($_REQUEST['relmod_id']);
  262. }
  263. else if($_REQUEST['fromPotential'] != '')
  264. {
  265. $mod = "Accounts";
  266. $id= vtlib_purify($_REQUEST['acc_id']);
  267. }
  268. $smarty->assign("mod_var_name", "parent_module");
  269. $smarty->assign("mod_var_value", $mod);
  270. $smarty->assign("recid_var_name", "relmod_id");
  271. $smarty->assign("recid_var_value",$id);
  272. $where_relquery.= getPopupCheckquery($currentModule,$mod,$id);
  273. }
  274. else if(isset($_REQUEST['task_relmod_id']))
  275. {
  276. $smarty->assign("mod_var_name", "task_parent_module");
  277. $smarty->assign("mod_var_value", vtlib_purify($_REQUEST['task_parent_module']));
  278. $smarty->assign("recid_var_name", "task_relmod_id");
  279. $smarty->assign("recid_var_value",vtlib_purify($_REQUEST['task_relmod_id']));
  280. $where_relquery.= getPopupCheckquery($currentModule,$_REQUEST['task_parent_module'],$_REQUEST['task_relmod_id']);
  281. }
  282. if($currentModule == 'Products' && !$_REQUEST['record_id'] && ($popuptype == 'inventory_prod' || $popuptype == 'inventory_prod_po'))
  283. $where_relquery .=" and vtiger_products.discontinued <> 0 AND (vtiger_products.productid NOT IN (SELECT crmid FROM vtiger_seproductsrel WHERE setype='Products'))";
  284. elseif($currentModule == 'Products' && $_REQUEST['record_id'] && ($popuptype == 'inventory_prod' || $popuptype == 'inventory_prod_po'))
  285. $where_relquery .=" and vtiger_products.discontinued <> 0 AND (vtiger_products.productid IN (SELECT crmid FROM vtiger_seproductsrel WHERE setype='Products' AND productid=".$adb->sql_escape_string($_REQUEST['record_id'])."))";
  286. elseif($currentModule == 'Products' && $_REQUEST['return_module'] != 'Products')
  287. $where_relquery .=" and vtiger_products.discontinued <> 0";
  288. if($_REQUEST['return_module'] == 'Products' && $currentModule == 'Products' && $_REQUEST['recordid'])
  289. $where_relquery .=" and vtiger_products.discontinued <> 0 AND (vtiger_crmentity.crmid NOT IN (".$adb->sql_escape_string($_REQUEST['recordid']).") AND vtiger_crmentity.crmid NOT IN (SELECT productid FROM vtiger_seproductsrel WHERE setype='Products') AND vtiger_crmentity.crmid NOT IN (SELECT crmid FROM vtiger_seproductsrel WHERE setype='Products' AND productid=".$adb->sql_escape_string($_REQUEST['recordid'])."))";
  290. if($currentModule == 'Services' && $popuptype == 'inventory_service') {
  291. $where_relquery .=" and vtiger_service.discontinued <> 0";
  292. }
  293. //Avoiding Current Record to show up in the popups When editing.
  294. if($currentModule == 'Accounts' && $_REQUEST['recordid']!=''){
  295. $where_relquery .=" and vtiger_account.accountid!=".$adb->sql_escape_string($_REQUEST['recordid']);
  296. $smarty->assign("RECORDID",vtlib_purify($_REQUEST['recordid']));
  297. }
  298. if($currentModule == 'Contacts' && $_REQUEST['recordid']!=''){
  299. $where_relquery .=" and vtiger_contactdetails.contactid!=".$adb->sql_escape_string($_REQUEST['recordid']);
  300. $smarty->assign("RECORDID",vtlib_purify($_REQUEST['recordid']));
  301. }
  302. if($currentModule == 'Users' && $_REQUEST['recordid']!=''){
  303. $where_relquery .=" and vtiger_users.id!=".$adb->sql_escape_string($_REQUEST['recordid']);
  304. $smarty->assign("RECORDID",vtlib_purify($_REQUEST['recordid']));
  305. }
  306. $query = getListQuery($currentModule,$where_relquery);
  307. }
  308. if($currentModule == 'Products' && $_REQUEST['record_id'] && ($popuptype == 'inventory_prod' || $popuptype == 'inventory_prod_po'))
  309. {
  310. $product_name = getProductName($_REQUEST['record_id']);
  311. $smarty->assign("PRODUCT_NAME", $product_name);
  312. $smarty->assign("RECORD_ID", vtlib_purify($_REQUEST['record_id']));
  313. }
  314. $listview_header_search=getSearchListHeaderValues($focus,"$currentModule",$url_string,$sorder,$order_by);
  315. $smarty->assign("SEARCHLISTHEADER", $listview_header_search);
  316. $smarty->assign("ALPHABETICAL", $alphabetical);
  317. if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
  318. {
  319. list($where, $ustring) = split("#@@#",getWhereCondition($currentModule));
  320. $url_string .="&query=true".$ustring;
  321. }
  322. if(isset($where) && $where != '')
  323. {
  324. $query .= ' and '.$where;
  325. }
  326. //Added to fix the issue #2307
  327. $order_by = $focus->getOrderBy();
  328. $sorder = $focus->getSortOrder();
  329. if(isset($order_by) && $order_by != '')
  330. {
  331. $query .= ' ORDER BY '.$order_by.' '.$sorder;
  332. }
  333. // vtlib customization: To override module specific popup query for a given field
  334. $override_query = false;
  335. if(method_exists($focus, 'getQueryByModuleField')) {
  336. $override_query = $focus->getQueryByModuleField(vtlib_purify($_REQUEST['srcmodule']), vtlib_purify($_REQUEST['forfield']), vtlib_purify($_REQUEST['forrecord']), $query);
  337. if($override_query) {
  338. $query = $override_query;
  339. }
  340. }
  341. // END
  342. if(PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true){
  343. $count_result = $adb->query( mkCountQuery( $query));
  344. $noofrows = $adb->query_result($count_result,0,"count");
  345. }else{
  346. $noofrows = null;
  347. }
  348. //Retreiving the start value from request
  349. if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
  350. $start = vtlib_purify($_REQUEST['start']);
  351. if($start == 'last'){
  352. $count_result = $adb->query( mkCountQuery($query));
  353. $noofrows = $adb->query_result($count_result,0,"count");
  354. if($noofrows > 0){
  355. $start = ceil($noofrows/$list_max_entries_per_page);
  356. }
  357. }
  358. if(!is_numeric($start)){
  359. $start = 1;
  360. }elseif($start < 1){
  361. $start = 1;
  362. }
  363. $start = ceil($start);
  364. } else {
  365. $start = 1;
  366. }
  367. $limstart=($start-1)*$list_max_entries_per_page;
  368. $query.=" LIMIT $limstart,$list_max_entries_per_page";
  369. $list_result = $adb->query($query);
  370. //Retreive the Navigation array
  371. $navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page,$noofrows);
  372. //Retreive the List View Table Header
  373. $focus->initSortbyField($currentModule);
  374. $focus->list_mode="search";
  375. $focus->popup_type=$popuptype;
  376. $url_string .='&popuptype='.$popuptype;
  377. if(isset($_REQUEST['select']) && $_REQUEST['select'] == 'enable')
  378. $url_string .='&select=enable';
  379. if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != '')
  380. $url_string .='&return_module='.vtlib_purify($_REQUEST['return_module']);
  381. if($popuptype == 'set_return_emails'){
  382. $tabid = getTabid($currentModule);
  383. $mail_arr = getMailFields($tabid);
  384. if(!empty($mail_arr)){
  385. $tablename = str_replace("vtiger_","",$mail_arr['tablename']);
  386. $fieldname = $mail_arr['fieldname'];
  387. $fieldlabel = $mail_arr['fieldlabel'];
  388. $focus->search_fields[$fieldlabel] = Array($tablename=>$fieldname);
  389. $focus->search_fields_name[$fieldlabel] = $fieldname;
  390. }
  391. }
  392. $listview_header = getSearchListViewHeader($focus,"$currentModule",$url_string,$sorder,$order_by);
  393. $smarty->assign("LISTHEADER", $listview_header);
  394. $smarty->assign("HEADERCOUNT",count($listview_header)+1);
  395. $listview_entries = getSearchListViewEntries($focus,"$currentModule",$list_result,$navigation_array,$form);
  396. $smarty->assign("LISTENTITY", $listview_entries);
  397. $navigationOutput = getTableHeaderSimpleNavigation($navigation_array, $url_string,$currentModule,"Popup");
  398. $smarty->assign("NAVIGATION", $navigationOutput);
  399. $smarty->assign("RECORD_COUNTS", $record_string);
  400. $smarty->assign("POPUPTYPE", $popuptype);
  401. $smarty->assign("PARENT_MODULE", vtlib_purify($_REQUEST['parent_module']));
  402. if(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '')
  403. $smarty->display("PopupContents.tpl");
  404. else
  405. $smarty->display("Popup.tpl");
  406. ?>