コード例 #1
0
ファイル: APIKey.php プロジェクト: moraesmv/testlink-code
 public function __construct()
 {
     $db = null;
     doDBConnect($db);
     parent::__construct($db);
     $this->object_table = $this->tables["users"];
 }
コード例 #2
0
 /** 
  * class constructor 
  * 
  * @param resource &$db reference to database handler
  * @param integer $tplanId
  **/
 public function __construct(&$db, &$tplanId = null)
 {
     $this->db = $db;
     $this->testPlanID = $tplanId;
     // tlObjectWithDB::__construct($db);
     parent::__construct($this->db);
 }
コード例 #3
0
 /**
  * class constructor
  * 
  * @param $db [ref] resource the database connection
  */
 function __construct(&$db)
 {
     tlObjectWithDB::__construct($db);
     $this->repositoryType = self::getType();
     $this->repositoryCompressionType = self::getCompression();
     $this->repositoryPath = self::getPathToRepository();
     $this->attachmentCfg = config_get('attachments');
 }
コード例 #4
0
 /**
  * class constructor
  * 
  * @param $db [ref] resource the database connection
  */
 function __construct(&$db)
 {
     tlObjectWithDB::__construct($db);
     $this->attachmentCfg = config_get('attachments');
     $prop2init = array('type', 'compressionType', 'path');
     foreach ($prop2init as $prop) {
         $this->{$prop} = $this->attachmentCfg->repository->{$prop};
     }
 }
コード例 #5
0
 function assignment_mgr(&$db)
 {
     parent::__construct($db);
 }
コード例 #6
0
 /**
  * Class constructor
  *  
  * @param object [ref] $db the database connection
  * @param string $attachmentTableName the foreign key table name to store the attachments
  */
 function __construct(&$db, $attachmentTableName)
 {
     tlObjectWithDB::__construct($db);
     $this->attachmentRepository = tlAttachmentRepository::create($this->db);
     $this->attachmentTableName = $attachmentTableName;
 }
コード例 #7
0
 /**
  * @param $db database object
  * @param $tproject_id to work on. If null (default) the project in session
  *                     is used
  * DO NOT USE this kind of code is not accepted have this kind of global coupling
  * for lazy users
  */
 public function __construct(&$db, $tproject_id = null)
 {
     parent::__construct($db);
     $this->tproject_id = $tproject_id;
 }
コード例 #8
0
 function __construct(&$db)
 {
     parent::__construct($db);
 }
コード例 #9
0
 public function __construct(&$db)
 {
     parent::__construct($db);
     $this->sendto_email = config_get('tl_admin_email');
     $this->from_email = config_get('from_email');
     $this->return_path_email = config_get('return_path_email');
     // now we need to check if we have all needed configuration
     $key2check = array('sendto_email', 'from_email', 'return_path_email');
     $regex2match = config_get('validation_cfg')->user_email_valid_regex_php;
     $this->configIsOK = true;
     foreach ($key2check as $emailKey) {
         $matches = array();
         $this->{$emailKey} = trim($this->{$emailKey});
         if (is_blank($this->{$emailKey}) || !preg_match($regex2match, $this->{$emailKey}, $matches)) {
             $this->configIsOK = false;
             break;
         }
     }
 }
コード例 #10
0
 /**
  * Class constructor
  * 
  * @param integer $testProjectID test Project identifier
  * @param integer $dbHandler the database connection handler
  */
 function __construct($testProjectID, &$dbHandler = null)
 {
     parent::__construct($dbHandler);
     $this->testProjectID = $testProjectID;
 }
コード例 #11
0
 /**
  *
  * @param database $dbHandler reference to database object
  */
 public function __construct(&$dbHandler)
 {
     // call to constructor of parent class tlObjectWithDB
     parent::__construct($dbHandler);
     // Here comes all initializing work: First read the config, then user input.
     // According to these inputs all filters which are not needed will not be used.
     // Then initialize and use only the remaining filters.
     $this->read_config();
     $this->init_args();
     // set filter mode to advanced or simple
     $this->advanced_filter_mode = $this->filter_mode_choice_enabled && $this->args->advanced_filter_mode && !$this->args->simple_filter_mode;
     // init button labels
     if ($this->advanced_filter_mode) {
         $label = self::SIMPLE_FILTER_BUTTON_LABEL;
         $qty = self::ADVANCED_FILTER_ITEM_QUANTITY;
     } else {
         $label = self::ADVANCED_FILTER_BUTTON_LABEL;
         $qty = self::SIMPLE_FILTER_ITEM_QUANTITY;
     }
     $this->filter_mode_button_label = lang_get($label);
     $this->filter_mode_button_name = $label;
     $this->filter_item_quantity = $qty;
     $this->init_settings();
     $this->init_filters();
 }
