PageRenderTime 46ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/includes/deprecated_functions.php

https://github.com/web2project/web2project
PHP | 774 lines | 438 code | 154 blank | 182 comment | 20 complexity | f1b3aaccef49455017c5a58dfde3ff32 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. /**
  3. * This file exists in order to identify individual functions which will be
  4. * deprecated in coming releases. In the documentation for each function,
  5. * you must describe two things:
  6. *
  7. * * the specific version of web2project where the behavior will change; and
  8. * * a reference to the new/proper way of performing the same functionality.
  9. *
  10. * During Minor releases, this file will grow only to shrink as Major releases
  11. * allow us to delete functions.
  12. *
  13. * WARNING: This file does not identify class-level method deprecations.
  14. * In order to find those, you'll have to explore the individual classes.
  15. */
  16. /**
  17. * Corrects the charset name if needed be
  18. * TODO: Remove for v4.0 - dkc 08 May 2011
  19. *
  20. * @deprecated
  21. */
  22. function w2PcheckCharset()
  23. {
  24. trigger_error("The w2PcheckCharset function has been deprecated and will be removed in v4.0.", E_USER_NOTICE );
  25. return 'utf-8';
  26. }
  27. /**
  28. * Convert string char (ref : Vbulletin #3987)
  29. * TODO: Remove for v4.0 - caseydk 20 September 2012
  30. *
  31. * @deprecated
  32. */
  33. function strJpGraph($text)
  34. {
  35. global $locale_char_set;
  36. trigger_error("The strJpGraph function has been deprecated and will be removed in v4.0.", E_USER_NOTICE );
  37. if ( $locale_char_set=='utf-8' && function_exists("utf8_decode") ) {
  38. return utf8_decode($text);
  39. } else {
  40. return $text;
  41. }
  42. }
  43. /**
  44. * Casts the $a parameter to an integer
  45. * TODO: Remove for v4.0 - caseydk 26 August 2011
  46. *
  47. * @deprecated
  48. */
  49. function atoi($a)
  50. {
  51. trigger_error("The atoi function has been deprecated and will be removed in v4.0. Please use (int) instead.", E_USER_NOTICE );
  52. return $a + 0;
  53. }
  54. /**
  55. * This was used to check if a $link was a URL. Since some users use local
  56. * network resources, this was failing miserably and making our lives difficult.
  57. * TODO: Remove for v4.0 - caseydk 01 September 2011
  58. *
  59. * @deprecated
  60. */
  61. function w2p_check_url()
  62. {
  63. trigger_error("The w2p_check_url function has been deprecated and will be removed in v4.0. There is no replacement.", E_USER_NOTICE );
  64. return true;
  65. }
  66. /**
  67. * This was used to remove zero length strings from the contacts array in
  68. * modules/public/contact_selector.php but can be replaced with array_filter.
  69. * TODO: Remove for v4.0 - caseydk 28 December 2011
  70. *
  71. * @deprecated
  72. *
  73. */
  74. function remove_invalid($arr)
  75. {
  76. trigger_error("The remove_invalid function has been deprecated and will be removed in v4.0. Please use array_filter instead.", E_USER_NOTICE );
  77. return array_filter($arr);
  78. }
  79. /**
  80. * This was a recursive function to generate the task list tree used in the
  81. * Project Designer module. It was the exact duplciate of the findchild_pr,
  82. * so this version has been deprecated.
  83. * Original location: modules/projectdesigner/projectdesigner.class.php
  84. * TODO: Remove for v4.0 - caseydk 21 March 2012
  85. *
  86. * @deprecated
  87. *
  88. */
  89. function findchild_pr(&$tarr, $parent, $level = 0)
  90. {
  91. trigger_error("The findchild_pr function has been deprecated and will be removed in v4.0. Please use findchild_new instead.", E_USER_NOTICE );
  92. findchild_new($tarr, $parent, $level = 0);
  93. }
  94. /**
  95. * This was a function that simply did a str_repeat.. no clue why it didn't
  96. * just use the regular str_repeat.
  97. * TODO: Remove for v4.0 - caseydk 22 March 2012
  98. *
  99. * @deprecated
  100. */
  101. // from modules/tasks/addedit.php and modules/projectdesigners/vw_actions.php
  102. function getSpaces($amount)
  103. {
  104. trigger_error("The getSpaces function has been deprecated and will be removed in v4.0. Please use str_repeat instead.", E_USER_NOTICE );
  105. return str_repeat('&nbsp;', $amount);
  106. }
  107. /**
  108. * This was used to retrieve and display the child departments starting from
  109. * any ancestor. More importantly, it displays the relationship visually
  110. * with little icons. There are a couple other variations of this function.
  111. * TODO: Remove for v4.0 - caseydk 13 Feb 2012
  112. *
  113. * @deprecated
  114. */
  115. // From: modules/companies/vw_depts.php
  116. function findchilddept_comp(&$tarr, $parent, $level = 0)
  117. {
  118. trigger_error("The findchilddept_comp function has been deprecated and will be removed in v4.0. There is no replacement.", E_USER_NOTICE );
  119. $level++;
  120. $n = count($tarr);
  121. for ($x = 0; $x < $n; $x++) {
  122. if ($tarr[$x]['dept_parent'] == $parent && $tarr[$x]['dept_parent'] != $tarr[$x]['dept_id']) {
  123. echo showchilddept_comp($tarr[$x], $level);
  124. findchilddept_comp($tarr, $tarr[$x]['dept_id'], $level);
  125. }
  126. }
  127. }
  128. /**
  129. * This was used to display the child departments one row at a time. More
  130. * importantly, it displays the relationship visually with little icons.
  131. * There are a couple other variations of this function.
  132. * TODO: Remove for v4.0 - caseydk 13 Feb 2012
  133. *
  134. * @deprecated
  135. */
  136. // From: modules/companies/vw_depts.php
  137. function showchilddept_comp(&$a, $level = 0)
  138. {
  139. trigger_error("The showchilddept_comp function has been deprecated and will be removed in v4.0. There is no replacement.", E_USER_NOTICE );
  140. global $AppUI;
  141. $s = '
  142. <td>
  143. <a href="./index.php?m=departments&amp;a=addedit&amp;dept_id=' . $a["dept_id"] . '" title="' . $AppUI->_('edit') . '">
  144. ' . w2PshowImage('icons/stock_edit-16.png', 16, 16, '') . '
  145. </td>
  146. <td>';
  147. for ($y = 0; $y < $level; $y++) {
  148. if ($y + 1 == $level) {
  149. $s .= '<img src="' . w2PfindImage('corner-dots.gif') . '" width="16" height="12" border="0" alt="">';
  150. } else {
  151. $s .= '<img src="' . w2PfindImage('shim.gif') . '" width="16" height="12" border="0" alt="">';
  152. }
  153. }
  154. $s .= '<a href="./index.php?m=departments&a=view&dept_id=' . $a['dept_id'] . '">' . $a['dept_name'] . '</a>';
  155. $s .= '</td>';
  156. $s .= '<td align="center">' . ($a['dept_users'] ? $a['dept_users'] : '') . '</td>';
  157. return '<tr>' . $s . '</tr>';
  158. }
  159. /**
  160. * This was used to designate if a task was on not started, late, on time, or
  161. * some other combination thereof.
  162. * TODO: Remove for v4.0 - caseydk 04 Mar 2012
  163. *
  164. * @deprecated
  165. */
  166. function taskstyle_pd($task)
  167. {
  168. trigger_error("The taskstyle_pd function has been deprecated and will be removed in v4.0. Use w2pFindTaskComplete() instead.", E_USER_NOTICE );
  169. $style = w2pFindTaskComplete($task['task_start_date'], $task['task_end_date'], $task['task_percent_complete']);
  170. switch ($style) {
  171. case 'done':
  172. case 'late':
  173. case 'notstarted':
  174. $style = 'task_'.$style;
  175. break;
  176. case 'active':
  177. $style = 'task_started';
  178. break;
  179. default:
  180. $style = 'task_future';
  181. break;
  182. }
  183. }
  184. /**
  185. * TODO: Remove for v4.0 - caseydk 20 September 2012
  186. *
  187. * @deprecated
  188. */
  189. function getStructuredProjects($original_project_id = 0, $project_status = -1, $active_only = false)
  190. {
  191. trigger_error("getStructuredProjects has been deprecated in v3.0 and will be removed in v4.0. Please use CProject->getStructuredProjects() instead.", E_USER_NOTICE);
  192. $project = new CProject();
  193. $project->project_original_parent = $original_project_id;
  194. $project->project_status = $project_status;
  195. return $project->getStructuredProjects($active_only);
  196. }
  197. /**
  198. * Deprecated in favor of buildTaskTree which doesn't use any globals.
  199. * TODO: Remove for v4.0 - caseydk 20 September 2012
  200. *
  201. * @deprecated
  202. */
  203. function constructTaskTree($task_data, $depth = 0)
  204. {
  205. global $projTasks, $all_tasks, $parents, $task_parent, $task_id;
  206. trigger_error("The constructTaskTree function has been deprecated and will be removed in v4.0. Use buildTaskTree() instead.", E_USER_NOTICE );
  207. return buildTaskTree($task_data, $depth, $projTasks, $all_tasks, $parents, $task_parent, $task_id);
  208. }
  209. /**
  210. * Deprecated in favor of buildTaskTree which doesn't use any globals.
  211. * TODO: Remove for v4.0 - caseydk 20 September 2012
  212. *
  213. * @deprecated
  214. */
  215. function constructTaskTree_pd($task_data, $parents, $all_tasks, $depth = 0)
  216. {
  217. global $projTasks, $all_tasks, $task_parent, $task_id;
  218. trigger_error("The constructTaskTree_pd function has been deprecated and will be removed in v4.0. Use buildTaskTree() instead.", E_USER_NOTICE );
  219. return buildTaskTree($task_data, $depth, $projTasks, $all_tasks, $parents, $task_parent, $task_id);
  220. }
  221. // from modules/tasks/tasks.class.php
  222. /**
  223. * Used to check if a user has task_access to see the task in task list context
  224. * (This function was optimized to try to use the DB the least possible)
  225. * TODO: Remove for v4.0 - caseydk 20 September 2012
  226. *
  227. * @param mixed $task_id
  228. * @param mixed $task_access
  229. * @param mixed $task_owner
  230. * @return true if user has task access to it, or false if he doesn't
  231. *
  232. * @deprecated
  233. */
  234. function canTaskAccess($task_id)
  235. {
  236. trigger_error("canTaskAccess has been deprecated in v3.0 and will be removed by v4.0. Please use CTask->canAccess() instead.", E_USER_NOTICE);
  237. global $AppUI;
  238. $task = new CTask();
  239. $task->load($task_id);
  240. return $task->canAccess($AppUI->user_id);
  241. }
  242. /**
  243. * TODO: Remove for v4.0 - caseydk 20 September 2012
  244. *
  245. * @deprecated
  246. */
  247. function getProjects()
  248. {
  249. trigger_error("getProjects() has been deprecated in v3.0 and will be removed in v4.0. Please use CProject->getProjects() instead.", E_USER_NOTICE);
  250. $project = new CProject();
  251. return $project->getProjects();
  252. }
  253. /**
  254. * TODO: Remove for v4.0 - caseydk 20 September 2012
  255. *
  256. * @deprecated
  257. */
  258. function show_st_project(&$a, $level = 0)
  259. {
  260. trigger_error("show_st_project() has been deprecated in v3.0 and will be removed in v4.0. There is no replacement.", E_USER_NOTICE);
  261. global $st_projects_arr;
  262. $st_projects_arr[] = array($a, $level);
  263. }
  264. /**
  265. * TODO: Remove for v4.0 - caseydk 20 September 2012
  266. *
  267. * @deprecated
  268. */
  269. function find_proj_child(&$tarr, $parent, $level = 0)
  270. {
  271. trigger_error("find_proj_child() has been deprecated in v3.0 and will be removed in v4.0. There is no replacement.", E_USER_NOTICE);
  272. $level++;
  273. $n = count($tarr);
  274. for ($x = 0; $x < $n; $x++) {
  275. if ($tarr[$x]['project_parent'] == $parent && $tarr[$x]['project_parent'] != $tarr[$x]['project_id']) {
  276. show_st_project($tarr[$x], $level);
  277. find_proj_child($tarr, $tarr[$x]['project_id'], $level);
  278. }
  279. }
  280. }
  281. /**
  282. * TODO: Remove for v4.0 - caseydk 22 February 2013
  283. *
  284. * @deprecated
  285. */
  286. function makePass()
  287. {
  288. trigger_error("makePass() has been deprecated in v3.0 and will be removed in v4.0. Use w2p_Authenticators_SQL->createNewPassword instead.", E_USER_NOTICE);
  289. $auth = new w2p_Authenticators_SQL();
  290. return $auth->createNewPassword();
  291. }
  292. /**
  293. * The original method didn't return anything..
  294. *
  295. * @todo Remove for v4.0 - caseydk 06 March 2013
  296. * @deprecated
  297. */
  298. function get_dependencies_pd($task_id)
  299. {
  300. trigger_error("get_dependencies_pd() has been deprecated in v3.0 and will be removed in v4.0. Use CTask->getDependencyList instead.", E_USER_NOTICE);
  301. $task = new CTask();
  302. return $task->getDependencyList($task_id);
  303. }
  304. /**
  305. * Rebuilt this as a class method to override the basic layout, etc information.
  306. * While this is overkill for the core system, it's absolutely necessary for
  307. * good custom theming.
  308. *
  309. * @param type $AppUI
  310. * @param type $rootTag
  311. * @param type $innerTag
  312. * @param type $dividingToken
  313. * @param type $m
  314. * @return type
  315. */
  316. function buildHeaderNavigation($AppUI, $rootTag = '', $innerTag = '', $dividingToken = '', $m = '')
  317. {
  318. trigger_error("The buildHeaderNavigation function has been deprecated in v3.1 and will be removed by v5.0. Please use w2p_Theme_Base->buildHeaderNavigation() instead.", E_USER_NOTICE );
  319. $uistyle = $AppUI->getPref('UISTYLE') ? $AppUI->getPref('UISTYLE') : w2PgetConfig('host_style');
  320. $style = 'style_' . str_replace('-', '', $uistyle);
  321. $theme = new $style($AppUI, $m);
  322. return $theme->buildHeaderNavigation($rootTag, $innerTag, $dividingToken);
  323. }
  324. if (!function_exists('styleRenderBoxTop')) {
  325. /**
  326. * @deprecated
  327. */
  328. function styleRenderBoxTop()
  329. {
  330. trigger_error("styleRenderBoxTop() has been deprecated in v3.1 and will be removed by v5.0. Use AppUI->getTheme()->styleRenderBoxTop instead.", E_USER_NOTICE);
  331. global $AppUI;
  332. echo $AppUI->getTheme()->styleRenderBoxTop();
  333. }
  334. }
  335. if (!function_exists('styleRenderBoxBottom')) {
  336. /**
  337. * @deprecated
  338. */
  339. function styleRenderBoxBottom()
  340. {
  341. trigger_error("styleRenderBoxBottom() has been deprecated in v3.1 and will be removed by v5.0. Use AppUI->getTheme()->styleRenderBoxBottom instead.", E_USER_NOTICE);
  342. global $AppUI;
  343. echo $AppUI->getTheme()->styleRenderBoxBottom();
  344. }
  345. }
  346. /** @deprecated */
  347. function w2PgetCleanParam(&$arr, $name, $def = null)
  348. {
  349. trigger_error("w2PgetCleanParam() has been deprecated in v3.1 and will be removed in v4.0. Use w2PgetParam() instead.", E_USER_NOTICE);
  350. return w2PgetParam($arr, $name, $def);
  351. }
  352. /** @deprecated */
  353. function contextHelp($title, $link = '')
  354. {
  355. trigger_error("contextHelp() has been deprecated in v3.1 and will be removed by v5.0", E_USER_NOTICE);
  356. return w2PcontextHelp($title, $link);
  357. }
  358. function w2PcontextHelp($title, $link = '')
  359. {
  360. global $AppUI;
  361. trigger_error("w2PcontextHelp() has been deprecated in v3.1 and will be removed by v5.0", E_USER_NOTICE);
  362. return '<a href="#' . $link . '" onclick="javascript:window.open(\'?m=help&amp;dialog=1&amp;hid=' . $link . '\', \'contexthelp\', \'width=400, height=400, left=50, top=50, scrollbars=yes, resizable=yes\')">' . $AppUI->_($title) . '</a>';
  363. }
  364. function w2PgetUsername($username)
  365. {
  366. trigger_error("w2PgetUsername() has been deprecated in v3.1 and will be removed by v5.0. Please use CContact::getContactByUsername() instead.", E_USER_NOTICE);
  367. return CContact::getContactByUsername($username);
  368. }
  369. function w2PgetUsernameFromID($userId)
  370. {
  371. trigger_error("w2PcontextHelp() has been deprecated in v3.1 and will be removed by v5.0. Please use CContact::getContactByUserid() instead.", E_USER_NOTICE);
  372. return CContact::getContactByUserid($userId);
  373. }
  374. /** @deprecated */
  375. function showtask_pd(&$arr, $level = 0, $today_view = false)
  376. {
  377. trigger_error("showtask_pd() has been deprecated in v3.1 and will be removed by v5.0. Please use showtask_new() instead.", E_USER_NOTICE);
  378. return showtask_new($arr, $level, $today_view);
  379. }
  380. /** @deprecated */
  381. function showtask_pr(&$arr, $level = 0, $today_view = false)
  382. {
  383. trigger_error("showtask_pr() has been deprecated in v3.1 and will be removed by v5.0. Please use showtask_new() instead.", E_USER_NOTICE);
  384. return showtask_new($arr, $level, $today_view);
  385. }
  386. /** @deprecated */
  387. function showtask(&$arr, $level = 0, $notUsed = true, $today_view = false)
  388. {
  389. trigger_error("showtask() has been deprecated in v3.1 and will be removed by v5.0. Please use showtask_new() instead.", E_USER_NOTICE);
  390. return showtask_new($arr, $level, $today_view);
  391. }
  392. function findchild(&$tarr, $parent, $level = 0)
  393. {
  394. trigger_error("findchild() has been deprecated in v3.1 and will be removed by v5.0. Please use findchild_new() instead.", E_USER_NOTICE);
  395. findchild_new($tarr, $parent, $level);
  396. }
  397. function findchild_pd(&$tarr, $parent, $level = 0)
  398. {
  399. trigger_error("findchild_pd() has been deprecated in v3.1 and will be removed by v5.0. Please use findchild_new() instead.", E_USER_NOTICE);
  400. findchild_new($tarr, $parent, $level);
  401. }
  402. /**
  403. * @deprecated
  404. */
  405. function cleanText($text)
  406. {
  407. trigger_error("cleanText() has been deprecated in v3.2 and will be removed by v5.0. There is no replacement.", E_USER_NOTICE);
  408. return $text;
  409. }
  410. /** @deprecated since 3.2 */
  411. function resource_presave()
  412. {
  413. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed by v5.0. There is no replacement.", E_USER_NOTICE);
  414. }
  415. /** @deprecated since 3.2 */
  416. function resource_postsave()
  417. {
  418. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed by v5.0. There is no replacement.", E_USER_NOTICE);
  419. }
  420. /** @deprecated since 3.2 */
  421. function showFVar(&$var, $title = '')
  422. {
  423. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed by v5.0. There is no replacement.", E_USER_NOTICE);
  424. echo '<h1>' . $title . '</h1>';
  425. echo '<pre>';
  426. print_r($var);
  427. echo '</pre>';
  428. }
  429. function w2PsessionOpen()
  430. {
  431. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0.", E_USER_NOTICE );
  432. return true;
  433. }
  434. function w2PsessionClose()
  435. {
  436. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0.", E_USER_NOTICE );
  437. return true;
  438. }
  439. function w2PsessionRead($id)
  440. {
  441. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_System_Session->read instead.", E_USER_NOTICE );
  442. $session = new w2p_System_Session();
  443. return $session->read($id);
  444. }
  445. function w2PsessionWrite($id, $data)
  446. {
  447. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_System_Session->write instead.", E_USER_NOTICE );
  448. $session = new w2p_System_Session();
  449. return $session->write($id, $data);
  450. }
  451. function w2PsessionDestroy($id)
  452. {
  453. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_System_Session->destroy instead.", E_USER_NOTICE );
  454. $session = new w2p_System_Session();
  455. return $session->destroy($id);
  456. }
  457. function w2PsessionGC()
  458. {
  459. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_System_Session->gc instead.", E_USER_NOTICE );
  460. $session = new w2p_System_Session();
  461. return $session->gc();
  462. }
  463. function w2PsessionConvertTime($key)
  464. {
  465. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_System_Session->convertTime instead.", E_USER_NOTICE );
  466. $session = new w2p_System_Session();
  467. return $session->convertTime($key);
  468. }
  469. function w2PsessionStart()
  470. {
  471. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_System_Session->start instead.", E_USER_NOTICE );
  472. $session = new w2p_System_Session();
  473. return $session->start();
  474. }
  475. function db_connect($host = 'localhost', $dbname, $user = 'root', $passwd = '', $persist = false)
  476. {
  477. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_Database_Connection->db_connect instead.", E_USER_NOTICE );
  478. global $db;
  479. $connection = new w2p_Database_Connection($db);
  480. $connection->connect($host, $dbname, $user, $passwd, $persist);
  481. }
  482. function db_error()
  483. {
  484. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_Database_Connection->db_error instead.", E_USER_NOTICE );
  485. global $db;
  486. $connection = new w2p_Database_Connection($db);
  487. return $connection->error();
  488. }
  489. function db_errno()
  490. {
  491. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_Database_Connection->db_errno instead.", E_USER_NOTICE );
  492. global $db;
  493. $connection = new w2p_Database_Connection($db);
  494. return $connection->errno();
  495. }
  496. function db_insert_id()
  497. {
  498. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_Database_Connection->db_insert_id instead.", E_USER_NOTICE );
  499. global $db;
  500. $connection = new w2p_Database_Connection($db);
  501. return $connection->insert_id();
  502. }
  503. function db_exec($sql)
  504. {
  505. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_Database_Connection->db_exec instead.", E_USER_NOTICE );
  506. global $db, $w2p_performance_dbtime, $w2p_performance_old_dbqueries;
  507. $connection = new w2p_Database_Connection($db);
  508. return $connection->exec($sql, $w2p_performance_dbtime, $w2p_performance_old_dbqueries);
  509. }
  510. function db_free_result($cur)
  511. {
  512. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_Database_Connection->db_free_result instead.", E_USER_NOTICE );
  513. global $db;
  514. $connection = new w2p_Database_Connection($db);
  515. $connection->free_result($cur);
  516. }
  517. function db_num_rows($qid)
  518. {
  519. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_Database_Connection->db_num_rows instead.", E_USER_NOTICE );
  520. global $db;
  521. $connection = new w2p_Database_Connection($db);
  522. return $connection->num_rows($qid);
  523. }
  524. function db_fetch_row(&$qid)
  525. {
  526. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_Database_Connection->db_fetch_row instead.", E_USER_NOTICE );
  527. global $db;
  528. $connection = new w2p_Database_Connection($db);
  529. return $connection->fetch_row($qid);
  530. }
  531. function db_fetch_assoc(&$qid)
  532. {
  533. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_Database_Connection->db_fetch_assoc instead.", E_USER_NOTICE );
  534. global $db;
  535. $connection = new w2p_Database_Connection($db);
  536. return $connection->fetch_assoc($qid);
  537. }
  538. function db_fetch_array(&$qid)
  539. {
  540. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_Database_Connection->db_fetch_array instead.", E_USER_NOTICE );
  541. global $db;
  542. $connection = new w2p_Database_Connection($db);
  543. return $connection->fetch_array($qid);
  544. }
  545. function db_fetch_object($qid)
  546. {
  547. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_Database_Connection->db_fetch_object instead.", E_USER_NOTICE );
  548. global $db;
  549. $connection = new w2p_Database_Connection($db);
  550. return $connection->fetch_object($qid);
  551. }
  552. function db_escape($str)
  553. {
  554. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_Database_Connection->db_escape instead.", E_USER_NOTICE );
  555. global $db;
  556. $connection = new w2p_Database_Connection($db);
  557. return $connection->escape($str);
  558. }
  559. function db_version()
  560. {
  561. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_Database_Connection->db_version instead.", E_USER_NOTICE );
  562. global $db;
  563. $connection = new w2p_Database_Connection($db);
  564. return $connection->version();
  565. }
  566. function db_unix2dateTime($time)
  567. {
  568. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_Database_Connection->db_unix2dateTime instead.", E_USER_NOTICE );
  569. global $db;
  570. $connection = new w2p_Database_Connection($db);
  571. return $connection->unix2dateTime($time);
  572. }
  573. function db_dateTime2unix($time)
  574. {
  575. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. Please use w2p_Database_Connection->db_dateTime2unix instead.", E_USER_NOTICE );
  576. global $db;
  577. $connection = new w2p_Database_Connection($db);
  578. return $connection->dateTime2unix($time);
  579. }
  580. /** @deprecated */
  581. function clash_process(w2p_Core_CAppUI $AppUI)
  582. {
  583. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. There is no replacement.", E_USER_NOTICE );
  584. $AppUI->redirect('m=events');
  585. }
  586. /** @deprecated */
  587. function clash_mail(w2p_Core_CAppUI $AppUI)
  588. {
  589. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. There is no replacement.", E_USER_NOTICE );
  590. $AppUI->redirect('m=events');
  591. }
  592. /** @deprecated */
  593. function clash_accept(w2p_Core_CAppUI $AppUI)
  594. {
  595. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. There is no replacement.", E_USER_NOTICE );
  596. $AppUI->redirect('m=events');
  597. }
  598. /** @deprecated */
  599. function clear_clash()
  600. {
  601. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. There is no replacement.", E_USER_NOTICE );
  602. return false;
  603. }
  604. /** @deprecated */
  605. function clash_cancel(w2p_Core_CAppUI $AppUI)
  606. {
  607. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. There is no replacement.", E_USER_NOTICE );
  608. $AppUI->redirect('m=events');
  609. }
  610. /** @deprecated */
  611. function smart_slice($arr, $notUsed1, $notUsed2, $notUsed3)
  612. {
  613. return dumb_slice($arr);
  614. }
  615. /** @deprecated */
  616. function __extract_from_tasks6($q, $history_active)
  617. {
  618. trigger_error(__FUNCTION__ . " has been deprecated in v3.2 and will be removed in v5.0. There is no replacement.", E_USER_NOTICE );
  619. return $q;
  620. }