当前位置: 首页>>代码示例>>PHP>>正文


PHP ReferenceManager::createReference方法代码示例

本文整理汇总了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);
 }
开发者ID:superlinger,项目名称:tuleap,代码行数:34,代码来源:ProjectCreator.class.php

示例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"]);
开发者ID:urban011,项目名称:ut-prc-symbiota,代码行数:31,代码来源:refdetails.php


注:本文中的ReferenceManager::createReference方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。