本文整理汇总了PHP中ReferenceManager::createReference方法的典型用法代码示例。如果您正苦于以下问题:PHP ReferenceManager::createReference方法的具体用法?PHP ReferenceManager::createReference怎么用?PHP ReferenceManager::createReference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReferenceManager
的用法示例。
在下文中一共展示了ReferenceManager::createReference方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initTrackerV3ModuleFromTemplate
private function initTrackerV3ModuleFromTemplate(Group $group, Group $template_group, $ugroup_mapping)
{
$group_id = $group->getID();
$tracker_mapping = array();
$report_mapping = array();
if (TrackerV3::instance()->available()) {
$atf = new ArtifactTypeFactory($template_group);
//$tracker_error = "";
// Add all trackers from template project (tracker templates) that need to be instanciated for new trackers.
$res = $atf->getTrackerTemplatesForNewProjects();
while ($arr_template = db_fetch_array($res)) {
$ath_temp = new ArtifactType($template_group, $arr_template['group_artifact_id']);
$report_mapping_for_this_tracker = array();
$new_at_id = $atf->create($group_id, $template_group->getID(), $ath_temp->getID(), db_escape_string($ath_temp->getName()), db_escape_string($ath_temp->getDescription()), $ath_temp->getItemName(), $ugroup_mapping, $report_mapping_for_this_tracker);
if (!$new_at_id) {
$GLOBALS['Response']->addFeedback('error', $atf->getErrorMessage());
} else {
$report_mapping = $report_mapping + $report_mapping_for_this_tracker;
$tracker_mapping[$ath_temp->getID()] = $new_at_id;
// Copy all the artifacts from the template tracker to the new tracker
$ath_new = new ArtifactType($group, $new_at_id);
// not now. perhaps one day
//if (!$ath_new->copyArtifacts($ath_temp->getID()) ) {
//$GLOBALS['Response']->addFeedback('info', $ath_new->getErrorMessage());
//}
// Create corresponding reference
$ref = new Reference(0, strtolower($ath_temp->getItemName()), $GLOBALS['Language']->getText('project_reference', 'reference_art_desc_key'), '/tracker/?func=detail&aid=$1&group_id=$group_id', 'P', 'tracker', ReferenceManager::REFERENCE_NATURE_ARTIFACT, '1', $group_id);
$result = $this->reference_manager->createReference($ref, true);
// Force reference creation because default trackers use reserved keywords
}
}
}
return array($tracker_mapping, $report_mapping);
}
示例2: ReferenceManager
<?php
include_once '../config/symbini.php';
include_once $serverRoot . '/classes/ReferenceManager.php';
$refId = array_key_exists('refid', $_REQUEST) ? $_REQUEST['refid'] : 0;
$formSubmit = array_key_exists('formsubmit', $_POST) ? $_POST['formsubmit'] : '';
$refManager = new ReferenceManager();
$refArr = '';
$statusStr = '';
if ($formSubmit) {
if ($formSubmit == 'Create Reference') {
$statusStr = $refManager->createReference($_POST);
$refId = $refManager->getRefId();
} elseif ($formSubmit == 'Edit Reference') {
if ($_POST['refGroup'] == 1) {
$statusStr = $refManager->editBookReference($_POST);
} elseif ($_POST['refGroup'] == 2) {
$statusStr = $refManager->editPerReference($_POST);
} else {
$statusStr = $refManager->editReference($_POST);
}
}
}
$refGroup = 0;
$refRank = 0;
$parentChild = 0;
if ($refId) {
$refArr = $refManager->getRefArr($refId);
$childArr = $refManager->getChildArr($refId);
$authArr = $refManager->getRefAuthArr($refId);
$fieldArr = $refManager->getRefTypeFieldArr($refArr["ReferenceTypeId"]);