tripal.views_default.inc 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. <?php
  2. /**
  3. * @file
  4. * Describes core default views
  5. */
  6. /**
  7. * Describes core default views
  8. *
  9. * @ingroup tripal
  10. */
  11. function tripal_views_default_views() {
  12. $views = [];
  13. $view = tripal_admin_defaultview_jobs();
  14. $views[$view->name] = $view;
  15. // Add in the views for existing content types.
  16. tripal_bundle_default_views($views);
  17. return $views;
  18. }
  19. function tripal_bundle_default_views(&$views) {
  20. // Get the list of all of the bundles (entity types) and add them
  21. // as "base tables" for views.
  22. $bundles = db_select('tripal_bundle', 'tb')
  23. ->fields('tb')
  24. ->execute();
  25. // Iterate through the bundles.
  26. while ($bundle = $bundles->fetchObject()) {
  27. // The base table for a TripalEntity content type is simply the
  28. // vocab and the accession for the term. It's not really a table
  29. // but we use that nomenclature for views.
  30. $term = tripal_load_term_entity(['term_id' => $bundle->term_id]);
  31. $base_table = $term->vocab->vocabulary . '__' . $term->accession;
  32. $view_name = preg_replace('/[^\w]/', '_', $bundle->label) . '_search';
  33. // Get the fields that are attached to this bundle type.
  34. $fields = field_info_instances('TripalEntity', $bundle->name);
  35. // Initalize the view.
  36. $view = new view();
  37. $view->name = $view_name;
  38. $view->description = 'A search tool for ' . $bundle->label . ' content.';
  39. $view->tag = $bundle->label . ' search';
  40. $view->base_table = $base_table;
  41. $view->human_name = $bundle->label . ' Search';
  42. $view->core = 7;
  43. $view->api_version = '3.0';
  44. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  45. /* Display: Defaults */
  46. $handler = $view->new_display('default', 'Defaults', 'default');
  47. $handler->display->display_options['title'] = $bundle->label . ' Search';
  48. $handler->display->display_options['use_more_always'] = FALSE;
  49. $handler->display->display_options['access']['type'] = 'perm';
  50. $handler->display->display_options['access']['perm'] = 'view ' . $bundle->name;
  51. $handler->display->display_options['cache']['type'] = 'none';
  52. $handler->display->display_options['query']['type'] = 'views_query';
  53. $handler->display->display_options['exposed_form']['type'] = 'input_required';
  54. $handler->display->display_options['exposed_form']['options']['submit_button'] = 'Search';
  55. $handler->display->display_options['exposed_form']['options']['text_input_required_format'] = 'filtered_html';
  56. $handler->display->display_options['pager']['type'] = 'full';
  57. $handler->display->display_options['pager']['options']['items_per_page'] = '10';
  58. $handler->display->display_options['pager']['options']['offset'] = '0';
  59. $handler->display->display_options['pager']['options']['id'] = '0';
  60. $handler->display->display_options['pager']['options']['quantity'] = '9';
  61. // Start the default display style options.
  62. $handler->display->display_options['style_plugin'] = 'table';
  63. $handler->display->display_options['style_options']['grouping'] = '';
  64. // We can't have all fields show up as columns in a table so we have
  65. // to be selective and choose those that are most likely to be most
  66. // descriptive of a content type.
  67. $columns = [];
  68. $default_fields = [
  69. 'data__image',
  70. 'data__identifier',
  71. 'schema__name',
  72. 'data__accession',
  73. 'rdfs__label',
  74. 'taxrank__genus',
  75. 'taxrank__species',
  76. 'obi__organism',
  77. 'tpub__title',
  78. 'schema__alternate_name',
  79. 'schema__description',
  80. 'tpub__abstract',
  81. ];
  82. $selected_fields = [];
  83. foreach ($default_fields as $field_name) {
  84. if (in_array($field_name, array_keys($fields))) {
  85. $selected_fields[] = $field_name;
  86. }
  87. }
  88. $handler->display->display_options['style_options']['default'] = '-1';
  89. // Add in the entity_id field.
  90. $handler->display->display_options['style_options']['columns']['entity_id'] = 'entity_id';
  91. $handler->display->display_options['style_options']['info']['entity_id'] = [
  92. 'sortable' => 1,
  93. 'separator' => '',
  94. ];
  95. $handler->display->display_options['fields']['entity_id']['id'] = 'entity_id';
  96. $handler->display->display_options['fields']['entity_id']['table'] = $base_table;
  97. $handler->display->display_options['fields']['entity_id']['field'] = 'entity_id';
  98. $handler->display->display_options['fields']['entity_id']['exclude'] = TRUE;
  99. // Add in other selected fields to the view.
  100. foreach ($selected_fields as $field_name) {
  101. $field = $fields[$field_name];
  102. // Make sure the table headers are there for this field.
  103. $handler->display->display_options['style_options']['columns'][$field_name] = $field_name;
  104. $handler->display->display_options['style_options']['info'][$field_name]['separator'] = '';
  105. // Add in the current field.
  106. $handler->display->display_options['fields'][$field_name]['id'] = $field_name;
  107. $handler->display->display_options['fields'][$field_name]['table'] = $base_table;
  108. $handler->display->display_options['fields'][$field_name]['field'] = $field_name;
  109. $handler->display->display_options['fields'][$field_name]['label'] = $field['label'];
  110. // Only some fields are sortable.
  111. if (in_array($field_name, [
  112. 'data__identifier',
  113. 'schema__name',
  114. 'data__accession',
  115. 'rdfs__label',
  116. 'taxrank__genus',
  117. 'taxrank__species',
  118. 'obi__organism',
  119. 'schema__alternate_name',
  120. 'tpub__title',
  121. ])) {
  122. $handler->display->display_options['style_options']['info'][$field_name]['sortable'] = 1;
  123. $handler->display->display_options['style_options']['info'][$field_name]['default_sort_order'] = 'asc';
  124. }
  125. // The name or identifier fields should link to the record.
  126. if ($field_name == 'data__identifier' or $field_name == 'schema__name' or
  127. $field_name == 'taxrank__genus' or $field_name == 'taxrank__species' or
  128. $field_name == 'tpub__title') {
  129. $handler->display->display_options['fields'][$field_name]['alter']['make_link'] = TRUE;
  130. $handler->display->display_options['fields'][$field_name]['alter']['path'] = 'bio_data/[entity_id]';
  131. }
  132. // Set a default image width to 100px.
  133. if ($field_name == 'data__image') {
  134. $handler->display->display_options['fields']['data__image']['image_width'] = '100';
  135. }
  136. // Add a 'read more' link to the description field if it's too big
  137. if ($field_name == 'schema__description') {
  138. $handler->display->display_options['fields']['schema__description']['alter']['max_length'] = '512';
  139. $handler->display->display_options['fields']['schema__description']['alter']['more_link'] = TRUE;
  140. $handler->display->display_options['fields']['schema__description']['alter']['more_link_text'] = 'read more';
  141. $handler->display->display_options['fields']['schema__description']['alter']['more_link_path'] = 'bio_data/[entity_id]';
  142. $handler->display->display_options['fields']['schema__description']['alter']['trim'] = TRUE;
  143. }
  144. // Add a filter to show published content only.
  145. $handler->display->display_options['filters']['status']['id'] = 'status';
  146. $handler->display->display_options['filters']['status']['table'] = $base_table;
  147. $handler->display->display_options['filters']['status']['field'] = 'status';
  148. $handler->display->display_options['filters']['status']['value'] = '1';
  149. // Filter criterion.
  150. if (in_array($field_name, [
  151. 'data__identifier',
  152. 'schema__name',
  153. 'data__accession',
  154. 'rdfs__label',
  155. 'taxrank__genus',
  156. 'taxrank__species',
  157. 'obi__organism',
  158. 'tpub__title',
  159. ])) {
  160. $handler->display->display_options['filters'][$field_name]['id'] = $field_name;
  161. $handler->display->display_options['filters'][$field_name]['table'] = $base_table;
  162. $handler->display->display_options['filters'][$field_name]['field'] = $field_name;
  163. $handler->display->display_options['filters'][$field_name]['operator'] = 'contains';
  164. $handler->display->display_options['filters'][$field_name]['group'] = 1;
  165. $handler->display->display_options['filters'][$field_name]['exposed'] = TRUE;
  166. $handler->display->display_options['filters'][$field_name]['expose']['operator_id'] = $field_name . '_op';
  167. $handler->display->display_options['filters'][$field_name]['expose']['label'] = $field['label'];
  168. $handler->display->display_options['filters'][$field_name]['expose']['use_operator'] = TRUE;
  169. $handler->display->display_options['filters'][$field_name]['expose']['operator'] = $field_name . '_op';
  170. $handler->display->display_options['filters'][$field_name]['expose']['identifier'] = $field_name;
  171. $handler->display->display_options['filters'][$field_name]['expose']['remember_roles'] = [
  172. 2 => '2',
  173. 1 => 0,
  174. 3 => 0,
  175. ];
  176. $handler->display->display_options['filters'][$field_name]['select_optional'] = TRUE;
  177. $handler->display->display_options['filters'][$field_name]['max_length'] = '40';
  178. }
  179. }
  180. // Add the default sorted column.
  181. if (in_array('data__identifier', $selected_fields)) {
  182. $handler->display->display_options['sorts']['priority']['id'] = $field_name;
  183. $handler->display->display_options['sorts']['priority']['table'] = $base_table;
  184. $handler->display->display_options['sorts']['priority']['field'] = 'data__identifier';
  185. }
  186. else {
  187. if (in_array('schema__name', $selected_fields)) {
  188. $handler->display->display_options['sorts']['priority']['id'] = $field_name;
  189. $handler->display->display_options['sorts']['priority']['table'] = $base_table;
  190. $handler->display->display_options['sorts']['priority']['field'] = 'schema__name';
  191. }
  192. else {
  193. if (in_array('obi__organism', $selected_fields)) {
  194. $handler->display->display_options['sorts']['priority']['id'] = $field_name;
  195. $handler->display->display_options['sorts']['priority']['table'] = $base_table;
  196. $handler->display->display_options['sorts']['priority']['field'] = 'obi__organism';
  197. }
  198. else {
  199. if (in_array('rdfs_label', $selected_fields)) {
  200. $handler->display->display_options['sorts']['priority']['id'] = $field_name;
  201. $handler->display->display_options['sorts']['priority']['table'] = $base_table;
  202. $handler->display->display_options['sorts']['priority']['field'] = 'rdfs_label';
  203. }
  204. else {
  205. if (in_array('taxrank__genus', $selected_fields)) {
  206. $handler->display->display_options['sorts']['priority']['id'] = $field_name;
  207. $handler->display->display_options['sorts']['priority']['table'] = $base_table;
  208. $handler->display->display_options['sorts']['priority']['field'] = 'taxrank__genus';
  209. }
  210. else {
  211. if (in_array('taxrank__species', $selected_fields)) {
  212. $handler->display->display_options['sorts']['priority']['id'] = $field_name;
  213. $handler->display->display_options['sorts']['priority']['table'] = $base_table;
  214. $handler->display->display_options['sorts']['priority']['field'] = 'taxrank__species';
  215. }
  216. }
  217. }
  218. }
  219. }
  220. }
  221. /* Footer: Global: Tripal Content Data Collections */
  222. $handler->display->display_options['footer']['tripal_area_collections']['id'] = 'tripal_area_collections';
  223. $handler->display->display_options['footer']['tripal_area_collections']['table'] = 'views';
  224. $handler->display->display_options['footer']['tripal_area_collections']['field'] = 'tripal_area_collections';
  225. // No results behavior: Global: Text area.
  226. $handler->display->display_options['empty']['text']['id'] = 'text';
  227. $handler->display->display_options['empty']['text']['table'] = 'views';
  228. $handler->display->display_options['empty']['text']['field'] = 'area';
  229. $handler->display->display_options['empty']['text']['empty'] = TRUE;
  230. $handler->display->display_options['empty']['text']['content'] = 'No ' . strtolower($bundle->label) . ' records matched the supplied criteria.';
  231. $handler->display->display_options['empty']['text']['format'] = 'filtered_html';
  232. // Add page and menu.
  233. $handler = $view->new_display('page', 'Page', 'page_1');
  234. $handler->display->display_options['path'] = 'data_search/' . strtolower(preg_replace('/[^\w]/', '_', $bundle->label));
  235. $handler->display->display_options['menu']['type'] = 'normal';
  236. $handler->display->display_options['menu']['title'] = $bundle->label . ' Search';
  237. $handler->display->display_options['menu']['description'] = 'A search form for finding ' . $bundle->label . ' records';
  238. $handler->display->display_options['menu']['weight'] = '-10';
  239. $handler->display->display_options['menu']['name'] = 'data_search';
  240. $handler->display->display_options['menu']['context'] = 0;
  241. $handler->display->display_options['menu']['context_only_inline'] = 0;
  242. $views[$view_name] = $view;
  243. }
  244. }
  245. /**
  246. * Describes the jobs administration view.
  247. *
  248. * @ingroup tripal
  249. */
  250. function tripal_admin_defaultview_jobs() {
  251. $view = new view();
  252. $view->name = 'tripal_admin_jobs';
  253. $view->description = 'DO NOT DISABLE';
  254. $view->tag = 'tripal admin';
  255. $view->base_table = 'tripal_jobs';
  256. $view->human_name = 'Tripal Jobs (Admin)';
  257. $view->core = 7;
  258. $view->api_version = '3.0';
  259. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  260. /* Display: Master */
  261. $handler = $view->new_display('default', 'Master', 'default');
  262. $handler->display->display_options['title'] = 'Jobs';
  263. $handler->display->display_options['use_more_always'] = FALSE;
  264. $handler->display->display_options['access']['type'] = 'perm';
  265. $handler->display->display_options['access']['perm'] = 'administer tripal';
  266. $handler->display->display_options['cache']['type'] = 'none';
  267. $handler->display->display_options['query']['type'] = 'views_query';
  268. $handler->display->display_options['exposed_form']['type'] = 'basic';
  269. $handler->display->display_options['exposed_form']['options']['submit_button'] = 'Filter';
  270. $handler->display->display_options['pager']['type'] = 'full';
  271. $handler->display->display_options['pager']['options']['items_per_page'] = '25';
  272. $handler->display->display_options['style_plugin'] = 'table';
  273. $handler->display->display_options['style_options']['columns'] = [
  274. 'job_id' => 'job_id',
  275. 'job_name' => 'job_name',
  276. 'submit_date' => 'submit_date',
  277. 'start_time' => 'start_time',
  278. 'end_time' => 'end_time',
  279. 'nothing' => 'nothing',
  280. 'priority' => 'priority',
  281. 'progress' => 'progress',
  282. 'status' => 'status',
  283. 'nothing_2' => 'nothing_2',
  284. 'nothing_3' => 'nothing_3',
  285. 'nothing_1' => 'nothing_1',
  286. ];
  287. $handler->display->display_options['style_options']['default'] = 'job_id';
  288. $handler->display->display_options['style_options']['info'] = [
  289. 'job_id' => [
  290. 'sortable' => 1,
  291. 'default_sort_order' => 'desc',
  292. 'align' => '',
  293. 'separator' => '',
  294. 'empty_column' => 0,
  295. ],
  296. 'job_name' => [
  297. 'sortable' => 1,
  298. 'default_sort_order' => 'asc',
  299. 'align' => '',
  300. 'separator' => '',
  301. 'empty_column' => 0,
  302. ],
  303. 'submit_date' => [
  304. 'sortable' => 0,
  305. 'default_sort_order' => 'asc',
  306. 'align' => '',
  307. 'separator' => '',
  308. 'empty_column' => 0,
  309. ],
  310. 'start_time' => [
  311. 'sortable' => 0,
  312. 'default_sort_order' => 'asc',
  313. 'align' => '',
  314. 'separator' => '',
  315. 'empty_column' => 0,
  316. ],
  317. 'end_time' => [
  318. 'sortable' => 0,
  319. 'default_sort_order' => 'asc',
  320. 'align' => '',
  321. 'separator' => '',
  322. 'empty_column' => 0,
  323. ],
  324. 'nothing' => [
  325. 'align' => '',
  326. 'separator' => '',
  327. 'empty_column' => 0,
  328. ],
  329. 'priority' => [
  330. 'sortable' => 1,
  331. 'default_sort_order' => 'asc',
  332. 'align' => '',
  333. 'separator' => '',
  334. 'empty_column' => 0,
  335. ],
  336. 'progress' => [
  337. 'sortable' => 1,
  338. 'default_sort_order' => 'asc',
  339. 'align' => '',
  340. 'separator' => '',
  341. 'empty_column' => 0,
  342. ],
  343. 'status' => [
  344. 'sortable' => 1,
  345. 'default_sort_order' => 'asc',
  346. 'align' => '',
  347. 'separator' => '',
  348. 'empty_column' => 0,
  349. ],
  350. 'nothing_2' => [
  351. 'align' => '',
  352. 'separator' => '',
  353. 'empty_column' => 0,
  354. ],
  355. 'nothing_3' => [
  356. 'align' => '',
  357. 'separator' => '',
  358. 'empty_column' => 0,
  359. ],
  360. 'nothing_1' => [
  361. 'align' => '',
  362. 'separator' => '',
  363. 'empty_column' => 0,
  364. ],
  365. ];
  366. /* Header: Global: Text area */
  367. $handler->display->display_options['header']['area']['id'] = 'area';
  368. $handler->display->display_options['header']['area']['table'] = 'views';
  369. $handler->display->display_options['header']['area']['field'] = 'area';
  370. $handler->display->display_options['header']['area']['label'] = 'Description';
  371. $handler->display->display_options['header']['area']['empty'] = TRUE;
  372. $handler->display->display_options['header']['area']['content'] = '<p>Waiting jobs are executed first by priority level (the lower the number the higher the priority) and second by the order they were entered.</p>';
  373. $handler->display->display_options['header']['area']['format'] = 'filtered_html';
  374. /* Field: Tripal Jobs: Job ID */
  375. $handler->display->display_options['fields']['job_id']['id'] = 'job_id';
  376. $handler->display->display_options['fields']['job_id']['table'] = 'tripal_jobs';
  377. $handler->display->display_options['fields']['job_id']['field'] = 'job_id';
  378. $handler->display->display_options['fields']['job_id']['label'] = '';
  379. $handler->display->display_options['fields']['job_id']['element_class'] = 'extra-short-column';
  380. $handler->display->display_options['fields']['job_id']['element_label_class'] = 'extra-short-column';
  381. $handler->display->display_options['fields']['job_id']['element_label_colon'] = FALSE;
  382. $handler->display->display_options['fields']['job_id']['separator'] = '';
  383. /* Field: Tripal Jobs: Job Name */
  384. $handler->display->display_options['fields']['job_name']['id'] = 'job_name';
  385. $handler->display->display_options['fields']['job_name']['table'] = 'tripal_jobs';
  386. $handler->display->display_options['fields']['job_name']['field'] = 'job_name';
  387. $handler->display->display_options['fields']['job_name']['alter']['make_link'] = TRUE;
  388. $handler->display->display_options['fields']['job_name']['alter']['path'] = 'admin/tripal/tripal_jobs/view/[job_id]';
  389. /* Field: Tripal Jobs: Submit Date */
  390. $handler->display->display_options['fields']['submit_date']['id'] = 'submit_date';
  391. $handler->display->display_options['fields']['submit_date']['table'] = 'tripal_jobs';
  392. $handler->display->display_options['fields']['submit_date']['field'] = 'submit_date';
  393. $handler->display->display_options['fields']['submit_date']['exclude'] = TRUE;
  394. $handler->display->display_options['fields']['submit_date']['date_format'] = 'long';
  395. /* Field: Tripal Jobs: Start Time */
  396. $handler->display->display_options['fields']['start_time']['id'] = 'start_time';
  397. $handler->display->display_options['fields']['start_time']['table'] = 'tripal_jobs';
  398. $handler->display->display_options['fields']['start_time']['field'] = 'start_time';
  399. $handler->display->display_options['fields']['start_time']['exclude'] = TRUE;
  400. $handler->display->display_options['fields']['start_time']['date_format'] = 'long';
  401. /* Field: Tripal Jobs: End Time */
  402. $handler->display->display_options['fields']['end_time']['id'] = 'end_time';
  403. $handler->display->display_options['fields']['end_time']['table'] = 'tripal_jobs';
  404. $handler->display->display_options['fields']['end_time']['field'] = 'end_time';
  405. $handler->display->display_options['fields']['end_time']['exclude'] = TRUE;
  406. $handler->display->display_options['fields']['end_time']['date_format'] = 'long';
  407. /* Field: Global: Custom text */
  408. $handler->display->display_options['fields']['nothing']['id'] = 'nothing';
  409. $handler->display->display_options['fields']['nothing']['table'] = 'views';
  410. $handler->display->display_options['fields']['nothing']['field'] = 'nothing';
  411. $handler->display->display_options['fields']['nothing']['label'] = 'Dates';
  412. $handler->display->display_options['fields']['nothing']['alter']['text'] = 'Submitted: [submit_date]<br />
  413. Started: [start_time]<br />
  414. Ended: [end_time]';
  415. /* Field: Tripal Jobs: Priority */
  416. $handler->display->display_options['fields']['priority']['id'] = 'priority';
  417. $handler->display->display_options['fields']['priority']['table'] = 'tripal_jobs';
  418. $handler->display->display_options['fields']['priority']['field'] = 'priority';
  419. $handler->display->display_options['fields']['priority']['element_class'] = 'short-column';
  420. $handler->display->display_options['fields']['priority']['element_label_class'] = 'short-column';
  421. $handler->display->display_options['fields']['priority']['separator'] = '';
  422. /* Field: Tripal Jobs: Progress */
  423. $handler->display->display_options['fields']['progress']['id'] = 'progress';
  424. $handler->display->display_options['fields']['progress']['table'] = 'tripal_jobs';
  425. $handler->display->display_options['fields']['progress']['field'] = 'progress';
  426. $handler->display->display_options['fields']['progress']['element_class'] = 'short-column';
  427. $handler->display->display_options['fields']['progress']['element_label_class'] = 'short-column';
  428. $handler->display->display_options['fields']['progress']['separator'] = '';
  429. $handler->display->display_options['fields']['progress']['suffix'] = '%';
  430. /* Field: Tripal Jobs: Status */
  431. $handler->display->display_options['fields']['status']['id'] = 'status';
  432. $handler->display->display_options['fields']['status']['table'] = 'tripal_jobs';
  433. $handler->display->display_options['fields']['status']['field'] = 'status';
  434. $handler->display->display_options['fields']['status']['element_class'] = 'short-column';
  435. $handler->display->display_options['fields']['status']['element_label_class'] = 'short-column';
  436. /* Field: Global: Custom text */
  437. $handler->display->display_options['fields']['nothing_2']['id'] = 'nothing_2';
  438. $handler->display->display_options['fields']['nothing_2']['table'] = 'views';
  439. $handler->display->display_options['fields']['nothing_2']['field'] = 'nothing';
  440. $handler->display->display_options['fields']['nothing_2']['label'] = 'Re-run Link';
  441. $handler->display->display_options['fields']['nothing_2']['exclude'] = TRUE;
  442. $handler->display->display_options['fields']['nothing_2']['alter']['text'] = 'Re-run';
  443. $handler->display->display_options['fields']['nothing_2']['alter']['make_link'] = TRUE;
  444. $handler->display->display_options['fields']['nothing_2']['alter']['path'] = 'admin/tripal/tripal_jobs/rerun/[job_id]';
  445. /* Field: Global: Custom text */
  446. $handler->display->display_options['fields']['nothing_3']['id'] = 'nothing_3';
  447. $handler->display->display_options['fields']['nothing_3']['table'] = 'views';
  448. $handler->display->display_options['fields']['nothing_3']['field'] = 'nothing';
  449. $handler->display->display_options['fields']['nothing_3']['label'] = 'Cancel link';
  450. $handler->display->display_options['fields']['nothing_3']['exclude'] = TRUE;
  451. $handler->display->display_options['fields']['nothing_3']['alter']['text'] = 'Cancel';
  452. $handler->display->display_options['fields']['nothing_3']['alter']['make_link'] = TRUE;
  453. $handler->display->display_options['fields']['nothing_3']['alter']['path'] = 'admin/tripal/tripal_jobs/cancel/[job_id]';
  454. /* Field: Global: Custom text */
  455. $handler->display->display_options['fields']['nothing_4']['id'] = 'nothing_4';
  456. $handler->display->display_options['fields']['nothing_4']['table'] = 'views';
  457. $handler->display->display_options['fields']['nothing_4']['field'] = 'nothing';
  458. $handler->display->display_options['fields']['nothing_4']['label'] = 'Execute link';
  459. $handler->display->display_options['fields']['nothing_4']['exclude'] = TRUE;
  460. $handler->display->display_options['fields']['nothing_4']['alter']['text'] = 'Execute';
  461. $handler->display->display_options['fields']['nothing_4']['alter']['make_link'] = TRUE;
  462. $handler->display->display_options['fields']['nothing_4']['alter']['path'] = 'admin/tripal/tripal_jobs/execute/[job_id]';
  463. /* Field: Global: Custom text */
  464. $handler->display->display_options['fields']['nothing_1']['id'] = 'nothing_1';
  465. $handler->display->display_options['fields']['nothing_1']['table'] = 'views';
  466. $handler->display->display_options['fields']['nothing_1']['field'] = 'nothing';
  467. $handler->display->display_options['fields']['nothing_1']['label'] = 'Action';
  468. $handler->display->display_options['fields']['nothing_1']['alter']['text'] = '[nothing_4]<br />[nothing_2]<br />[nothing_3]';
  469. $handler->display->display_options['fields']['nothing_1']['element_class'] = 'short-column';
  470. $handler->display->display_options['fields']['nothing_1']['element_label_class'] = 'short-column';
  471. /* Filter criterion: Tripal Jobs: Job Name */
  472. $handler->display->display_options['filters']['job_name']['id'] = 'job_name';
  473. $handler->display->display_options['filters']['job_name']['table'] = 'tripal_jobs';
  474. $handler->display->display_options['filters']['job_name']['field'] = 'job_name';
  475. $handler->display->display_options['filters']['job_name']['operator'] = 'contains';
  476. $handler->display->display_options['filters']['job_name']['exposed'] = TRUE;
  477. $handler->display->display_options['filters']['job_name']['expose']['operator_id'] = 'job_name_op';
  478. $handler->display->display_options['filters']['job_name']['expose']['label'] = 'Job Name Contains';
  479. $handler->display->display_options['filters']['job_name']['expose']['operator'] = 'job_name_op';
  480. $handler->display->display_options['filters']['job_name']['expose']['identifier'] = 'job_name';
  481. $handler->display->display_options['filters']['job_name']['expose']['remember_roles'] = [
  482. 2 => '2',
  483. 1 => 0,
  484. 3 => 0,
  485. ];
  486. /* Filter criterion: Tripal Jobs: Module Name */
  487. $handler->display->display_options['filters']['modulename']['id'] = 'modulename';
  488. $handler->display->display_options['filters']['modulename']['table'] = 'tripal_jobs';
  489. $handler->display->display_options['filters']['modulename']['field'] = 'modulename';
  490. $handler->display->display_options['filters']['modulename']['exposed'] = TRUE;
  491. $handler->display->display_options['filters']['modulename']['expose']['operator_id'] = 'modulename_op';
  492. $handler->display->display_options['filters']['modulename']['expose']['label'] = 'Submitting Module';
  493. $handler->display->display_options['filters']['modulename']['expose']['operator'] = 'modulename_op';
  494. $handler->display->display_options['filters']['modulename']['expose']['identifier'] = 'modulename';
  495. $handler->display->display_options['filters']['modulename']['expose']['remember_roles'] = [
  496. 2 => '2',
  497. 1 => 0,
  498. 3 => 0,
  499. ];
  500. /* Filter criterion: Tripal Jobs: Status */
  501. $handler->display->display_options['filters']['status']['id'] = 'status';
  502. $handler->display->display_options['filters']['status']['table'] = 'tripal_jobs';
  503. $handler->display->display_options['filters']['status']['field'] = 'status';
  504. $handler->display->display_options['filters']['status']['exposed'] = TRUE;
  505. $handler->display->display_options['filters']['status']['expose']['operator_id'] = 'status_op';
  506. $handler->display->display_options['filters']['status']['expose']['label'] = 'Job Status';
  507. $handler->display->display_options['filters']['status']['expose']['operator'] = 'status_op';
  508. $handler->display->display_options['filters']['status']['expose']['identifier'] = 'status';
  509. $handler->display->display_options['filters']['status']['expose']['remember_roles'] = [
  510. 2 => '2',
  511. 1 => 0,
  512. 3 => 0,
  513. ];
  514. /* Display: Page */
  515. $handler = $view->new_display('page', 'Page', 'page');
  516. $handler->display->display_options['path'] = 'admin/tripal/tripal_jobs/jobs';
  517. $handler->display->display_options['menu']['title'] = 'Jobs';
  518. $handler->display->display_options['menu']['description'] = 'Jobs managed by Tripal';
  519. $handler->display->display_options['menu']['weight'] = '-10';
  520. $handler->display->display_options['menu']['context'] = 0;
  521. $handler->display->display_options['menu']['context_only_inline'] = 0;
  522. $handler->display->display_options['tab_options']['weight'] = '0';
  523. return $view;
  524. }