<?php

//
//  FORM TO COPY Choices configured by admin for extra_field BOXES
//
$id = getIntFromRequest('id');
$fb = new ArtifactExtraField($ath, $id);
$title = sprintf(_('Copy choices from custom field %1$s'), $fb->getName());
$ath->adminHeader(array('title' => $title));
echo "<h3>" . $title . "</h3>";
$efearr =& $ath->getExtraFieldElements($id);
for ($i = 0; $i < count($efearr); $i++) {
    $field_id_arr[] = $efearr[$i]['element_id'];
    $field_arr[] = $efearr[$i]['element_name'];
}
echo '<table>';
echo '<tr>';
echo '<td></td><td><center><strong>';
echo _('Copy From');
echo '<br />';
echo $fb->getName();
echo '</center></strong></td><td></td><td><strong><center>';
echo _('Into trackers and custom fields');
echo '</center></strong></tr><tr><td><strong><center>';
echo '</center></strong></td>';
echo '<td valign=top>';
?>
		
		<form action="<?php 
echo getStringFromServer('PHP_SELF') . '?group_id=' . $group_id . '&atid=' . $ath->getID();
?>
示例#2
0
function artifacttype_to_soap($at_arr)
{
    $return = array();
    for ($i = 0; $i < count($at_arr); $i++) {
        if ($at_arr[$i]->isError()) {
            //skip if error
        } else {
            // Get list of extra fields for this artifact
            $extrafields = array();
            $tmpextrafields = $at_arr[$i]->getExtraFields();
            foreach ($tmpextrafields as $extrafield) {
                $aefobj = new ArtifactExtraField($at_arr[$i], $extrafield["extra_field_id"]);
                // array of available values
                $avtmp = $aefobj->getAvailableValues();
                $avs = array();
                for ($j = 0; $j < count($avtmp); $j++) {
                    $avs[$j]["element_id"] = $avtmp[$j]["element_id"];
                    $avs[$j]["element_name"] = $avtmp[$j]["element_name"];
                    $avs[$j]["status_id"] = $avtmp[$j]["status_id"];
                }
                $extrafields[] = array("extra_field_id" => $aefobj->getID(), "field_name" => $aefobj->getName(), "field_type" => $aefobj->getType(), "attribute1" => $aefobj->getAttribute1(), "attribute2" => $aefobj->getAttribute2(), "is_required" => $aefobj->isRequired(), "alias" => $aefobj->getAlias(), "available_values" => $avs, "default_selected_id" => 0);
            }
            $return[] = array('group_artifact_id' => $at_arr[$i]->data_array['group_artifact_id'], 'group_id' => $at_arr[$i]->data_array['group_id'], 'name' => $at_arr[$i]->data_array['name'], 'description' => $at_arr[$i]->data_array['description'], 'is_public' => $at_arr[$i]->data_array['is_public'], 'allow_anon' => $at_arr[$i]->data_array['allow_anon'], 'due_period' => $at_arr[$i]->data_array['due_period'], 'datatype' => $at_arr[$i]->data_array['datatype'], 'status_timeout' => $at_arr[$i]->data_array['status_timeout'], 'extra_fields' => $extrafields, 'custom_status_field' => $at_arr[$i]->data_array['custom_status_field']);
        }
    }
    return $return;
}