コード例 #12
0
 function __construct(&$db, $type, $echoOnDestruct = false)
 {
     parent::__construct($db);
     $this->counterType = $type;
     $this->reset();
     $this->echoOnDestruct = $echoOnDestruct;
 }
コード例 #13
0
 /**
  * Load the necessary data from execution and assignment tables and generate the
  * build result matrix by computing this data.
  * 
  * @author Andreas Simon
  * @param Database $db reference to database object
  * @param int $tplan_id Testplan ID for which the table shall be generated
  */
 public function __construct(&$db, $tplan_id)
 {
     parent::__construct($db);
     $this->labels = array('na' => lang_get('not_aplicable'));
     $res_cfg = config_get('results');
     foreach ($res_cfg['status_label_for_exec_ui'] as $status => $label) {
         $this->status_map[$status] = $res_cfg['status_code'][$status];
     }
     $this->tplan_mgr = new testplan($this->db);
     $this->tproject_mgr = new testproject($this->db);
     $this->tplan_id = is_numeric($tplan_id) ? $tplan_id : 0;
     if ($this->tplan_id) {
         $this->tplan_info = $this->tplan_mgr->get_by_id($this->tplan_id);
         $this->load_builds();
         $this->load_assigned_execution_map();
         $this->load_unassigned_execution_map();
         $this->build_results_matrix();
     }
 }
コード例 #14
0
ファイル: APIKey.php プロジェクト: tamtrong/testlink
 public function __construct()
 {
     $db = null;
     doDBConnect($db);
     parent::__construct($db);
 }
