• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ReferenceManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: removePreviousCrossReferences

 private function removePreviousCrossReferences(Project $project, $revision, $old_commit_message)
 {
     $GLOBALS['group_id'] = $project->getID();
     $references = $this->reference_manager->extractReferences($old_commit_message, $project->getID());
     foreach ($references as $reference_instance) {
         /* @var $reference Reference */
         $reference = $reference_instance->getReference();
         if ($reference) {
             $cross_reference = new CrossReference($revision, $project->getID(), ReferenceManager::REFERENCE_NATURE_SVNREVISION, '', $reference_instance->getValue(), $reference->getGroupId(), $reference->getNature(), '', '');
             $this->reference_manager->removeCrossReference($cross_reference);
         }
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:13,代码来源:PostRevPropset.class.php


示例2: service_create_service

/**
* Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
* 
* 
* 
*/
function service_create_service($arr, $group_id, $template, $force_enable = false)
{
    // Convert link to real values
    // NOTE: if you change link variables here, change them also in src/www/project/admin/servicebar.php and src/www/include/Layout.class.php
    $link = $arr['link'];
    $pm = ProjectManager::instance();
    if ($template['system']) {
        $link = str_replace('$projectname', $pm->getProject($group_id)->getUnixName(), $link);
        $link = str_replace('$sys_default_domain', $GLOBALS['sys_default_domain'], $link);
        $link = str_replace('$group_id', $group_id, $link);
        if ($GLOBALS['sys_force_ssl']) {
            $sys_default_protocol = 'https';
        } else {
            $sys_default_protocol = 'http';
        }
        $link = str_replace('$sys_default_protocol', $sys_default_protocol, $link);
    } else {
        //for non-system templates
        $link = service_replace_template_name_in_link($link, $template, $pm->getProject($group_id));
    }
    $is_used = isset($template['is_used']) ? $template['is_used'] : $arr['is_used'];
    $server_id = isset($template['server_id']) ? $template['server_id'] : $arr['server_id'];
    $sql = "INSERT INTO service (group_id, label, description, short_name, link, is_active, is_used, scope, rank, location, server_id, is_in_iframe) VALUES (" . db_ei($group_id) . ", '" . db_es($arr['label']) . "', '" . db_es($arr['description']) . "', '" . db_es($arr['short_name']) . "', '" . db_es($link) . "', " . db_ei($arr['is_active']) . ", " . ($force_enable ? 1 : db_ei($is_used)) . ", '" . db_es($arr['scope']) . "', " . db_ei($arr['rank']) . ",  '" . db_es($arr['location']) . "', " . db_ei($server_id) . ", " . db_ei($arr['is_in_iframe']) . ")";
    $result = db_query($sql);
    if ($result) {
        // activate corresponding references
        $reference_manager =& ReferenceManager::instance();
        if ($arr['short_name'] != "") {
            $reference_manager->addSystemReferencesForService($template['id'], $group_id, $arr['short_name']);
        }
        return true;
    } else {
        return false;
    }
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:41,代码来源:service.php


示例3: doCreate

 private function doCreate()
 {
     $projectCreator = new ProjectCreator($this->project_manager, ReferenceManager::instance());
     $data = $this->creation_request->getProjectValues();
     $creationData = ProjectCreationData::buildFromFormArray($data);
     return $projectCreator->build($creationData);
 }
开发者ID:lincoln56,项目名称:tuleap,代码行数:7,代码来源:OneStepCreationController.class.php


示例4: 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


示例5: GivenAProjectCreator

 /**
  * @return ProjectCreator
  */
 private function GivenAProjectCreator()
 {
     $projectManager = new MockProjectManager();
     $creator = TestHelper::getPartialMock('ProjectCreator', array('createProject'));
     $creator->__construct($projectManager, ReferenceManager::instance());
     return $creator;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:10,代码来源:ProjectCreatorTest.php


示例6: generate

 function generate()
 {
     global $Language;
     $request =& HTTPRequest::instance();
     if ($data = $request->get('data')) {
         if (isset($data['users']['generate']) && $data['users']['generate']) {
             $um = UserManager::instance();
             $nb_wanted = isset($data['users']['nb']) ? (int) $data['users']['nb'] : 1;
             $users = $this->_getUsersData();
             reset($users);
             $nb_done = 0;
             while ((list(, $user) = each($users)) && $nb_wanted > $nb_done) {
                 if (!$um->getUserByUserName($user['name'])) {
                     require_once 'account.php';
                     account_create($user['name'], 'codendi', '', $user['realname'], '', '[email protected]', 'A', '', 0, 0, 'Europe/Paris', 'en_US', 'A');
                     $nb_done++;
                 }
             }
         }
         if (isset($data['projects']['generate']) && $data['projects']['generate']) {
             $nb_wanted = isset($data['projects']['nb']) ? (int) $data['projects']['nb'] : 1;
             $projects = $this->_getProjectsData();
             reset($projects);
             $nb_done = 0;
             while ((list(, $project) = each($projects)) && $nb_wanted > $nb_done) {
                 if (!group_get_object_by_name($project['name'])) {
                     $projectCreator = new ProjectCreator(ProjectManager::instance(), ReferenceManager::instance());
                     $projectCreator->create(array('project' => array('form_unix_name' => $project['name'], 'form_full_name' => $project['name'], 'form_short_description' => $project['description'], 'form_purpose' => $project['description'], 'form_required_sw' => '', 'form_patents' => '', 'form_comments' => '', 'built_from_template' => 100, 'is_test' => false, 'is_public' => true, 'trove' => array())));
                     $nb_done++;
                 }
             }
         }
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:34,代码来源:DataGeneratorActions.class.php


示例7: onOutputPageBeforeHTML

 public static function onOutputPageBeforeHTML(OutputPage &$out, &$text)
 {
     global $wgTuleapArtLinksGroupId;
     $reference_manager = ReferenceManager::instance();
     $reference_manager->insertReferences($text, $wgTuleapArtLinksGroupId);
     return true;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:TuleapArtLinks.hooks.php


示例8: itCreatesAProject

 public function itCreatesAProject()
 {
     $projectCreator = new ProjectCreator(ProjectManager::instance(), ReferenceManager::instance());
     $projectCreator->create('short-name', 'Long name', array('project' => array('form_short_description' => '', 'is_test' => false, 'is_public' => false, 'services' => array(), 'built_from_template' => 100)));
     ProjectManager::clearInstance();
     $project = ProjectManager::instance()->getProjectByUnixName('short-name');
     $this->assertEqual($project->getPublicName(), 'Long name');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:ProjectCreationTest.php


示例9: __construct

 public function __construct(EventManager $event_manager, ProjectManager $project_manager, XML_RNGValidator $xml_validator, UGroupManager $ugroup_manager, User\XML\Import\IFindUserFromXMLReference $user_finder, Logger $logger)
 {
     $this->event_manager = $event_manager;
     $this->project_manager = $project_manager;
     $this->xml_validator = $xml_validator;
     $this->ugroup_manager = $ugroup_manager;
     $this->user_finder = $user_finder;
     $this->logger = $logger;
     $this->project_creator = new ProjectCreator($this->project_manager, ReferenceManager::instance(), true);
 }
开发者ID:blestab,项目名称:tuleap,代码行数:10,代码来源:ProjectXMLImporter.class.php


示例10: getListPage

 /**
  * Récupérer une liste d'articles en fonction de critères
  * @param   array   $params         tableau associatif contenant les critères de sélection. clé : nom du paramètre, valeur : valeur du paramètre
  * @param   array   $infosPages     tableau associatif contenant des indications sur le nombre de pages, la liste des numéros de pages disponibles, etc.
  * @return  array   liste des articles
  * @see Manager::getIndexPages
  * @see Manager::_getListPage
  * @see Manager::_getCount
  */
 function getListPage($params, &$infosPages)
 {
     // Construction de la requête en fonction des paramètres
     $sql = 'SELECT a.doc_id as id, doc_auteurs,
           doc_titre as titre, doc_etat as etat, doc_date_publication,
           doc_date_enregistrement, doc_date_modification,
           u.uti_nom as nom, u.uti_prenom as prenom ';
     $from = ' FROM uti_utilisateur u, doc_document a';
     $where = ' WHERE u.uti_id = a.uti_id_soumis ';
     if (isset($params['uti']) && intval($params['uti']) > 0) {
         $where .= ' AND uti_id_soumis = ' . intval($params['uti']);
     }
     if (isset($params['status']) && is_numeric($params['status'])) {
         $where .= ' AND doc_etat = ' . trim($params['status']);
     }
     if (isset($params['type']) && strlen($params['type']) == 1) {
         $where .= ' AND typ_id = \'' . trim($params['type']) . '\'';
     }
     $ref = new ReferenceManager($this->db);
     $i = 0;
     foreach ($params as $clef => $val) {
         if (strpos($clef, 'cri_') === 0 && $val != 'none') {
             $crit = $ref->getCriterionInfos(substr($clef, 4));
             $crit = $crit['id'];
             $tmpsql = 'SELECT doc_id FROM doc_document WHERE doc_repertoire = ' . $this->db->quote($val);
             $res = $this->_getRow($tmpsql);
             $intro = $res['doc_id'];
             $from .= ", document_criteres c{$i}";
             $where .= " AND a.doc_id = c{$i}.doc_id AND c{$i}.cri_id = " . intval($crit) . " AND c{$i}.intro_id = " . intval($intro);
             $i++;
         }
     }
     if (isset($params['pg'])) {
         $page = intval($params['pg']);
     } else {
         $page = 0;
     }
     $nombreLigneTotal = $this->_getCount($from . $where);
     $infosPages = $this->getIndexPages($page, $this->nbParPage, $nombreLigneTotal, $this->nbLiensMax);
     $sql = $sql . $from . $where . " ORDER BY doc_date_enregistrement DESC";
     return $this->_getListPage($sql, $page, $this->nbParPage);
 }
开发者ID:BackupTheBerlios,项目名称:openweb-cms-svn,代码行数:51,代码来源:DocumentManager.class.php


示例11: build

 /**
  * @return Tracker_Artifact_XMLImport
  */
 public function build(User\XML\Import\IFindUserFromXMLReference $user_finder)
 {
     $artifact_factory = Tracker_ArtifactFactory::instance();
     $formelement_factory = Tracker_FormElementFactory::instance();
     $fields_validator = new Tracker_Artifact_Changeset_AtGivenDateFieldsValidator($formelement_factory);
     $changeset_dao = new Tracker_Artifact_ChangesetDao();
     $changeset_comment_dao = new Tracker_Artifact_Changeset_CommentDao();
     $logger = new Log_ConsoleLogger();
     $send_notifications = false;
     $artifact_creator = new Tracker_ArtifactCreator($artifact_factory, $fields_validator, new Tracker_Artifact_Changeset_InitialChangesetAtGivenDateCreator($fields_validator, $formelement_factory, $changeset_dao, $artifact_factory, EventManager::instance()));
     $new_changeset_creator = new Tracker_Artifact_Changeset_NewChangesetAtGivenDateCreator($fields_validator, $formelement_factory, $changeset_dao, $changeset_comment_dao, $artifact_factory, EventManager::instance(), ReferenceManager::instance());
     return new Tracker_Artifact_XMLImport(new XML_RNGValidator(), $artifact_creator, $new_changeset_creator, Tracker_FormElementFactory::instance(), $user_finder, new Tracker_FormElement_Field_List_Bind_Static_ValueDao(), $logger, $send_notifications);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:16,代码来源:XMLImportBuilder.class.php


示例12: getReferencesTable

function getReferencesTable($groupId)
{
    $html = '';
    $html .= '<h3>' . $GLOBALS['Language']->getText('project_showdetails', 'references') . '</h3>';
    $title_arr[] = $GLOBALS['Language']->getText('project_reference', 'r_keyword');
    $title_arr[] = $GLOBALS['Language']->getText('project_reference', 'r_desc');
    $title_arr[] = $GLOBALS['Language']->getText('project_reference', 'r_link');
    $html .= html_build_list_table_top($title_arr, false, false, true);
    $referenceManager =& ReferenceManager::instance();
    $references =& $referenceManager->getReferencesByGroupId($groupId);
    // References are sorted by scope first
    $row_num = 0;
    foreach ($references as $ref) {
        $html .= getReferenceRow($ref, $row_num);
        $row_num++;
    }
    $html .= '</table>';
    return $html;
}
开发者ID:nterray,项目名称:tuleap,代码行数:19,代码来源:showdetails.php


示例13: createMailForUsers


//.........这里部分代码省略.........
     if ($changes) {
         $body = $GLOBALS['sys_lf'] . "=============   " . strtoupper(SimpleSanitizer::unsanitize($this->ArtifactType->getName())) . " #" . $this->getID() . ": " . $Language->getText('tracker_include_artifact', 'latest_modif') . "   =============" . $GLOBALS['sys_lf'] . $artifact_href . $GLOBALS['sys_lf'] . $GLOBALS['sys_lf'] . $this->formatChanges($changes, $field_perm, $visible_change) . $GLOBALS['sys_lf'] . $GLOBALS['sys_lf'] . $GLOBALS['sys_lf'] . $GLOBALS['sys_lf'] . "";
         if (!$visible_change) {
             return;
         }
     }
     $ok = true;
     $visible_snapshot = false;
     $full_snapshot = "";
     // We write the name of the project
     $pm = ProjectManager::instance();
     $full_snapshot .= sprintf($fmt_left . $GLOBALS['sys_lf'] . "", $Language->getText('tracker_include_artifact', 'project') . ' ' . util_unconvert_htmlspecialchars($pm->getProject($group_id)->getPublicName()));
     // Write all the fields, grouped by fieldsetset and ordered by rank.
     $left = 1;
     $visible_fieldset = false;
     // fetch list of used fieldsets for this artifact
     foreach ($used_fieldsets as $fieldset_id => $fieldset) {
         $fieldset_snapshot = '';
         $used_fields = $fieldset->getAllUsedFields();
         // fetch list of used fields and the current field values
         // for this artifact
         while (list($key, $field) = each($used_fields)) {
             $field_name = $field->getName();
             if ($field_perm === false || isset($field_perm[$field_name]) && $field_perm[$field_name] && permission_can_read_field($field_perm[$field_name])) {
                 $field_html = new ArtifactFieldHtml($field);
                 $visible_fieldset = true;
                 $visible_snapshot = true;
                 // For multi select box, we need to retrieve all the values
                 if ($field->isMultiSelectBox()) {
                     $field_value = $field->getValues($this->getID());
                 } else {
                     $field_value = $this->getValue($field->getName());
                 }
                 $display = $field_html->display($group_artifact_id, $field_value, false, true, true, true);
                 $item = sprintf($left ? $fmt_left : $fmt_right, $display);
                 if (strlen($item) > $fmt_len) {
                     if (!$left) {
                         $fieldset_snapshot .= "" . $GLOBALS['sys_lf'] . "";
                     }
                     $fieldset_snapshot .= sprintf($fmt_right, $display);
                     $fieldset_snapshot .= "" . $GLOBALS['sys_lf'] . "";
                     $left = 1;
                 } else {
                     $fieldset_snapshot .= $item;
                     $left = !$left;
                     if ($left) {
                         $fieldset_snapshot .= "" . $GLOBALS['sys_lf'] . "";
                     }
                 }
             }
         }
         // while
         if ($visible_fieldset) {
             $full_snapshot .= "" . $GLOBALS['sys_lf'] . "";
             $full_snapshot .= $left ? "" : "" . $GLOBALS['sys_lf'] . "";
             $full_snapshot .= '--- ' . SimpleSanitizer::unsanitize($fieldset->getLabel()) . ' ---';
             $full_snapshot .= "" . $GLOBALS['sys_lf'] . "";
             $full_snapshot .= $fieldset_snapshot;
         }
     }
     if ($visible_snapshot) {
         $full_snapshot .= "" . $GLOBALS['sys_lf'] . "";
     }
     $body .= "=============   " . strtoupper(SimpleSanitizer::unsanitize($this->ArtifactType->getName())) . " #" . $this->getID() . ": " . $Language->getText('tracker_include_artifact', 'full_snapshot') . "   =============" . $GLOBALS['sys_lf'] . ($changes ? '' : $artifact_href) . $GLOBALS['sys_lf'] . $GLOBALS['sys_lf'] . $full_snapshot;
     if (!$left) {
         $body .= "" . $GLOBALS['sys_lf'] . "";
     }
     // Now display other special fields
     // Then output the history of bug comments from newest to oldest
     $body .= $this->showFollowUpComments($group_id, 0, self::OUTPUT_MAIL_TEXT);
     // Then output the CC list
     $body .= "" . $GLOBALS['sys_lf'] . $GLOBALS['sys_lf'] . $this->showCCList($group_id, $group_artifact_id, true);
     // Then output the dependencies
     $body .= "" . $GLOBALS['sys_lf'] . $GLOBALS['sys_lf'] . $this->showDependencies($group_id, $group_artifact_id, true);
     // Then output the history of attached files from newest to oldest
     $body .= "" . $GLOBALS['sys_lf'] . $GLOBALS['sys_lf'] . $this->showAttachedFiles($group_id, $group_artifact_id, true);
     // Extract references from the message
     $referenceManager =& ReferenceManager::instance();
     $ref_array = $referenceManager->extractReferencesGrouped($body, $group_id);
     if (count($ref_array) > 0) {
         $body .= $GLOBALS['sys_lf'] . $GLOBALS['sys_lf'] . $Language->getText('tracker_include_artifact', 'references') . $GLOBALS['sys_lf'];
     }
     foreach ($ref_array as $description => $match_array) {
         $body .= $GLOBALS['sys_lf'] . $description . ":" . $GLOBALS['sys_lf'];
         foreach ($match_array as $match => $ref_instance) {
             $reference =& $ref_instance->getReference();
             $body .= ' ' . $ref_instance->getMatch() . ': ' . $ref_instance->getFullGotoLink() . $GLOBALS['sys_lf'];
         }
     }
     // Finally output the message trailer
     $body .= "" . $GLOBALS['sys_lf'] . $GLOBALS['sys_lf'] . $Language->getText('tracker_include_artifact', 'follow_link');
     $body .= "" . $GLOBALS['sys_lf'] . $artifact_href;
     if ($ok) {
         $mail = new Mail();
         $mail->setBody($body);
         return $mail;
     } else {
         return null;
     }
 }
开发者ID:nterray,项目名称:tuleap,代码行数:101,代码来源:Artifact.class.php


示例14: strtoupper

 $oRef->ref_emb_vlm_ctn = $_REQUEST['refEmbVlmCtn'];
 $oRef->ref_emb_dim_lng = $_REQUEST['refEmbDimLng'];
 $oRef->ref_emb_dim_lrg = $_REQUEST['refEmbDimLrg'];
 $oRef->ref_emb_dim_ht = $_REQUEST['refEmbDimHt'];
 $oRef->ref_emb_dim_diam = $_REQUEST['refEmbDimDiam'];
 $oRef->ref_com = $_REQUEST['refCom'];
 $oRef->ref_code = strtoupper($_REQUEST['refCode']);
 $oRef->ref_mrq = $_REQUEST['refMrq'];
 $oRef->ref_code_douane = $_REQUEST['refCodeDouane'];
 $resPhoto = Tool::uplImg($imgPath, $imgMiniPath, $imgExtension, $imgMaxSize);
 if (count($resPhoto) > 0 && $resPhoto[0] != '') {
     $oRef->ref_photos = implode(',', $resPhoto);
     $oRef->ref_photos_pref = $resPhoto[0];
 }
 //Tool::printAnyCase($oRef);
 $resAddRef = ReferenceManager::addReference($oRef);
 $idRef = Connection::dernierId();
 if (isset($_REQUEST['pvePer']) && !empty($_REQUEST['pvePer']) || isset($_REQUEST['pveEnt']) && !empty($_REQUEST['pveEnt'])) {
     require $path . '/model/PrixVente.php';
     require $path . '/model/PrixVenteManager.php';
     $oPve = new PrixVente();
     $oPve->ref_id = $idRef;
     $oPve->pve_ent = $_REQUEST['pveEnt'];
     $oPve->pve_per = $_REQUEST['pvePer'];
     $resPv = PrixVenteManager::addPrixVente($oPve);
 }
 $cnx->commit();
 $msg = "<p class='info'>" . date('H:i:s') . " La référence " . $oRef->ref_lbl . " a été enregistré" . " avec succès</p>";
 $_SESSION['token'] = $_REQUEST['token'];
 $sAction = 'ref_list';
 require $path . '/controler/control_ref_list.php';
开发者ID:Arcken,项目名称:SOLYA,代码行数:31,代码来源:control_ref_add.php


示例15: getHTMLDisplayCrossRefs

 function getHTMLDisplayCrossRefs($with_links = true, $condensed = false, $isBrowser = true)
 {
     global $Language;
     /**
      * Array of cross references grouped by nature (to easy cross reference display)
      * Array has the form:
      * ['nature1'] => array (
      *                  ['both'] => array (
      *                                  CrossReference1,
      *                                  CrossReference2,
      *                                  ...)
      *                  ['source'] => array (
      *                                  CrossReference3,
      *                                  CrossReference4,
      *                                  ...)
      *                  ['target'] => array (
      *                                  CrossReference3,
      *                                  CrossReference4,
      *                                  ...)
      *  ['nature2'] => array (
      *                  ['both'] => array (
      *                                  CrossReference5,
      *                                  CrossReference6,
      *                                  ...)
      *                  ['source'] => array (
      *                                  CrossReference7,
      *                                  CrossReference8,
      *                                  ...)
      *                  ['target'] => array (
      *                                  CrossReference9,
      *                                  CrossReference10,
      *                                  ...)
      *  ...
      */
     $crossRefArray = $this->getCrossReferences();
     $reference_manager = ReferenceManager::instance();
     $available_natures = $reference_manager->getAvailableNatures();
     $user = UserManager::instance()->getCurrentUser();
     $itemIsReferenced = false;
     if ($isBrowser && ($user->isSuperUser() || $user->isMember($this->entity_gid, 'A'))) {
         $can_delete = true;
     } else {
         $can_delete = false;
     }
     $classes = array('both' => 'cross_reference', 'source' => 'referenced_by', 'target' => 'reference_to');
     $img = array('both' => array('both_arrows', 'cross_referenced'), 'source' => array('left_arrow', 'referenced_in'), 'target' => array('right_arrow', 'reference_to'));
     $message = addslashes($GLOBALS['Language']->getText('cross_ref_fact_include', 'confirm_delete'));
     // HTML part (stored in $display)
     $display = '';
     if (!$condensed) {
         $display .= '<p id="cross_references_legend">' . $Language->getText('cross_ref_fact_include', 'legend') . '</p>';
     }
     // loop through natures
     foreach ($crossRefArray as $nature => $refArraySourceTarget) {
         $display .= '<div class="nature">';
         if (!$condensed) {
             $display .= "<p><b>" . $available_natures[$nature]['label'] . "</b>";
         }
         // loop through each type of target
         $display .= '<ul class="cross_reference_list">';
         foreach (array('both', 'target', 'source') as $key) {
             if (array_key_exists($key, $refArraySourceTarget)) {
                 // one li for one type of ref (both, target, source)
                 $display .= '<li class="' . $classes[$key] . '">';
                 $display .= $GLOBALS['HTML']->getImage('ic/' . $img[$key][0] . '.png', array('alt' => $Language->getText('cross_ref_fact_include', $img[$key][1]), 'align' => 'top-left', 'hspace' => '5', 'title' => $Language->getText('cross_ref_fact_include', $img[$key][1])));
                 // the refs
                 $spans = array();
                 foreach ($refArraySourceTarget[$key] as $currRef) {
                     $span = '';
                     if ($key === 'source') {
                         $id = $currRef->getRefSourceKey() . "_" . $currRef->getRefSourceId();
                         $ref = $currRef->getRefSourceKey() . " #" . $currRef->getRefSourceId();
                         $url = $currRef->getRefSourceUrl();
                     } else {
                         $id = $currRef->getRefTargetKey() . "_" . $currRef->getRefTargetId();
                         $ref = $currRef->getRefTargetKey() . " #" . $currRef->getRefTargetId();
                         $url = $currRef->getRefTargetUrl();
                     }
                     $span .= '<span id="' . $id . '" class="link_to_ref">';
                     if ($with_links) {
                         $span .= '<a class="cross-reference" 
                                         title="' . $available_natures[$nature]['label'] . '" 
                                         href="' . $url . '">';
                         $span .= $ref . '</a>';
                     } else {
                         $span .= $ref;
                     }
                     if ($with_links && $can_delete && !$condensed) {
                         $params = $this->getParams($currRef);
                         $span .= '<a class="delete_ref" 
                                        href="/reference/rmreference.php' . $params . '"
                                        onClick="return delete_ref(\'' . $id . '\', \'' . $message . '\');">';
                         $span .= $GLOBALS['HTML']->getImage('ic/cross.png', array('alt' => $Language->getText('cross_ref_fact_include', 'delete'), 'title' => $Language->getText('cross_ref_fact_include', 'delete')));
                         $span .= '</a>';
                     }
                     $spans[] = $span;
                 }
                 $display .= implode(', </span>', $spans) . '</span>';
                 $display .= '</li>';
             }
//.........这里部分代码省略.........
开发者ID:nterray,项目名称:tuleap,代码行数:101,代码来源:CrossReferenceFactory.class.php


示例16: frs_process_release_form


//.........这里部分代码省略.........
        } else {
            //parse the date
            $date_list = split("-", $release['date'], 3);
            $unix_release_time = mktime(0, 0, 0, $date_list[1], $date_list[2], $date_list[0]);
        }
        //now we create or update the release
        $array = array('release_date' => $unix_release_time, 'name' => $release['name'], 'status_id' => $release['status_id'], 'package_id' => $release['package_id'], 'notes' => $release['release_notes'], 'changes' => $release['change_log']);
        if ($is_update) {
            $array['release_id'] = $release['release_id'];
        }
        if ($is_update) {
            $res = $frsrf->update($array);
            if (!$res) {
                $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('file_admin_editreleases', 'rel_update_failed'));
                //insert failed - go back to definition screen
            } else {
                //release added - now show the detail page for this new release
                $release_id = $array['release_id'];
                $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('file_admin_editreleases', 'rel_updated', $release['name']));
            }
        } else {
            $res = $frsrf->create($array);
            if (!$res) {
                $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language'] > getText('file_admin_editreleases', 'add_rel_fail'));
                //insert failed - go back to definition screen
            } else {
                //release added - now show the detail page for this new release
                $release_id = $res;
                $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('file_admin_editreleases', 'rel_added'));
            }
        }
        if ($res) {
            // extract cross references
            $reference_manager =& ReferenceManager::instance();
            $reference_manager->extractCrossRef($release['release_notes'], $release_id, ReferenceManager::REFERENCE_NATURE_RELEASE, $group_id);
            $reference_manager->extractCrossRef($release['change_log'], $release_id, ReferenceManager::REFERENCE_NATURE_RELEASE, $group_id);
            //set the release permissions
            list($return_code, $feedbacks) = permission_process_selection_form($group_id, 'RELEASE_READ', $release_id, $ugroups);
            if (!$return_code) {
                $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('file_admin_editpackages', 'perm_update_err'));
                $GLOBALS['Response']->addFeedback('error', $feedbacks);
            }
            //submit news if requested
            if ($release_id && user_ismember($group_id, 'A') && $release_submit_news) {
                news_submit($group_id, $release_news_subject, $release_news_details, $private_news, 3);
            }
            // Send notification
            if ($notification) {
                $rel = $frsrf->getFRSReleaseFromDb($release_id);
                $count = $frsrf->emailNotification($rel);
                if ($count === false) {
                    $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('global', 'mail_failed', array($GLOBALS['sys_email_admin'])));
                } else {
                    if ($count > 0) {
                        $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('file_admin_editreleases', 'email_sent', $count));
                    }
                }
            }
            $group = $pm->getProject($group_id);
            $group_unix_name = $group->getUnixName(false);
            $project_files_dir = $GLOBALS['ftp_frs_dir_prefix'] . '/' . $group_unix_name;
            if ($is_update) {
                $files =& $rel->getFiles();
                //remove files
                foreach ($release_files_to_delete as $rel_file) {
                    $res =& $frsff->getFRSFileFromDb($rel_file);
开发者ID:rinodung,项目名称:tuleap,代码行数:67,代码来源:file_utils.php


示例17: catch

                 $lotBon = BonLigneManager::getBonLignesFromLot($lotId);
                 //Si le tableau est définie, au moins une occurence est trouvé
                 if (is_array($lotBon)) {
                     //Dans ce cas on stock l'id du lot dans le tableau,
                     //dans le formulaire si on trouve l'id du lot dans le tableau
                     //on désactive la checkbox de suppression
                     $resAllLotsBons[] = $lotId;
                 }
                 //On récupére les infos du lot
                 $lot = LotManager::getLotForUpd($lotId);
                 //On ajoute le lot retourné au tableau de lot
                 $resAllLots[] = $lot;
                 //On récupére l'id de la référence
                 $refId = $lot->ref_id;
                 //On récupére les infos de la référence
                 $ref = ReferenceManager::getReference($refId);
                 //On ajoute la référence retournée au tableau de référence
                 $resAllRefs[] = $ref;
                 //On récupére l'id du droit de douane
                 $ddId = $ref->dd_id;
                 //On récupére les infos du droit de douane
                 $dd = DroitDouaneManager::getDroitDouaneById($ddId);
                 //On ajoute le droit de douane retournée au tableau de droit douane
                 $resAllDds[] = $dd;
             }
         }
     } catch (MySQLException $e) {
         $msg = $resEr[1];
         Tool::addMsg($msg);
     }
 }
开发者ID:Arcken,项目名称:SOLYA,代码行数:31,代码来源:control_be_upd.php


示例18: GitDao

 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
 */
require_once 'pre.php';
$git_dao = new GitDao();
$user_manager = UserManager::instance();
$git_repository_factory = new GitRepositoryFactory($git_dao, ProjectManager::instance());
$system_event_manager = new Git_SystemEventManager(SystemEventManager::instance(), $git_repository_factory);
$git_plugin = PluginManager::instance()->getPluginByName('git');
$logger = $git_plugin->getLogger();
if ($argv[1] == "--init") {
    $repository_path = $argv[2];
    $user_name = $argv[3];
    $repository = $git_repository_factory->getFromFullPath($repository_path);
    if ($repository) {
        $system_event_manager->queueGrokMirrorManifestFollowingAGitPush($repository);
    }
} else {
    $repository_path = $argv[1];
    $user_name = $argv[2];
    $old_rev = $argv[3];
    $new_rev = $argv[4];
    $refname = $argv[5];
    try {
        $git_exec = new Git_Exec($repository_path, $repository_path);
        $post_receive = new Git_Hook_PostReceive(new Git_Hook_LogAnalyzer($git_exec, $logger), $git_repository_factory, $user_manager, new Git_Ci_Launcher(new Jenkins_Client(new Http_Client()), new Git_Ci_Dao(), $logger), new Git_Hook_ParseLog(new Git_Hook_LogPushes($git_dao), new Git_Hook_ExtractCrossReferences($git_exec, ReferenceManager::instance()), $logger));
        $post_receive->execute($repository_path, $user_name, $old_rev, $new_rev, $refname);
    } catch (Exception $exception) {
        $logger->error("[git post-receive] {$repository_path} {$user_name} {$refname} {$old_rev} {$new_rev} " . $exception->getMessage());
        exit(1);
    }
}
开发者ID:rinodung,项目名称:tuleap,代码行数:31,代码来源:post-receive.php


示例19: getReferenceManager

 /**
  * @return ReferenceManager
  */
 protected function getReferenceManager()
 {
     return ReferenceManager::instance();
 }
开发者ID:magarnier,项目名称:tuleap,代码行数:7,代码来源:Tracker_Artifact_Changeset.class.php


示例20: getReferenceManager

 /**
  * @return ReferenceManager
  */
 public function getReferenceManager()
 {
     return ReferenceManager::instance();
 }
开发者ID:superlinger,项目名称:tuleap,代码行数:7,代码来源:Tracker_Artifact.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Referrer类代码示例发布时间:2022-05-23
下一篇:
PHP Reference类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap