phpDocumentor Testlink
[ class tree: Testlink ] [ index: Testlink ] [ all elements ]

Procedural File: common.php

Source Location: /common.php

Page Details
Includes
require_once ("plan.core.inc.php") [line 73]
[ Top ]

require_once ("user.class.php") [line 69]
Information Tags:
TODO:  use the next include only if it is used -> must be removed
[ Top ]

require_once ('object.class.php') [line 38]

TestLink Open Source Project - http://testlink.sourceforge.net/ This script is distributed under the GNU General Public License 2 or later.

Information Tags:
Author:  

Martin Havlat, Chad Rosen

SCOPE: Load core functions for TestLink GUI Common functions: database connection, session and data initialization, maintain $_SESSION data, redirect page, log, etc.

Note: this file cannot include a feature specific code for performance and readability reason

----------------------------------------------------------------------------------- Revisions: 20090111 - franciscom - commented some required_once and some global coupling 20081027 - havlatm - refactorization, description removed unused $g_cache_config and some functions 20080907 - franciscom - isValidISODateTime() 20080518 - franciscom - translate_tc_status() 20080412 - franciscom - templateConfiguration() 20080326 - franciscom - config_get() - refactored removed eval() 20071027 - franciscom - added ini_get_bool() from mantis code, needed to user string_api.php, also from Mantis.

20071002 - jbarchibald - BUGID 1051 20070705 - franciscom - init_labels() 20070623 - franciscom - improved info in header of localize_dateOrTimeStamp()

-----------------------------------------------------------------------------------

Version:  $Revision: 1.1.2.1 $ $Author: havlat $
[ Top ]

require_once ('tlsmarty.inc.php') [line 51]

Testlink Smarty class wrapper sets up the default smarty settings for testlink

[ Top ]

require_once ("keyword.class.php") [line 70]
[ Top ]

require_once ('lang_api.php') [line 42]

library for localization

[ Top ]

require_once ('metastring.class.php') [line 39]
[ Top ]

require_once ('logger.class.php') [line 55]
[ Top ]

require_once ('database.class.php') [line 45]

library of database wrapper

[ Top ]

require_once ("treeMenu.inc.php") [line 71]
[ Top ]

require_once ("testproject.class.php") [line 66]
[ Top ]

require_once ("exec_cfield_mgr.class.php") [line 72]
[ Top ]

require_once (TL_ABS_PATH.'third_party'.DIRECTORY_SEPARATOR.'domxml-php4-to-php5.php') [line 81]

load the php4 to php5 domxml wrapper if the php5 is used and

the domxml extension is not loaded

[ Top ]

require_once ('roles.inc.php') [line 48]

user right checking

[ Top ]

require_once ("role.class.php") [line 64]
[ Top ]

require_once ("attachment.class.php") [line 65]
[ Top ]

require_once (TL_ABS_PATH.'lib'.DIRECTORY_SEPARATOR.'bugtracking'.DIRECTORY_SEPARATOR.'int_bugtracking.php') [line 61]
Information Tags:
TODO:  martin: remove from global loading - limited using
[ Top ]

require_once ('logging.inc.php') [line 54]

logging functions

[ Top ]


Functions
array_diff_byId  [line 881]

map: array_diff_byId( $testcase_id: $arrAll, $tree_manager: $arrPart, $cfield_manager: 2  )

Initiate the execution of a testcase through XML Server RPCs.

All the object instantiations are done here. XML-RPC Server Settings need to be configured using the custom fields feature. Three fields each for testcase level and testsuite level are required. The fields are: server_host, server_port and server_path. Precede 'tc_' for custom fields assigned to testcase level.

Parameters:
$cfield_manager:   2:  Custom Field manager object, to read the XML-RPC server params.
$testcase_id:   $arrAll:  The testcase id of the testcase to be executed
$tree_manager:   $arrPart:  The tree manager object to read node values and testcase and parent ids.

API Tags:
Return:  keys: 'result','notes','message' values: 'result' -> (Pass, Fail or Blocked) 'notes' -> Notes text 'message' -> Message from server


[ Top ]
checkSessionValid  [line 230]

void checkSessionValid( &$db  )

Verify if user is log in. Redirect to login page if not.

Parameters:
   &$db: 


[ Top ]
checkUserRightsFor  [line 1051]

void checkUserRightsFor( &$db, $pfn  )
Parameters:
   &$db: 
   $pfn: 


[ Top ]
check_string  [line 557]

1: check_string( string $str2check, $ereg_forbidden_chars, string $ereg_forbidden_chars:  )
Parameters:
string   $str2check: 
string   $ereg_forbidden_chars::  regular expression
   $ereg_forbidden_chars: 

API Tags:
Return:  check ok, 0:check KO


[ Top ]
config_get  [line 608]

void config_get( $config_id  )
Parameters:
   $config_id: 


[ Top ]
doDBConnect  [line 126]

assoc doDBConnect( &$db  )

TestLink connects to the database

Parameters:
   &$db: 

API Tags:
Return:  

