1 Index: common/include/Group.class.php
2 ===================================================================
3 RCS file: /cvsroot/gforge/gforge/common/include/Group.class.php,v
4 retrieving revision 1.22
5 diff -u -b -r1.22 Group.class.php
6 --- common/include/Group.class.php 12 Feb 2003 17:23:47 -0000 1.22
7 +++ common/include/Group.class.php 16 Feb 2003 06:35:09 -0000
14 + * @var array $members_array.
19 * Associative array of data for plugins.
21 * @var array $plugins_array.
23 return $this->data_array['register_purpose'];
26 + function getMembers() {
27 + if (!$this->members_array) {
28 + $query = "SELECT users.user_id, users.realname, users.*
29 + FROM users,user_group
30 + WHERE users.user_id=user_group.user_id
31 + AND user_group.group_id='".$this->getID()."'";
32 + $this->members_array = db_query($query);
34 + return $this->members_array;
41 Index: common/tracker/Artifact.class.php
42 ===================================================================
43 RCS file: /cvsroot/gforge/gforge/common/tracker/Artifact.class.php,v
44 retrieving revision 1.7
45 diff -u -b -r1.7 Artifact.class.php
46 --- common/tracker/Artifact.class.php 12 Feb 2003 17:23:47 -0000 1.7
47 +++ common/tracker/Artifact.class.php 16 Feb 2003 06:35:10 -0000
52 + * Array of user IDs to CC: on changes.
59 * Array of ArtifactFile objects.
63 * @param int The ID of the user to which this artifact is to be assigned.
64 * @param int The artifacts priority.
65 * @param string An email address to add to the monitoring queue.
66 + * @param array An array ofuser_id's that should be CC:ed
67 * @return id on success / false on failure.
69 - function create($category_id, $artifact_group_id, $summary, $details, $assigned_to=100, $priority=5, $monitor_email=false) {
70 + function create($category_id, $artifact_group_id, $summary, $details, $assigned_to=100, $priority=5, $monitor_email=false, &$cc_arr) {
74 // make sure this person has permission to add artifacts
78 $artifact_id=db_insertid($res,'artifact','artifact_id');
81 if (!$res || !$artifact_id) {
82 $this->setError('Artifact: '.db_error());
88 + if (!$this->setCC($cc_arr)) {
94 // now send an email if appropriate
97 return $this->data_array['assigned_unixname'];
100 + function &getCC() {
101 + if (!$this->getID()) {
105 + $this->cc =& util_result_column_to_array(db_query("SELECT cc_id FROM tracker_cc WHERE artifact_id='".$this->getID()."'"));
110 + function getCCString() {
111 + $cc_arr = $this->getCC();
113 + return 'Nobody (none)';
115 + while (list($key, $value) = each($cc_arr)) {
116 + $user = user_get_object($value);
120 + $return .= $user->getRealName() . " (" . $user->getUnixName() . ")";
125 + function setCC(&$arr) {
126 + $arr2 =& $this->getCC();
127 + $this->cc =& $arr2;
128 + if (count($arr) < 1 || ((count($arr)==1) && ($arr[0]==''))) {
131 + if (count($arr) || count($arr2)) {
132 + $add_arr = array_diff($arr, $arr2);
133 + $del_arr = array_diff($arr2, $arr);
134 + while(list($key, $value) = each($del_arr)) {
135 + db_query("DELETE FROM tracker_cc
136 + WHERE artifact_id='".$this->getID()."'
137 + AND cc_id='".$value."'");
139 + $this->setError('setCC 1:: ' . db_error());
143 + while(list($key, $value) = each($add_arr)) {
144 + db_query("INSERT INTO tracker_cc (artifact_id, cc_id)
145 + VALUES ('".$this->getID()."', '". $value . "')");
147 + $this->setError('setCC 2:: ' . db_error());
158 * getOpenDate - get unix time of creation.
160 @@ -670,10 +740,11 @@
161 * @param int The canned response.
162 * @param string Attaching another comment.
163 * @param int Allows you to move an artifact to another type.
164 + * @param array List of user_id's to CC.
165 * @return boolean success.
167 function update($priority,$status_id,$category_id,$artifact_group_id,$resolution_id,
168 - $assigned_to,$summary,$canned_response,$details,$new_artifact_type_id) {
169 + $assigned_to,$summary,$canned_response,$details,$new_artifact_type_id, &$cc_arr) {
177 + $cc_add = array_diff($cc_arr, $this->getCC());
178 + $cc_del = array_diff($this->getCC(), $cc_arr);
179 + if ($cc_add || $cc_del) {
180 + $old_cc = $this->getCCString();
181 + if (!$this->setCC($cc_arr)) {
185 + $this->addHistory('cc',$old_cc);
186 + $changes['cc'] = 1;
187 + $send_message = true;
191 Finally, update the artifact itself
194 $this->marker('assigned_to',$changes).
195 "Assigned to: ". $this->getAssignedRealName() .
196 " (". $this->getAssignedUnixName(). ")"."\n".
197 + $this->marker('cc',$changes).
198 + "CC: " . $this->getCCString() . "\n".
199 $this->marker('summary',$changes).
200 "Summary: ". util_unconvert_htmlspecialchars( $this->getSummary() );
202 @@ -961,6 +1047,17 @@
206 + // Add CC: people to emails.
207 + $cc_arr = $this->getCC();
209 + while(list($key, $value) = each($cc_arr)) {
210 + if ($value != 100) {
211 + $user = user_get_object($value);
212 + $emails[] = $user->getEmail();
213 + $jabbers[] = $user->getJabberAddress();
217 $body .= "\n\nInitial Comment:".
218 "\n".util_unconvert_htmlspecialchars( $this->getDetails() ) .
219 "\n\n----------------------------------------------------------------------";
220 @@ -1016,6 +1113,9 @@
221 if (count($emails) > 0) {
222 $BCC=implode(',',array_unique($emails));
224 + if (count($jabbers) > 0) {
225 + $jab=implode(',',array_unique($jabbers));
228 if (count($monitor_ids) < 1) {
229 $monitor_ids=array();
230 @@ -1025,7 +1125,7 @@
234 - util_handle_message($monitor_ids,$subject,$body,$BCC);
235 + util_handle_message($monitor_ids,$subject,$body,$BCC,$jab);
239 Index: www/tracker/add.php
240 ===================================================================
241 RCS file: /cvsroot/gforge/gforge/www/tracker/add.php,v
242 retrieving revision 1.7
243 diff -u -b -r1.7 add.php
244 --- www/tracker/add.php 13 Feb 2003 13:58:22 -0000 1.7
245 +++ www/tracker/add.php 16 Feb 2003 06:35:10 -0000
247 echo '</td><td><strong>'.$Language->getText('tracker','priority').': <a href="javascript:help_window(\'/help/tracker.php?helpname=priority\')"><strong>(?)</strong></a></strong><br />';
248 echo build_priority_select_box('priority');
250 + echo '<tr><td><strong>CC:</strong><br />';
251 + echo $ath->multipleCCBox();
252 + echo '</td><td></td></tr>';
255 <tr><td colspan="2"><strong><?php echo $Language->getText('tracker','summary') ?>: <a href="javascript:help_window('/help/tracker.php?helpname=summary')"></strong><?php echo utils_requiredField(); ?><strong>(?)</strong></a><br />
256 Index: www/tracker/detail.php
257 ===================================================================
258 RCS file: /cvsroot/gforge/gforge/www/tracker/detail.php,v
259 retrieving revision 1.9
260 diff -u -b -r1.9 detail.php
261 --- www/tracker/detail.php 13 Feb 2003 13:58:22 -0000 1.9
262 +++ www/tracker/detail.php 16 Feb 2003 06:35:10 -0000
264 <td><strong><?php echo $Language->getText('tracker','status') ?>:</strong><br /><?php echo $ah->getStatusName(); ?></td>
269 + <strong>CC:</strong>
271 + $cc=db_query("SELECT users.realname AS user_name, users.user_name AS unix_name FROM users,tracker_cc WHERE users.user_id=tracker_cc.cc_id AND tracker_cc.artifact_id='".$ah->getID()."'");
272 + if (db_numrows($cc) == 0) {
273 + echo "<br />Nobody (None)\n";
275 + while ($cc_row=db_fetch_array($cc)) {
276 + echo "<br />".$cc_row['user_name']." (".$cc_row['unix_name'].")\n";
284 <tr><td colspan="2"><strong><?php echo $Language->getText('tracker','summary') ?>:</strong><br /><?php echo $ah->getSummary(); ?></td></tr>
286 <form action="<?php echo $PHP_SELF; ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>" METHOD="POST">
287 Index: www/tracker/index.php
288 ===================================================================
289 RCS file: /cvsroot/gforge/gforge/www/tracker/index.php,v
290 retrieving revision 1.11
291 diff -u -b -r1.11 index.php
292 --- www/tracker/index.php 13 Feb 2003 13:58:22 -0000 1.11
293 +++ www/tracker/index.php 16 Feb 2003 06:35:11 -0000
295 exit_error('ERROR', $Language->getText('general','invalid_email'));
298 - if (!$ah->create($category_id,$artifact_group_id,$summary,$details,$assigned_to,$priority, $user_email)) {
299 + if (!$ah->create($category_id,$artifact_group_id,$summary,$details,$assigned_to,$priority, $user_email, $cc)) {
300 exit_error('ERROR',$ah->getErrorMessage());
304 exit_error('ERROR',$ah->getErrorMessage());
306 if (!$ah->update($priority,$status_id,$category_id,$artifact_group_id,$resolution_id,
307 - $assigned_to,$summary,$canned_response,$details,$new_artfact_type_id)) {
308 + $assigned_to,$summary,$canned_response,$details,$new_artfact_type_id,$cc)) {
309 $feedback =$Language->getText('tracker','tracker_item'). ': '.$ah->getErrorMessage();
312 Index: www/tracker/mod.php
313 ===================================================================
314 RCS file: /cvsroot/gforge/gforge/www/tracker/mod.php,v
315 retrieving revision 1.10
316 diff -u -b -r1.10 mod.php
317 --- www/tracker/mod.php 2 Feb 2003 23:03:09 -0000 1.10
318 +++ www/tracker/mod.php 16 Feb 2003 06:35:11 -0000
325 + <strong>CC: <a href="javascript:help_window('/help/tracker.php?helpname=cc')"><strong>(?)</strong></a></strong><br />
328 + echo $ath->multipleCCBox('cc[]', $ah->getCC());
333 <strong><?php echo $Language->getText('tracker','status') ?>: <a href="javascript:help_window('/help/tracker.php?helpname=status')"><strong>(?)</strong></a></strong><br />
345 if ($ath->useResolution()) {
355 Index: www/tracker/include/ArtifactTypeHtml.class.php
356 ===================================================================
357 RCS file: /cvsroot/gforge/gforge/www/tracker/include/ArtifactTypeHtml.class.php,v
358 retrieving revision 1.10
359 diff -u -b -r1.10 ArtifactTypeHtml.class.php
360 --- www/tracker/include/ArtifactTypeHtml.class.php 3 Feb 2003 04:52:45 -0000 1.10
361 +++ www/tracker/include/ArtifactTypeHtml.class.php 16 Feb 2003 06:35:11 -0000
363 return html_build_select_box($this->getStatuses(),$name,$checked,$show_100,$text_100);
366 - function resolutionBox ($name='resolution_id',$checked='xzxz',$show_100=false,$text_100='none') {
367 + function multipleCCBox($name='cc[]',$cc_arr='') {
368 + $group = $this->getGroup();
369 + $result = $group->getMembers();
370 + if (!$cc_arr || count($cc_arr) == 0) {
371 + $cc_arr[0] = '100';
373 + return html_build_multiple_select_box($result, $name, $cc_arr);
376 + function resolutionBox ($name='resolution_id',$checked='xzxz',$show_100=false,$text_100='None') {
378 if ($text_100=='none'){
379 $text_100=$Language->getText('tracker_artifacttype','none');
380 --- /dev/null 1969-12-31 16:00:00.000000000 -0800
381 +++ db/tracker-cc.sql 2003-01-25 20:21:25.000000000 -0800
383 +CREATE SEQUENCE "tracker_cc_pk_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
386 +CREATE TABLE "tracker_cc" (
387 + "tracker_cc_id" integer DEFAULT nextval('tracker_cc_pk_seq'::text) NOT NULL,
388 + "artifact_id" integer DEFAULT '0' NOT NULL,
389 + "cc_id" integer DEFAULT '0' NOT NULL,
390 + Constraint "tracker_cc_pkey" Primary Key ("tracker_cc_id")