3 * GForge Command-line Interface
5 * Copyright 2005 GForge, LLC
8 * @version $Id: default.php,v 1.6 2005/10/20 18:55:31 marcelo Exp $
10 * This file is part of GForge.
12 * GForge is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * GForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with GForge; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 * Variables passed by parent script:
29 * - $SOAP: Soap object to talk to the server
30 * - $PARAMS: parameters passed to this script
31 * - $LOG: object for logging of events
34 // These constants are defined in ArtifactExtraField.class.php (GForge's source). They
35 // declare the different types of extra fields available for an artifact type
36 define('ARTIFACT_EXTRAFIELDTYPE_SELECT',1);
37 define('ARTIFACT_EXTRAFIELDTYPE_CHECKBOX',2);
38 define('ARTIFACT_EXTRAFIELDTYPE_RADIO',3);
39 define('ARTIFACT_EXTRAFIELDTYPE_TEXT',4);
40 define('ARTIFACT_EXTRAFIELDTYPE_MULTISELECT',5);
41 define('ARTIFACT_EXTRAFIELDTYPE_TEXTAREA',6);
42 define('ARTIFACT_EXTRAFIELDTYPE_STATUS',7);
43 define('ARTIFACT_EXTRAFIELDTYPE_INTEGER',10);
45 // function to execute
46 // $PARAMS[0] is "tracker" (the name of this module) and $PARAMS[1] is the name of the function
47 $module_name = array_shift($PARAMS); // Pop off module name
48 $function_name = array_shift($PARAMS); // Pop off function name
50 switch ($function_name) {
55 tracker_do_typelist();
64 tracker_do_messages();
67 tracker_do_addmessage();
79 tracker_do_technicians();
82 exit_error("Unknown function name: ".$function_name);
86 ///////////////////////////////
88 * tracker_do_list - List of trackers
90 function tracker_do_list() {
91 global $PARAMS, $SOAP, $LOG;
93 $cmd_params = array();
95 $group_artifact_id = get_parameter($PARAMS, "type", true);
96 if (!$group_artifact_id) {
97 exit_error("You must specify a tracker type ID using the --type parameter");
100 $cmd_params["group_artifact_id"] = $group_artifact_id;
102 if ( ($assigned_to = get_parameter($PARAMS, "assigned_to", true)) ) {
103 $cmd_params["assigned_to"] = intval($assigned_to);
105 $cmd_params["assigned_to"] = "";
108 if ( ($status = get_parameter($PARAMS, "status", true)) !== null ) {
109 $cmd_params["status"] = intval($status);
111 $cmd_params["status"] = "";
114 $group_id = get_working_group($PARAMS);
115 $cmd_params["group_id"] = $group_id;
117 $res = $SOAP->call("getArtifacts", $cmd_params);
119 if (($error = $SOAP->getError())) {
120 $LOG->add($SOAP->responseData);
121 exit_error($error, $SOAP->faultcode);
124 if (!is_array($res) || count($res) == 0) {
125 echo "No trackers were found for this type.";
128 // Remove the details column to provide a valid output.
129 for($i=0;$i<count($res);$i++) {
130 unset($res[$i]['details']);
137 * tracker_do_typelist - List of tracker type
139 function tracker_do_typelist() {
140 global $PARAMS, $SOAP, $LOG;
142 $group_id = get_working_group($PARAMS);
144 $res = $SOAP->call("getArtifactTypes", array("group_id" => $group_id));
145 if (($error = $SOAP->getError())) {
146 $LOG->add($SOAP->responseData);
147 exit_error($error, $SOAP->faultcode);
154 * tracker_do_add - Add a new tracker
156 function tracker_do_add() {
157 global $PARAMS, $SOAP, $LOG;
159 if (get_parameter($PARAMS, "help")) {
161 Add a new item in a tracker.
163 --project=<name>: Name of the project in which this item will be added. If you specified the name of
164 the working project when you logged in, this parameter is not needed.
165 --type=<id>: Specify the ID of the tracker the item will be added in. The function "typelist" shows a list
166 of available types and their corresponding IDs.
167 --priority=<number>: Item priority. Goes from 1 (lowest priority) to 5 (top priority). If not specified,
169 --assigned_to=<id>: Comma-separated list of user IDs this item should be assigned to (optional)
170 --summary=<text>: Description of this item (i.e. "Bug when clicking the Help button")
171 --details=<text>: Detailed description of the item
176 $add_params = get_artifact_params(true);
177 $add_desc = $add_params["desc"];
178 $add_data = $add_params["data"];
181 // TODO: Show extra field summary
183 Confirm you want to add a new tracker with the following information:
184 Project: {$add_desc['group_name']}
185 Tracker type: {$add_desc['artifact_type_name']}
186 Priority: {$add_desc['priority']}
187 Assigned to: {$add_desc['assigned_to_name']}
188 Summary: {$add_desc['summary']}
190 {$add_desc['details']}
194 // ask for confirmation if the --noask param is not set
195 if (!get_parameter($PARAMS, array("n", "noask"))) {
196 $input = get_user_input("Is this information correct? (y/n): ");
197 $input = strtolower($input);
199 $input = "y"; // commit changes directly
202 if ($input == "yes" || $input == "y") {
203 // Everything is OK... add the artifact
205 "group_id" => $add_data["group_id"],
206 "group_artifact_id" => $add_data["group_artifact_id"],
207 "priority" => $add_data["priority"],
208 "assigned_to" => $add_data["assigned_to"],
209 "summary" => $add_data["summary"],
210 "details" => $add_data["details"],
211 "extra_fields" => $add_data["extra_fields_data"]
213 $res = $SOAP->call("addArtifact", $cmd_params);
214 if (($error = $SOAP->getError())) {
215 $LOG->add($SOAP->responseData);
216 exit_error($error, $SOAP->faultcode);
220 exit_error("Submission aborted");
225 * tracker_do_update - Update a tracker
227 function tracker_do_update() {
228 global $PARAMS, $SOAP, $LOG, $extra_fields;
230 if (get_parameter($PARAMS, "help")) {
238 $update_params = get_artifact_params(false);
239 $update_desc = $update_params["desc"];
240 $update_data = $update_params["data"];
243 echo "Confirm you want to update the tracker with the following information:\n";
244 echo "Project: ".$update_desc["group_name"]."\n";
245 echo "Tracker type: ".$update_desc["artifact_type_name"]."\n";
246 echo "Summary: ".$update_desc["original_summary"]."\n";
247 if (array_key_exists("priority", $update_desc)) {
248 echo "> Priority: ".$update_desc["priority"]."\n";
250 if (array_key_exists("assigned_to_name", $update_desc)) {
251 echo "> Assigned to: ".$update_desc["assigned_to_name"]."\n";
253 if (array_key_exists("summary", $update_desc)) {
254 echo "> Summary: ".$update_desc["summary"]."\n";
257 //NOTE: When updating, the details can't be changed. Instead of that,
258 //a new message is added, and we don't want that
259 if (array_key_exists("details", $update_desc)) {
260 echo "> Details: \n";
261 echo $update_desc["details"]."\n";
264 // Show extra fields also.
265 foreach ($update_data["extra_fields_data"] as $new_extra_field) {
266 $extra_field_id = $new_extra_field["extra_field_id"];
267 $extra_field_name = '';
268 foreach ($extra_fields as $k => $v) {
269 if ($v['extra_field_id'] == $extra_field_id)
270 $extra_field_name = $v['field_name'];
272 print "> $extra_field_name: ".$new_extra_field["field_data"]."\n";
275 // ask for confirmation if the --noask param is not set
276 if (!get_parameter($PARAMS, array("n", "noask"))) {
277 $input = get_user_input("Is this information correct? (y/n): ");
278 $input = strtolower($input);
280 $input = "y"; // commit changes directly
283 // Update the information array
284 $update_params = $update_data["original_data"];
285 $update_params["description"] = $update_params["details"];
286 $update_params["details"] = ""; // see comment above
288 if ($input == "yes" || $input == "y") {
289 if (array_key_exists("priority", $update_data)) {
290 $update_params["priority"] = $update_data["priority"];
292 if (array_key_exists("assigned_to", $update_data)) {
293 $update_params["assigned_to"] = $update_data["assigned_to"];
295 if (array_key_exists("summary", $update_data)) {
296 $update_params["summary"] = $update_data["summary"];
298 if (array_key_exists("status_id", $update_data)) {
299 $update_params["status_id"] = $update_data["status_id"];
302 $update_params["extra_fields_data"] = $update_params["extra_fields"];
303 // include the extra fields
304 foreach ($update_data["extra_fields_data"] as $new_extra_field) {
306 for ($i = 0; $i < count($update_params["extra_fields"]); $i++) {
307 if ($update_params["extra_fields_data"][$i]["extra_field_id"] == $new_extra_field["extra_field_id"]) {
308 $update_params["extra_fields_data"][$i] = $new_extra_field; // overwrite old data with new data
312 // if it couldn't replace the old value, insert a new value
314 $update_params["extra_fields_data"][] = $new_extra_field;
318 $update_params["group_id"] = $update_data["group_id"];
319 //TODO: Manage the new artifact_type id
320 $update_params["new_artifact_type_id"] = $update_params["group_artifact_id"];
322 $res = $SOAP->call("updateArtifact", $update_params);
323 if (($error = $SOAP->getError())) {
324 $LOG->add($SOAP->responseData);
325 exit_error($error, $SOAP->faultcode);
329 exit_error("Submission aborted");
334 function tracker_do_messages() {
335 global $PARAMS, $SOAP, $LOG;
337 $group_artifact_id = get_parameter($PARAMS, "type", true);
338 if (!$group_artifact_id || !is_numeric($group_artifact_id)) {
339 exit_error("You must specify the type ID as a valid number");
342 $artifact_id = get_parameter($PARAMS, "id", true);
343 if (!$artifact_id || !is_numeric($artifact_id)) {
344 exit_error("You must specify the artifact ID as a valid number");
347 $group_id = get_working_group($PARAMS);
350 "group_id" => $group_id,
351 "group_artifact_id" => $group_artifact_id,
352 "artifact_id" => $artifact_id
354 $res = $SOAP->call("getArtifactMessages", $cmd_params);
355 if (($error = $SOAP->getError())) {
356 $LOG->add($SOAP->responseData);
357 exit_error($error, $SOAP->faultcode);
363 function tracker_do_addmessage() {
364 global $PARAMS, $SOAP, $LOG;
366 $group_artifact_id = get_parameter($PARAMS, "type", true);
367 if (!$group_artifact_id || !is_numeric($group_artifact_id)) {
368 exit_error("You must specify the type ID as a valid number");
371 $artifact_id = get_parameter($PARAMS, "id", true);
372 if (!$artifact_id || !is_numeric($artifact_id)) {
373 exit_error("You must specify the artifact ID as a valid number");
376 $body = get_parameter($PARAMS, "message", true);
377 if (strlen($body) == 0) {
378 exit_error("You must specify the message");
381 $group_id = get_working_group($PARAMS);
384 "group_id" => $group_id,
385 "group_artifact_id" => $group_artifact_id,
386 "artifact_id" => $artifact_id,
389 $res = $SOAP->call("addArtifactMessage", $cmd_params);
390 if (($error = $SOAP->getError())) {
391 $LOG->add($SOAP->responseData);
392 exit_error($error, $SOAP->faultcode);
398 function tracker_do_files() {
399 global $PARAMS, $SOAP, $LOG;
401 $group_artifact_id = get_parameter($PARAMS, "type", true);
402 if (!$group_artifact_id || !is_numeric($group_artifact_id)) {
403 exit_error("You must specify the type ID as a valid number");
406 $artifact_id = get_parameter($PARAMS, "id", true);
407 if (!$artifact_id || !is_numeric($artifact_id)) {
408 exit_error("You must specify the artifact ID as a valid number");
411 $group_id = get_working_group($PARAMS);
414 "group_id" => $group_id,
415 "group_artifact_id" => $group_artifact_id,
416 "artifact_id" => $artifact_id,
419 $res = $SOAP->call("getArtifactFiles", $cmd_params);
420 if (($error = $SOAP->getError())) {
421 $LOG->add($SOAP->responseData);
422 exit_error($error, $SOAP->faultcode);
428 function tracker_do_getfile() {
429 global $PARAMS, $SOAP, $LOG;
431 $group_artifact_id = get_parameter($PARAMS, "type", true);
432 if (!$group_artifact_id || !is_numeric($group_artifact_id)) {
433 exit_error("You must specify the type ID as a valid number");
436 $artifact_id = get_parameter($PARAMS, "id", true);
437 if (!$artifact_id || !is_numeric($artifact_id)) {
438 exit_error("You must specify the artifact ID as a valid number");
441 $file_id = get_parameter($PARAMS, "file_id", true);
442 if (!$file_id || !is_numeric($file_id)) {
443 exit_error("You must specify the file ID as a valid number");
446 // Should we save the contents to a file?
447 $output = get_parameter($PARAMS, "output", true);
449 if (file_exists($output)) {
450 $sure = get_user_input("File $output already exists. Do you want to overwrite it? (y/n): ");
451 if (strtolower($sure) != "y" && strtolower($sure) != "yes") {
452 exit_error("Retrieval of file aborted");
457 $group_id = get_working_group($PARAMS);
460 "group_id" => $group_id,
461 "group_artifact_id" => $group_artifact_id,
462 "artifact_id" => $artifact_id,
463 "file_id" => $file_id
466 $res = $SOAP->call("getArtifactFileData", $cmd_params);
467 if (($error = $SOAP->getError())) {
468 $LOG->add($SOAP->responseData);
469 exit_error($error, $SOAP->faultcode);
472 $file = base64_decode($res);
474 while (!($fh = @fopen($output, "wb"))) {
475 echo "Couldn't open file ".$output." for writing.\n";
478 $output = get_user_input("Please specify a new file name: ");
482 fwrite($fh, $file, strlen($file));
485 echo "File retrieved successfully.\n";
487 echo $file; // if not saving to a file, output to screen
491 function tracker_do_addfile() {
492 global $PARAMS, $SOAP, $LOG;
494 $group_artifact_id = get_parameter($PARAMS, "type", true);
495 if (!$group_artifact_id || !is_numeric($group_artifact_id)) {
496 exit_error("You must specify the type ID as a valid number");
499 $artifact_id = get_parameter($PARAMS, "id", true);
500 if (!$artifact_id || !is_numeric($artifact_id)) {
501 exit_error("You must specify the artifact ID as a valid number");
504 $description = get_parameter($PARAMS, "description", true);
505 if (is_null($description)) $description = ""; // description wasn't specified
507 $group_id = get_working_group($PARAMS);
509 if (!($file = get_parameter($PARAMS, "file", true))) {
510 exit_error("You must specify a file for uploading");
513 while (!($fh = fopen($file, "rb"))) {
514 echo "Couldn't open file ".$file." for reading.\n";
517 $file = get_user_input("Please specify a new file name: ");
521 $bin_contents = fread($fh, filesize($file));
522 $base64_contents = base64_encode($bin_contents);
523 $filename = basename($file);
525 //TODO: Check file type
529 "group_id" => $group_id,
530 "group_artifact_id" => $group_artifact_id,
531 "artifact_id" => $artifact_id,
532 "base64_contents" => $base64_contents,
533 "description" => $description,
534 "filename" => $filename,
535 "filetype" => $filetype
538 $res = $SOAP->call("addArtifactFile", $cmd_params);
539 if (($error = $SOAP->getError())) {
540 $LOG->add($SOAP->responseData);
541 exit_error($error, $SOAP->faultcode);
548 function tracker_do_technicians() {
549 global $PARAMS, $SOAP, $LOG;
551 $group_artifact_id = get_parameter($PARAMS, "type", true);
552 if (!$group_artifact_id || !is_numeric($group_artifact_id)) {
553 exit_error("You must specify the type ID as a valid number");
556 $group_id = get_working_group($PARAMS);
559 "group_id" => $group_id,
560 "group_artifact_id" => $group_artifact_id
563 $res = $SOAP->call("getArtifactTechnicians", $cmd_params);
564 if (($error = $SOAP->getError())) {
565 $LOG->add($SOAP->responseData);
566 exit_error($error, $SOAP->faultcode);
574 * Get the variables for an artifact from the command line. This function is used when
575 * adding/updating an artifact
577 * @param bool Specify that we're getting the variables for adding an artifact and not updating
580 function get_artifact_params($adding = false) {
581 global $PARAMS, $SOAP, $LOG, $extra_fields;
582 $group_id = get_working_group($PARAMS);
585 $updating = !$adding; // we're updating if and only if we're not adding
588 if (!($group_artifact_id = get_parameter($PARAMS, "type", true))) {
589 $group_artifact_id = get_user_input("Type ID of the artifact: ");
591 if (!$group_artifact_id || !is_numeric($group_artifact_id)) {
592 exit_error("You must specify the type ID of the artifact as a valid number");
595 // Force the input of the artifact ID only if we're updating
597 if (!($artifact_id = get_parameter($PARAMS, "id", true))) {
598 $artifact_id = get_user_input("ID of the artifact to modify: ");
600 if (!$artifact_id || !is_numeric($artifact_id)) {
601 exit_error("You must specify the artifact ID as a valid number");
604 // check the artifact ID is valid
605 $artifacts = $SOAP->call("getArtifacts", array("group_id" => $group_id, "group_artifact_id" => $group_artifact_id, "assigned_to" => "", "status" => ""));
606 if (($error = $SOAP->getError())) {
607 $LOG->add($SOAP->responseData);
608 exit_error($error, $SOAP->faultcode);
610 $original_data = array();
611 foreach ($artifacts as $artifact) {
612 if ($artifact["artifact_id"] == $artifact_id) {
613 $original_data = $artifact;
614 $artifact_summary = $artifact["summary"];
618 // The artifact wasn't found
619 if (count($original_data) == 0) {
620 exit_error("The artifact #".$artifact_id." doesn't belong to tracker #".$group_artifact_id);
624 // Check the priority
625 if (!($priority = get_parameter($PARAMS, "priority", true)) && $adding) {
626 // set a default value (only if adding)
629 if ($priority && (!is_numeric($priority) || $priority < 1 || $priority > 5)) {
630 exit_error("The priority must be a number between 1 and 5");
633 // ID of the user the artifact is assigned to
634 if (!($assigned_to = get_parameter($PARAMS, "assigned_to", true)) && $adding) {
635 $assigned_to = 100; // 100 = nobody
638 // Status ID (only for updating)
640 $status_id = get_parameter($PARAMS, "status", true);
644 if (!($summary = get_parameter($PARAMS, "summary")) && $adding) {
645 $summary = get_user_input("Summary for this item: ");
647 $summary = trim($summary);
648 if ($adding && !$summary) { // Summary is required only if adding an artifact
649 exit_error("You must specify a summary for this item");
653 if (!($details = get_parameter($PARAMS, "details")) && $adding) {
654 $details = get_user_input("Details for this item: ");
656 $details = trim($details);
657 if ($adding && !$details) {
658 exit_error("You must specify a detail for this item");
661 // Check for invalid IDs
663 $group_res = $SOAP->call("getGroups", array("group_ids" => array($group_id)));
664 if (count($group_res) == 0) { // Group doesn't exist
665 exit_error("Group ".$group_id." doesn't exist");
667 $group_name = $group_res[0]["group_name"];
669 // Get the artifact type
670 $artifact_type_res = $SOAP->call("getArtifactTypes", array("group_id" => $group_id));
671 if (is_array($artifact_type_res) && count($artifact_type_res) > 0) {
673 // Search the name of the selected artifact type in the array of artifact types for the project
674 for ($i = 0; $i < count($artifact_type_res); $i++) {
675 if ($artifact_type_res[$i]["group_artifact_id"] == $group_artifact_id) {
677 $artifact_type_name = $artifact_type_res[$i]["name"];
678 $artifact_index = $i;
684 exit_error("Type number ".$group_artifact_id." doesn't belong to project ".$group_name);
687 exit_error("Type number ".$group_artifact_id." doesn't belong to project ".$group_name);
690 // Get the extra fields for this artifact and validate the input
691 $extra_fields_tmp = $artifact_type_res[$artifact_index]["extra_fields"];
692 $extra_fields = array();
693 $extra_fields_data = array();
695 // rebuild the array in a more convenient way
696 foreach ($extra_fields_tmp as $extra_field) {
697 $alias = $extra_field["alias"];
698 if (strlen($alias) == 0) continue;
699 $extra_fields[$alias] = $extra_field;
701 // Get the value specified for this extra field (if any)
702 $value = get_parameter($PARAMS, $alias, true);
703 // the extra field wasn't specified but it is required...
704 if ($adding && strlen($value) == 0 && $extra_field["is_required"]) {
705 exit_error("You must specify the parameter '".$alias."'");
708 if (strlen($value) > 0) {
711 switch ($extra_field["field_type"]) {
712 case ARTIFACT_EXTRAFIELDTYPE_TEXT:
713 case ARTIFACT_EXTRAFIELDTYPE_TEXTAREA:
714 // this doesn't need validation
717 case ARTIFACT_EXTRAFIELDTYPE_CHECKBOX:
718 case ARTIFACT_EXTRAFIELDTYPE_MULTISELECT:
719 if (strtolower($value) == "none") {
724 // in this case, $value is a list of comma-separated ids
725 $available_values_str = "";
726 // first get the list of the available values
727 foreach ($extra_field["available_values"] as $available_value) {
728 $available_values_str .= $available_value["element_id"]." (".$available_value["element_name"]."), ";
731 $available_values_str = preg_replace("/, \$/", "", $available_values_str);
734 $values = split(",", $value);
735 $invalid_values = array(); // list of invalid values entered by the user
736 foreach ($values as $id) {
738 foreach ($extra_field["available_values"] as $available_value) {
739 // note we are comparing strings
740 if ("$id" == "".$available_value["element_id"]) {
747 $invalid_values[] = $id;
752 if (count($invalid_values) == 1) {
753 $error = "Value ".$invalid_values[0]." is invalid for the field '".$extra_field["field_name"]."'. Available values are: ".$available_values_str;
755 $error = "Values ".implode(",",$invalid_values)." are invalid for the field '".$extra_field["field_name"]."'. Available values are: ".$available_values_str;
759 case ARTIFACT_EXTRAFIELDTYPE_STATUS:
760 case ARTIFACT_EXTRAFIELDTYPE_RADIO:
761 case ARTIFACT_EXTRAFIELDTYPE_SELECT:
762 // Map the value entered by the user to an existing element_id
763 $available_values_str = "";
764 foreach ($extra_field["available_values"] as $available_value) {
765 $available_values_str .= $available_value["element_id"]." (".$available_value["element_name"]."), ";
766 // note we are comparing strings
767 if ( "".$available_value["element_id"] == "$value") {
772 $available_values_str = preg_replace("/, \$/", "", $available_values_str);
774 $error = "Value '$value' is invalid for the field '".$extra_field["field_name"]."'. Available values are: ".$available_values_str;
782 $extra_fields_data[$efd_index] = array();
783 $extra_fields_data[$efd_index]["extra_field_id"] = $extra_field["extra_field_id"];
784 $extra_fields_data[$efd_index]["field_data"] = $value;
792 $users_res = $SOAP->call("getUsers", array("user_ids" => array($assigned_to)));
793 if (!$SOAP->getError() && is_array($users_res) && count($users_res) > 0) {
794 $assigned_to_name = $users_res[0]["firstname"]." ".$users_res[0]["lastname"]." (".$users_res[0]["user_name"].")";
796 exit_error("Invalid user ID: ".$assigned_to);
799 $assigned_to_name = "(nobody)";
802 // return the data to insert
803 $ret["data"]["group_id"] = $group_id;
804 $ret["data"]["group_artifact_id"] = $group_artifact_id;
806 $ret["data"]["artifact_id"] = $artifact_id;
807 $ret["data"]["original_data"] = $original_data;
808 if ($status_id) $ret["data"]["status_id"] = $status_id;
809 if ($priority) $ret["data"]["priority"] = $priority;
810 if ($assigned_to) $ret["data"]["assigned_to"] = $assigned_to;
811 if ($summary) $ret["data"]["summary"] = $summary;
812 if ($details) $ret["data"]["details"] = $details;
815 $ret["data"]["priority"] = $priority;
816 $ret["data"]["assigned_to"] = $assigned_to;
817 $ret["data"]["summary"] = $summary;
818 $ret["data"]["details"] = $details;
820 $ret["data"]["extra_fields_data"] = $extra_fields_data;
822 // also return the textual description of the data
823 $ret["desc"]["group_name"] = $group_name;
824 $ret["desc"]["artifact_type_name"] = $artifact_type_name;
825 if ($updating) $ret["desc"]["original_summary"] = $artifact_summary;
826 if ($priority) $ret["desc"]["priority"] = $priority;
827 if ($summary) $ret["desc"]["summary"] = $summary;
828 if ($details) $ret["desc"]["details"] = $details;
829 if ($assigned_to) $ret["desc"]["assigned_to_name"] = $assigned_to_name;