3 * GForge Command-line Interface
5 * Copyright 2005 GForge, LLC
6 * http://fusionforge.org/
8 * @version $Id: default.php,v 1.6 2005/10/20 18:55:31 marcelo Exp $
10 * This file is part of FusionForge.
12 * FusionForge 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 * FusionForge 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 FusionForge; 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"];
301 if (array_key_exists("details", $update_data)) {
302 $update_params["description"] = $update_data["details"];
305 $update_params["extra_fields_data"] = $update_params["extra_fields"];
306 // include the extra fields
307 foreach ($update_data["extra_fields_data"] as $new_extra_field) {
309 for ($i = 0; $i < count($update_params["extra_fields"]); $i++) {
310 if ($update_params["extra_fields_data"][$i]["extra_field_id"] == $new_extra_field["extra_field_id"]) {
311 $update_params["extra_fields_data"][$i] = $new_extra_field; // overwrite old data with new data
315 // if it couldn't replace the old value, insert a new value
317 $update_params["extra_fields_data"][] = $new_extra_field;
321 $update_params["group_id"] = $update_data["group_id"];
322 //TODO: Manage the new artifact_type id
323 $update_params["new_artifact_type_id"] = $update_params["group_artifact_id"];
325 $res = $SOAP->call("updateArtifact", $update_params);
326 if (($error = $SOAP->getError())) {
327 $LOG->add($SOAP->responseData);
328 exit_error($error, $SOAP->faultcode);
332 exit_error("Submission aborted");
337 function tracker_do_messages() {
338 global $PARAMS, $SOAP, $LOG;
340 $group_artifact_id = get_parameter($PARAMS, "type", true);
341 if (!$group_artifact_id || !is_numeric($group_artifact_id)) {
342 exit_error("You must specify the type ID as a valid number");
345 $artifact_id = get_parameter($PARAMS, "id", true);
346 if (!$artifact_id || !is_numeric($artifact_id)) {
347 exit_error("You must specify the artifact ID as a valid number");
350 $group_id = get_working_group($PARAMS);
353 "group_id" => $group_id,
354 "group_artifact_id" => $group_artifact_id,
355 "artifact_id" => $artifact_id
357 $res = $SOAP->call("getArtifactMessages", $cmd_params);
358 if (($error = $SOAP->getError())) {
359 $LOG->add($SOAP->responseData);
360 exit_error($error, $SOAP->faultcode);
366 function tracker_do_addmessage() {
367 global $PARAMS, $SOAP, $LOG;
369 $group_artifact_id = get_parameter($PARAMS, "type", true);
370 if (!$group_artifact_id || !is_numeric($group_artifact_id)) {
371 exit_error("You must specify the type ID as a valid number");
374 $artifact_id = get_parameter($PARAMS, "id", true);
375 if (!$artifact_id || !is_numeric($artifact_id)) {
376 exit_error("You must specify the artifact ID as a valid number");
379 $body = get_parameter($PARAMS, "message", true);
380 if (strlen($body) == 0) {
381 exit_error("You must specify the message");
384 $group_id = get_working_group($PARAMS);
387 "group_id" => $group_id,
388 "group_artifact_id" => $group_artifact_id,
389 "artifact_id" => $artifact_id,
392 $res = $SOAP->call("addArtifactMessage", $cmd_params);
393 if (($error = $SOAP->getError())) {
394 $LOG->add($SOAP->responseData);
395 exit_error($error, $SOAP->faultcode);
401 function tracker_do_files() {
402 global $PARAMS, $SOAP, $LOG;
404 $group_artifact_id = get_parameter($PARAMS, "type", true);
405 if (!$group_artifact_id || !is_numeric($group_artifact_id)) {
406 exit_error("You must specify the type ID as a valid number");
409 $artifact_id = get_parameter($PARAMS, "id", true);
410 if (!$artifact_id || !is_numeric($artifact_id)) {
411 exit_error("You must specify the artifact ID as a valid number");
414 $group_id = get_working_group($PARAMS);
417 "group_id" => $group_id,
418 "group_artifact_id" => $group_artifact_id,
419 "artifact_id" => $artifact_id,
422 $res = $SOAP->call("getArtifactFiles", $cmd_params);
423 if (($error = $SOAP->getError())) {
424 $LOG->add($SOAP->responseData);
425 exit_error($error, $SOAP->faultcode);
431 function tracker_do_getfile() {
432 global $PARAMS, $SOAP, $LOG;
434 $group_artifact_id = get_parameter($PARAMS, "type", true);
435 if (!$group_artifact_id || !is_numeric($group_artifact_id)) {
436 exit_error("You must specify the type ID as a valid number");
439 $artifact_id = get_parameter($PARAMS, "id", true);
440 if (!$artifact_id || !is_numeric($artifact_id)) {
441 exit_error("You must specify the artifact ID as a valid number");
444 $file_id = get_parameter($PARAMS, "file_id", true);
445 if (!$file_id || !is_numeric($file_id)) {
446 exit_error("You must specify the file ID as a valid number");
449 // Should we save the contents to a file?
450 $output = get_parameter($PARAMS, "output", true);
452 if (file_exists($output)) {
453 $sure = get_user_input("File $output already exists. Do you want to overwrite it? (y/n): ");
454 if (strtolower($sure) != "y" && strtolower($sure) != "yes") {
455 exit_error("Retrieval of file aborted");
460 $group_id = get_working_group($PARAMS);
463 "group_id" => $group_id,
464 "group_artifact_id" => $group_artifact_id,
465 "artifact_id" => $artifact_id,
466 "file_id" => $file_id
469 $res = $SOAP->call("getArtifactFileData", $cmd_params);
470 if (($error = $SOAP->getError())) {
471 $LOG->add($SOAP->responseData);
472 exit_error($error, $SOAP->faultcode);
475 $file = base64_decode($res);
477 while (!($fh = @fopen($output, "wb"))) {
478 echo "Couldn't open file ".$output." for writing.\n";
481 $output = get_user_input("Please specify a new file name: ");
485 fwrite($fh, $file, strlen($file));
488 echo "File retrieved successfully.\n";
490 echo $file; // if not saving to a file, output to screen
494 function tracker_do_addfile() {
495 global $PARAMS, $SOAP, $LOG;
497 $group_artifact_id = get_parameter($PARAMS, "type", true);
498 if (!$group_artifact_id || !is_numeric($group_artifact_id)) {
499 exit_error("You must specify the type ID as a valid number");
502 $artifact_id = get_parameter($PARAMS, "id", true);
503 if (!$artifact_id || !is_numeric($artifact_id)) {
504 exit_error("You must specify the artifact ID as a valid number");
507 $description = get_parameter($PARAMS, "description", true);
508 if (is_null($description)) $description = ""; // description wasn't specified
510 $group_id = get_working_group($PARAMS);
512 if (!($file = get_parameter($PARAMS, "file", true))) {
513 exit_error("You must specify a file for uploading");
516 while (!($fh = fopen($file, "rb"))) {
517 echo "Couldn't open file ".$file." for reading.\n";
520 $file = get_user_input("Please specify a new file name: ");
524 $bin_contents = fread($fh, filesize($file));
525 $base64_contents = base64_encode($bin_contents);
526 $filename = basename($file);
528 //TODO: Check file type
532 "group_id" => $group_id,
533 "group_artifact_id" => $group_artifact_id,
534 "artifact_id" => $artifact_id,
535 "base64_contents" => $base64_contents,
536 "description" => $description,
537 "filename" => $filename,
538 "filetype" => $filetype
541 $res = $SOAP->call("addArtifactFile", $cmd_params);
542 if (($error = $SOAP->getError())) {
543 $LOG->add($SOAP->responseData);
544 exit_error($error, $SOAP->faultcode);
551 function tracker_do_technicians() {
552 global $PARAMS, $SOAP, $LOG;
554 $group_artifact_id = get_parameter($PARAMS, "type", true);
555 if (!$group_artifact_id || !is_numeric($group_artifact_id)) {
556 exit_error("You must specify the type ID as a valid number");
559 $group_id = get_working_group($PARAMS);
562 "group_id" => $group_id,
563 "group_artifact_id" => $group_artifact_id
566 $res = $SOAP->call("getArtifactTechnicians", $cmd_params);
567 if (($error = $SOAP->getError())) {
568 $LOG->add($SOAP->responseData);
569 exit_error($error, $SOAP->faultcode);
577 * Get the variables for an artifact from the command line. This function is used when
578 * adding/updating an artifact
580 * @param bool Specify that we're getting the variables for adding an artifact and not updating
583 function get_artifact_params($adding = false) {
584 global $PARAMS, $SOAP, $LOG, $extra_fields;
585 $group_id = get_working_group($PARAMS);
588 $updating = !$adding; // we're updating if and only if we're not adding
591 if (!($group_artifact_id = get_parameter($PARAMS, "type", true))) {
592 $group_artifact_id = get_user_input("Type ID of the artifact: ");
594 if (!$group_artifact_id || !is_numeric($group_artifact_id)) {
595 exit_error("You must specify the type ID of the artifact as a valid number");
598 // Force the input of the artifact ID only if we're updating
600 if (!($artifact_id = get_parameter($PARAMS, "id", true))) {
601 $artifact_id = get_user_input("ID of the artifact to modify: ");
603 if (!$artifact_id || !is_numeric($artifact_id)) {
604 exit_error("You must specify the artifact ID as a valid number");
607 // check the artifact ID is valid
608 $artifacts = $SOAP->call("getArtifacts", array("group_id" => $group_id, "group_artifact_id" => $group_artifact_id, "assigned_to" => "", "status" => ""));
609 if (($error = $SOAP->getError())) {
610 $LOG->add($SOAP->responseData);
611 exit_error($error, $SOAP->faultcode);
613 $original_data = array();
614 foreach ($artifacts as $artifact) {
615 if ($artifact["artifact_id"] == $artifact_id) {
616 $original_data = $artifact;
617 $artifact_summary = $artifact["summary"];
621 // The artifact wasn't found
622 if (count($original_data) == 0) {
623 exit_error("The artifact #".$artifact_id." doesn't belong to tracker #".$group_artifact_id);
627 // Check the priority
628 if (!($priority = get_parameter($PARAMS, "priority", true)) && $adding) {
629 // set a default value (only if adding)
632 if ($priority && (!is_numeric($priority) || $priority < 1 || $priority > 5)) {
633 exit_error("The priority must be a number between 1 and 5");
636 // ID of the user the artifact is assigned to
637 if (!($assigned_to = get_parameter($PARAMS, "assigned_to", true)) && $adding) {
638 $assigned_to = 100; // 100 = nobody
641 // Status ID (only for updating)
643 $status_id = get_parameter($PARAMS, "status", true);
647 if (!($summary = get_parameter($PARAMS, "summary")) && $adding) {
648 $summary = get_user_input("Summary for this item: ");
650 $summary = trim($summary);
651 if ($adding && !$summary) { // Summary is required only if adding an artifact
652 exit_error("You must specify a summary for this item");
656 if (!($details = get_parameter($PARAMS, "details")) && $adding) {
657 $details = get_user_input("Details for this item: ");
659 $details = trim($details);
660 if ($adding && !$details) {
661 exit_error("You must specify a detail for this item");
664 // Check for invalid IDs
666 $group_res = $SOAP->call("getGroups", array("group_ids" => array($group_id)));
667 if (count($group_res) == 0) { // Group doesn't exist
668 exit_error("Group ".$group_id." doesn't exist");
670 $group_name = $group_res[0]["group_name"];
672 // Get the artifact type
673 $artifact_type_res = $SOAP->call("getArtifactTypes", array("group_id" => $group_id));
674 if (is_array($artifact_type_res) && count($artifact_type_res) > 0) {
676 // Search the name of the selected artifact type in the array of artifact types for the project
677 for ($i = 0; $i < count($artifact_type_res); $i++) {
678 if ($artifact_type_res[$i]["group_artifact_id"] == $group_artifact_id) {
680 $artifact_type_name = $artifact_type_res[$i]["name"];
681 $artifact_index = $i;
687 exit_error("Type number ".$group_artifact_id." doesn't belong to project ".$group_name);
690 exit_error("Type number ".$group_artifact_id." doesn't belong to project ".$group_name);
693 // Get the extra fields for this artifact and validate the input
694 $extra_fields_tmp = $artifact_type_res[$artifact_index]["extra_fields"];
695 $extra_fields = array();
696 $extra_fields_data = array();
698 // rebuild the array in a more convenient way
699 foreach ($extra_fields_tmp as $extra_field) {
700 $alias = $extra_field["alias"];
701 if (strlen($alias) == 0) continue;
702 $extra_fields[$alias] = $extra_field;
704 // Get the value specified for this extra field (if any)
705 $value = get_parameter($PARAMS, $alias, true);
706 // the extra field wasn't specified but it is required...
707 if ($adding && strlen($value) == 0 && $extra_field["is_required"]) {
708 exit_error("You must specify the parameter '".$alias."'");
711 if (strlen($value) > 0) {
714 switch ($extra_field["field_type"]) {
715 case ARTIFACT_EXTRAFIELDTYPE_TEXT:
716 case ARTIFACT_EXTRAFIELDTYPE_TEXTAREA:
717 // this doesn't need validation
720 case ARTIFACT_EXTRAFIELDTYPE_CHECKBOX:
721 case ARTIFACT_EXTRAFIELDTYPE_MULTISELECT:
722 if (strtolower($value) == "none") {
727 // in this case, $value is a list of comma-separated ids
728 $available_values_str = "";
729 // first get the list of the available values
730 foreach ($extra_field["available_values"] as $available_value) {
731 $available_values_str .= $available_value["element_id"]." (".$available_value["element_name"]."), ";
734 $available_values_str = preg_replace("/, \$/", "", $available_values_str);
737 $values = split(",", $value);
738 $invalid_values = array(); // list of invalid values entered by the user
739 foreach ($values as $id) {
741 foreach ($extra_field["available_values"] as $available_value) {
742 // note we are comparing strings
743 if ("$id" == "".$available_value["element_id"]) {
750 $invalid_values[] = $id;
755 if (count($invalid_values) == 1) {
756 $error = "Value ".$invalid_values[0]." is invalid for the field '".$extra_field["field_name"]."'. Available values are: ".$available_values_str;
758 $error = "Values ".implode(",",$invalid_values)." are invalid for the field '".$extra_field["field_name"]."'. Available values are: ".$available_values_str;
762 case ARTIFACT_EXTRAFIELDTYPE_STATUS:
763 case ARTIFACT_EXTRAFIELDTYPE_RADIO:
764 case ARTIFACT_EXTRAFIELDTYPE_SELECT:
765 // Map the value entered by the user to an existing element_id
766 $available_values_str = "";
767 foreach ($extra_field["available_values"] as $available_value) {
768 $available_values_str .= $available_value["element_id"]." (".$available_value["element_name"]."), ";
769 // note we are comparing strings
770 if ( "".$available_value["element_id"] == "$value") {
775 $available_values_str = preg_replace("/, \$/", "", $available_values_str);
777 $error = "Value '$value' is invalid for the field '".$extra_field["field_name"]."'. Available values are: ".$available_values_str;
785 $extra_fields_data[$efd_index] = array();
786 $extra_fields_data[$efd_index]["extra_field_id"] = $extra_field["extra_field_id"];
787 $extra_fields_data[$efd_index]["field_data"] = $value;
795 $users_res = $SOAP->call("getUsers", array("user_ids" => array($assigned_to)));
796 if (!$SOAP->getError() && is_array($users_res) && count($users_res) > 0) {
797 $assigned_to_name = $users_res[0]["firstname"]." ".$users_res[0]["lastname"]." (".$users_res[0]["user_name"].")";
799 exit_error("Invalid user ID: ".$assigned_to);
802 $assigned_to_name = "(nobody)";
805 // return the data to insert
806 $ret["data"]["group_id"] = $group_id;
807 $ret["data"]["group_artifact_id"] = $group_artifact_id;
809 $ret["data"]["artifact_id"] = $artifact_id;
810 $ret["data"]["original_data"] = $original_data;
811 if ($status_id) $ret["data"]["status_id"] = $status_id;
812 if ($priority) $ret["data"]["priority"] = $priority;
813 if ($assigned_to) $ret["data"]["assigned_to"] = $assigned_to;
814 if ($summary) $ret["data"]["summary"] = $summary;
815 if ($details) $ret["data"]["details"] = $details;
818 $ret["data"]["priority"] = $priority;
819 $ret["data"]["assigned_to"] = $assigned_to;
820 $ret["data"]["summary"] = $summary;
821 $ret["data"]["details"] = $details;
823 $ret["data"]["extra_fields_data"] = $extra_fields_data;
825 // also return the textual description of the data
826 $ret["desc"]["group_name"] = $group_name;
827 $ret["desc"]["artifact_type_name"] = $artifact_type_name;
828 if ($updating) $ret["desc"]["original_summary"] = $artifact_summary;
829 if ($priority) $ret["desc"]["priority"] = $priority;
830 if ($summary) $ret["desc"]["summary"] = $summary;
831 if ($details) $ret["desc"]["details"] = $details;
832 if ($assigned_to) $ret["desc"]["assigned_to_name"] = $assigned_to_name;