/[pkg-tikiwiki]/tags/feature/1.9.5/external-libs/tiki-g-user_processes.php
ViewVC logotype

Contents of /tags/feature/1.9.5/external-libs/tiki-g-user_processes.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 124 - (show annotations) (download)
Tue Nov 7 12:14:33 2006 UTC (6 years, 6 months ago) by marcusb-guest
File size: 2839 byte(s)
Tag and move branch.
1 <?php
2
3 // $Header: /cvsroot/tikiwiki/tiki/tiki-g-user_processes.php,v 1.8.2.2 2006/03/04 22:46:16 georger_br Exp $
4
5 // Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
6 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
7 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
8 require_once ('tiki-setup.php');
9
10 include_once ('lib/Galaxia/GUI.php');
11
12 if ($feature_workflow != 'y') {
13 $smarty->assign('msg', tra("This feature is disabled").": feature_workflow");
14
15 $smarty->display("error.tpl");
16 die;
17 }
18
19 if ($tiki_p_use_workflow != 'y') {
20 $smarty->assign('msg', tra("Permission denied"));
21
22 $smarty->display("error.tpl");
23 die;
24 }
25
26 // When $user is null, it means an anonymous user is trying to use Galaxia
27 $user = is_null($user) ? "Anonymous" : $user;
28
29 // Filtering data to be received by request and used to build the where part of a query
30 // filter_active, filter_valid, find, sort_mode, filter_process
31 $where = '';
32 $wheres = array();
33
34 /*
35 if(isset($_REQUEST['filter_active'])&&$_REQUEST['filter_active']) $wheres[]="isActive='".$_REQUEST['filter_active']."'";
36 if(isset($_REQUEST['filter_valid'])&&$_REQUEST['filter_valid']) $wheres[]="isValid='".$_REQUEST['filter_valid']."'";
37 if(isset($_REQUEST['filter_process'])&&$_REQUEST['filter_process']) $wheres[]="pId=".$_REQUEST['filter_process']."";
38 $where = implode(' and ',$wheres);
39 */
40 if (!isset($_REQUEST["sort_mode"])) {
41 $sort_mode = 'procname_asc';
42 } else {
43 $sort_mode = $_REQUEST["sort_mode"];
44 }
45
46 if (!isset($_REQUEST["offset"])) {
47 $offset = 0;
48 } else {
49 $offset = $_REQUEST["offset"];
50 }
51
52 $smarty->assign_by_ref('offset', $offset);
53
54 if (isset($_REQUEST["find"])) {
55 $find = $_REQUEST["find"];
56 } else {
57 $find = '';
58 }
59
60 $smarty->assign('find', $find);
61 $smarty->assign('where', $where);
62 $smarty->assign_by_ref('sort_mode', $sort_mode);
63
64 $items = $GUI->gui_list_user_processes($user, $offset, $maxRecords, $sort_mode, $find, $where);
65 $smarty->assign('cant', $items['cant']);
66
67 $cant_pages = ceil($items["cant"] / $maxRecords);
68 $smarty->assign_by_ref('cant_pages', $cant_pages);
69 $smarty->assign('actual_page', 1 + ($offset / $maxRecords));
70
71 if ($items["cant"] > ($offset + $maxRecords)) {
72 $smarty->assign('next_offset', $offset + $maxRecords);
73 } else {
74 $smarty->assign('next_offset', -1);
75 }
76
77 if ($offset > 0) {
78 $smarty->assign('prev_offset', $offset - $maxRecords);
79 } else {
80 $smarty->assign('prev_offset', -1);
81 }
82
83 $smarty->assign_by_ref('items', $items["data"]);
84
85 $section = 'workflow';
86 include_once ('tiki-section_options.php');
87
88 $sameurl_elements = array(
89 'offset',
90 'sort_mode',
91 'where',
92 'find',
93 'filter_valid',
94 'filter_process',
95 'filter_active',
96 'pid'
97 );
98 ask_ticket('g-user-processes');
99
100 $smarty->assign('mid', 'tiki-g-user_processes.tpl');
101 $smarty->display("tiki.tpl");
102
103 ?>

  ViewVC Help
Powered by ViewVC 1.1.5