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


PHP TrackerManager类代码示例

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


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

示例1: userCanAccessProject

 /**
  * Ensure given user can access given project
  *
  * @param PFUser  $user
  * @param Project $project
  * @return boolean
  * @throws Project_AccessProjectNotFoundException
  * @throws Project_AccessDeletedException
  * @throws Project_AccessRestrictedException
  * @throws Project_AccessPrivateException
  */
 public function userCanAccessProject(PFUser $user, Project $project)
 {
     $tracker_manager = new TrackerManager();
     if ($tracker_manager->userCanAdminAllProjectTrackers($user)) {
         return true;
     }
     return parent::userCanAccessProject($user, $project);
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:19,代码来源:Tracker_URLVerification.class.php

示例2: displayHeader

 /**
  * Display header for service tracker
  *
  * @param string $title       The title
  * @param array  $breadcrumbs array of breadcrumbs (array of 'url' => string, 'title' => string)
  * @param array  $toolbar     array of toolbars (array of 'url' => string, 'title' => string)
  *
  * @return void
  */
 public function displayHeader($title, $breadcrumbs, $toolbar, $params = array())
 {
     $GLOBALS['HTML']->includeCalendarScripts();
     $tracker_manager = new TrackerManager();
     $user_has_special_access = $tracker_manager->userCanAdminAllProjectTrackers();
     $params = $params + array('user_has_special_access' => $user_has_special_access);
     $params['service_name'] = self::NAME;
     $params['project_id'] = $this->getGroupId();
     parent::displayHeader($title, $breadcrumbs, $toolbar, $params);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:19,代码来源:ServiceTracker.class.php

示例3: getOrderBy

 /**
  * checks the request for the order by and if that is not set then it checks the session for it
  *
  * @return array containing the keys orderBy => field being ordered off of and sortOrder => the sort order of that field
  */
 function getOrderBy($orderBy = '', $direction = '')
 {
     if (!empty($orderBy) || !empty($_REQUEST[$this->var_order_by])) {
         if (!empty($_REQUEST[$this->var_order_by])) {
             $direction = 'ASC';
             $orderBy = $_REQUEST[$this->var_order_by];
             if (!empty($_REQUEST['lvso']) && (empty($_SESSION['lvd']['last_ob']) || strcmp($orderBy, $_SESSION['lvd']['last_ob']) == 0)) {
                 $direction = $_REQUEST['lvso'];
                 $trackerManager = TrackerManager::getInstance();
                 if ($monitor = $trackerManager->getMonitor('tracker')) {
                     $monitor->setValue('module_name', $GLOBALS['module']);
                     $monitor->setValue('item_summary', "lvso=" . $direction . "&" . $this->var_order_by . "=" . $_REQUEST[$this->var_order_by]);
                     $monitor->setValue('action', 'listview');
                     $monitor->setValue('user_id', $GLOBALS['current_user']->id);
                     $monitor->setValue('date_modified', gmdate($GLOBALS['timedate']->get_db_date_time_format()));
                     $monitor->save();
                 }
             }
         }
         $_SESSION[$this->var_order_by] = array('orderBy' => $orderBy, 'direction' => $direction);
         $_SESSION['lvd']['last_ob'] = $orderBy;
     } else {
         if (!empty($_SESSION[$this->var_order_by])) {
             $orderBy = $_SESSION[$this->var_order_by]['orderBy'];
             $direction = $_SESSION[$this->var_order_by]['direction'];
         }
     }
     return array('orderBy' => $orderBy, 'sortOrder' => $direction);
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:34,代码来源:ListViewData.php

示例4: start

 function start()
 {
     $this->db = DBManagerFactory::getInstance();
     $this->userDemoData = new UserDemoData($this->user, false);
     $this->trackerManager = TrackerManager::getInstance();
     foreach ($this->modules as $mod) {
         $query = "select id from {$mod}";
         $result = $this->db->limitQuery($query, 0, 50);
         $ids = array();
         while ($row = $this->db->fetchByAssoc($result)) {
             $ids[] = $row['id'];
         }
         //while
         $this->beanIdMap[$mod] = $ids;
     }
     while ($this->monitorIds-- > 0) {
         $this->monitorId = create_guid();
         $this->trackerManager->setMonitorId($this->monitorId);
         $this->user = $this->userDemoData->guids[array_rand($this->userDemoData->guids)];
         $this->module = $this->modules[array_rand($this->modules)];
         $this->action = $this->actions[array_rand($this->actions)];
         $this->date = $this->randomTimestamp();
         $this->populate_tracker();
         $this->populate_tracker_perf();
         $this->populate_tracker_sessions();
         $this->populate_tracker_queries();
         $this->trackerManager->save();
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:29,代码来源:populateSeedData.php

示例5: insertTrackerEntry

 public static function insertTrackerEntry($bean, $action)
 {
     require_once 'modules/Trackers/TrackerManager.php';
     $trackerManager = TrackerManager::getInstance();
     $timeStamp = gmdate($GLOBALS['timedate']->get_db_date_time_format());
     $_REQUEST['action'] = $action;
     if ($monitor = $trackerManager->getMonitor('tracker')) {
         $monitor->setValue('action', $action);
         $monitor->setValue('user_id', $GLOBALS['current_user']->id);
         $monitor->setValue('module_name', $bean->module_dir);
         $monitor->setValue('date_modified', $timeStamp);
         $monitor->setValue('visible', $action == 'detailview' || $action == 'editview' ? 1 : 0);
         if (!empty($bean->id)) {
             $monitor->setValue('item_id', $bean->id);
             $monitor->setValue('item_summary', $bean->get_summary_text());
         }
         //If visible is true, but there is no bean, do not track (invalid/unauthorized reference)
         //Also, do not track save actions where there is no bean id
         if ($monitor->visible && empty($bean->id)) {
             $trackerManager->unsetMonitor($monitor);
             return false;
         }
         $trackerManager->saveMonitor($monitor, true, true);
         if (empty(self::$_monitorId)) {
             self::$_monitorId = $monitor->monitor_id;
         }
     }
 }
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:28,代码来源:SugarTestTrackerUtility.php

示例6: display

 /** 
  * @see SugarView::display()
  */
 public function display()
 {
     global $mod_strings, $app_strings;
     $admin = Administration::getSettings();
     require 'modules/Trackers/config.php';
     ///////////////////////////////////////////////////////////////////////////////
     ////	HANDLE CHANGES
     if (isset($_POST['process'])) {
         if ($_POST['process'] == 'true') {
             foreach ($tracker_config as $entry) {
                 if (isset($entry['bean'])) {
                     //If checkbox is unchecked, we add the entry into the config table; otherwise delete it
                     if (empty($_POST[$entry['name']])) {
                         $admin->saveSetting('tracker', $entry['name'], 1);
                     } else {
                         $db = DBManagerFactory::getInstance();
                         $db->query("DELETE FROM config WHERE category = 'tracker' and name = '" . $entry['name'] . "'");
                     }
                 }
             }
             //foreach
             //save the tracker prune interval
             if (!empty($_POST['tracker_prune_interval'])) {
                 $admin->saveSetting('tracker', 'prune_interval', $_POST['tracker_prune_interval']);
             }
             //save log slow queries and slow query interval
             $configurator = new Configurator();
             $configurator->saveConfig();
         }
         //if
         header('Location: index.php?module=Administration&action=index');
     }
     echo getClassicModuleTitle("Administration", array("<a href='index.php?module=Administration&action=index'>" . translate('LBL_MODULE_NAME', 'Administration') . "</a>", translate('LBL_TRACKER_SETTINGS', 'Administration')), false);
     $trackerManager = TrackerManager::getInstance();
     $disabledMonitors = $trackerManager->getDisabledMonitors();
     $trackerEntries = array();
     foreach ($tracker_config as $entry) {
         if (isset($entry['bean'])) {
             $disabled = !empty($disabledMonitors[$entry['name']]);
             $trackerEntries[$entry['name']] = array('label' => $mod_strings['LBL_' . strtoupper($entry['name']) . '_DESC'], 'helpLabel' => $mod_strings['LBL_' . strtoupper($entry['name']) . '_HELP'], 'disabled' => $disabled);
         }
     }
     $configurator = new Configurator();
     $this->ss->assign('config', $configurator->config);
     $config_strings = return_module_language($GLOBALS['current_language'], 'Configurator');
     $mod_strings['LOG_SLOW_QUERIES'] = $config_strings['LOG_SLOW_QUERIES'];
     $mod_strings['SLOW_QUERY_TIME_MSEC'] = $config_strings['SLOW_QUERY_TIME_MSEC'];
     $this->ss->assign('mod', $mod_strings);
     $this->ss->assign('app', $app_strings);
     $this->ss->assign('trackerEntries', $trackerEntries);
     $this->ss->assign('tracker_prune_interval', !empty($admin->settings['tracker_prune_interval']) ? $admin->settings['tracker_prune_interval'] : 30);
     $this->ss->display('modules/Trackers/tpls/TrackerSettings.tpl');
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:56,代码来源:view.trackersettings.php

示例7: trackView

 /**
  * Track a view for a particular bean.
  *
  * @param SugarBean $seed
  * @param string $current_view
  */
 function trackView($seed, $current_view)
 {
     $trackerManager = TrackerManager::getInstance();
     if ($monitor = $trackerManager->getMonitor('tracker')) {
         $monitor->setValue('date_modified', TimeDate::getInstance()->nowDb());
         $monitor->setValue('user_id', $GLOBALS['current_user']->id);
         $monitor->setValue('module_name', $seed->module_dir);
         $monitor->setValue('action', $current_view);
         $monitor->setValue('item_id', $seed->id);
         $monitor->setValue('item_summary', $seed->get_summary_text());
         $monitor->setValue('visible', true);
         $trackerManager->saveMonitor($monitor, TRUE, TRUE);
     }
 }
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:20,代码来源:SugarWebServiceUtilv3_1.php

示例8: __construct

 public function __construct($importSource, $bean)
 {
     global $mod_strings, $sugar_config;
     $this->importSource = $importSource;
     //Vanilla copy of the bean object.
     $this->bean = $bean;
     // use our own error handler
     set_error_handler(array('Importer', 'handleImportErrors'), E_ALL & ~E_STRICT & ~E_DEPRECATED);
     // Increase the max_execution_time since this step can take awhile
     ini_set("max_execution_time", max($sugar_config['import_max_execution_time'], 3600));
     // stop the tracker
     TrackerManager::getInstance()->pause();
     // set the default locale settings
     $this->ifs = $this->getFieldSanitizer();
     //Get the default user currency
     $this->defaultUserCurrency = BeanFactory::getBean('Currencies', '-99');
     //Get our import column definitions
     $this->importColumns = $this->getImportColumns();
     $this->isUpdateOnly = isset($_REQUEST['import_type']) && $_REQUEST['import_type'] == 'update';
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:20,代码来源:Importer.php

示例9: handleSave


//.........这里部分代码省略.........
             if (!empty($_POST['return_module'])) {
                 $get .= $_POST['return_module'];
             } else {
                 $get .= 'xVendors';
             }
             $get .= '&return_action=';
             if (!empty($_POST['return_action'])) {
                 $get .= $_POST['return_action'];
             }
             //else $get .= 'DetailView';
             if (!empty($_POST['return_id'])) {
                 $get .= '&return_id=' . $_POST['return_id'];
             }
             if (!empty($_POST['popup'])) {
                 $get .= '&popup=' . $_POST['popup'];
             }
             if (!empty($_POST['create'])) {
                 $get .= '&create=' . $_POST['create'];
             }
             $_SESSION['SHOW_DUPLICATES'] = $get;
             //now redirect the post to modules/xVendors/ShowDuplicates.php
             if (!empty($_POST['is_ajax_call']) && $_POST['is_ajax_call'] == '1') {
                 ob_clean();
                 $json = getJSONobj();
                 echo $json->encode(array('status' => 'dupe', 'get' => $location));
             } else {
                 if (!empty($_REQUEST['ajax_load'])) {
                     echo "<script>SUGAR.ajaxUI.loadContent('index.php?{$location}');</script>";
                 } else {
                     if (!empty($_POST['to_pdf'])) {
                         $location .= '&to_pdf=' . $_POST['to_pdf'];
                     }
                     header("Location: index.php?{$location}");
                 }
             }
             return null;
         }
     }
     if (!$focus->ACLAccess('Save')) {
         ACLController::displayNoAccess(true);
         sugar_cleanup(true);
     }
     $focus->save($check_notify);
     $return_id = $focus->id;
     $GLOBALS['log']->debug("Saved record with id of " . $return_id);
     if (!empty($_POST['is_ajax_call']) && $_POST['is_ajax_call'] == '1') {
         $json = getJSONobj();
         echo $json->encode(array('status' => 'success', 'get' => ''));
         $trackerManager = TrackerManager::getInstance();
         $timeStamp = TimeDate::getInstance()->nowDb();
         if ($monitor = $trackerManager->getMonitor('tracker')) {
             $monitor->setValue('action', 'detailview');
             $monitor->setValue('user_id', $GLOBALS['current_user']->id);
             $monitor->setValue('module_name', 'xVendors');
             $monitor->setValue('date_modified', $timeStamp);
             $monitor->setValue('visible', 1);
             if (!empty($this->bean->id)) {
                 $monitor->setValue('item_id', $return_id);
                 $monitor->setValue('item_summary', $focus->get_summary_text());
             }
             $trackerManager->saveMonitor($monitor, true, true);
         }
         return null;
     }
     if (isset($_POST['popup']) && $_POST['popup'] == 'true') {
         $get = '&module=';
         if (!empty($_POST['return_module'])) {
             $get .= $_POST['return_module'];
         } else {
             $get .= 'xVendors';
         }
         $get .= '&action=';
         if (!empty($_POST['return_action'])) {
             $get .= $_POST['return_action'];
         } else {
             $get .= 'Popup';
         }
         if (!empty($_POST['return_id'])) {
             $get .= '&return_id=' . $_POST['return_id'];
         }
         if (!empty($_POST['popup'])) {
             $get .= '&popup=' . $_POST['popup'];
         }
         if (!empty($_POST['create'])) {
             $get .= '&create=' . $_POST['create'];
         }
         if (!empty($_POST['to_pdf'])) {
             $get .= '&to_pdf=' . $_POST['to_pdf'];
         }
         $get .= '&name=' . $focus->name;
         $get .= '&query=true';
         header("Location: index.php?{$get}");
         return;
     }
     if ($redirect) {
         handleRedirect($return_id, 'xVendors');
     } else {
         return $focus;
     }
 }
开发者ID:sunmo,项目名称:snowlotus,代码行数:101,代码来源:xVendorFormBase.php

示例10: codendi_daily_start

 /**
  * Process the nightly job to send reminder on artifact correponding to given criteria
  *
  * @param Array $params Hook params
  *
  * @return Void
  */
 public function codendi_daily_start($params)
 {
     include_once 'Tracker/TrackerManager.class.php';
     $trackerManager = new TrackerManager();
     $logger = new BackendLogger();
     $logger->debug("[TDR] Tuleap daily start event: launch date reminder");
     return $trackerManager->sendDateReminder();
 }
开发者ID:bamboolsu,项目名称:tuleap,代码行数:15,代码来源:trackerPlugin.class.php

示例11: handleSave


//.........这里部分代码省略.........
                     echo "<script>SUGAR.ajaxUI.loadContent('index.php?{$location}');</script>";
                 } else {
                     if (!empty($_POST['to_pdf'])) {
                         $location .= '&to_pdf=' . $_POST['to_pdf'];
                     }
                     header("Location: index.php?{$location}");
                 }
             }
             return null;
         }
     }
     global $current_user;
     if (is_admin($current_user)) {
         if (!isset($_POST[$prefix . 'portal_active'])) {
             $focus->portal_active = '0';
         }
         //if no password is set set account to inactive for portal
         if (empty($_POST[$prefix . 'portal_name'])) {
             $focus->portal_active = '0';
         }
     }
     ///////////////////////////////////////////////////////////////////////////////
     ////	INBOUND EMAIL HANDLING
     ///////////////////////////////////////////////////////////////////////////////
     if (isset($_REQUEST['inbound_email_id']) && !empty($_REQUEST['inbound_email_id'])) {
         // fake this case like it's already saved.
         $focus->save($check_notify);
         $email = new Email();
         $email->retrieve($_REQUEST['inbound_email_id']);
         $email->parent_type = 'Contacts';
         $email->parent_id = $focus->id;
         $email->assigned_user_id = $current_user->id;
         $email->status = 'read';
         $email->save();
         $email->load_relationship('contacts');
         $email->contacts->add($focus->id);
         header("Location: index.php?&module=Emails&action=EditView&type=out&inbound_email_id=" . $_REQUEST['inbound_email_id'] . "&parent_id=" . $email->parent_id . "&parent_type=" . $email->parent_type . '&start=' . $_REQUEST['start'] . '&assigned_user_id=' . $current_user->id);
         exit;
     }
     ////	END INBOUND EMAIL HANDLING
     ///////////////////////////////////////////////////////////////////////////////
     $focus->save($check_notify);
     $return_id = $focus->id;
     $GLOBALS['log']->debug("Saved record with id of " . $return_id);
     if (!empty($_POST['is_ajax_call']) && $_POST['is_ajax_call'] == '1') {
         $json = getJSONobj();
         echo $json->encode(array('status' => 'success', 'get' => ''));
         $trackerManager = TrackerManager::getInstance();
         $timeStamp = TimeDate::getInstance()->nowDb();
         if ($monitor = $trackerManager->getMonitor('tracker')) {
             $monitor->setValue('action', 'detailview');
             $monitor->setValue('user_id', $GLOBALS['current_user']->id);
             $monitor->setValue('module_name', 'Contacts');
             $monitor->setValue('date_modified', $timeStamp);
             $monitor->setValue('visible', 1);
             if (!empty($this->bean->id)) {
                 $monitor->setValue('item_id', $return_id);
                 $monitor->setValue('item_summary', $focus->get_summary_text());
             }
             $trackerManager->saveMonitor($monitor, true, true);
         }
         return null;
     }
     if (isset($_POST['popup']) && $_POST['popup'] == 'true') {
         $get = '&module=';
         if (!empty($_POST['return_module'])) {
             $get .= $_POST['return_module'];
         } else {
             $get .= 'Contacts';
         }
         $get .= '&action=';
         if (!empty($_POST['return_action'])) {
             $get .= $_POST['return_action'];
         } else {
             $get .= 'Popup';
         }
         if (!empty($_POST['return_id'])) {
             $get .= '&return_id=' . $_POST['return_id'];
         }
         if (!empty($_POST['popup'])) {
             $get .= '&popup=' . $_POST['popup'];
         }
         if (!empty($_POST['create'])) {
             $get .= '&create=' . $_POST['create'];
         }
         if (!empty($_POST['to_pdf'])) {
             $get .= '&to_pdf=' . $_POST['to_pdf'];
         }
         $get .= '&first_name=' . urlencode($focus->first_name);
         $get .= '&last_name=' . urlencode($focus->last_name);
         $get .= '&query=true';
         header("Location: index.php?{$get}");
         return;
     }
     if ($redirect) {
         $this->handleRedirect($return_id);
     } else {
         return $focus;
     }
 }