array aa['status'] = 1 -> OK , 0 -> KO aa['dbms_msg''] = 'ok', or $db->error_msg().

20050416 - fm



[ Top ]
doSessionStart  [line 281]

void doSessionStart( )

Function start session



[ Top ]
downloadContentsToFile  [line 655]

void downloadContentsToFile( string $content, string $fileName  )

Builds the header needed to make the content available for downloading

Parameters:
string   $content:  the content which should be downloaded
string   $fileName:  the filename


[ Top ]
getFileUploadErrorMessage  [line 966]

string getFileUploadErrorMessage( array $fInfo  )

Checks $_FILES for errors while uploading

Parameters:
array   $fInfo:  an array used by uploading files ($_FILES)

API Tags:
Return:  containing an error message (if any)


[ Top ]
init_labels  [line 750]

void init_labels( $map_code_label  )
Parameters:
   $map_code_label: 


[ Top ]
ini_get_bool  [line 765]

void ini_get_bool( $p_name  )

Get the named php ini variable but return it as a bool

Parameters:
   $p_name: 

Information Tags:
Author:  Copyright (C) 2000 - 2004 Mantis Team, Kenzaburo Ito

[ Top ]
isValidISODateTime  [line 1038]

void isValidISODateTime( $ISODateTime  )
Parameters:
   $ISODateTime: 


[ Top ]
is_blank  [line 636]

void is_blank( $p_var  )

Return true if the parameter is an empty string or a string

containing only whitespace, false otherwise

Parameters:
   $p_var: 

Information Tags:
Author:  Copyright (C) 2000 - 2004 Mantis Team, Kenzaburo Ito

[ Top ]
localize_dateOrTimeStamp  [line 534]

void localize_dateOrTimeStamp( $params, &$smarty, $what, $value  )
Parameters:
   $params: 
   &$smarty: 
   $what: 
   $value: 


[ Top ]
localize_date_smarty  [line 502]

void localize_date_smarty( $params, &$smarty  )
Parameters:
   $params: 
   &$smarty: 


[ Top ]
localize_timestamp_smarty  [line 514]

void localize_timestamp_smarty( $params, &$smarty  )
Parameters:
   $params: 
   &$smarty: 


[ Top ]
microtime_float  [line 733]

void microtime_float( )


[ Top ]
my_array_intersect_keys  [line 713]

void my_array_intersect_keys( $array1, $array2  )
Parameters:
   $array1: 
   $array2: 

Information Tags:
TODO:  describe

[ Top ]
printPageStatistics  [line 85]

void printPageStatistics( $startupMemory, $startupTime  )
Parameters:
   $startupMemory: 
   $startupTime: 


[ Top ]
redirect  [line 424]

void redirect( string $path, [string $level = 'location']  )

Redirect page to another one

Parameters:
string   $path:  URL of required page
string   $level:  Browser location - use for redirection or refresh of another frame Default: 'location'


[ Top ]
setPaths  [line 221]

void setPaths( )

Set home URL path


Information Tags:
Todo:  solve problems after session expires 200806 - havlatm - removed rpath

[ Top ]
setSessionTestPlan  [line 198]

void setSessionTestPlan( array $tplan_info  )

Set session data related to the current test plan

Parameters:
array   $tplan_info:  result of DB query


[ Top ]
setSessionTestProject  [line 164]

void setSessionTestProject( array $tproject_info  )

Set session data related to the current test project

Parameters:
array   $tproject_info:  result of DB query


[ Top ]
set_dt_formats  [line 578]

void set_dt_formats( )


[ Top ]
show_instructions  [line 995]

N/A show_instructions( string $key, [ $refreshTree = 0]  )
Parameters:
string   $key:  keyword for finding exact html text in definition array
   $refreshTree: 

API Tags:
Abstract:  redirect to a page with static html defined in locale/en_GB/texts.php


[ Top ]
strings_stripSlashes  [line 440]

string strings_stripSlashes( string $parameter, [ $bGPC = true]  )

Security parser for input strings

Parameters:
string   $parameter: 
   $bGPC: 

API Tags:
Return:  cleaned parameter


[ Top ]
templateConfiguration  [line 1013]

void templateConfiguration( )


[ Top ]
testlinkInitPage  [line 379]

void testlinkInitPage( &$db, [boolean $initProject = FALSE], [boolean $bDontCheckSession = false], [ $userRightsCheckFunction = null], integer $db  )

General page initialization procedure

  • init session
  • init database
  • check rights

Parameters:
integer   $db:  DB connection identifier
boolean   $initProject:  (optional) Set true if adjustment of Product or Test Plan is required; default is FALSE
boolean   $bDontCheckSession:  (optional) Set to true if no session should be started
   &$db: 
   $userRightsCheckFunction: 


[ Top ]
tlStringLen  [line 1068]

void tlStringLen( $str  )
Parameters:
   $str: 


[ Top ]
to_boolean  [line 466]

void to_boolean( $alt_boolean  )
Parameters:
   $alt_boolean: 


[ Top ]
transform_nodes_order  [line 941]

void transform_nodes_order( $nodes_order, [ $node_to_exclude = null]  )
Parameters:
   $nodes_order: 
   $node_to_exclude: 


[ Top ]
translate_tc_status  [line 675]

void translate_tc_status( $status_code  )
Parameters:
   $status_code: 

Information Tags:
TODO:  martin: move the next two functions to appropriate class + describe

[ Top ]
translate_tc_status_smarty  [line 692]

void translate_tc_status_smarty( $params, &$smarty  )
Parameters:
   $params: 
   &$smarty: 


[ Top ]
trim_and_limit  [line 927]

string trim_and_limit( string $s, [int $len = 100]  )

trim string and limit to N chars

Parameters:
string   $s: 
int   $len:  [len]: how many chars return

API Tags:
Return:  trimmed string

Information Tags:
Author:  Francisco Mancardi - 20050905 - refactoring

[ Top ]
upd_session_tplan_tproject  [line 301]

void upd_session_tplan_tproject( &$db, $hash_user_sel  )
Parameters:
   &$db: 
   $hash_user_sel: 


[ Top ]
__autoload  [line 109]

void __autoload( $class_name  )
Parameters:
   $class_name: 


[ Top ]


Documentation generated on Fri, 03 Apr 2009 14:13:45 +0200 by phpDocumentor 1.4.1