tripal_core.DEPRECATED.inc 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234
  1. <?php
  2. /**
  3. * @file
  4. * Contains all the deprecated functions to keep the tripal api backwards compatible.
  5. */
  6. /**
  7. * @deprecated Restructured API to make naming more readable and consistent.
  8. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  9. * This function has been replaced by @see chado_get_id_from_nid().
  10. */
  11. function chado_get_id_for_node($table, $nid) {
  12. tripal_report_error(
  13. 'tripal_api',
  14. TRIPAL_NOTICE,
  15. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  16. array(
  17. '%old_function'=>'chado_get_id_for_node',
  18. '%new_function' => 'chado_get_id_from_nid'
  19. )
  20. );
  21. //New API Function
  22. return chado_get_id_from_nid($table, $nid);
  23. }
  24. /**
  25. * @deprecated Restructured API to make naming more readable and consistent.
  26. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  27. * This function has been replaced by @see chado_get_nid_from_id().
  28. */
  29. function chado_get_node_id($table, $id) {
  30. tripal_report_error(
  31. 'tripal_api',
  32. TRIPAL_NOTICE,
  33. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  34. array(
  35. '%old_function'=>'chado_get_node_id',
  36. '%new_function' => 'chado_get_nid_from_id'
  37. )
  38. );
  39. //New API Function
  40. return chado_get_nid_from_id($table, $id);
  41. }
  42. /**
  43. * @deprecated Restructured API to make naming more readable and consistent.
  44. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  45. * This function has been replaced by @see chado_cleanup_orphaned_nodes().
  46. */
  47. function tripal_core_chado_node_cleanup_orphaned($table, $job_id = NULL) {
  48. tripal_report_error(
  49. 'tripal_api',
  50. TRIPAL_NOTICE,
  51. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  52. array(
  53. '%old_function'=>'tripal_core_chado_node_cleanup_orphaned',
  54. '%new_function' => 'chado_cleanup_orphaned_nodes'
  55. )
  56. );
  57. //New API Function
  58. return chado_cleanup_orphaned_nodes($table, $job_id);
  59. }
  60. /**
  61. * @deprecated Restructured API to make naming more readable and consistent.
  62. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  63. * This function has been replaced by @see chado_add_node_form_dbxrefs().
  64. */
  65. function chado_node_additional_dbxrefs_form(&$form, &$form_state, $details) {
  66. tripal_report_error(
  67. 'tripal_api',
  68. TRIPAL_NOTICE,
  69. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  70. array(
  71. '%old_function'=>'chado_node_additional_dbxrefs_form',
  72. '%new_function' => 'chado_add_node_form_dbxrefs'
  73. )
  74. );
  75. //New API Function
  76. return chado_add_node_form_dbxrefs($form, $form_state, $details);
  77. }
  78. /**
  79. * @deprecated Restructured API to make naming more readable and consistent.
  80. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  81. * This function has been replaced by @see chado_retrieve_node_form_dbxrefs().
  82. */
  83. function chado_node_additional_dbxrefs_form_retreive($node) {
  84. tripal_report_error(
  85. 'tripal_api',
  86. TRIPAL_NOTICE,
  87. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  88. array(
  89. '%old_function'=>'chado_node_additional_dbxrefs_form_retreive',
  90. '%new_function' => 'chado_retrieve_node_form_dbxrefs'
  91. )
  92. );
  93. //New API Function
  94. return chado_retrieve_node_form_dbxrefs($node);
  95. }
  96. /**
  97. * @deprecated Restructured API to make naming more readable and consistent.
  98. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  99. * This function has been replaced by @see chado_update_node_form_dbxrefs().
  100. */
  101. function chado_node_additional_dbxrefs_form_update_dbxrefs($node, $details, $retrieved_dbxrefs = FALSE) {
  102. tripal_report_error(
  103. 'tripal_api',
  104. TRIPAL_NOTICE,
  105. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  106. array(
  107. '%old_function'=>'chado_node_additional_dbxrefs_form_update_dbxrefs',
  108. '%new_function' => 'chado_update_node_form_dbxrefs'
  109. )
  110. );
  111. //New API Function
  112. return chado_update_node_form_dbxrefs($node, $details, $retrieved_dbxrefs);
  113. }
  114. /**
  115. * @deprecated Restructured API to make naming more readable and consistent.
  116. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  117. * This function has been replaced by @see chado_add_node_form_properties().
  118. */
  119. function chado_node_properties_form($form, $form_state, $details) {
  120. tripal_report_error(
  121. 'tripal_api',
  122. TRIPAL_NOTICE,
  123. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  124. array(
  125. '%old_function'=>'chado_node_properties_form',
  126. '%new_function' => 'chado_add_node_form_properties'
  127. )
  128. );
  129. //New API Function
  130. return chado_add_node_form_properties($form, $form_state, $details);
  131. }
  132. /**
  133. * @deprecated Restructured API to make naming more readable and consistent.
  134. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  135. * This function has been replaced by @see chado_retrieve_node_form_properties().
  136. */
  137. function chado_node_properties_form_retreive($node) {
  138. tripal_report_error(
  139. 'tripal_api',
  140. TRIPAL_NOTICE,
  141. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  142. array(
  143. '%old_function'=>'chado_node_properties_form_retreive',
  144. '%new_function' => 'chado_retrieve_node_form_properties'
  145. )
  146. );
  147. //New API Function
  148. return chado_retrieve_node_form_properties($node);
  149. }
  150. /**
  151. * @deprecated Restructured API to make naming more readable and consistent.
  152. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  153. * This function has been replaced by @see chado_update_node_form_properties().
  154. */
  155. function chado_node_properties_form_update_properties($node, $details, $retrieved_properties = FALSE) {
  156. tripal_report_error(
  157. 'tripal_api',
  158. TRIPAL_NOTICE,
  159. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  160. array(
  161. '%old_function'=>'chado_node_properties_form_update_properties',
  162. '%new_function' => 'chado_update_node_form_properties'
  163. )
  164. );
  165. //New API Function
  166. return chado_update_node_form_properties($node, $details, $retrieved_properties);
  167. }
  168. /**
  169. * @deprecated Restructured API to make naming more readable and consistent.
  170. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  171. * This function has been replaced by @see chado_add_node_form_relationships().
  172. */
  173. function chado_node_relationships_form(&$form, &$form_state, $details) {
  174. tripal_report_error(
  175. 'tripal_api',
  176. TRIPAL_NOTICE,
  177. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  178. array(
  179. '%old_function'=>'chado_node_relationships_form',
  180. '%new_function' => 'chado_add_node_form_relationships'
  181. )
  182. );
  183. //New API Function
  184. return chado_add_node_form_relationships($form, $form_state, $details);
  185. }
  186. /**
  187. * @deprecated Restructured API to make naming more readable and consistent.
  188. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  189. * This function has been replaced by @see chado_retrieve_node_form_relationships().
  190. */
  191. function chado_node_relationships_form_retreive($node) {
  192. tripal_report_error(
  193. 'tripal_api',
  194. TRIPAL_NOTICE,
  195. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  196. array(
  197. '%old_function'=>'chado_node_relationships_form_retreive',
  198. '%new_function' => 'chado_retrieve_node_form_relationships'
  199. )
  200. );
  201. //New API Function
  202. return chado_retrieve_node_form_relationships($node);
  203. }
  204. /**
  205. * @deprecated Restructured API to make naming more readable and consistent.
  206. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  207. * This function has been replaced by @see chado_update_node_form_relationships().
  208. */
  209. function chado_node_relationships_form_update_relationships($node, $details, $retrieved_relationships = FALSE) {
  210. tripal_report_error(
  211. 'tripal_api',
  212. TRIPAL_NOTICE,
  213. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  214. array(
  215. '%old_function'=>'chado_node_relationships_form_update_relationships',
  216. '%new_function' => 'chado_update_node_form_relationships'
  217. )
  218. );
  219. //New API Function
  220. return chado_update_node_form_relationships($node, $details, $retrieved_relationships);
  221. }
  222. /**
  223. * @deprecated Restructured API to make naming more readable and consistent.
  224. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  225. * This function has been replaced by @see chado_node_sync_form().
  226. */
  227. function tripal_core_chado_node_sync_form($form, &$form_state) {
  228. tripal_report_error(
  229. 'tripal_api',
  230. TRIPAL_NOTICE,
  231. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  232. array(
  233. '%old_function'=>'tripal_core_chado_node_sync_form',
  234. '%new_function' => 'chado_node_sync_form'
  235. )
  236. );
  237. //New API Function
  238. return chado_node_sync_form($form, $form_state);
  239. }
  240. /**
  241. * @deprecated Restructured API to make naming more readable and consistent.
  242. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  243. * This function has been replaced by @see chado_node_sync_records().
  244. */
  245. function tripal_core_chado_node_sync_records($base_table, $max_sync = FALSE, $organism_id = FALSE,
  246. $types = array(), $ids = array(), $job_id = NULL) {
  247. tripal_report_error(
  248. 'tripal_api',
  249. TRIPAL_NOTICE,
  250. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  251. array(
  252. '%old_function'=>'tripal_core_chado_node_sync_records',
  253. '%new_function' => 'chado_node_sync_records'
  254. )
  255. );
  256. //New API Function
  257. return chado_node_sync_records($base_table, $max_sync, $organism_id, $types, $ids, $job_id);
  258. }
  259. /**
  260. * @deprecated Restructured API to make naming more readable and consistent.
  261. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  262. * There is no new functionality as this function was deamed unnecessary.
  263. */
  264. function tripal_core_is_tripal_node_type() {
  265. tripal_report_error(
  266. 'tripal_api',
  267. TRIPAL_ERROR,
  268. "DEPRECATED: %old_function has been completely removed since we felt there wasn't a real need for it.",
  269. array(
  270. '%old_function'=>'tripal_core_is_tripal_node_type'
  271. )
  272. );
  273. }
  274. /**
  275. * @deprecated Restructured API to make naming more readable and consistent.
  276. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  277. * This function has been replaced by @see chado_schema_get_foreign_key().
  278. */
  279. function tripal_core_chado_get_foreign_key($table_desc, $field, $values, $options = NULL) {
  280. tripal_report_error(
  281. 'tripal_api',
  282. TRIPAL_NOTICE,
  283. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  284. array(
  285. '%old_function'=>'tripal_core_chado_get_foreign_key',
  286. '%new_function' => 'chado_schema_get_foreign_key'
  287. )
  288. );
  289. //New API Function
  290. return chado_schema_get_foreign_key($table_desc, $field, $values, $options);
  291. }
  292. /**
  293. * @deprecated Restructured API to make naming more readable and consistent.
  294. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  295. * This function has been replaced by @see chado_delete_record().
  296. */
  297. function tripal_core_chado_delete($table, $match, $options = NULL) {
  298. tripal_report_error(
  299. 'tripal_api',
  300. TRIPAL_NOTICE,
  301. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  302. array(
  303. '%old_function'=>'tripal_core_chado_delete',
  304. '%new_function' => 'chado_delete_record'
  305. )
  306. );
  307. //New API Function
  308. return chado_delete_record();
  309. }
  310. /**
  311. * @deprecated Restructured API to make naming more readable and consistent.
  312. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  313. * This function has been replaced by @see chado_expand_var().
  314. */
  315. function tripal_core_expand_chado_vars($object, $type, $to_expand, $table_options = array()) {
  316. tripal_report_error(
  317. 'tripal_api',
  318. TRIPAL_NOTICE,
  319. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  320. array(
  321. '%old_function'=>'tripal_core_expand_chado_vars',
  322. '%new_function' => 'chado_expand_var'
  323. )
  324. );
  325. //New API Function
  326. return chado_expand_var($object, $type, $to_expand, $table_options);
  327. }
  328. /**
  329. * @deprecated Restructured API to make naming more readable and consistent.
  330. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  331. * This function has been replaced by @see chado_generate_var().
  332. */
  333. function tripal_core_generate_chado_var($table, $values, $base_options = array()) {
  334. tripal_report_error(
  335. 'tripal_api',
  336. TRIPAL_NOTICE,
  337. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  338. array(
  339. '%old_function'=>'tripal_core_generate_chado_var',
  340. '%new_function' => 'chado_generate_var'
  341. )
  342. );
  343. //New API Function
  344. return chado_generate_var($table, $values, $base_options);
  345. }
  346. /**
  347. * @deprecated Restructured API to make naming more readable and consistent.
  348. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  349. * This function has been replaced by @see chado_insert_record().
  350. */
  351. function tripal_core_chado_insert($table, $values, $options = array()) {
  352. tripal_report_error(
  353. 'tripal_api',
  354. TRIPAL_NOTICE,
  355. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  356. array(
  357. '%old_function'=>'tripal_core_chado_insert',
  358. '%new_function' => 'chado_insert_record'
  359. )
  360. );
  361. //New API Function
  362. return chado_insert_record($table, $values, $options);
  363. }
  364. /**
  365. * @deprecated Restructured API to make naming more readable and consistent.
  366. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  367. * This function has been replaced by @see chado_select_record();
  368. */
  369. function tripal_core_chado_select($table, $columns, $values, $options = NULL) {
  370. tripal_report_error(
  371. 'tripal_api',
  372. TRIPAL_NOTICE,
  373. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  374. array(
  375. '%old_function'=>'tripal_core_chado_select',
  376. '%new_function' => 'chado_select_record'
  377. )
  378. );
  379. //New API Function
  380. return chado_select_record($table, $columns, $values, $options);
  381. }
  382. /**
  383. * @deprecated Restructured API to make naming more readable and consistent.
  384. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  385. * This function has been replaced by @see chado_update_record();
  386. */
  387. function tripal_core_chado_update($table, $match, $values, $options = NULL) {
  388. tripal_report_error(
  389. 'tripal_api',
  390. TRIPAL_NOTICE,
  391. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  392. array(
  393. '%old_function'=>'tripal_core_chado_update',
  394. '%new_function' => 'chado_update_record'
  395. )
  396. );
  397. //New API Function
  398. return chado_update_record($table, $match, $values, $options);
  399. }
  400. /**
  401. * @deprecated Restructured API to make naming more readable and consistent.
  402. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  403. * This function has been replaced by @see tripal_create_files_dir();
  404. */
  405. function tripal_create_moddir($module_name) {
  406. tripal_report_error(
  407. 'tripal_api',
  408. TRIPAL_NOTICE,
  409. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  410. array(
  411. '%old_function'=>'tripal_create_moddir',
  412. '%new_function' => 'tripal_create_files_dir'
  413. )
  414. );
  415. //New API Function
  416. return tripal_create_files_dir($module_name);
  417. }
  418. /**
  419. * @deprecated Restructured API to make naming more readable and consistent.
  420. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  421. * This function has been replaced by @see tripal_create_files_dir();
  422. */
  423. function tripal_create_mod_subdir($module_name, $path) {
  424. tripal_report_error(
  425. 'tripal_api',
  426. TRIPAL_NOTICE,
  427. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  428. array(
  429. '%old_function'=>'tripal_create_mod_subdir',
  430. '%new_function' => 'tripal_create_files_dir'
  431. )
  432. );
  433. //New API Function
  434. return tripal_create_files_dir($module_name, $path);
  435. }
  436. /**
  437. * @deprecated Restructured API to make naming more readable and consistent.
  438. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  439. * This function has been replaced by @see tripal_create_files_dir().
  440. */
  441. function tripal_file_directory_path() {
  442. tripal_report_error(
  443. 'tripal_api',
  444. TRIPAL_NOTICE,
  445. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  446. array(
  447. '%old_function'=>'tripal_file_directory_path',
  448. '%new_function' => 'tripal_get_files_dir'
  449. )
  450. );
  451. //New API Function
  452. return tripal_get_files_dir();
  453. }
  454. /**
  455. * @deprecated Restructured API to make naming more readable and consistent.
  456. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  457. * This function has been replaced by @see tripal_get_files_dir().
  458. */
  459. function tripal_get_moddir($module_name) {
  460. tripal_report_error(
  461. 'tripal_api',
  462. TRIPAL_NOTICE,
  463. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  464. array(
  465. '%old_function'=>'tripal_get_moddir',
  466. '%new_function' => 'tripal_get_files_dir'
  467. )
  468. );
  469. //New API Function
  470. return tripal_get_files_dir($module_name);
  471. }
  472. /**
  473. * @deprecated Restructured API to make naming more readable and consistent.
  474. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  475. * This function has been replaced by @see tripal_cancel_job().
  476. */
  477. function tripal_jobs_cancel($job_id, $redirect = TRUE) {
  478. tripal_report_error(
  479. 'tripal_api',
  480. TRIPAL_NOTICE,
  481. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  482. array(
  483. '%old_function'=>'tripal_jobs_cancel',
  484. '%new_function' => 'tripal_cancel_job'
  485. )
  486. );
  487. //New API Function
  488. return tripal_cancel_job($job_id);
  489. }
  490. /**
  491. * @deprecated Restructured API to make naming more readable and consistent.
  492. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  493. * This function has been replaced by @see tripal_get_active_jobs().
  494. */
  495. function tripal_get_module_active_jobs($modulename) {
  496. tripal_report_error(
  497. 'tripal_api',
  498. TRIPAL_NOTICE,
  499. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  500. array(
  501. '%old_function'=>'tripal_get_module_active_jobs',
  502. '%new_function' => 'tripal_get_active_jobs'
  503. )
  504. );
  505. //New API Function
  506. return tripal_get_active_jobs($modulename);
  507. }
  508. /**
  509. * @deprecated Restructured API to make naming more readable and consistent.
  510. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  511. * This function has been replaced by @see tripal_get_job_end().
  512. */
  513. function tripal_jobs_get_end_time($job) {
  514. tripal_report_error(
  515. 'tripal_api',
  516. TRIPAL_NOTICE,
  517. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  518. array(
  519. '%old_function'=>'tripal_jobs_get_end_time',
  520. '%new_function' => 'tripal_get_job_end'
  521. )
  522. );
  523. //New API Function
  524. return tripal_get_job_end($job);
  525. }
  526. /**
  527. * @deprecated Restructured API to make naming more readable and consistent.
  528. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  529. * This function has been replaced by @see tripal_get_job_start().
  530. */
  531. function tripal_jobs_get_start_time($job) {
  532. tripal_report_error(
  533. 'tripal_api',
  534. TRIPAL_NOTICE,
  535. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  536. array(
  537. '%old_function'=>'tripal_jobs_get_start_time',
  538. '%new_function' => 'tripal_get_job_start'
  539. )
  540. );
  541. //New API Function
  542. return tripal_get_job_start($job);
  543. }
  544. /**
  545. * @deprecated Restructured API to make naming more readable and consistent.
  546. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  547. * This function has been replaced by @see tripal_get_job_submit_date().
  548. */
  549. function tripal_jobs_get_submit_date($job) {
  550. tripal_report_error(
  551. 'tripal_api',
  552. TRIPAL_NOTICE,
  553. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  554. array(
  555. '%old_function'=>'tripal_jobs_get_submit_date',
  556. '%new_function' => 'tripal_get_job_submit_date'
  557. )
  558. );
  559. //New API Function
  560. return tripal_get_job_submit_date($job);
  561. }
  562. /**
  563. * @deprecated Restructured API to make naming more readable and consistent.
  564. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  565. * This function has been replaced by @see tripal_is_job_running().
  566. */
  567. function tripal_jobs_check_running() {
  568. tripal_report_error(
  569. 'tripal_api',
  570. TRIPAL_NOTICE,
  571. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  572. array(
  573. '%old_function'=>'tripal_jobs_check_running',
  574. '%new_function' => 'tripal_is_job_running'
  575. )
  576. );
  577. //New API Function
  578. return tripal_is_job_running();
  579. }
  580. /**
  581. * @deprecated Restructured API to make naming more readable and consistent.
  582. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  583. * This function has been replaced by @see tripal_launch_job().
  584. */
  585. function tripal_jobs_launch($do_parallel = 0, $job_id = NULL) {
  586. tripal_report_error(
  587. 'tripal_api',
  588. TRIPAL_NOTICE,
  589. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  590. array(
  591. '%old_function'=>'tripal_jobs_launch',
  592. '%new_function' => 'tripal_launch_job'
  593. )
  594. );
  595. //New API Function
  596. return tripal_launch_job($do_parallel, $job_id);
  597. }
  598. /**
  599. * @deprecated Restructured API to make naming more readable and consistent.
  600. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  601. * This function has been replaced by @see tripal_rerun_job().
  602. */
  603. function tripal_jobs_rerun($job_id, $goto_jobs_page = TRUE) {
  604. tripal_report_error(
  605. 'tripal_api',
  606. TRIPAL_NOTICE,
  607. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  608. array(
  609. '%old_function'=>'tripal_jobs_rerun',
  610. '%new_function' => 'tripal_rerun_job'
  611. )
  612. );
  613. //New API Function
  614. return tripal_rerun_job($job_id, $goto_jobs_page);
  615. }
  616. /**
  617. * @deprecated Restructured API to make naming more readable and consistent.
  618. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  619. * This function has been replaced by @see tripal_set_job_progress().
  620. */
  621. function tripal_job_set_progress($job_id, $percentage) {
  622. tripal_report_error(
  623. 'tripal_api',
  624. TRIPAL_NOTICE,
  625. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  626. array(
  627. '%old_function'=>'tripal_job_set_progress',
  628. '%new_function' => 'tripal_set_job_progress'
  629. )
  630. );
  631. //New API Function
  632. return tripal_set_job_progress($job_id, $percentage);
  633. }
  634. /**
  635. * @deprecated Restructured API to make naming more readable and consistent.
  636. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  637. * This function has been replaced by @see tripal_update_mview().
  638. */
  639. function tripal_mviews_action($op, $mview_id, $redirect = FALSE) {
  640. if ($op == 'update') {
  641. tripal_report_error(
  642. 'tripal_api',
  643. TRIPAL_NOTICE,
  644. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  645. array(
  646. '%old_function'=>'tripal_mviews_action',
  647. '%new_function' => 'tripal_add_populate_mview'
  648. )
  649. );
  650. //New API Function
  651. return tripal_add_populate_mview($mview_id, $redirect);
  652. }
  653. if ($op == 'delete') {
  654. tripal_report_error(
  655. 'tripal_api',
  656. TRIPAL_NOTICE,
  657. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  658. array(
  659. '%old_function'=>'tripal_mviews_action',
  660. '%new_function' => 'tripal_delete_mview'
  661. )
  662. );
  663. //New API Function
  664. return tripal_delete_mview($mview_id, $redirect);
  665. }
  666. }
  667. /**
  668. * @deprecated Restructured API to make naming more readable and consistent.
  669. * Function was deprecated in Tripal 1.0 and will is in the process of being removed.
  670. */
  671. function tripal_add_legacy_mview($name, $modulename, $mv_table, $mv_specs, $indexed,
  672. $query, $special_index, $comment) {
  673. tripal_report_error(
  674. 'tripal_api',
  675. TRIPAL_ERROR,
  676. "DEPRECATED: %old_function has been completely removed after a period of two releases
  677. since deprecation. Please use the new Materialized View Interface.",
  678. array(
  679. '%old_function'=>'tripal_add_legacy_mview'
  680. )
  681. );
  682. }
  683. /**
  684. * @deprecated Restructured API to make naming more readable and consistent.
  685. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  686. * This function has been replaced by @see tripal_populate_mview();
  687. */
  688. function tripal_update_mview($mview_id) {
  689. tripal_report_error(
  690. 'tripal_api',
  691. TRIPAL_NOTICE,
  692. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  693. array(
  694. '%old_function'=>'tripal_update_mview',
  695. '%new_function' => 'tripal_populate_mview'
  696. )
  697. );
  698. //New API Function
  699. return tripal_populate_mview($mview_id);
  700. }
  701. /**
  702. * @deprecated Restructured API to make naming more readable and consistent.
  703. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  704. * This function is considered to be no easier to use than chado_delete_record directly
  705. * @see chado_delete_record().
  706. */
  707. function tripal_core_delete_property_by_id($basetable, $property_id) {
  708. tripal_report_error(
  709. 'tripal_api',
  710. TRIPAL_NOTICE,
  711. "DEPRECATED: %old_function has been replaced with %new_function. This requires manual
  712. intervention since the arguements for the two functions are different.
  713. Please update your code.",
  714. array(
  715. '%old_function'=>'tripal_core_delete_property_by_id',
  716. '%new_function' => 'chado_delete_record'
  717. )
  718. );
  719. // construct the array that will match the exact record to update
  720. $match = array(
  721. $basetable.'prop_id' => $property_id,
  722. );
  723. return chado_delete_record($basetable.'prop', $match);
  724. }
  725. /**
  726. * @deprecated Restructured API to make naming more readable and consistent.
  727. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  728. * This function has been replaced by @see chado_delete_property().
  729. */
  730. function tripal_core_delete_property($basetable, $record_id, $property, $cv_name) {
  731. tripal_report_error(
  732. 'tripal_api',
  733. TRIPAL_NOTICE,
  734. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  735. array(
  736. '%old_function'=>'tripal_core_delete_property',
  737. '%new_function' => 'chado_delete_property'
  738. )
  739. );
  740. //New API Function
  741. return chado_delete_property($basetable, $record_id, $property, $cv_name);
  742. }
  743. /**
  744. * @deprecated Restructured API to make naming more readable and consistent.
  745. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  746. * This function has been replaced by @see chado_get_property().
  747. */
  748. function tripal_core_get_property($basetable, $record_id, $property, $cv_name) {
  749. tripal_report_error(
  750. 'tripal_api',
  751. TRIPAL_NOTICE,
  752. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  753. array(
  754. '%old_function'=>'tripal_core_get_property',
  755. '%new_function' => 'chado_get_property'
  756. )
  757. );
  758. //New API Function
  759. return chado_get_property($basetable, $record_id, $property, $cv_name);
  760. }
  761. /**
  762. * @deprecated Restructured API to make naming more readable and consistent.
  763. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  764. * This function has been replaced by @see chado_get_table_max_rank().
  765. */
  766. function tripal_core_get_max_chado_rank($tablename, $where_options) {
  767. tripal_report_error(
  768. 'tripal_api',
  769. TRIPAL_NOTICE,
  770. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  771. array(
  772. '%old_function'=>'tripal_core_get_max_chado_rank',
  773. '%new_function' => 'chado_get_table_max_rank'
  774. )
  775. );
  776. //New API Function
  777. return chado_get_table_max_rank($tablename, $where_options);
  778. }
  779. /**
  780. * @deprecated Restructured API to make naming more readable and consistent.
  781. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  782. * This function has been replaced by @see chado_insert_property().
  783. */
  784. function tripal_core_insert_property($basetable, $record_id, $property,
  785. $cv_name, $value, $update_if_present = 0) {
  786. tripal_report_error(
  787. 'tripal_api',
  788. TRIPAL_NOTICE,
  789. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  790. array(
  791. '%old_function'=>'tripal_core_insert_property',
  792. '%new_function' => 'chado_insert_property'
  793. )
  794. );
  795. //New API Function
  796. return chado_insert_property($basetable, $record_id, $property, $cv_name, $value, $update_if_present);
  797. }
  798. /**
  799. * @deprecated Restructured API to make naming more readable and consistent.
  800. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  801. * This function has been replaced by @see chado_update_property().
  802. */
  803. function tripal_core_update_property_by_id($basetable, $record_id, $property,
  804. $cv_name, $value) {
  805. tripal_report_error(
  806. 'tripal_api',
  807. TRIPAL_NOTICE,
  808. "DEPRECATED: %old_function has been replaced with %new_function. This requires manual
  809. intervention since the arguments have changed. Please update your code.",
  810. array(
  811. '%old_function'=>'tripal_core_update_property_by_id',
  812. '%new_function' => 'chado_update_property'
  813. )
  814. );
  815. //New API Function
  816. return chado_update_property($basetable, FALSE, $property, $cv_name, $value, FALSE, $record_id);
  817. }
  818. /**
  819. * @deprecated Restructured API to make naming more readable and consistent.
  820. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  821. * This function has been replaced by @see chado_update_property().
  822. */
  823. function tripal_core_update_property($basetable, $record_id, $property,
  824. $cv_name, $value, $insert_if_missing = 0) {
  825. tripal_report_error(
  826. 'tripal_api',
  827. TRIPAL_NOTICE,
  828. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  829. array(
  830. '%old_function'=>'tripal_core_update_property',
  831. '%new_function' => 'chado_update_property'
  832. )
  833. );
  834. //New API Function
  835. return chado_update_property($basetable, $record_id, $property, $cv_name, $value, $insert_if_missing);
  836. }
  837. /**
  838. * @deprecated Restructured API to make naming more readable and consistent.
  839. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  840. * This function has been replaced by @see chado_create_custom_table().
  841. */
  842. function tripal_core_create_custom_table($table, $schema, $skip_creation = 1) {
  843. tripal_report_error(
  844. 'tripal_api',
  845. TRIPAL_NOTICE,
  846. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  847. array(
  848. '%old_function'=>'tripal_core_create_custom_table',
  849. '%new_function' => 'chado_create_custom_table'
  850. )
  851. );
  852. //New API Function
  853. return chado_create_custom_table($table, $schema, $skip_creation);
  854. }
  855. /**
  856. * @deprecated Restructured API to make naming more readable and consistent.
  857. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  858. * This function has been replaced by @see chado_edit_custom_table().
  859. */
  860. function tripal_core_edit_custom_table($table_id, $table_name, $schema, $skip_creation = 1) {
  861. tripal_report_error(
  862. 'tripal_api',
  863. TRIPAL_NOTICE,
  864. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  865. array(
  866. '%old_function'=>'tripal_core_edit_custom_table',
  867. '%new_function' => 'chado_edit_custom_table'
  868. )
  869. );
  870. //New API Function
  871. return chado_edit_custom_table($table_id, $table_name, $schema, $skip_creation);
  872. }
  873. /**
  874. * @deprecated Restructured API to make naming more readable and consistent.
  875. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  876. * This function has been replaced by @see chado_get_custom_table_id().
  877. */
  878. function tripal_custom_tables_get_table_id($table_name) {
  879. tripal_report_error(
  880. 'tripal_api',
  881. TRIPAL_NOTICE,
  882. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  883. array(
  884. '%old_function'=>'tripal_custom_tables_get_table_id',
  885. '%new_function' => 'chado_get_custom_table_id'
  886. )
  887. );
  888. //New API Function
  889. return chado_get_custom_table_id($table_name);
  890. }
  891. /**
  892. * @deprecated Restructured API to make naming more readable and consistent.
  893. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  894. * This function has been replaced by @see chado_get_custom_table_schema().
  895. */
  896. function tripal_get_chado_custom_schema($table) {
  897. tripal_report_error(
  898. 'tripal_api',
  899. TRIPAL_NOTICE,
  900. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  901. array(
  902. '%old_function'=>'tripal_get_chado_custom_schema',
  903. '%new_function' => 'chado_get_custom_table_schema'
  904. )
  905. );
  906. //New API Function
  907. return chado_get_custom_table_schema($table);
  908. }
  909. /**
  910. * @deprecated Restructured API to make naming more readable and consistent.
  911. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  912. * This function has been replaced by @see chado_is_installed().
  913. */
  914. function tripal_core_is_chado_installed() {
  915. tripal_report_error(
  916. 'tripal_api',
  917. TRIPAL_NOTICE,
  918. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  919. array(
  920. '%old_function'=>'tripal_core_is_chado_installed',
  921. '%new_function' => 'chado_is_installed'
  922. )
  923. );
  924. //New API Function
  925. return chado_is_installed();
  926. }
  927. /**
  928. * @deprecated Restructured API to make naming more readable and consistent.
  929. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  930. * This function has been replaced by @see chado_get_schema().
  931. */
  932. function tripal_core_get_chado_table_schema($table) {
  933. tripal_report_error(
  934. 'tripal_api',
  935. TRIPAL_NOTICE,
  936. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  937. array(
  938. '%old_function'=>'tripal_core_get_chado_table_schema',
  939. '%new_function' => 'chado_get_schema'
  940. )
  941. );
  942. //New API Function
  943. return chado_get_schema($table);
  944. }
  945. /**
  946. * @deprecated Restructured API to make naming more readable and consistent.
  947. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  948. * This function has been replaced by @see chado_get_version().
  949. */
  950. function tripal_core_get_chado_version($exact = FALSE, $warn_if_unsupported = FALSE) {
  951. tripal_report_error(
  952. 'tripal_api',
  953. TRIPAL_NOTICE,
  954. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  955. array(
  956. '%old_function'=>'tripal_core_get_chado_version',
  957. '%new_function' => 'chado_get_version'
  958. )
  959. );
  960. //New API Function
  961. return chado_get_version($exact, $warn_if_unsupported);
  962. }
  963. /**
  964. * @deprecated Restructured API to make naming more readable and consistent.
  965. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  966. * This function has been replaced by @see chado_set_active().
  967. */
  968. function tripal_db_set_active($dbname = 'default') {
  969. tripal_report_error(
  970. 'tripal_api',
  971. TRIPAL_NOTICE,
  972. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  973. array(
  974. '%old_function'=>'tripal_db_set_active',
  975. '%new_function' => 'chado_set_active'
  976. )
  977. );
  978. //New API Function
  979. return chado_set_active($dbname);
  980. }
  981. /**
  982. * @deprecated Restructured API to make naming more readable and consistent.
  983. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  984. * This function has been replaced by @see chado_is_local().
  985. */
  986. function tripal_core_is_chado_local() {
  987. tripal_report_error(
  988. 'tripal_api',
  989. TRIPAL_NOTICE,
  990. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  991. array(
  992. '%old_function'=>'tripal_core_is_chado_local',
  993. '%new_function' => 'chado_is_local'
  994. )
  995. );
  996. //New API Function
  997. return chado_is_local();
  998. }
  999. /**
  1000. * @deprecated Restructured API to make naming more readable and consistent.
  1001. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  1002. * This function has been replaced by @see chado_get_table_names().
  1003. */
  1004. function tripal_core_get_chado_tables($include_custom = NULL) {
  1005. tripal_report_error(
  1006. 'tripal_api',
  1007. TRIPAL_NOTICE,
  1008. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1009. array(
  1010. '%old_function'=>'tripal_core_get_chado_tables',
  1011. '%new_function' => 'chado_get_table_names'
  1012. )
  1013. );
  1014. //New API Function
  1015. return chado_get_table_names($include_custom);
  1016. }
  1017. /**
  1018. * @deprecated Restructured API to make naming more readable and consistent.
  1019. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  1020. * This function has been replaced by @see chado_is_local().
  1021. */
  1022. function tripal_core_chado_schema_exists() {
  1023. tripal_report_error(
  1024. 'tripal_api',
  1025. TRIPAL_NOTICE,
  1026. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1027. array(
  1028. '%old_function'=>'tripal_core_chado_schema_exists',
  1029. '%new_function' => 'chado_is_local'
  1030. )
  1031. );
  1032. //New API Function
  1033. return chado_is_local();
  1034. }
  1035. /**
  1036. * @deprecated Restructured API to make naming more readable and consistent.
  1037. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  1038. * This function has been replaced by @see chado_dbschema_exists().
  1039. */
  1040. function tripal_core_schema_exists($schema) {
  1041. tripal_report_error(
  1042. 'tripal_api',
  1043. TRIPAL_NOTICE,
  1044. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1045. array(
  1046. '%old_function'=>'tripal_core_schema_exists',
  1047. '%new_function' => 'chado_dbschema_exists'
  1048. )
  1049. );
  1050. //New API Function
  1051. return chado_dbschema_exists($schema);
  1052. }
  1053. /**
  1054. * @deprecated Restructured API to make naming more readable and consistent.
  1055. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  1056. * This function has been replaced by @see tripal_set_admin_message().
  1057. *
  1058. function theme_tripal_admin_message($variables) {
  1059. tripal_report_error(
  1060. 'tripal_api',
  1061. TRIPAL_NOTICE,
  1062. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1063. array(
  1064. '%old_function'=>'chado_get_id_for_node',
  1065. '%new_function' => 'chado_get_id_from_nid'
  1066. )
  1067. );
  1068. //New API Function
  1069. return tripal_set_admin_message();
  1070. }
  1071. */
  1072. /**
  1073. * @deprecated Restructured API to make naming more readable and consistent.
  1074. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  1075. * This function has been replaced by @see tripal_report_error().
  1076. */
  1077. function tripal_core_report_error($type, $severity, $message, $variables = array(), $options = array()) {
  1078. tripal_report_error(
  1079. 'tripal_api',
  1080. TRIPAL_NOTICE,
  1081. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1082. array(
  1083. '%old_function'=>'tripal_core_report_error',
  1084. '%new_function' => 'tripal_report_error'
  1085. )
  1086. );
  1087. //New API Function
  1088. return tripal_report_error($type, $severity, $message, $variables, $options);
  1089. }