コード例 #15
0
 /**
  * $builds_to_query = 'a' will query all build, $builds_to_query = -1 will prevent
  * most logic in constructor from executing/ executions table from being queried
  * if keyword = 0, search by keyword would not be performed
  * @author kevinlevy
  *
  * @internal Revisions:
  *      20100720 - asimon - BUGID 3406, 1508: added logic to get result counts on build level
  * 	    20090327 - amitkhullar - added parameter $latest_results to get the latest results only.	
  *      20071013 - franciscom - changes to fix MSSQL problems
  *                 $startTime = "0000-00-00 00:00:00" -> null
  *                 $endTime = "9999-01-01 00:00:00" -> null
  *
  *      20070916 - franciscom - interface changes
  */
 public function results_overload(&$db, &$tplan_mgr, $tproject_info, $tplan_info, $suitesSelected = 'all', $builds_to_query = -1, $platforms_to_query = array(ALL_PLATFORMS), $lastResult = 'a', $keywordId = 0, $owner = null, $startTime = null, $endTime = null, $executor = null, $search_notes_string = null, $linkExecutionBuild = null, &$suiteStructure = null, &$flatArray = null, &$linked_tcversions = null)
 {
     $this->resultsCfg = config_get('results');
     $this->testCaseCfg = config_get('testcase_cfg');
     $this->db = $db;
     tlObjectWithDB::__construct($db);
     $this->tplanMgr = $tplan_mgr;
     $this->map_tc_status = $this->resultsCfg['status_code'];
     // TestLink standard configuration is (at least for me)
     // not_run not available at user interface level on execution feature as choice.
     //
     // if( !isset($dummy['not_run']) )
     // {
     //     $dummy['not_run']=$this->map_tc_status['not_run'];
     // }
     // This will be used to create dynamically counters if user add new status
     foreach ($this->resultsCfg['status_label_for_exec_ui'] as $tc_status_verbose => $label) {
         $this->tc_status_for_statistics[$tc_status_verbose] = $this->map_tc_status[$tc_status_verbose];
     }
     if (!isset($this->resultsCfg['status_label_for_exec_ui']['not_run'])) {
         $this->tc_status_for_statistics['not_run'] = $this->map_tc_status['not_run'];
     }
     $this->suitesSelected = $suitesSelected;
     $this->tprojectID = $tproject_info['id'];
     $this->testCasePrefix = $tproject_info['prefix'];
     $this->testPlanID = $tplan_info['id'];
     $this->tplanName = $tplan_info['name'];
     $this->suiteStructure = $suiteStructure;
     $this->flatArray = $flatArray;
     $this->linked_tcversions = $linked_tcversions;
     // build suiteStructure and flatArray
     if ($this->suiteStructure == null && $this->flatArray == null && $this->linked_tcversions == null) {
         list($this->suiteStructure, $this->linked_tcversions) = $this->generateExecTree($db, $keywordId, $owner);
     }
     // KL - if no builds are specified, no need to execute the following block of code
     if ($builds_to_query != -1) {
         // retrieve results from executions table
         // get keyword id -> keyword name pairs used in this test plan
         $keywords_in_tplan = $tplan_mgr->get_keywords_map($this->testPlanID, 'ORDER BY keyword');
         // KL - 20061229 - this call may not be necessary for all reports
         // only those that require info on results for keywords
         // Map of test case ids to array of associated keywords
         $this->keywordData = null;
         if (!is_null($keywords_in_tplan)) {
             $this->keywordData = $this->getKeywordData(array_keys($keywords_in_tplan));
         }
         //$tplan_mgr->get_keywords_tcases($this->testPlanID);
         // get owner id -> owner name pairs used in this test plan
         $arrOwners = getUsersForHtmlOptions($db);
         // create data object which tallies last result for each test case
         // this function now also creates mapOfLastResultByKeyword ???
         // KL - 2/01/07
         // we should NOT build executions map with cases that are just pass/failed/or blocked.
         // we should always populate the executions map with all results
         // and then programmatically figure out the last result
         // if you just query the executions table for those rows with status = $this->map_tc_status['passed']
         // that is not the way to determine last result
         $all_results = $this->latest_results;
         $this->executionsMap = $this->buildExecutionsMap($builds_to_query, $platforms_to_query, 'a', $keywordId, $owner, $startTime, $endTime, $executor, $search_notes_string, $linkExecutionBuild, $all_results);
         // new dBug($this->executionsMap);
         $this->createMapOfLastResult($this->suiteStructure, $this->executionsMap, $lastResult);
         $this->aggregateKeywordResults = $this->tallyKeywordResults($this->mapOfLastResultByKeyword, $keywords_in_tplan);
         $this->aggregateOwnerResults = $this->tallyOwnerResults($this->mapOfLastResultByOwner, $arrOwners);
         // create data object which tallies totals for individual suites
         // child suites are NOT taken into account in this step
         $this->createMapOfSuiteSummary($this->mapOfLastResult);
         // create data object which tallies totals for suites taking
         // child suites into account
         $this->createAggregateMap($this->suiteStructure, $this->mapOfSuiteSummary);
         $this->totalsForPlan = $this->createTotalsForPlan($this->suiteStructure);
         // must be done after totalsForPlan is performed because the total # of cases is needed
         // BUGID 3682
         $arrBuilds = $tplan_mgr->get_builds($this->testPlanID, testplan::GET_ACTIVE_BUILD);
         // BUGID 3406, BUGID 1508 - we need the totals per build here, not for the whole plan anymore
         $this->totalsForBuilds = $this->createTotalsForBuilds($arrBuilds);
         $this->aggregateBuildResults = $this->tallyBuildResults($this->mapOfLastResultByBuild, $arrBuilds, $this->totalsForBuilds);
     }
     // end if block
 }
コード例 #16
0
 /**
  *
  * @param database $dbHandler reference to database object
  */
 public function __construct(&$dbHandler)
 {
     parent::__construct($dbHandler);
     // Here comes all initializing work:
     // First read the config, then user input.
     // According to these inputs all filters which are not needed will not be used.
     // Then initialize and use only the remaining filters.
     //
     // Remember difference bewteen self & this when extending classes
     //
     $this->read_config();
     $this->init_args();
     $this->filter_item_quantity = self::SIMPLE_FILTER_ITEM_QUANTITY;
     $this->filter_mode_button_name = self::ADVANCED_FILTER_BUTTON_LABEL;
     $this->advanced_filter_mode = $this->filter_mode_choice_enabled && $this->args->advanced_filter_mode && !$this->args->simple_filter_mode;
     if ($this->advanced_filter_mode) {
         $this->filter_mode_button_name = self::SIMPLE_FILTER_BUTTON_LABEL;
         $this->filter_item_quantity = self::ADVANCED_FILTER_ITEM_QUANTITY;
     }
     $this->filter_mode_button_label = lang_get($this->filter_mode_button_name);
     $this->init_settings();
     $this->init_filters();
 }