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


PHP ReferenceManager::addProjectReferences方法代码示例

本文整理汇总了PHP中ReferenceManager::addProjectReferences方法的典型用法代码示例。如果您正苦于以下问题:PHP ReferenceManager::addProjectReferences方法的具体用法?PHP ReferenceManager::addProjectReferences怎么用?PHP ReferenceManager::addProjectReferences使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ReferenceManager的用法示例。


在下文中一共展示了ReferenceManager::addProjectReferences方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createProject

 /**
  * createProject
  *
  * Create a new project
  *
  * Insert in group table
  * Insert group_desc_value, trove_group_link
  * Create filemodule in DB
  * Assign an admin user
  * Copy from template:
  * - activate the same services (using the ame server id and options)
  * - send message to the project requested (pepend on template values)
  * - create forums with the same name and public status
  * - copy CVS properties
  * - copy SVN settings and start .SVNAccessFile hisr=tiry
  * - add system references withut services
  * - copy ugroups and save mapping for further import
  * - copy FRS packages with permissions
  * - copy trackers
  * - copy wiki
  * - copy layout summary page
  * - Add the template as a project reference
  * - Copy Truncated email option
  * - Raise an event for plugin configuration
  *
  * @param  data ProjectCreationData
  */
 protected function createProject(ProjectCreationData $data)
 {
     $admin_user = UserManager::instance()->getCurrentUser();
     $group_id = $this->createGroupEntry($data);
     if ($group_id === false) {
         return;
     }
     $this->setCategories($data, $group_id);
     $this->initFileModule($group_id);
     $this->setProjectAdmin($group_id, $admin_user);
     // Instanciate all services from the project template that are 'active'
     $group = $this->projectManager->getProject($group_id);
     if (!$group || !is_object($group)) {
         exit_no_group();
     }
     $this->fakeGroupIdIntoHTTPParams($group_id);
     $template_id = $group->getTemplate();
     $template_group = $this->projectManager->getProject($template_id);
     if (!$template_group || !is_object($template_group) || $template_group->isError()) {
         exit_no_group();
     }
     $this->activateServicesFromTemplate($group_id, $template_group, $data);
     $this->setMessageToRequesterFromTemplate($group_id, $template_id);
     $this->initForumModuleFromTemplate($group_id, $template_id);
     $this->initCVSModuleFromTemplate($group_id, $template_id);
     $this->initSVNModuleFromTemplate($group_id, $template_id);
     // Activate other system references not associated with any service
     $this->reference_manager->addSystemReferencesWithoutService($template_id, $group_id);
     //Copy ugroups
     $ugroup_mapping = array();
     ugroup_copy_ugroups($template_id, $group_id, $ugroup_mapping);
     $this->initFRSModuleFromTemplate($group_id, $template_id, $ugroup_mapping);
     list($tracker_mapping, $report_mapping) = $this->initTrackerV3ModuleFromTemplate($group, $template_group, $ugroup_mapping);
     $this->initWikiModuleFromTemplate($group_id, $template_id);
     $this->initLayoutFromTemplate($group_id, $template_id);
     //Create project specific references if template is not default site template
     if (!$template_group->isSystem()) {
         $this->reference_manager->addProjectReferences($template_id, $group_id);
     }
     $this->copyEmailOptionsFromTemplate($group_id, $template_id);
     // Raise an event for plugin configuration
     $em = EventManager::instance();
     $em->processEvent('register_project_creation', array('reportMapping' => $report_mapping, 'trackerMapping' => $tracker_mapping, 'ugroupsMapping' => $ugroup_mapping, 'group_id' => $group_id, 'template_id' => $template_id));
     $this->autoActivateProject($group);
     return $group_id;
 }
开发者ID:superlinger,项目名称:tuleap,代码行数:73,代码来源:ProjectCreator.class.php


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