开发者ID:razorinc,项目名称:sugarcrm-example,代码行数:101,代码来源:ContactFormBase.php

示例12: track_slow_queries

 /**
  * Tracks slow queries in the tracker database table
  *
  * @param string $query  value of query to track
  */
 protected function track_slow_queries($query)
 {
     $trackerManager = TrackerManager::getInstance();
     if ($trackerManager->isPaused()) {
         return;
     }
     if ($monitor = $trackerManager->getMonitor('tracker_queries')) {
         $monitor->setValue('date_modified', $this->timedate->nowDb());
         $monitor->setValue('text', $query);
         $monitor->setValue('sec_total', $this->query_time);
         //Save the monitor to cache (do not flush)
         $trackerManager->saveMonitor($monitor, false);
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:19,代码来源:DBManager.php

示例13: getTrackerManager

 /**
  * Helper until we have dependency injection to grab a tracker manager
  * @return TrackerManager An instance of the tracker manager
  */
 public function getTrackerManager()
 {
     return TrackerManager::getInstance();
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:8,代码来源:SugarApi.php

示例14: finishJob

 /**
  * This function takes a job_id, and updates schedulers last_run as well as
  * soft delete the job instance from schedulers_times
  * @return	boolean		Success
  */
 function finishJob()
 {
     $trackerManager = TrackerManager::getInstance();
     $trackerManager->pause();
     $GLOBALS['log']->debug('----->SchedulersJob updating Job Status and finishing Job execution.');
     $this->scheduler->retrieve($this->scheduler->id);
     $this->scheduler->last_run = gmdate($GLOBALS['timedate']->get_db_date_time_format());
     if ($this->scheduler->last_run == gmdate($GLOBALS['timedate']->get_db_date_time_format(), strtotime('Jan 01 2000 00:00:00'))) {
         $this->scheduler->last_run = $this->handleDateFormat('now');
         $GLOBALS['log']->fatal('Scheduler applying bogus date for "Last Run": ' . $this->scheduler->last_run);
     }
     $this->scheduler->save();
     $trackerManager->unPause();
 }
开发者ID:razorinc,项目名称:sugarcrm-example,代码行数:19,代码来源:SchedulersJob.php

示例15: createFromXML

 /**
  * First, creates a new Tracker Object by importing its structure from an XML file,
  * then, imports it into the Database, before verifying the consistency
  *
  * @param string         $xmlFile        the location of the imported file
  * @param int            $groupId        the Id of the project to create the tracker
  * @param string         $name           the name of the tracker (label)
  * @param string         $description    the description of the tracker
  * @param string         $itemname       the short name of the tracker
  * @param TrackerManager $trackermanager an instance of TrackerManager
  *
  * @return the new Tracker, or null if error
  */
 public function createFromXML($xmlFile, $groupId, $name, $description, $itemname, $trackermanager)
 {
     $tracker = null;
     if ($this->validMandatoryInfoOnCreate($name, $description, $itemname, $groupId)) {
         // XML validation before creating a new tracker
         $dom = new DOMDocument();
         $dom->load($xmlFile);
         $rng = realpath(dirname(__FILE__) . '/../../www/resources/tracker.rng');
         if (!@$dom->relaxNGValidate($rng)) {
             //hide warning since we will extract the errors below
             //try to be more verbose for the end user (RelaxNG notices are hidden)
             $hp = Codendi_HTMLPurifier::instance();
             $indent = $GLOBALS['codendi_utils_prefix'] . '/xml/indent.xsl';
             $jing = $GLOBALS['codendi_utils_prefix'] . '/xml/jing.jar';
             $temp = tempnam($GLOBALS['tmp_dir'], 'xml');
             $cmd_indent = "xsltproc -o {$temp} {$indent} {$xmlFile}";
             `{$cmd_indent}`;
             $output = array();
             $cmd_valid = "java -jar {$jing} {$rng} {$temp}";
             exec($cmd_valid, $output);
             $errors = array();
             if ($trackermanager) {
                 $project = ProjectManager::instance()->getProject($groupId);
                 $breadcrumbs = array(array('title' => 'Create a new tracker', 'url' => TRACKER_BASE_URL . '/?group_id=' . $project->group_id . '&amp;func=create'));
                 $toolbar = array();
                 $trackermanager->displayHeader($project, 'Trackers', $breadcrumbs, $toolbar);
                 //var_dump($cmd_indent, $cmd_valid);
                 echo '<h2>XML file doesnt have correct format</h2>';
                 foreach ($output as $o) {
                     $matches = array();
                     preg_match('/:(\\d+):(\\d+):([^:]+):(.*)/', $o, $matches);
                     //1 line
                     //2 column
                     //3 type
                     //4 message
                     $errors[$matches[1]][$matches[2]][] = array(trim($matches[3]) => trim($matches[4]));
                     echo '<a href="#line_' . $matches[1] . '">' . $matches[3] . ': ' . $matches[4] . '</a><br />';
                 }
                 $clear = $GLOBALS['HTML']->getimage('clear.png', array('width' => 24, 'height' => 1));
                 $icons = array('error' => $GLOBALS['HTML']->getimage('ic/error.png', array('style' => 'vertical-align:middle')));
                 $styles = array('error' => 'color:red; font-weight:bold;');
                 echo '<pre>';
                 foreach (file($temp) as $number => $line) {
                     echo '<div id="line_' . ($number + 1) . '">';
                     echo '<span style="color:gray;">' . sprintf('%4d', $number + 1) . '</span>' . $clear . $hp->purify($line, CODENDI_PURIFIER_CONVERT_HTML);
                     if (isset($errors[$number + 1])) {
                         foreach ($errors[$number + 1] as $c => $e) {
                             echo '<div>' . sprintf('%3s', '') . $clear . sprintf('%' . ($c - 1) . 's', '') . '<span style="color:blue; font-weight:bold;">^</span></div>';
                             foreach ($e as $error) {
                                 foreach ($error as $type => $message) {
                                     $style = isset($styles['error']) ? $styles['error'] : '';
                                     echo '<div style="' . $style . '">';
                                     if (isset($icons[$type])) {
                                         echo $icons[$type];
                                     } else {
                                         echo $clear;
                                     }
                                     echo sprintf('%3s', '') . sprintf('%' . ($c - 1) . 's', '') . $message;
                                     echo '</div>';
                                 }
                             }
                         }
                     }
                     echo '</div>';
                 }
                 echo '</pre>';
                 unlink($temp);
                 $trackermanager->displayFooter($project);
                 exit;
             } else {
                 unlink($temp);
                 echo PHP_EOL;
                 echo implode(PHP_EOL, $output);
                 echo PHP_EOL;
             }
         } else {
             //create the tracker as a SimpleXMLElement
             $trackerXML = simplexml_load_file($xmlFile);
             $tracker = $this->getInstanceFromXML($trackerXML, $groupId, $name, $description, $itemname);
             //Testing consistency of the imported tracker before updating database
             if ($tracker->testImport()) {
                 if ($tracker_id = $this->saveObject($tracker)) {
                     $tracker->setId($tracker_id);
                 } else {
                     $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_admin', 'error_during_creation'));
                     $tracker = null;
                 }
//.........这里部分代码省略.........
开发者ID:nterray,项目名称:tuleap,代码行数:101,代码来源:TrackerFactory.class.php


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