00001 <?php
00002 # This file is part of the Savane project
00003 # <http://gna.org/projects/savane/>
00004 #
00005 # $Id: items.php 5381 2006-02-15 14:40:03Z yeupou $
00006 #
00007 # Copyright 1999-2000 (c) The SourceForge Crew
00008 # Copyright 2001-2002 (c) Laurent Julliard, CodeX Team, Xerox
00009 #
00010 # Copyright 2002-2006 (c) Mathieu Roy <yeupou--gnu.org>
00011 #
00012 # The Savane project is free software; you can redistribute it and/or
00013 # modify it under the terms of the GNU General Public License
00014 # as published by the Free Software Foundation; either version 2
00015 # of the License, or (at your option) any later version.
00016 #
00017 # The Savane project is distributed in the hope that it will be useful,
00018 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00020 # GNU General Public License for more details.
00021 #
00022 # You should have received a copy of the GNU General Public License
00023 # along with the Savane project; if not, write to the Free Software
00024 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00025
00026
00027 require '../include/pre.php';
00028 require_directory("trackers");
00029
00030 register_globals_off();
00031
00032 if (user_isloggedin())
00033 {
00034 $form_threshold = sane_all("form_threshold");
00035 $form_open = sane_all("form_open");
00036 unset($threshold);
00037 unset($open);
00038
00039 # Extract arguments
00040 if ($form_threshold)
00041 {
00042 # Check if the argument is valid: numeric > 0 and < 10
00043 if (preg_match('/^[1-9]*$/i', $form_threshold))
00044 {
00045 $threshold = $form_threshold;
00046 user_set_preference("my_items_threshold", $threshold);
00047 }
00048 }
00049 if ($form_open)
00050 {
00051 # Check if the argument is valid: open or closed
00052 if ($form_open == 'open' || $form_open == 'closed')
00053 {
00054 $open = $form_open;
00055 user_set_preference("my_items_open", $open);
00056 }
00057 }
00058
00059 # Extract configuration if needed
00060 if (!$threshold)
00061 { $threshold = user_get_preference("my_items_threshold"); }
00062 if (!$open)
00063 { $open = user_get_preference("my_items_open"); }
00064
00065 # Still nothing? Set the default settings
00066 if (!$threshold)
00067 { $threshold = 5; }
00068 if (!$open)
00069 { $open = "open"; }
00070
00071 site_user_header(array('context'=>'myitems'));
00072
00073 print '<p>'._("This page contains lists of items assigned to or submitted by you.").'</p>';
00074
00075 # we get site-specific content
00076 utils_get_content("my/items");
00077
00078 $fopen = '<select name="form_open"><option value="open" '.($open == "open" ? 'selected="selected"':'').'>'._("Open").'</option><option value="closed" '.($open == "closed" ? 'selected="selected"':'').'>'._("Closed").'</option></select> ';
00079 $fthreshold = '<select name="form_threshold"><option value="1" '.($threshold == 1 ? 'selected="selected"':'').'>'._("Lowest").'</option><option value="3" '.($threshold == 3 ? 'selected="selected"':'').'>'._("Low").'</option><option value="5" '.($threshold == 5 ? 'selected="selected"':'').'>'._("Normal").'</option><option value="7" '.($threshold == 7 ? 'selected="selected"':'').'>'._("High").'</option><option value="9" '.($threshold == 9 ? 'selected="selected"':'').'>'._("Immediate").'</option></select> ';
00080
00081 $form_opening = '<form action="'.$PHP_SELF.'#options" method="get">';
00082 $form_submit = '<input class="bold" type="submit" value="'._("Apply").'" />';
00083 print html_show_displayoptions(sprintf(_("Show %s new items or of %s priority at least."), $fopen, $fthreshold),
00084 $form_opening,
00085 $form_submit);
00086
00087
00088 ################ RIGHT PART ############################
00089
00090 print html_splitpage(1);
00091
00092 print '<br /><div class="box"><div class="boxtitle">'._("Assigned to me").'</div>';
00093 print my_item_list("assignee", $threshold, $open);
00094 print '</div>';
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169 ################ LEFT PART ############################
00170
00171
00172 print html_splitpage(2);
00173
00174 print '<br /><div class="box"><div class="boxtitle">'._("Submitted by me").'</div>';
00175 print my_item_list("submitter", $threshold, $open);
00176 print '</div>';
00177
00178 print html_splitpage(3);
00179
00180 # End
00181
00182 print "\n\n".show_priority_colors_key();
00183
00184
00185 $HTML->footer(array());
00186
00187 }
00188 else
00189 {
00190
00191 exit_not_logged_in();
00192
00193 }
00194
00195 ?>